@powerhousedao/ph-clint-app 0.1.0-dev.91 → 0.1.0-dev.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-CpE72nB8.js → ClearStorageModal-CXoNWmRe-UB24DImi.js} +2 -2
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-CpE72nB8.js.map → ClearStorageModal-CXoNWmRe-UB24DImi.js.map} +1 -1
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-Me3H9oNw.js → DebugSettingsModal-5SDhy5gt-D0iQimch.js} +2 -2
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-Me3H9oNw.js.map → DebugSettingsModal-5SDhy5gt-D0iQimch.js.map} +1 -1
- package/dist/connect/assets/{InspectorModal-BsSihzuc-DVTFZSUH.js → InspectorModal-BsSihzuc-Bavb3r9J.js} +2 -2
- package/dist/connect/assets/{InspectorModal-BsSihzuc-DVTFZSUH.js.map → InspectorModal-BsSihzuc-Bavb3r9J.js.map} +1 -1
- package/dist/connect/assets/{SettingsModal-S_A5qf95-nzYOCl3o.js → SettingsModal-S_A5qf95-q6y3kJdv.js} +2 -2
- package/dist/connect/assets/{SettingsModal-S_A5qf95-nzYOCl3o.js.map → SettingsModal-S_A5qf95-q6y3kJdv.js.map} +1 -1
- package/dist/connect/assets/{components-ByEUkO4U-DoBYY0k7.js → components-ByEUkO4U-BWcOYd4s.js} +4 -4
- package/dist/connect/assets/{components-ByEUkO4U-DoBYY0k7.js.map → components-ByEUkO4U-BWcOYd4s.js.map} +1 -1
- package/dist/connect/assets/{connect.config-Bt4pvvWV-DPiXrGYV.js → connect.config-Bt4pvvWV-CRF9MQO6.js} +2 -2
- package/dist/connect/assets/{connect.config-Bt4pvvWV-DPiXrGYV.js.map → connect.config-Bt4pvvWV-CRF9MQO6.js.map} +1 -1
- package/dist/connect/assets/{index-CK9tPzCS.js → index-D8arPQE9.js} +3 -3
- package/dist/connect/assets/{index-CK9tPzCS.js.map → index-D8arPQE9.js.map} +1 -1
- package/dist/connect/assets/{load-BWibkoFV-DWy1LALw.js → load-BWibkoFV-CryaAPih.js} +2 -2
- package/dist/connect/assets/{load-BWibkoFV-DWy1LALw.js.map → load-BWibkoFV-CryaAPih.js.map} +1 -1
- package/dist/connect/assets/{module-5NdQh7xr.js → module-BA2WsOHG.js} +2 -2
- package/dist/connect/assets/{module-5NdQh7xr.js.map → module-BA2WsOHG.js.map} +1 -1
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-BHQsaOhO.js → pglite-seed-BWk7yOwr-CPFa41Bn.js} +2 -2
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-BHQsaOhO.js.map → pglite-seed-BWk7yOwr-CPFa41Bn.js.map} +1 -1
- package/dist/connect/assets/{reactor-BxNvHOKC-CSy_kfH0.js → reactor-BxNvHOKC-DRYvJVeI.js} +2 -2
- package/dist/connect/assets/{reactor-BxNvHOKC-CSy_kfH0.js.map → reactor-BxNvHOKC-DRYvJVeI.js.map} +1 -1
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-C-5yx671.js → registerServiceWorker-D9l1kja7-BDpTOs18.js} +2 -2
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-C-5yx671.js.map → registerServiceWorker-D9l1kja7-BDpTOs18.js.map} +1 -1
- package/dist/connect/index.html +1 -1
- package/dist/connect/powerhouse.config.json +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as e,L as t,V as n,_t as r,c as i}from"./dist-t-ezfpxv.js";import{i as a}from"./connect-CGvtDtZh.js";import{r as o}from"./dist-Cb4AoJ-8.js";import{t as s}from"./reactor-BxNvHOKC-
|
|
2
|
-
//# sourceMappingURL=ClearStorageModal-CXoNWmRe-
|
|
1
|
+
import{I as e,L as t,V as n,_t as r,c as i}from"./dist-t-ezfpxv.js";import{i as a}from"./connect-CGvtDtZh.js";import{r as o}from"./dist-Cb4AoJ-8.js";import{t as s}from"./reactor-BxNvHOKC-DRYvJVeI.js";import{t as c}from"./useTranslation-DQCCLfKw.js";import{jsx as l}from"react/jsx-runtime";import{useState as u}from"react";(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`12a59e3b-9586-5c13-a195-20f1d19afbd7`)}catch{}})();var d=o([`ClearStorage`]);function f(){let o=r()?.type===`clearStorage`,{t:f}=c(),[p,m]=u(!1);function h(){m(!0),s().then(()=>{d.info(`Storage cleared`),e(void 0),t(void 0),window.location.reload()}).catch(e=>{d.error(`Error clearing storage: @error`,e),m(!1)})}return l(a,{open:o,header:f(`modals.connectSettings.clearStorage.confirmation.title`),body:f(`modals.connectSettings.clearStorage.confirmation.body`),cancelLabel:f(`common.cancel`),continueLabel:f(`modals.connectSettings.clearStorage.confirmation.clearButton`),onCancel:()=>n({type:`settings`}),onContinue:h,onOpenChange:e=>{if(!e)return i()},continueDisabled:p})}export{f as ClearStorageModal};
|
|
2
|
+
//# sourceMappingURL=ClearStorageModal-CXoNWmRe-UB24DImi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearStorageModal-CXoNWmRe-
|
|
1
|
+
{"version":3,"file":"ClearStorageModal-CXoNWmRe-UB24DImi.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/ClearStorageModal-CXoNWmRe.js"],"sourcesContent":["\n!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]=\"12a59e3b-9586-5c13-a195-20f1d19afbd7\")}catch(e){}}();\nimport { t as clearReactorStorage } from \"./reactor-BxNvHOKC.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useTranslation } from \"react-i18next\";\nimport { useState } from \"react\";\nimport { closePHModal, setSelectedDrive, setSelectedNode, showPHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { childLogger } from \"document-model\";\nimport { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\n//#region src/components/modal/modals/ClearStorageModal.tsx\nconst logger$1 = childLogger([\"ClearStorage\"]);\nfunction ClearStorageModal() {\n\tconst open = usePHModal()?.type === \"clearStorage\";\n\tconst { t } = useTranslation();\n\tconst [loading, setLoading] = useState(false);\n\tfunction clearStorage() {\n\t\tsetLoading(true);\n\t\tclearReactorStorage().then(() => {\n\t\t\tlogger$1.info(\"Storage cleared\");\n\t\t\tsetSelectedDrive(void 0);\n\t\t\tsetSelectedNode(void 0);\n\t\t\twindow.location.reload();\n\t\t}).catch((error) => {\n\t\t\tlogger$1.error(\"Error clearing storage: @error\", error);\n\t\t\tsetLoading(false);\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(ConnectConfirmationModal, {\n\t\topen,\n\t\theader: t(\"modals.connectSettings.clearStorage.confirmation.title\"),\n\t\tbody: t(\"modals.connectSettings.clearStorage.confirmation.body\"),\n\t\tcancelLabel: t(\"common.cancel\"),\n\t\tcontinueLabel: t(\"modals.connectSettings.clearStorage.confirmation.clearButton\"),\n\t\tonCancel: () => showPHModal({ type: \"settings\" }),\n\t\tonContinue: clearStorage,\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) return closePHModal();\n\t\t},\n\t\tcontinueDisabled: loading\n\t});\n}\n//#endregion\nexport { ClearStorageModal };\n\n//# sourceMappingURL=ClearStorageModal-CXoNWmRe.js.map\n//# debugId=12a59e3b-9586-5c13-a195-20f1d19afbd7\n"],"x_google_ignoreList":[0],"mappings":"mUACC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,WAApB,IAA+B,WAAwB,OAAO,KAApB,IAAyB,KAAK,EAAE,CAAC,EAAG,IAAI,EAAE,OAAK,CAAE,MAAM,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC,EAAE,gBAAgB,GAAG,6CAAgD,MAAK,CASjT,IAAM,EAAW,EAAY,CAAC,eAAe,CAAC,CAC9C,SAAS,GAAoB,CAC5B,IAAM,EAAO,GAAY,EAAE,OAAS,eAC9B,CAAE,KAAM,GAAgB,CACxB,CAAC,EAAS,GAAc,EAAS,GAAM,CAC7C,SAAS,GAAe,CACvB,EAAW,GAAK,CAChB,GAAqB,CAAC,SAAW,CAChC,EAAS,KAAK,kBAAkB,CAChC,EAAiB,IAAK,GAAE,CACxB,EAAgB,IAAK,GAAE,CACvB,OAAO,SAAS,QAAQ,EACvB,CAAC,MAAO,GAAU,CACnB,EAAS,MAAM,iCAAkC,EAAM,CACvD,EAAW,GAAM,EAChB,CAEH,OAAuB,EAAI,EAA0B,CACpD,OACA,OAAQ,EAAE,yDAAyD,CACnE,KAAM,EAAE,wDAAwD,CAChE,YAAa,EAAE,gBAAgB,CAC/B,cAAe,EAAE,+DAA+D,CAChF,aAAgB,EAAY,CAAE,KAAM,WAAY,CAAC,CACjD,WAAY,EACZ,aAAe,GAAW,CACzB,GAAI,CAAC,EAAQ,OAAO,GAAc,EAEnC,iBAAkB,EAClB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_t as e,c as t}from"./dist-t-ezfpxv.js";import{L as n,R as r,b as i,r as a}from"./connect-CGvtDtZh.js";import{n as o}from"./clsx-CtFH8AOT.js";import{r as s}from"./connect.config-Bt4pvvWV-
|
|
2
|
-
//# sourceMappingURL=DebugSettingsModal-5SDhy5gt-
|
|
1
|
+
import{_t as e,c as t}from"./dist-t-ezfpxv.js";import{L as n,R as r,b as i,r as a}from"./connect-CGvtDtZh.js";import{n as o}from"./clsx-CtFH8AOT.js";import{r as s}from"./connect.config-Bt4pvvWV-CRF9MQO6.js";import{n as c,r as l,t as u}from"./build-info-cc1PjSvF-DtAGzh0W.js";import{t as d}from"./registerServiceWorker-D9l1kja7-BDpTOs18.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useEffect as m,useState as h}from"react";(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`46fc1fe5-b003-554a-8eb3-88c674da49ab`)}catch{}})();var g=()=>{let g=e()?.type===`debugSettings`,[_,v]=h(s.appVersion),[y,b]=h({label:d.debug?`Enabled`:`Disabled`,value:d.debug});return m(()=>{d.setDebug(y.value)},[y]),f(n,{open:g,onOpenChange:e=>{if(!e)return t()},contentProps:{className:`rounded-2xl`},children:p(`div`,{className:`w-[700px] rounded-2xl bg-background p-6`,children:[p(`div`,{className:`mb-6 flex justify-between`,children:[f(`div`,{className:`text-xl font-bold`,children:`Debug Tools`}),f(`button`,{id:`close-modal`,onClick:()=>t(),children:f(o,{name:`Xmark`,size:28})})]}),p(`div`,{className:`flex text-sm font-bold`,children:[f(o,{name:`Ring`,size:22}),p(`span`,{className:`ml-2`,children:[`App Version: `,s.appVersion]}),(()=>{let e=u();if(e===`unknown`)return null;let t=c(),n=l(e);return t?p(`a`,{className:`ml-2 font-mono text-xs font-normal text-info hover:underline`,href:t,target:`_blank`,rel:`noreferrer noopener`,title:e,children:[`(`,n,`)`]}):p(`span`,{className:`ml-2 font-mono text-xs font-normal text-muted-foreground`,title:e,children:[`(`,n,`)`]})})()]}),p(`div`,{className:`mt-4 flex text-sm font-bold`,children:[f(o,{name:`Hdd`,size:22}),f(`span`,{className:`ml-2`,children:`Drive Tools:`})]}),p(`div`,{className:`mt-4 flex text-sm font-bold`,children:[f(o,{name:`Gear`,size:22}),f(`span`,{className:`ml-2`,children:`Service Worker Tools:`})]}),f(`div`,{className:`mt-2 flex items-end justify-between pl-4`,children:p(`div`,{className:`w-[400px]`,children:[f(`label`,{htmlFor:`serviceWorkerDebugMode`,className:`text-xs`,children:`Service Worker Debug Mode:`}),f(a,{id:`serviceWorkerDebugMode`,onChange:e=>{b(e)},value:y,options:[{label:`Enabled`,value:!0},{label:`Disabled`,value:!1}]})]})}),p(`div`,{className:`mt-2 flex items-end justify-between pl-4`,children:[p(`div`,{className:`w-[400px]`,children:[f(`label`,{htmlFor:`appVersion`,className:`text-xs`,children:`Set invalid app version:`}),f(i,{containerClassName:`rounded-md border border-border bg-background p-1 text-sm`,inputClassName:`text-xs font-normal`,id:`appVersion`,icon:f(`div`,{className:`flex h-full items-center text-xs`,children:`Version:`}),value:_,onChange:e=>v(e.target.value)})]}),f(`div`,{className:`mb-1 flex items-center justify-center`,children:f(r,{color:_===``?`light`:`red`,size:`small`,disabled:_===``,onClick:()=>{d.sendMessage({type:`SET_APP_VERSION`,version:_}),v(``)},children:`Add Invalid App Version`})})]})]})})};export{g as DebugSettingsModal};
|
|
2
|
+
//# sourceMappingURL=DebugSettingsModal-5SDhy5gt-D0iQimch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugSettingsModal-5SDhy5gt-
|
|
1
|
+
{"version":3,"file":"DebugSettingsModal-5SDhy5gt-D0iQimch.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/DebugSettingsModal-5SDhy5gt.js"],"sourcesContent":["\n!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]=\"46fc1fe5-b003-554a-8eb3-88c674da49ab\")}catch(e){}}();\nimport { n as getGitUrl, r as shortGitSha, t as getGitSha } from \"./build-info-cc1PjSvF.js\";\nimport { r as connectConfig } from \"./connect.config-Bt4pvvWV.js\";\nimport { t as serviceWorkerManager } from \"./registerServiceWorker-D9l1kja7.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { Combobox, FormInput } from \"@powerhousedao/design-system/connect\";\nimport { Icon, Modal, PowerhouseButton } from \"@powerhousedao/design-system\";\n//#region src/components/modal/modals/DebugSettingsModal.tsx\nconst DebugSettingsModal = () => {\n\tconst open = usePHModal()?.type === \"debugSettings\";\n\tconst [appVersion, setAppVersion] = useState(connectConfig.appVersion);\n\tconst [serviceWorkerDebugMode, setServiceWorkerDebugMode] = useState({\n\t\tlabel: serviceWorkerManager.debug ? \"Enabled\" : \"Disabled\",\n\t\tvalue: serviceWorkerManager.debug\n\t});\n\tuseEffect(() => {\n\t\tserviceWorkerManager.setDebug(serviceWorkerDebugMode.value);\n\t}, [serviceWorkerDebugMode]);\n\treturn /* @__PURE__ */ jsx(Modal, {\n\t\topen,\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) return closePHModal();\n\t\t},\n\t\tcontentProps: { className: \"rounded-2xl\" },\n\t\tchildren: /* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: \"w-[700px] rounded-2xl bg-background p-6\",\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"mb-6 flex justify-between\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\t\tclassName: \"text-xl font-bold\",\n\t\t\t\t\t\tchildren: \"Debug Tools\"\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\t\t\tid: \"close-modal\",\n\t\t\t\t\t\tonClick: () => closePHModal(),\n\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\t\tname: \"Xmark\",\n\t\t\t\t\t\t\tsize: 28\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"flex text-sm font-bold\",\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t/* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\t\tname: \"Ring\",\n\t\t\t\t\t\t\tsize: 22\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t/* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\t\t\t\tclassName: \"ml-2\",\n\t\t\t\t\t\t\tchildren: [\"App Version: \", connectConfig.appVersion]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(() => {\n\t\t\t\t\t\t\tconst sha = getGitSha();\n\t\t\t\t\t\t\tif (sha === \"unknown\") return null;\n\t\t\t\t\t\t\tconst url = getGitUrl();\n\t\t\t\t\t\t\tconst label = shortGitSha(sha);\n\t\t\t\t\t\t\treturn url ? /* @__PURE__ */ jsxs(\"a\", {\n\t\t\t\t\t\t\t\tclassName: \"ml-2 font-mono text-xs font-normal text-info hover:underline\",\n\t\t\t\t\t\t\t\thref: url,\n\t\t\t\t\t\t\t\ttarget: \"_blank\",\n\t\t\t\t\t\t\t\trel: \"noreferrer noopener\",\n\t\t\t\t\t\t\t\ttitle: sha,\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\"(\",\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}) : /* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\t\t\t\t\tclassName: \"ml-2 font-mono text-xs font-normal text-muted-foreground\",\n\t\t\t\t\t\t\t\ttitle: sha,\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\"(\",\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})()\n\t\t\t\t\t]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"mt-4 flex text-sm font-bold\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\tname: \"Hdd\",\n\t\t\t\t\t\tsize: 22\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"ml-2\",\n\t\t\t\t\t\tchildren: \"Drive Tools:\"\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"mt-4 flex text-sm font-bold\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\tname: \"Gear\",\n\t\t\t\t\t\tsize: 22\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"ml-2\",\n\t\t\t\t\t\tchildren: \"Service Worker Tools:\"\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"mt-2 flex items-end justify-between pl-4\",\n\t\t\t\t\tchildren: /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\tclassName: \"w-[400px]\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\t\t\t\thtmlFor: \"serviceWorkerDebugMode\",\n\t\t\t\t\t\t\tclassName: \"text-xs\",\n\t\t\t\t\t\t\tchildren: \"Service Worker Debug Mode:\"\n\t\t\t\t\t\t}), /* @__PURE__ */ jsx(Combobox, {\n\t\t\t\t\t\t\tid: \"serviceWorkerDebugMode\",\n\t\t\t\t\t\t\tonChange: (value) => {\n\t\t\t\t\t\t\t\tsetServiceWorkerDebugMode(value);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tvalue: serviceWorkerDebugMode,\n\t\t\t\t\t\t\toptions: [{\n\t\t\t\t\t\t\t\tlabel: \"Enabled\",\n\t\t\t\t\t\t\t\tvalue: true\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\tlabel: \"Disabled\",\n\t\t\t\t\t\t\t\tvalue: false\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t})]\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"mt-2 flex items-end justify-between pl-4\",\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\tclassName: \"w-[400px]\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"label\", {\n\t\t\t\t\t\t\thtmlFor: \"appVersion\",\n\t\t\t\t\t\t\tclassName: \"text-xs\",\n\t\t\t\t\t\t\tchildren: \"Set invalid app version:\"\n\t\t\t\t\t\t}), /* @__PURE__ */ jsx(FormInput, {\n\t\t\t\t\t\t\tcontainerClassName: \"rounded-md border border-border bg-background p-1 text-sm\",\n\t\t\t\t\t\t\tinputClassName: \"text-xs font-normal\",\n\t\t\t\t\t\t\tid: \"appVersion\",\n\t\t\t\t\t\t\ticon: /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\t\t\t\tclassName: \"flex h-full items-center text-xs\",\n\t\t\t\t\t\t\t\tchildren: \"Version:\"\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tvalue: appVersion,\n\t\t\t\t\t\t\tonChange: (element) => setAppVersion(element.target.value)\n\t\t\t\t\t\t})]\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\t\tclassName: \"mb-1 flex items-center justify-center\",\n\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(PowerhouseButton, {\n\t\t\t\t\t\t\tcolor: appVersion === \"\" ? \"light\" : \"red\",\n\t\t\t\t\t\t\tsize: \"small\",\n\t\t\t\t\t\t\tdisabled: appVersion === \"\",\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tserviceWorkerManager.sendMessage({\n\t\t\t\t\t\t\t\t\ttype: \"SET_APP_VERSION\",\n\t\t\t\t\t\t\t\t\tversion: appVersion\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tsetAppVersion(\"\");\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Add Invalid App Version\"\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n};\n//#endregion\nexport { DebugSettingsModal };\n\n//# sourceMappingURL=DebugSettingsModal-5SDhy5gt.js.map\n//# debugId=46fc1fe5-b003-554a-8eb3-88c674da49ab\n"],"x_google_ignoreList":[0],"mappings":"ubACC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,WAApB,IAA+B,WAAwB,OAAO,KAApB,IAAyB,KAAK,EAAE,CAAC,EAAG,IAAI,EAAE,OAAK,CAAE,MAAM,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC,EAAE,gBAAgB,GAAG,6CAAgD,MAAK,CAUjT,IAAM,MAA2B,CAChC,IAAM,EAAO,GAAY,EAAE,OAAS,gBAC9B,CAAC,EAAY,GAAiB,EAAS,EAAc,WAAW,CAChE,CAAC,EAAwB,GAA6B,EAAS,CACpE,MAAO,EAAqB,MAAQ,UAAY,WAChD,MAAO,EAAqB,MAC5B,CAAC,CAIF,OAHA,MAAgB,CACf,EAAqB,SAAS,EAAuB,MAAM,EACzD,CAAC,EAAuB,CAAC,CACL,EAAI,EAAO,CACjC,OACA,aAAe,GAAW,CACzB,GAAI,CAAC,EA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,EAAK,MAAO,CACrC,UAAW,YACX,SAAU,CAAiB,EAAI,QAAS,CACvC,QAAS,yBACT,UAAW,UACX,SAAU,6BACV,CAAC,CAAkB,EAAI,EAAU,CACjC,GAAI,yBACJ,SAAW,GAAU,CACpB,EAA0B,EAAM,EAEjC,MAAO,EACP,QAAS,CAAC,CACT,MAAO,UACP,MAAO,GACP,CAAE,CACF,MAAO,WACP,MAAO,GACP,CAAC,CACF,CAAC,CAAC,CACH,CAAC,CACF,CAAC,CACc,EAAK,MAAO,CAC3B,UAAW,2CACX,SAAU,CAAiB,EAAK,MAAO,CACtC,UAAW,YACX,SAAU,CAAiB,EAAI,QAAS,CACvC,QAAS,aACT,UAAW,UACX,SAAU,2BACV,CAAC,CAAkB,EAAI,EAAW,CAClC,mBAAoB,4DACpB,eAAgB,sBAChB,GAAI,aACJ,KAAsB,EAAI,MAAO,CAChC,UAAW,mCACX,SAAU,WACV,CAAC,CACF,MAAO,EACP,SAAW,GAAY,EAAc,EAAQ,OAAO,MAAM,CAC1D,CAAC,CAAC,CACH,CAAC,CAAkB,EAAI,MAAO,CAC9B,UAAW,wCACX,SAA0B,EAAI,EAAkB,CAC/C,MAAO,IAAe,GAAK,QAAU,MACrC,KAAM,QACN,SAAU,IAAe,GACzB,YAAe,CACd,EAAqB,YAAY,CAChC,KAAM,kBACN,QAAS,EACT,CAAC,CACF,EAAc,GAAG,EAElB,SAAU,0BACV,CAAC,CACF,CAAC,CAAC,CACH,CAAC,CACF,CACD,CAAC,CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{K as e,Pt as t,_t as n,c as r,dn as i,gt as a,ln as o,q as s,s as c,un as l,xt as u}from"./dist-t-ezfpxv.js";import{w as d}from"./connect-CGvtDtZh.js";import{y as f}from"./worker-XYrQaEmt-w0FhumYk.js";import{m as p}from"./esm-0nAQjFUV.js";import{_ as m,g as h,l as g,p as _}from"./module-
|
|
1
|
+
import{K as e,Pt as t,_t as n,c as r,dn as i,gt as a,ln as o,q as s,s as c,un as l,xt as u}from"./dist-t-ezfpxv.js";import{w as d}from"./connect-CGvtDtZh.js";import{y as f}from"./worker-XYrQaEmt-w0FhumYk.js";import{m as p}from"./esm-0nAQjFUV.js";import{_ as m,g as h,l as g,p as _}from"./module-BA2WsOHG.js";import{t as v}from"./reactor-BxNvHOKC-DRYvJVeI.js";import{t as y}from"./pglite-seed-BWk7yOwr-CPFa41Bn.js";import{jsx as b}from"react/jsx-runtime";import{useCallback as x,useMemo as S,useSyncExternalStore as C}from"react";(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`92a6ca0a-6b25-50be-8118-6da0537f14f9`)}catch{}})();async function w(e){await new Promise(t=>e.block(()=>t()))}async function T(e){await new Promise((t,n)=>{e.Module.FS.syncfs(!1,e=>e?n(e):t())})}var E=[`documentType`,`documentId`,`scope`,`branch`,`index`,`skip`];function D(){let e=s(),t=a(),n=u(),r=n?.reactorModule?.reactor,i=n?.reactorModule?.queue,o=x(async()=>{if(!e)return[];let t=await p`
|
|
2
2
|
SELECT
|
|
3
3
|
c.table_name,
|
|
4
4
|
c.column_name,
|
|
@@ -27,4 +27,4 @@ import{K as e,Pt as t,_t as n,c as r,dn as i,gt as a,ln as o,q as s,s as c,un as
|
|
|
27
27
|
WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')
|
|
28
28
|
AND nspname NOT LIKE 'pg_temp_%'
|
|
29
29
|
AND nspname NOT LIKE 'pg_toast_temp_%'`);for(let{nspname:e}of n.rows)await t.exec(`DROP SCHEMA IF EXISTS "${e}" CASCADE`);try{await t.exec(`SET standard_conforming_strings = off;`)}catch{}await t.exec(e),await t.exec(`SET search_path TO ${f}`)}),await T(t),window.location.reload(),await new Promise(()=>{}))},[t,i,r]);return{getTables:o,getTableRows:c,getDefaultSort:x(e=>{if(e===`Operation`)return{column:`timestampUtcMs`,direction:`desc`}},[]),onExportDb:l,onImportDb:d}}var O=[16,17];function k(){let e=C(m,g,()=>void 0),t=x(async e=>{console.info(`[debug-inspector] Reset requested: PG${e}`);try{localStorage.setItem(y,String(e)),console.info(`[debug-inspector] Clearing reactor storage...`),await v(),console.info(`[debug-inspector] Storage cleared. Reloading...`),window.location.reload()}catch(e){throw console.error(`[debug-inspector] Reset failed:`,e),localStorage.removeItem(y),e}},[]);return{supportedPgVersions:O,currentPgVersion:e??null,onResetToPgVersion:t}}function A(){let e=u()?.reactorModule,t=S(()=>{if(e)return new o(e.keyframeStore,e.operationStore,e.writeCache,e.documentView,e.documentModelRegistry)},[e]),n=x(async(e,n)=>{if(!t)throw Error(`Reactor module not available`);return t.validateDocument(e,n)},[t]),r=x(async(e,n)=>{if(!t)throw Error(`Reactor module not available`);return t.rebuildKeyframes(e,n)},[t]),i=x(async(e,n)=>{if(!t)throw Error(`Reactor module not available`);return t.rebuildSnapshots(e,n)},[t]);if(t)return{onValidate:n,onRebuildKeyframes:r,onRebuildSnapshots:i}}function j(){let e=u()?.reactorModule?.processorManager,t=S(()=>e!=null,[e]),n=x(()=>e?Promise.resolve(e.getAll().map(e=>({processorId:e.processorId,factoryId:e.factoryId,driveId:e.driveId,processorIndex:e.processorIndex,lastOrdinal:e.lastOrdinal,status:e.status,lastError:e.lastError,lastErrorTimestamp:e.lastErrorTimestamp}))):Promise.resolve([]),[e]),r=x(async t=>{if(!e)return;let n=e.get(t);n&&await n.retry()},[e]);if(t)return{getProcessors:n,onRetry:r}}function M(){let e=u()?.reactorModule?.queue,t=S(()=>{if(e instanceof l)return e},[e]),n=x(()=>{if(!t)return Promise.resolve({isPaused:!1,pendingJobs:[],executingJobs:[],totalPending:0,totalExecuting:0});let e=t.getPendingJobs(),n=t.getExecutingJobIds(),r=[];for(let e of n.values())for(let n of e){let e=t.getJob(n);e&&r.push(e)}return Promise.resolve({isPaused:t.paused,pendingJobs:e,executingJobs:r,totalPending:e.length,totalExecuting:r.length})},[t]),r=x(()=>(t&&t.pause(),Promise.resolve()),[t]),i=x(async()=>{t&&await t.resume()},[t]);if(t)return{getQueueState:n,onPause:r,onResume:i}}function N(){let n=t();if(!n)throw Error(`Sync manager not found`);let r=e();return{getRemotes:x(()=>Promise.resolve(n.list()),[n]),removeRemote:x(e=>n.remove(e),[n]),addRemoteManual:x(async e=>{await c(e,void 0,{pollBehavior:i.Manual})},[]),triggerPull:x(e=>n.triggerPull(e),[n]),connectionStates:r}}var P=25,F=()=>{let e=n()?.type===`inspector`,{getTables:t,getTableRows:i,getDefaultSort:a,onExportDb:o,onImportDb:s}=D(),{getRemotes:c,removeRemote:l,addRemoteManual:u,triggerPull:p,connectionStates:m}=N(),h=M(),g=j(),_=A(),{currentPgVersion:v,supportedPgVersions:y,onResetToPgVersion:x}=k();return b(d,{open:e,onOpenChange:e=>{e||r()},dbExplorerProps:{schema:f,getTables:t,getTableRows:i,getDefaultSort:a,pageSize:P,onExportDb:o,onImportDb:s,pgVersionControl:{currentPgVersion:v,supportedPgVersions:y,onResetToPgVersion:x}},remotesInspectorProps:{getRemotes:c,removeRemote:l,addRemoteManual:u,triggerPull:p,connectionStates:m},queueInspectorProps:h,processorsInspectorProps:g,integrityInspectorProps:_})};export{F as InspectorModal};
|
|
30
|
-
//# sourceMappingURL=InspectorModal-BsSihzuc-
|
|
30
|
+
//# sourceMappingURL=InspectorModal-BsSihzuc-Bavb3r9J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InspectorModal-BsSihzuc-DVTFZSUH.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/InspectorModal-BsSihzuc.js"],"sourcesContent":["\n!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]=\"92a6ca0a-6b25-50be-8118-6da0537f14f9\")}catch(e){}}();\nimport { c as subscribeReactorPgMajor, o as loadPgDump, r as getCachedReactorPgMajor, s as resolvePgMajorForRuntime } from \"./pglite-runtime-Ch2YeUAA.js\";\nimport { t as PENDING_PG_SEED_KEY } from \"./pglite-seed-BWk7yOwr.js\";\nimport { t as clearReactorStorage } from \"./reactor-BxNvHOKC.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { DocumentIntegrityService, InMemoryQueue, PollBehavior, REACTOR_SCHEMA, addRemoteDrive, closePHModal, useConnectionStates, useDatabase, usePGlite, usePHModal, useReactorClientModule, useSync } from \"@powerhousedao/reactor-browser\";\nimport { InspectorModal as InspectorModal$1 } from \"@powerhousedao/design-system/connect\";\nimport { sql } from \"kysely\";\n//#region src/components/modal/modals/InspectorModal/useDbExplorer.ts\nasync function quiesceQueue(queue) {\n\tawait new Promise((resolve) => queue.block(() => resolve()));\n}\nasync function syncPgliteToIdb(pglite) {\n\tawait new Promise((resolve, reject) => {\n\t\tpglite.Module.FS.syncfs(false, (err) => err ? reject(err) : resolve());\n\t});\n}\nconst PRIORITY_COLUMNS = [\n\t\"documentType\",\n\t\"documentId\",\n\t\"scope\",\n\t\"branch\",\n\t\"index\",\n\t\"skip\"\n];\nfunction useDbExplorer() {\n\tconst database = useDatabase();\n\tconst pglite = usePGlite();\n\tconst reactorClientModule = useReactorClientModule();\n\tconst reactor = reactorClientModule?.reactorModule?.reactor;\n\tconst queue = reactorClientModule?.reactorModule?.queue;\n\tconst getTables = useCallback(async () => {\n\t\tif (!database) return [];\n\t\tconst result = await sql`\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\t\tconst tableMap = /* @__PURE__ */ new Map();\n\t\tfor (const row of result.rows) {\n\t\t\tif (!tableMap.has(row.table_name)) tableMap.set(row.table_name, []);\n\t\t\ttableMap.get(row.table_name).push({\n\t\t\t\tname: row.column_name,\n\t\t\t\tdataType: row.data_type,\n\t\t\t\tisNullable: row.is_nullable === \"YES\"\n\t\t\t});\n\t\t}\n\t\treturn Array.from(tableMap).map(([name, columns]) => {\n\t\t\tconst columnNames = columns.map((col) => col.name);\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tcolumns: [...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map((col) => columns.find((c) => c.name === col)), ...columns.filter((col) => !PRIORITY_COLUMNS.includes(col.name))]\n\t\t\t};\n\t\t});\n\t}, [database]);\n\tconst getTableRows = useCallback(async (table, options) => {\n\t\tif (!database) return {\n\t\t\tcolumns: [],\n\t\t\trows: [],\n\t\t\ttotal: null\n\t\t};\n\t\tconst limit = options.limit;\n\t\tconst offset = options.offset;\n\t\tconst sort = options.sort;\n\t\tconst filters = options.filters;\n\t\tconst tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\t\tlet whereClause = sql``;\n\t\tif (filters?.clauses && filters.clauses.length > 0) {\n\t\t\tconst conditions = [];\n\t\t\tfor (let i = 0; i < filters.clauses.length; i++) {\n\t\t\t\tconst clause = filters.clauses[i];\n\t\t\t\tif (!clause) continue;\n\t\t\t\tconst columnRef = sql.raw(`\"${clause.column}\"`);\n\t\t\t\tlet condition;\n\t\t\t\tif (clause.operator === \"IS NULL\") condition = sql`${columnRef} IS NULL`;\n\t\t\t\telse if (clause.operator === \"IS NOT NULL\") condition = sql`${columnRef} IS NOT NULL`;\n\t\t\t\telse if (clause.operator === \"LIKE\" || clause.operator === \"ILIKE\") {\n\t\t\t\t\tconst value = clause.value;\n\t\t\t\t\tcondition = sql`${columnRef} ${clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`} ${value}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst operator = sql.raw(clause.operator);\n\t\t\t\t\tconst value = clause.value;\n\t\t\t\t\tlet parsedValue = value;\n\t\t\t\t\tif (value !== \"\" && !isNaN(Number(value)) && value.trim() !== \"\") parsedValue = Number(value);\n\t\t\t\t\tcondition = sql`${columnRef} ${operator} ${parsedValue}`;\n\t\t\t\t}\n\t\t\t\tconditions.push(condition);\n\t\t\t\tif (i < filters.clauses.length - 1) {\n\t\t\t\t\tconst connector = filters.connectors?.[i] ?? \"AND\";\n\t\t\t\t\tconditions.push(sql.raw(connector));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (conditions.length > 0) whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n\t\t}\n\t\tlet query;\n\t\tif (sort) {\n\t\t\tconst columnRef = sql.raw(`\"${sort.column}\"`);\n\t\t\tconst direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n\t\t\tquery = sql`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n\t\t} else query = sql`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n\t\tconst result = await query.execute(database);\n\t\tconst countResult = await sql`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `.execute(database);\n\t\tconst total = countResult.rows[0] ? parseInt(countResult.rows[0].count, 10) : null;\n\t\tconst rawColumns = result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n\t\treturn {\n\t\t\tcolumns: [...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)), ...rawColumns.filter((col) => !PRIORITY_COLUMNS.includes(col))],\n\t\t\trows: result.rows,\n\t\t\ttotal\n\t\t};\n\t}, [database]);\n\tconst onExportDb = useCallback(async () => {\n\t\tif (!pglite) return;\n\t\tif (queue) await quiesceQueue(queue);\n\t\ttry {\n\t\t\tconst sqlContent = await (await (await loadPgDump(resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null)))({ pg: pglite })).text();\n\t\t\tconst blob = new Blob([sqlContent], { type: \"text/sql\" });\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst a = document.createElement(\"a\");\n\t\t\ta.href = url;\n\t\t\ta.download = `database-export-${Date.now()}.sql`;\n\t\t\ta.click();\n\t\t\tURL.revokeObjectURL(url);\n\t\t} finally {\n\t\t\tqueue?.unblock();\n\t\t}\n\t}, [pglite, queue]);\n\tconst onImportDb = useCallback(async (sqlContent) => {\n\t\tif (!pglite) return;\n\t\tif (queue) await quiesceQueue(queue);\n\t\tif (reactor) await reactor.kill().completed;\n\t\tawait pglite.transaction(async (tx) => {\n\t\t\tconst schemas = await tx.query(`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\t\t\tfor (const { nspname } of schemas.rows) await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n\t\t\ttry {\n\t\t\t\tawait tx.exec(\"SET standard_conforming_strings = off;\");\n\t\t\t} catch {}\n\t\t\tawait tx.exec(sqlContent);\n\t\t\tawait tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n\t\t});\n\t\tawait syncPgliteToIdb(pglite);\n\t\twindow.location.reload();\n\t\tawait new Promise(() => {});\n\t}, [\n\t\tpglite,\n\t\tqueue,\n\t\treactor\n\t]);\n\treturn {\n\t\tgetTables,\n\t\tgetTableRows,\n\t\tgetDefaultSort: useCallback((table) => {\n\t\t\tif (table === \"Operation\") return {\n\t\t\t\tcolumn: \"timestampUtcMs\",\n\t\t\t\tdirection: \"desc\"\n\t\t\t};\n\t\t}, []),\n\t\tonExportDb,\n\t\tonImportDb\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useDebugInspector.ts\nconst SUPPORTED_PG_VERSIONS = [16, 17];\nfunction useDebugInspector() {\n\tconst currentPgVersion = useSyncExternalStore(subscribeReactorPgMajor, getCachedReactorPgMajor, () => void 0);\n\tconst onResetToPgVersion = useCallback(async (major) => {\n\t\tconsole.info(`[debug-inspector] Reset requested: PG${major}`);\n\t\ttry {\n\t\t\tlocalStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n\t\t\tconsole.info(`[debug-inspector] Clearing reactor storage...`);\n\t\t\tawait clearReactorStorage();\n\t\t\tconsole.info(`[debug-inspector] Storage cleared. Reloading...`);\n\t\t\twindow.location.reload();\n\t\t} catch (err) {\n\t\t\tconsole.error(\"[debug-inspector] Reset failed:\", err);\n\t\t\tlocalStorage.removeItem(PENDING_PG_SEED_KEY);\n\t\t\tthrow err;\n\t\t}\n\t}, []);\n\treturn {\n\t\tsupportedPgVersions: SUPPORTED_PG_VERSIONS,\n\t\tcurrentPgVersion: currentPgVersion ?? null,\n\t\tonResetToPgVersion\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useIntegrityInspector.ts\nfunction useIntegrityInspector() {\n\tconst reactorModule = useReactorClientModule()?.reactorModule;\n\tconst service = useMemo(() => {\n\t\tif (!reactorModule) return void 0;\n\t\treturn new DocumentIntegrityService(reactorModule.keyframeStore, reactorModule.operationStore, reactorModule.writeCache, reactorModule.documentView, reactorModule.documentModelRegistry);\n\t}, [reactorModule]);\n\tconst onValidate = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.validateDocument(documentId, branch);\n\t}, [service]);\n\tconst onRebuildKeyframes = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.rebuildKeyframes(documentId, branch);\n\t}, [service]);\n\tconst onRebuildSnapshots = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.rebuildSnapshots(documentId, branch);\n\t}, [service]);\n\tif (!service) return;\n\treturn {\n\t\tonValidate,\n\t\tonRebuildKeyframes,\n\t\tonRebuildSnapshots\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useProcessorsInspector.ts\nfunction useProcessorsInspector() {\n\tconst processorManager = useReactorClientModule()?.reactorModule?.processorManager;\n\tconst hasProcessorManager = useMemo(() => processorManager != null, [processorManager]);\n\tconst getProcessors = useCallback(() => {\n\t\tif (!processorManager) return Promise.resolve([]);\n\t\treturn Promise.resolve(processorManager.getAll().map((tracked) => ({\n\t\t\tprocessorId: tracked.processorId,\n\t\t\tfactoryId: tracked.factoryId,\n\t\t\tdriveId: tracked.driveId,\n\t\t\tprocessorIndex: tracked.processorIndex,\n\t\t\tlastOrdinal: tracked.lastOrdinal,\n\t\t\tstatus: tracked.status,\n\t\t\tlastError: tracked.lastError,\n\t\t\tlastErrorTimestamp: tracked.lastErrorTimestamp\n\t\t})));\n\t}, [processorManager]);\n\tconst onRetry = useCallback(async (processorId) => {\n\t\tif (!processorManager) return;\n\t\tconst tracked = processorManager.get(processorId);\n\t\tif (tracked) await tracked.retry();\n\t}, [processorManager]);\n\tif (!hasProcessorManager) return;\n\treturn {\n\t\tgetProcessors,\n\t\tonRetry\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useQueueInspector.ts\nfunction useQueueInspector() {\n\tconst queue = useReactorClientModule()?.reactorModule?.queue;\n\tconst inMemoryQueue = useMemo(() => {\n\t\tif (queue instanceof InMemoryQueue) return queue;\n\t}, [queue]);\n\tconst getQueueState = useCallback(() => {\n\t\tif (!inMemoryQueue) return Promise.resolve({\n\t\t\tisPaused: false,\n\t\t\tpendingJobs: [],\n\t\t\texecutingJobs: [],\n\t\t\ttotalPending: 0,\n\t\t\ttotalExecuting: 0\n\t\t});\n\t\tconst pendingJobs = inMemoryQueue.getPendingJobs();\n\t\tconst executingJobIds = inMemoryQueue.getExecutingJobIds();\n\t\tconst executingJobs = [];\n\t\tfor (const jobIdSet of executingJobIds.values()) for (const jobId of jobIdSet) {\n\t\t\tconst job = inMemoryQueue.getJob(jobId);\n\t\t\tif (job) executingJobs.push(job);\n\t\t}\n\t\treturn Promise.resolve({\n\t\t\tisPaused: inMemoryQueue.paused,\n\t\t\tpendingJobs,\n\t\t\texecutingJobs,\n\t\t\ttotalPending: pendingJobs.length,\n\t\t\ttotalExecuting: executingJobs.length\n\t\t});\n\t}, [inMemoryQueue]);\n\tconst onPause = useCallback(() => {\n\t\tif (inMemoryQueue) inMemoryQueue.pause();\n\t\treturn Promise.resolve();\n\t}, [inMemoryQueue]);\n\tconst onResume = useCallback(async () => {\n\t\tif (inMemoryQueue) await inMemoryQueue.resume();\n\t}, [inMemoryQueue]);\n\tif (!inMemoryQueue) return;\n\treturn {\n\t\tgetQueueState,\n\t\tonPause,\n\t\tonResume\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useRemotesInspector.ts\nfunction useRemotesInspector() {\n\tconst syncManager = useSync();\n\tif (!syncManager) throw new Error(\"Sync manager not found\");\n\tconst connectionStates = useConnectionStates();\n\treturn {\n\t\tgetRemotes: useCallback(() => {\n\t\t\treturn Promise.resolve(syncManager.list());\n\t\t}, [syncManager]),\n\t\tremoveRemote: useCallback((name) => syncManager.remove(name), [syncManager]),\n\t\taddRemoteManual: useCallback(async (url) => {\n\t\t\tawait addRemoteDrive(url, void 0, { pollBehavior: PollBehavior.Manual });\n\t\t}, []),\n\t\ttriggerPull: useCallback((name) => syncManager.triggerPull(name), [syncManager]),\n\t\tconnectionStates\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/InspectorModal.tsx\nconst DEFAULT_PAGE_SIZE = 25;\nconst InspectorModal = () => {\n\tconst open = usePHModal()?.type === \"inspector\";\n\tconst { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } = useDbExplorer();\n\tconst { getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates } = useRemotesInspector();\n\tconst queueInspectorProps = useQueueInspector();\n\tconst processorsInspectorProps = useProcessorsInspector();\n\tconst integrityInspectorProps = useIntegrityInspector();\n\tconst { currentPgVersion, supportedPgVersions, onResetToPgVersion } = useDebugInspector();\n\treturn /* @__PURE__ */ jsx(InspectorModal$1, {\n\t\topen,\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) closePHModal();\n\t\t},\n\t\tdbExplorerProps: {\n\t\t\tschema: REACTOR_SCHEMA,\n\t\t\tgetTables,\n\t\t\tgetTableRows,\n\t\t\tgetDefaultSort,\n\t\t\tpageSize: DEFAULT_PAGE_SIZE,\n\t\t\tonExportDb,\n\t\t\tonImportDb,\n\t\t\tpgVersionControl: {\n\t\t\t\tcurrentPgVersion,\n\t\t\t\tsupportedPgVersions,\n\t\t\t\tonResetToPgVersion\n\t\t\t}\n\t\t},\n\t\tremotesInspectorProps: {\n\t\t\tgetRemotes,\n\t\t\tremoveRemote,\n\t\t\taddRemoteManual,\n\t\t\ttriggerPull,\n\t\t\tconnectionStates\n\t\t},\n\t\tqueueInspectorProps,\n\t\tprocessorsInspectorProps,\n\t\tintegrityInspectorProps\n\t});\n};\n//#endregion\nexport { InspectorModal };\n\n//# sourceMappingURL=InspectorModal-BsSihzuc.js.map\n//# debugId=92a6ca0a-6b25-50be-8118-6da0537f14f9\n"],"x_google_ignoreList":[0],"mappings":"khBACC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,WAApB,IAA+B,WAAwB,OAAO,KAApB,IAAyB,KAAK,EAAE,CAAC,EAAG,IAAI,EAAE,OAAK,CAAE,MAAM,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC,EAAE,gBAAgB,GAAG,6CAAgD,MAAK,CAUjT,eAAe,EAAa,EAAO,CAClC,MAAM,IAAI,QAAS,GAAY,EAAM,UAAY,GAAS,CAAC,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AAY,eAAc,kBAAiB,cAAa,oBAAqB,GAAqB,CACpG,EAAsB,GAAmB,CACzC,EAA2B,GAAwB,CACnD,EAA0B,GAAuB,CACjD,CAAE,mBAAkB,sBAAqB,sBAAuB,GAAmB,CACzF,OAAuB,EAAI,EAAkB,CAC5C,OACA,aAAe,GAAW,CACpB,GAAQ,GAAc,EAE5B,gBAAiB,CAChB,OAAQ,EACR,YACA,eACA,iBACA,SAAU,EACV,aACA,aACA,iBAAkB,CACjB,mBACA,sBACA,qBACA,CACD,CACD,sBAAuB,CACtB,aACA,eACA,kBACA,cACA,mBACA,CACD,sBACA,2BACA,0BACA,CAAC"}
|
|
1
|
+
{"version":3,"file":"InspectorModal-BsSihzuc-Bavb3r9J.js","names":[],"sources":["../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/InspectorModal-BsSihzuc.js"],"sourcesContent":["\n!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]=\"92a6ca0a-6b25-50be-8118-6da0537f14f9\")}catch(e){}}();\nimport { c as subscribeReactorPgMajor, o as loadPgDump, r as getCachedReactorPgMajor, s as resolvePgMajorForRuntime } from \"./pglite-runtime-Ch2YeUAA.js\";\nimport { t as PENDING_PG_SEED_KEY } from \"./pglite-seed-BWk7yOwr.js\";\nimport { t as clearReactorStorage } from \"./reactor-BxNvHOKC.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { DocumentIntegrityService, InMemoryQueue, PollBehavior, REACTOR_SCHEMA, addRemoteDrive, closePHModal, useConnectionStates, useDatabase, usePGlite, usePHModal, useReactorClientModule, useSync } from \"@powerhousedao/reactor-browser\";\nimport { InspectorModal as InspectorModal$1 } from \"@powerhousedao/design-system/connect\";\nimport { sql } from \"kysely\";\n//#region src/components/modal/modals/InspectorModal/useDbExplorer.ts\nasync function quiesceQueue(queue) {\n\tawait new Promise((resolve) => queue.block(() => resolve()));\n}\nasync function syncPgliteToIdb(pglite) {\n\tawait new Promise((resolve, reject) => {\n\t\tpglite.Module.FS.syncfs(false, (err) => err ? reject(err) : resolve());\n\t});\n}\nconst PRIORITY_COLUMNS = [\n\t\"documentType\",\n\t\"documentId\",\n\t\"scope\",\n\t\"branch\",\n\t\"index\",\n\t\"skip\"\n];\nfunction useDbExplorer() {\n\tconst database = useDatabase();\n\tconst pglite = usePGlite();\n\tconst reactorClientModule = useReactorClientModule();\n\tconst reactor = reactorClientModule?.reactorModule?.reactor;\n\tconst queue = reactorClientModule?.reactorModule?.queue;\n\tconst getTables = useCallback(async () => {\n\t\tif (!database) return [];\n\t\tconst result = await sql`\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\t\tconst tableMap = /* @__PURE__ */ new Map();\n\t\tfor (const row of result.rows) {\n\t\t\tif (!tableMap.has(row.table_name)) tableMap.set(row.table_name, []);\n\t\t\ttableMap.get(row.table_name).push({\n\t\t\t\tname: row.column_name,\n\t\t\t\tdataType: row.data_type,\n\t\t\t\tisNullable: row.is_nullable === \"YES\"\n\t\t\t});\n\t\t}\n\t\treturn Array.from(tableMap).map(([name, columns]) => {\n\t\t\tconst columnNames = columns.map((col) => col.name);\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tcolumns: [...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map((col) => columns.find((c) => c.name === col)), ...columns.filter((col) => !PRIORITY_COLUMNS.includes(col.name))]\n\t\t\t};\n\t\t});\n\t}, [database]);\n\tconst getTableRows = useCallback(async (table, options) => {\n\t\tif (!database) return {\n\t\t\tcolumns: [],\n\t\t\trows: [],\n\t\t\ttotal: null\n\t\t};\n\t\tconst limit = options.limit;\n\t\tconst offset = options.offset;\n\t\tconst sort = options.sort;\n\t\tconst filters = options.filters;\n\t\tconst tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\t\tlet whereClause = sql``;\n\t\tif (filters?.clauses && filters.clauses.length > 0) {\n\t\t\tconst conditions = [];\n\t\t\tfor (let i = 0; i < filters.clauses.length; i++) {\n\t\t\t\tconst clause = filters.clauses[i];\n\t\t\t\tif (!clause) continue;\n\t\t\t\tconst columnRef = sql.raw(`\"${clause.column}\"`);\n\t\t\t\tlet condition;\n\t\t\t\tif (clause.operator === \"IS NULL\") condition = sql`${columnRef} IS NULL`;\n\t\t\t\telse if (clause.operator === \"IS NOT NULL\") condition = sql`${columnRef} IS NOT NULL`;\n\t\t\t\telse if (clause.operator === \"LIKE\" || clause.operator === \"ILIKE\") {\n\t\t\t\t\tconst value = clause.value;\n\t\t\t\t\tcondition = sql`${columnRef} ${clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`} ${value}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst operator = sql.raw(clause.operator);\n\t\t\t\t\tconst value = clause.value;\n\t\t\t\t\tlet parsedValue = value;\n\t\t\t\t\tif (value !== \"\" && !isNaN(Number(value)) && value.trim() !== \"\") parsedValue = Number(value);\n\t\t\t\t\tcondition = sql`${columnRef} ${operator} ${parsedValue}`;\n\t\t\t\t}\n\t\t\t\tconditions.push(condition);\n\t\t\t\tif (i < filters.clauses.length - 1) {\n\t\t\t\t\tconst connector = filters.connectors?.[i] ?? \"AND\";\n\t\t\t\t\tconditions.push(sql.raw(connector));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (conditions.length > 0) whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n\t\t}\n\t\tlet query;\n\t\tif (sort) {\n\t\t\tconst columnRef = sql.raw(`\"${sort.column}\"`);\n\t\t\tconst direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n\t\t\tquery = sql`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n\t\t} else query = sql`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n\t\tconst result = await query.execute(database);\n\t\tconst countResult = await sql`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `.execute(database);\n\t\tconst total = countResult.rows[0] ? parseInt(countResult.rows[0].count, 10) : null;\n\t\tconst rawColumns = result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n\t\treturn {\n\t\t\tcolumns: [...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)), ...rawColumns.filter((col) => !PRIORITY_COLUMNS.includes(col))],\n\t\t\trows: result.rows,\n\t\t\ttotal\n\t\t};\n\t}, [database]);\n\tconst onExportDb = useCallback(async () => {\n\t\tif (!pglite) return;\n\t\tif (queue) await quiesceQueue(queue);\n\t\ttry {\n\t\t\tconst sqlContent = await (await (await loadPgDump(resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null)))({ pg: pglite })).text();\n\t\t\tconst blob = new Blob([sqlContent], { type: \"text/sql\" });\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst a = document.createElement(\"a\");\n\t\t\ta.href = url;\n\t\t\ta.download = `database-export-${Date.now()}.sql`;\n\t\t\ta.click();\n\t\t\tURL.revokeObjectURL(url);\n\t\t} finally {\n\t\t\tqueue?.unblock();\n\t\t}\n\t}, [pglite, queue]);\n\tconst onImportDb = useCallback(async (sqlContent) => {\n\t\tif (!pglite) return;\n\t\tif (queue) await quiesceQueue(queue);\n\t\tif (reactor) await reactor.kill().completed;\n\t\tawait pglite.transaction(async (tx) => {\n\t\t\tconst schemas = await tx.query(`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\t\t\tfor (const { nspname } of schemas.rows) await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n\t\t\ttry {\n\t\t\t\tawait tx.exec(\"SET standard_conforming_strings = off;\");\n\t\t\t} catch {}\n\t\t\tawait tx.exec(sqlContent);\n\t\t\tawait tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n\t\t});\n\t\tawait syncPgliteToIdb(pglite);\n\t\twindow.location.reload();\n\t\tawait new Promise(() => {});\n\t}, [\n\t\tpglite,\n\t\tqueue,\n\t\treactor\n\t]);\n\treturn {\n\t\tgetTables,\n\t\tgetTableRows,\n\t\tgetDefaultSort: useCallback((table) => {\n\t\t\tif (table === \"Operation\") return {\n\t\t\t\tcolumn: \"timestampUtcMs\",\n\t\t\t\tdirection: \"desc\"\n\t\t\t};\n\t\t}, []),\n\t\tonExportDb,\n\t\tonImportDb\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useDebugInspector.ts\nconst SUPPORTED_PG_VERSIONS = [16, 17];\nfunction useDebugInspector() {\n\tconst currentPgVersion = useSyncExternalStore(subscribeReactorPgMajor, getCachedReactorPgMajor, () => void 0);\n\tconst onResetToPgVersion = useCallback(async (major) => {\n\t\tconsole.info(`[debug-inspector] Reset requested: PG${major}`);\n\t\ttry {\n\t\t\tlocalStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n\t\t\tconsole.info(`[debug-inspector] Clearing reactor storage...`);\n\t\t\tawait clearReactorStorage();\n\t\t\tconsole.info(`[debug-inspector] Storage cleared. Reloading...`);\n\t\t\twindow.location.reload();\n\t\t} catch (err) {\n\t\t\tconsole.error(\"[debug-inspector] Reset failed:\", err);\n\t\t\tlocalStorage.removeItem(PENDING_PG_SEED_KEY);\n\t\t\tthrow err;\n\t\t}\n\t}, []);\n\treturn {\n\t\tsupportedPgVersions: SUPPORTED_PG_VERSIONS,\n\t\tcurrentPgVersion: currentPgVersion ?? null,\n\t\tonResetToPgVersion\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useIntegrityInspector.ts\nfunction useIntegrityInspector() {\n\tconst reactorModule = useReactorClientModule()?.reactorModule;\n\tconst service = useMemo(() => {\n\t\tif (!reactorModule) return void 0;\n\t\treturn new DocumentIntegrityService(reactorModule.keyframeStore, reactorModule.operationStore, reactorModule.writeCache, reactorModule.documentView, reactorModule.documentModelRegistry);\n\t}, [reactorModule]);\n\tconst onValidate = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.validateDocument(documentId, branch);\n\t}, [service]);\n\tconst onRebuildKeyframes = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.rebuildKeyframes(documentId, branch);\n\t}, [service]);\n\tconst onRebuildSnapshots = useCallback(async (documentId, branch) => {\n\t\tif (!service) throw new Error(\"Reactor module not available\");\n\t\treturn service.rebuildSnapshots(documentId, branch);\n\t}, [service]);\n\tif (!service) return;\n\treturn {\n\t\tonValidate,\n\t\tonRebuildKeyframes,\n\t\tonRebuildSnapshots\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useProcessorsInspector.ts\nfunction useProcessorsInspector() {\n\tconst processorManager = useReactorClientModule()?.reactorModule?.processorManager;\n\tconst hasProcessorManager = useMemo(() => processorManager != null, [processorManager]);\n\tconst getProcessors = useCallback(() => {\n\t\tif (!processorManager) return Promise.resolve([]);\n\t\treturn Promise.resolve(processorManager.getAll().map((tracked) => ({\n\t\t\tprocessorId: tracked.processorId,\n\t\t\tfactoryId: tracked.factoryId,\n\t\t\tdriveId: tracked.driveId,\n\t\t\tprocessorIndex: tracked.processorIndex,\n\t\t\tlastOrdinal: tracked.lastOrdinal,\n\t\t\tstatus: tracked.status,\n\t\t\tlastError: tracked.lastError,\n\t\t\tlastErrorTimestamp: tracked.lastErrorTimestamp\n\t\t})));\n\t}, [processorManager]);\n\tconst onRetry = useCallback(async (processorId) => {\n\t\tif (!processorManager) return;\n\t\tconst tracked = processorManager.get(processorId);\n\t\tif (tracked) await tracked.retry();\n\t}, [processorManager]);\n\tif (!hasProcessorManager) return;\n\treturn {\n\t\tgetProcessors,\n\t\tonRetry\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useQueueInspector.ts\nfunction useQueueInspector() {\n\tconst queue = useReactorClientModule()?.reactorModule?.queue;\n\tconst inMemoryQueue = useMemo(() => {\n\t\tif (queue instanceof InMemoryQueue) return queue;\n\t}, [queue]);\n\tconst getQueueState = useCallback(() => {\n\t\tif (!inMemoryQueue) return Promise.resolve({\n\t\t\tisPaused: false,\n\t\t\tpendingJobs: [],\n\t\t\texecutingJobs: [],\n\t\t\ttotalPending: 0,\n\t\t\ttotalExecuting: 0\n\t\t});\n\t\tconst pendingJobs = inMemoryQueue.getPendingJobs();\n\t\tconst executingJobIds = inMemoryQueue.getExecutingJobIds();\n\t\tconst executingJobs = [];\n\t\tfor (const jobIdSet of executingJobIds.values()) for (const jobId of jobIdSet) {\n\t\t\tconst job = inMemoryQueue.getJob(jobId);\n\t\t\tif (job) executingJobs.push(job);\n\t\t}\n\t\treturn Promise.resolve({\n\t\t\tisPaused: inMemoryQueue.paused,\n\t\t\tpendingJobs,\n\t\t\texecutingJobs,\n\t\t\ttotalPending: pendingJobs.length,\n\t\t\ttotalExecuting: executingJobs.length\n\t\t});\n\t}, [inMemoryQueue]);\n\tconst onPause = useCallback(() => {\n\t\tif (inMemoryQueue) inMemoryQueue.pause();\n\t\treturn Promise.resolve();\n\t}, [inMemoryQueue]);\n\tconst onResume = useCallback(async () => {\n\t\tif (inMemoryQueue) await inMemoryQueue.resume();\n\t}, [inMemoryQueue]);\n\tif (!inMemoryQueue) return;\n\treturn {\n\t\tgetQueueState,\n\t\tonPause,\n\t\tonResume\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/useRemotesInspector.ts\nfunction useRemotesInspector() {\n\tconst syncManager = useSync();\n\tif (!syncManager) throw new Error(\"Sync manager not found\");\n\tconst connectionStates = useConnectionStates();\n\treturn {\n\t\tgetRemotes: useCallback(() => {\n\t\t\treturn Promise.resolve(syncManager.list());\n\t\t}, [syncManager]),\n\t\tremoveRemote: useCallback((name) => syncManager.remove(name), [syncManager]),\n\t\taddRemoteManual: useCallback(async (url) => {\n\t\t\tawait addRemoteDrive(url, void 0, { pollBehavior: PollBehavior.Manual });\n\t\t}, []),\n\t\ttriggerPull: useCallback((name) => syncManager.triggerPull(name), [syncManager]),\n\t\tconnectionStates\n\t};\n}\n//#endregion\n//#region src/components/modal/modals/InspectorModal/InspectorModal.tsx\nconst DEFAULT_PAGE_SIZE = 25;\nconst InspectorModal = () => {\n\tconst open = usePHModal()?.type === \"inspector\";\n\tconst { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } = useDbExplorer();\n\tconst { getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates } = useRemotesInspector();\n\tconst queueInspectorProps = useQueueInspector();\n\tconst processorsInspectorProps = useProcessorsInspector();\n\tconst integrityInspectorProps = useIntegrityInspector();\n\tconst { currentPgVersion, supportedPgVersions, onResetToPgVersion } = useDebugInspector();\n\treturn /* @__PURE__ */ jsx(InspectorModal$1, {\n\t\topen,\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) closePHModal();\n\t\t},\n\t\tdbExplorerProps: {\n\t\t\tschema: REACTOR_SCHEMA,\n\t\t\tgetTables,\n\t\t\tgetTableRows,\n\t\t\tgetDefaultSort,\n\t\t\tpageSize: DEFAULT_PAGE_SIZE,\n\t\t\tonExportDb,\n\t\t\tonImportDb,\n\t\t\tpgVersionControl: {\n\t\t\t\tcurrentPgVersion,\n\t\t\t\tsupportedPgVersions,\n\t\t\t\tonResetToPgVersion\n\t\t\t}\n\t\t},\n\t\tremotesInspectorProps: {\n\t\t\tgetRemotes,\n\t\t\tremoveRemote,\n\t\t\taddRemoteManual,\n\t\t\ttriggerPull,\n\t\t\tconnectionStates\n\t\t},\n\t\tqueueInspectorProps,\n\t\tprocessorsInspectorProps,\n\t\tintegrityInspectorProps\n\t});\n};\n//#endregion\nexport { InspectorModal };\n\n//# sourceMappingURL=InspectorModal-BsSihzuc.js.map\n//# debugId=92a6ca0a-6b25-50be-8118-6da0537f14f9\n"],"x_google_ignoreList":[0],"mappings":"khBACC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,WAApB,IAA+B,WAAwB,OAAO,KAApB,IAAyB,KAAK,EAAE,CAAC,EAAG,IAAI,EAAE,OAAK,CAAE,MAAM,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC,EAAE,gBAAgB,GAAG,6CAAgD,MAAK,CAUjT,eAAe,EAAa,EAAO,CAClC,MAAM,IAAI,QAAS,GAAY,EAAM,UAAY,GAAS,CAAC,CAAC,CAE7D,eAAe,EAAgB,EAAQ,CACtC,MAAM,IAAI,SAAS,EAAS,IAAW,CACtC,EAAO,OAAO,GAAG,OAAO,GAAQ,GAAQ,EAAM,EAAO,EAAI,CAAG,GAAS,CAAC,EACrE,CAEH,IAAM,EAAmB,CACxB,eACA,aACA,QACA,SACA,QACA,OACA,CACD,SAAS,GAAgB,CACxB,IAAM,EAAW,GAAa,CACxB,EAAS,GAAW,CACpB,EAAsB,GAAwB,CAC9C,EAAU,GAAqB,eAAe,QAC9C,EAAQ,GAAqB,eAAe,MAC5C,EAAY,EAAY,SAAY,CACzC,GAAI,CAAC,EAAU,MAAO,EAAE,CACxB,IAAM,EAAS,KAAM,EAAG;;;;;;;;;;+BAUK,EAAe;;;MAGxC,QAAQ,EAAS,CACf,EAA2B,IAAI,IACrC,IAAK,IAAM,KAAO,EAAO,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,m as p,p as m,t as h}from"./connect-CGvtDtZh.js";import{l as g}from"./worker-XYrQaEmt-w0FhumYk.js";import{n as _}from"./clsx-CtFH8AOT.js";import{n as v}from"./toast-BEy42aYx-Dg_jZf6v.js";import{r as y}from"./i18next-kqPoxo7u.js";import{r as b}from"./connect.config-Bt4pvvWV-
|
|
2
|
-
//# sourceMappingURL=SettingsModal-S_A5qf95-
|
|
1
|
+
import{Ft as e,I as t,Lt as n,V as r,_t as i,at as a,c as o,it as s,l as c}from"./dist-t-ezfpxv.js";import{A as l,D as u,I as d,N as f,m as p,p as m,t as h}from"./connect-CGvtDtZh.js";import{l as g}from"./worker-XYrQaEmt-w0FhumYk.js";import{n as _}from"./clsx-CtFH8AOT.js";import{n as v}from"./toast-BEy42aYx-Dg_jZf6v.js";import{r as y}from"./i18next-kqPoxo7u.js";import{r as b}from"./connect.config-Bt4pvvWV-CRF9MQO6.js";import{n as x,r as S,t as C}from"./build-info-cc1PjSvF-DtAGzh0W.js";import{t as w}from"./useRegistryPackages-B-gFECmd-C8h2M5qM.js";import{t as T}from"./package-BZLLR0Ma-B7vswMvI.js";import{jsx as E,jsxs as D}from"react/jsx-runtime";import{useCallback as O,useMemo as k,useState as A}from"react";var j=d(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),M=d(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),N=d(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),P=d(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`df8e32ca-26bb-518f-b60b-821f1f094018`)}catch{}})();var F=()=>D(`div`,{children:[E(h,{packageJson:T,phCliVersion:typeof b.phCliVersion==`string`?b.phCliVersion:void 0}),E(I,{}),E(L,{}),D(`div`,{className:`bg-background p-3`,children:[E(`h2`,{className:`mb-2 font-semibold text-foreground`,children:`Inspector`}),E(`p`,{className:`mb-3 text-sm font-normal text-foreground`,children:`Explore the local database and sync state for debugging.`}),D(`button`,{className:`flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect`,onClick:()=>{o(),r({type:`inspector`})},type:`button`,children:[`Open Inspector `,E(_,{name:`CircleInfo`,size:16})]})]})]});function I(){let e=C();if(e===`unknown`)return null;let t=x(),n=S(e);return D(`div`,{className:`bg-background p-3 text-sm`,children:[E(`span`,{className:`font-semibold`,children:`Git hash: `}),t?E(`a`,{className:`font-mono underline`,href:t,target:`_blank`,rel:`noreferrer noopener`,title:e,children:n}):E(`span`,{className:`font-mono`,title:e,children:n})]})}function L(){let t=a()??[],n=e(),r=k(()=>t.filter(e=>n.some(t=>t.collectionId.equals(g.forDrive(e.header.id)))),[t,n]);return D(`div`,{className:`my-4 bg-background p-3`,children:[E(`h2`,{className:`mb-2 font-semibold text-foreground`,children:`Connected drives`}),r.length===0?E(`p`,{className:`text-sm font-normal text-foreground`,children:`No connected remote drives.`}):E(`ul`,{className:`flex flex-col gap-3`,children:r.map(e=>E(R,{drive:e},e.header.id))})]})}function R({drive:e}){let t=s(e);return D(`li`,{className:`text-sm text-foreground`,children:[D(`div`,{className:`flex items-baseline gap-2`,children:[E(`span`,{className:`font-medium`,children:e.state.global.name||e.header.name}),t.status===`ready`&&E(`span`,{className:`text-xs text-muted-foreground`,children:t.host})]}),t.status===`loading`&&E(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:`Loading…`}),t.status===`error`&&E(`div`,{className:`mt-1 text-xs text-destructive`,children:`Could not load system info`}),t.status===`ready`&&D(`div`,{className:`mt-1 text-xs text-foreground`,children:[D(`div`,{children:[E(`span`,{className:`font-medium`,children:`Version:`}),` `,t.version]}),D(`div`,{children:[E(`span`,{className:`font-medium`,children:`Git hash: `}),t.gitUrl?E(`a`,{className:`font-mono hover:underline`,href:t.gitUrl,target:`_blank`,rel:`noreferrer noopener`,title:t.gitHash,children:S(t.gitHash)}):E(`span`,{className:`font-mono`,title:t.gitHash,children:S(t.gitHash)})]})]}),t.status===`local`&&E(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:`Local drive — N/A`})]})}var z=()=>{let e=a(),n=async e=>{await c(e.header.id),t(void 0)};return E(m,{drives:e??[],onDeleteDrive:e=>{n(e)},onClearStorage:()=>{r({type:`clearStorage`})}})},B=[{label:`V1`,value:`document-model-editor`},{label:`V2`,value:`document-model-editor-v2`}],V=()=>{let[e,t]=A(B[1]),n=O(e=>{let n=B.find(t=>t.value==e);n&&t(n)},[]);return E(p,{documentModelEditor:e.value,setDocumentModelEditor:n,documentModelEditorOptions:B})};function H(e){let t=e.trim(),n=t.startsWith(`@`)?t.lastIndexOf(`@`):t.indexOf(`@`);return n>0?t.slice(0,n):t}var U=()=>{let e=n(),{registryPackageList:t,updateRegistryPackageStatus:r,registerFallbackRegistryPackage:i}=w();async function a(n){if(!e)return;let a=H(n),o=t.some(e=>e.name===a),s=await e.addPackage(n);if(s.type===`success`)o?r(a,`registry-install`):i(a,s.package,e.getPackageVersion(a)??e.getPackageVersion(n),`registry-install`),v(`Package "${n}" installed successfully`,{type:`connect-success`});else{let e=s.error.message;v(/failed to fetch|404|not found/i.test(e)?`Could not install "${n}". The package isn't available on this registry, and the npmjs.org fallback could not resolve it either.`:`Failed to install "${n}": ${e}`,{type:`error`})}}function o(t){if(e)try{e.removePackage(t),r(t,`available`),v(`Package "${t}" uninstalled successfully`,{type:`connect-success`})}catch(e){v(`Failed to uninstall "${t}": ${e instanceof Error?e.message:`Unknown error`}`,{type:`error`})}}return E(`div`,{className:`flex h-full flex-1 flex-col`,children:E(u,{mutable:!0,registryPackageList:t,onInstall:a,onUninstall:o})})},W={size:16},G=()=>{let e=i()?.type===`settings`,t=k(()=>[{id:`package-manager`,icon:E(M,{...W}),label:`Package Manager`,content:U},{id:`default-editors`,icon:E(N,{...W}),label:`Default Editors`,content:V},{id:`danger-zone`,icon:E(P,{...W,className:`text-destructive`}),label:E(`span`,{className:`text-destructive`,children:`Danger Zone`}),content:()=>E(z,{})},{id:`about`,icon:E(j,{...W}),label:`About`,content:F}],[]);return E(l,{open:e,title:y(`modals.connectSettings.title`),onOpenChange:e=>{if(!e)return o()},tabs:t,navFooter:E(f,{horizontal:!0})})};export{G as SettingsModal};
|
|
2
|
+
//# sourceMappingURL=SettingsModal-S_A5qf95-q6y3kJdv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsModal-S_A5qf95-nzYOCl3o.js","names":["__iconNode","__iconNode","__iconNode","CircleHelp"],"sources":["../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/circle-question-mark.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/package.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/pen-line.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/triangle-alert.mjs","../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/SettingsModal-S_A5qf95.js"],"sourcesContent":["/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\",\n key: \"1a0edw\"\n }\n ],\n [\"path\", { d: \"M12 22V12\", key: \"d0xqtd\" }],\n [\"polyline\", { points: \"3.29 7 12 12 20.71 7\", key: \"ousv84\" }],\n [\"path\", { d: \"m7.5 4.27 9 5.15\", key: \"1c824w\" }]\n];\nconst Package = createLucideIcon(\"package\", __iconNode);\n\nexport { __iconNode, Package as default };\n//# sourceMappingURL=package.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M13 21h8\", key: \"1jsn5i\" }],\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ]\n];\nconst PenLine = createLucideIcon(\"pen-line\", __iconNode);\n\nexport { __iconNode, PenLine as default };\n//# sourceMappingURL=pen-line.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.mjs.map\n","\n!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]=\"df8e32ca-26bb-518f-b60b-821f1f094018\")}catch(e){}}();\nimport { t as package_default } from \"./package-BZLLR0Ma.js\";\nimport { n as getGitUrl, r as shortGitSha, t as getGitSha } from \"./build-info-cc1PjSvF.js\";\nimport { r as connectConfig } from \"./connect.config-Bt4pvvWV.js\";\nimport { n as toast } from \"./toast-BEy42aYx.js\";\nimport { t as useRegistryPackages } from \"./useRegistryPackages-B-gFECmd.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { t } from \"i18next\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { DriveCollectionId, closePHModal, deleteDrive, setSelectedDrive, showPHModal, useDriveSystemInfo, useDrives, usePHModal, useSyncList, useVetraPackageManager } from \"@powerhousedao/reactor-browser\";\nimport { About, DangerZone, DefaultEditor, PackageManager, SettingsModal as SettingsModal$1, ThemeSwitch } from \"@powerhousedao/design-system/connect\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport { CircleHelp, Package, PenLine, TriangleAlert } from \"lucide-react\";\n//#region src/components/modal/modals/settings/about.tsx\nconst About$1 = () => {\n\tconst onOpenInspector = () => {\n\t\tclosePHModal();\n\t\tshowPHModal({ type: \"inspector\" });\n\t};\n\treturn /* @__PURE__ */ jsxs(\"div\", { children: [\n\t\t/* @__PURE__ */ jsx(About, {\n\t\t\tpackageJson: package_default,\n\t\t\tphCliVersion: typeof connectConfig.phCliVersion === \"string\" ? connectConfig.phCliVersion : void 0\n\t\t}),\n\t\t/* @__PURE__ */ jsx(AppGitHash, {}),\n\t\t/* @__PURE__ */ jsx(ConnectedDrives, {}),\n\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: \"bg-background p-3\",\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ jsx(\"h2\", {\n\t\t\t\t\tclassName: \"mb-2 font-semibold text-foreground\",\n\t\t\t\t\tchildren: \"Inspector\"\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(\"p\", {\n\t\t\t\t\tclassName: \"mb-3 text-sm font-normal text-foreground\",\n\t\t\t\t\tchildren: \"Explore the local database and sync state for debugging.\"\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"button\", {\n\t\t\t\t\tclassName: \"flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect\",\n\t\t\t\t\tonClick: onOpenInspector,\n\t\t\t\t\ttype: \"button\",\n\t\t\t\t\tchildren: [\"Open Inspector \", /* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\tname: \"CircleInfo\",\n\t\t\t\t\t\tsize: 16\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t] });\n};\nfunction AppGitHash() {\n\tconst sha = getGitSha();\n\tif (sha === \"unknown\") return null;\n\tconst url = getGitUrl();\n\tconst label = shortGitSha(sha);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"bg-background p-3 text-sm\",\n\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: \"font-semibold\",\n\t\t\tchildren: \"Git hash: \"\n\t\t}), url ? /* @__PURE__ */ jsx(\"a\", {\n\t\t\tclassName: \"font-mono underline\",\n\t\t\thref: url,\n\t\t\ttarget: \"_blank\",\n\t\t\trel: \"noreferrer noopener\",\n\t\t\ttitle: sha,\n\t\t\tchildren: label\n\t\t}) : /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: \"font-mono\",\n\t\t\ttitle: sha,\n\t\t\tchildren: label\n\t\t})]\n\t});\n}\nfunction ConnectedDrives() {\n\tconst drives = useDrives() ?? [];\n\tconst remotes = useSyncList();\n\tconst remoteDrives = useMemo(() => drives.filter((d) => remotes.some((r) => r.collectionId.equals(DriveCollectionId.forDrive(d.header.id)))), [drives, remotes]);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"my-4 bg-background p-3\",\n\t\tchildren: [/* @__PURE__ */ jsx(\"h2\", {\n\t\t\tclassName: \"mb-2 font-semibold text-foreground\",\n\t\t\tchildren: \"Connected drives\"\n\t\t}), remoteDrives.length === 0 ? /* @__PURE__ */ jsx(\"p\", {\n\t\t\tclassName: \"text-sm font-normal text-foreground\",\n\t\t\tchildren: \"No connected remote drives.\"\n\t\t}) : /* @__PURE__ */ jsx(\"ul\", {\n\t\t\tclassName: \"flex flex-col gap-3\",\n\t\t\tchildren: remoteDrives.map((drive) => /* @__PURE__ */ jsx(DriveAboutEntry, { drive }, drive.header.id))\n\t\t})]\n\t});\n}\nfunction DriveAboutEntry({ drive }) {\n\tconst info = useDriveSystemInfo(drive);\n\treturn /* @__PURE__ */ jsxs(\"li\", {\n\t\tclassName: \"text-sm text-foreground\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-baseline gap-2\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\tchildren: drive.state.global.name || drive.header.name\n\t\t\t\t}), info.status === \"ready\" && /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"text-xs text-muted-foreground\",\n\t\t\t\t\tchildren: info.host\n\t\t\t\t})]\n\t\t\t}),\n\t\t\tinfo.status === \"loading\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-muted-foreground\",\n\t\t\t\tchildren: \"Loading…\"\n\t\t\t}),\n\t\t\tinfo.status === \"error\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-destructive\",\n\t\t\t\tchildren: \"Could not load system info\"\n\t\t\t}),\n\t\t\tinfo.status === \"ready\" && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-foreground\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", { children: [\n\t\t\t\t\t/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\t\tchildren: \"Version:\"\n\t\t\t\t\t}),\n\t\t\t\t\t\" \",\n\t\t\t\t\tinfo.version\n\t\t\t\t] }), /* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\tchildren: \"Git hash: \"\n\t\t\t\t}), info.gitUrl ? /* @__PURE__ */ jsx(\"a\", {\n\t\t\t\t\tclassName: \"font-mono hover:underline\",\n\t\t\t\t\thref: info.gitUrl,\n\t\t\t\t\ttarget: \"_blank\",\n\t\t\t\t\trel: \"noreferrer noopener\",\n\t\t\t\t\ttitle: info.gitHash,\n\t\t\t\t\tchildren: shortGitSha(info.gitHash)\n\t\t\t\t}) : /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-mono\",\n\t\t\t\t\ttitle: info.gitHash,\n\t\t\t\t\tchildren: shortGitSha(info.gitHash)\n\t\t\t\t})] })]\n\t\t\t}),\n\t\t\tinfo.status === \"local\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-muted-foreground\",\n\t\t\t\tchildren: \"Local drive — N/A\"\n\t\t\t})\n\t\t]\n\t});\n}\n//#endregion\n//#region src/components/modal/modals/settings/danger-zone.tsx\nconst DangerZone$1 = () => {\n\tconst drives = useDrives();\n\tconst handleDeleteDrive = async (drive) => {\n\t\tawait deleteDrive(drive.header.id);\n\t\tsetSelectedDrive(void 0);\n\t};\n\tconst handleClearStorage = () => {\n\t\tshowPHModal({ type: \"clearStorage\" });\n\t};\n\treturn /* @__PURE__ */ jsx(DangerZone, {\n\t\tdrives: drives ?? [],\n\t\tonDeleteDrive: (drive) => {\n\t\t\thandleDeleteDrive(drive);\n\t\t},\n\t\tonClearStorage: handleClearStorage\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/settings/default-editor.tsx\nconst documentModelEditorOptions = [{\n\tlabel: \"V1\",\n\tvalue: \"document-model-editor\"\n}, {\n\tlabel: \"V2\",\n\tvalue: \"document-model-editor-v2\"\n}];\nconst DefaultEditor$1 = () => {\n\tconst [documentModelEditor, setDocumentModelEditor] = useState(documentModelEditorOptions[1]);\n\tconst handleSetDocumentEditor = useCallback((value) => {\n\t\tconst option = documentModelEditorOptions.find((dm) => dm.value == value);\n\t\tif (option) setDocumentModelEditor(option);\n\t}, []);\n\treturn /* @__PURE__ */ jsx(DefaultEditor, {\n\t\tdocumentModelEditor: documentModelEditor.value,\n\t\tsetDocumentModelEditor: handleSetDocumentEditor,\n\t\tdocumentModelEditorOptions\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/settings/package-manager.tsx\n/**\n* Split a `name@tag` spec into its bare package name. Mirrors the design-system's\n* `parsePackageSpec` — duplicated here to avoid reaching into a deep subpath\n* export. Scoped names split on the LAST `@`, unscoped on the first.\n*/\nfunction parseBareName(spec) {\n\tconst trimmed = spec.trim();\n\tconst at = trimmed.startsWith(\"@\") ? trimmed.lastIndexOf(\"@\") : trimmed.indexOf(\"@\");\n\treturn at > 0 ? trimmed.slice(0, at) : trimmed;\n}\nconst ConnectPackageManager = () => {\n\tconst packageManager = useVetraPackageManager();\n\tconst { registryPackageList, updateRegistryPackageStatus, registerFallbackRegistryPackage } = useRegistryPackages();\n\tasync function handleInstall(packageSpec) {\n\t\tif (!packageManager) return;\n\t\tconst bareName = parseBareName(packageSpec);\n\t\tconst wasKnownToRegistry = registryPackageList.some((p) => p.name === bareName);\n\t\tconst result = await packageManager.addPackage(packageSpec);\n\t\tif (result.type === \"success\") {\n\t\t\tif (wasKnownToRegistry) updateRegistryPackageStatus(bareName, \"registry-install\");\n\t\t\telse registerFallbackRegistryPackage(bareName, result.package, packageManager.getPackageVersion(bareName) ?? packageManager.getPackageVersion(packageSpec), \"registry-install\");\n\t\t\ttoast(`Package \"${packageSpec}\" installed successfully`, { type: \"connect-success\" });\n\t\t} else {\n\t\t\tconst message = result.error.message;\n\t\t\ttoast(/failed to fetch|404|not found/i.test(message) ? `Could not install \"${packageSpec}\". The package isn't available on this registry, and the npmjs.org fallback could not resolve it either.` : `Failed to install \"${packageSpec}\": ${message}`, { type: \"error\" });\n\t\t}\n\t}\n\tfunction handleUninstall(packageName) {\n\t\tif (!packageManager) return;\n\t\ttry {\n\t\t\tpackageManager.removePackage(packageName);\n\t\t\tupdateRegistryPackageStatus(packageName, \"available\");\n\t\t\ttoast(`Package \"${packageName}\" uninstalled successfully`, { type: \"connect-success\" });\n\t\t} catch (error) {\n\t\t\ttoast(`Failed to uninstall \"${packageName}\": ${error instanceof Error ? error.message : \"Unknown error\"}`, { type: \"error\" });\n\t\t}\n\t}\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: \"flex h-full flex-1 flex-col\",\n\t\tchildren: /* @__PURE__ */ jsx(PackageManager, {\n\t\t\tmutable: true,\n\t\t\tregistryPackageList,\n\t\t\tonInstall: handleInstall,\n\t\t\tonUninstall: handleUninstall\n\t\t})\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/SettingsModal.tsx\nconst iconProps = { size: 16 };\nconst SettingsModal = () => {\n\tconst open = usePHModal()?.type === \"settings\";\n\tconst tabs = useMemo(() => [\n\t\t{\n\t\t\tid: \"package-manager\",\n\t\t\ticon: /* @__PURE__ */ jsx(Package, { ...iconProps }),\n\t\t\tlabel: \"Package Manager\",\n\t\t\tcontent: ConnectPackageManager\n\t\t},\n\t\t{\n\t\t\tid: \"default-editors\",\n\t\t\ticon: /* @__PURE__ */ jsx(PenLine, { ...iconProps }),\n\t\t\tlabel: \"Default Editors\",\n\t\t\tcontent: DefaultEditor$1\n\t\t},\n\t\t{\n\t\t\tid: \"danger-zone\",\n\t\t\ticon: /* @__PURE__ */ jsx(TriangleAlert, {\n\t\t\t\t...iconProps,\n\t\t\t\tclassName: \"text-destructive\"\n\t\t\t}),\n\t\t\tlabel: /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: \"text-destructive\",\n\t\t\t\tchildren: \"Danger Zone\"\n\t\t\t}),\n\t\t\tcontent: () => /* @__PURE__ */ jsx(DangerZone$1, {})\n\t\t},\n\t\t{\n\t\t\tid: \"about\",\n\t\t\ticon: /* @__PURE__ */ jsx(CircleHelp, { ...iconProps }),\n\t\t\tlabel: \"About\",\n\t\t\tcontent: About$1\n\t\t}\n\t], []);\n\treturn /* @__PURE__ */ jsx(SettingsModal$1, {\n\t\topen,\n\t\ttitle: t(\"modals.connectSettings.title\"),\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) return closePHModal();\n\t\t},\n\t\ttabs,\n\t\tnavFooter: /* @__PURE__ */ jsx(ThemeSwitch, { horizontal: true })\n\t});\n};\n//#endregion\nexport { SettingsModal };\n\n//# sourceMappingURL=SettingsModal-S_A5qf95.js.map\n//# debugId=df8e32ca-26bb-518f-b60b-821f1f094018\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":"6sBAcA,IAAM,EAAqB,EAAiB,uBAAwBA,CAJlE,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,SAAU,CAAC,CAC1D,CAAC,OAAQ,CAAE,EAAG,uCAAwC,IAAK,SAAU,CAAC,CACtE,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,SAAU,CAAC,CAEsBA,CAAW,CCOzE,EAAU,EAAiB,UAAWC,CAX1C,CACE,OACA,CACE,EAAG,2HACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAC3C,CAAC,WAAY,CAAE,OAAQ,uBAAwB,IAAK,SAAU,CAAC,CAC/D,CAAC,OAAQ,CAAE,EAAG,mBAAoB,IAAK,SAAU,CAAC,CAERA,CAAW,CCFjD,EAAU,EAAiB,WAAYC,CAT3C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CACE,OACA,CACE,EAAG,mIACH,IAAK,SACN,CACF,CAE0CA,CAAW,CCClD,EAAgB,EAAiB,iBAAkB,CAVvD,CACE,OACA,CACE,EAAG,2EACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,UAA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M,EAAO,GAAY,EAAE,OAAS,WAC9B,EAAO,MAAc,CAC1B,CACC,GAAI,kBACJ,KAAsB,EAAI,EAAS,CAAE,GAAG,EAAW,CAAC,CACpD,MAAO,kBACP,QAAS,EACT,CACD,CACC,GAAI,kBACJ,KAAsB,EAAI,EAAS,CAAE,GAAG,EAAW,CAAC,CACpD,MAAO,kBACP,QAAS,EACT,CACD,CACC,GAAI,cACJ,KAAsB,EAAI,EAAe,CACxC,GAAG,EACH,UAAW,mBACX,CAAC,CACF,MAAuB,EAAI,OAAQ,CAClC,UAAW,mBACX,SAAU,cACV,CAAC,CACF,YAA+B,EAAI,EAAc,EAAE,CAAC,CACpD,CACD,CACC,GAAI,QACJ,KAAsB,EAAIC,EAAY,CAAE,GAAG,EAAW,CAAC,CACvD,MAAO,QACP,QAAS,EACT,CACD,CAAE,EAAE,CAAC,CACN,OAAuB,EAAI,EAAiB,CAC3C,OACA,MAAO,EAAE,+BAA+B,CACxC,aAAe,GAAW,CACzB,GAAI,CAAC,EAAQ,OAAO,GAAc,EAEnC,OACA,UAA2B,EAAI,EAAa,CAAE,WAAY,GAAM,CAAC,CACjE,CAAC"}
|
|
1
|
+
{"version":3,"file":"SettingsModal-S_A5qf95-q6y3kJdv.js","names":["__iconNode","__iconNode","__iconNode","CircleHelp"],"sources":["../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/circle-question-mark.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/package.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/pen-line.mjs","../../../../../node_modules/.pnpm/lucide-react@1.17.0_react@19.2.6/node_modules/lucide-react/dist/esm/icons/triangle-alert.mjs","../../../../../node_modules/.pnpm/@powerhousedao+connect@6.2.0-dev.23_@babel+runtime@7.29.2_@parcel+watcher@2.5.6_@sentry_92fbcdab943457b0ffd54c0864a4f38d/node_modules/@powerhousedao/connect/dist/SettingsModal-S_A5qf95.js"],"sourcesContent":["/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\",\n key: \"1a0edw\"\n }\n ],\n [\"path\", { d: \"M12 22V12\", key: \"d0xqtd\" }],\n [\"polyline\", { points: \"3.29 7 12 12 20.71 7\", key: \"ousv84\" }],\n [\"path\", { d: \"m7.5 4.27 9 5.15\", key: \"1c824w\" }]\n];\nconst Package = createLucideIcon(\"package\", __iconNode);\n\nexport { __iconNode, Package as default };\n//# sourceMappingURL=package.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M13 21h8\", key: \"1jsn5i\" }],\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ]\n];\nconst PenLine = createLucideIcon(\"pen-line\", __iconNode);\n\nexport { __iconNode, PenLine as default };\n//# sourceMappingURL=pen-line.mjs.map\n","/**\n * @license lucide-react v1.17.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.mjs.map\n","\n!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]=\"df8e32ca-26bb-518f-b60b-821f1f094018\")}catch(e){}}();\nimport { t as package_default } from \"./package-BZLLR0Ma.js\";\nimport { n as getGitUrl, r as shortGitSha, t as getGitSha } from \"./build-info-cc1PjSvF.js\";\nimport { r as connectConfig } from \"./connect.config-Bt4pvvWV.js\";\nimport { n as toast } from \"./toast-BEy42aYx.js\";\nimport { t as useRegistryPackages } from \"./useRegistryPackages-B-gFECmd.js\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { t } from \"i18next\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { DriveCollectionId, closePHModal, deleteDrive, setSelectedDrive, showPHModal, useDriveSystemInfo, useDrives, usePHModal, useSyncList, useVetraPackageManager } from \"@powerhousedao/reactor-browser\";\nimport { About, DangerZone, DefaultEditor, PackageManager, SettingsModal as SettingsModal$1, ThemeSwitch } from \"@powerhousedao/design-system/connect\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport { CircleHelp, Package, PenLine, TriangleAlert } from \"lucide-react\";\n//#region src/components/modal/modals/settings/about.tsx\nconst About$1 = () => {\n\tconst onOpenInspector = () => {\n\t\tclosePHModal();\n\t\tshowPHModal({ type: \"inspector\" });\n\t};\n\treturn /* @__PURE__ */ jsxs(\"div\", { children: [\n\t\t/* @__PURE__ */ jsx(About, {\n\t\t\tpackageJson: package_default,\n\t\t\tphCliVersion: typeof connectConfig.phCliVersion === \"string\" ? connectConfig.phCliVersion : void 0\n\t\t}),\n\t\t/* @__PURE__ */ jsx(AppGitHash, {}),\n\t\t/* @__PURE__ */ jsx(ConnectedDrives, {}),\n\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: \"bg-background p-3\",\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ jsx(\"h2\", {\n\t\t\t\t\tclassName: \"mb-2 font-semibold text-foreground\",\n\t\t\t\t\tchildren: \"Inspector\"\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(\"p\", {\n\t\t\t\t\tclassName: \"mb-3 text-sm font-normal text-foreground\",\n\t\t\t\t\tchildren: \"Explore the local database and sync state for debugging.\"\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsxs(\"button\", {\n\t\t\t\t\tclassName: \"flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect\",\n\t\t\t\t\tonClick: onOpenInspector,\n\t\t\t\t\ttype: \"button\",\n\t\t\t\t\tchildren: [\"Open Inspector \", /* @__PURE__ */ jsx(Icon, {\n\t\t\t\t\t\tname: \"CircleInfo\",\n\t\t\t\t\t\tsize: 16\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t] });\n};\nfunction AppGitHash() {\n\tconst sha = getGitSha();\n\tif (sha === \"unknown\") return null;\n\tconst url = getGitUrl();\n\tconst label = shortGitSha(sha);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"bg-background p-3 text-sm\",\n\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: \"font-semibold\",\n\t\t\tchildren: \"Git hash: \"\n\t\t}), url ? /* @__PURE__ */ jsx(\"a\", {\n\t\t\tclassName: \"font-mono underline\",\n\t\t\thref: url,\n\t\t\ttarget: \"_blank\",\n\t\t\trel: \"noreferrer noopener\",\n\t\t\ttitle: sha,\n\t\t\tchildren: label\n\t\t}) : /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: \"font-mono\",\n\t\t\ttitle: sha,\n\t\t\tchildren: label\n\t\t})]\n\t});\n}\nfunction ConnectedDrives() {\n\tconst drives = useDrives() ?? [];\n\tconst remotes = useSyncList();\n\tconst remoteDrives = useMemo(() => drives.filter((d) => remotes.some((r) => r.collectionId.equals(DriveCollectionId.forDrive(d.header.id)))), [drives, remotes]);\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"my-4 bg-background p-3\",\n\t\tchildren: [/* @__PURE__ */ jsx(\"h2\", {\n\t\t\tclassName: \"mb-2 font-semibold text-foreground\",\n\t\t\tchildren: \"Connected drives\"\n\t\t}), remoteDrives.length === 0 ? /* @__PURE__ */ jsx(\"p\", {\n\t\t\tclassName: \"text-sm font-normal text-foreground\",\n\t\t\tchildren: \"No connected remote drives.\"\n\t\t}) : /* @__PURE__ */ jsx(\"ul\", {\n\t\t\tclassName: \"flex flex-col gap-3\",\n\t\t\tchildren: remoteDrives.map((drive) => /* @__PURE__ */ jsx(DriveAboutEntry, { drive }, drive.header.id))\n\t\t})]\n\t});\n}\nfunction DriveAboutEntry({ drive }) {\n\tconst info = useDriveSystemInfo(drive);\n\treturn /* @__PURE__ */ jsxs(\"li\", {\n\t\tclassName: \"text-sm text-foreground\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-baseline gap-2\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\tchildren: drive.state.global.name || drive.header.name\n\t\t\t\t}), info.status === \"ready\" && /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"text-xs text-muted-foreground\",\n\t\t\t\t\tchildren: info.host\n\t\t\t\t})]\n\t\t\t}),\n\t\t\tinfo.status === \"loading\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-muted-foreground\",\n\t\t\t\tchildren: \"Loading…\"\n\t\t\t}),\n\t\t\tinfo.status === \"error\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-destructive\",\n\t\t\t\tchildren: \"Could not load system info\"\n\t\t\t}),\n\t\t\tinfo.status === \"ready\" && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-foreground\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", { children: [\n\t\t\t\t\t/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\t\tchildren: \"Version:\"\n\t\t\t\t\t}),\n\t\t\t\t\t\" \",\n\t\t\t\t\tinfo.version\n\t\t\t\t] }), /* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-medium\",\n\t\t\t\t\tchildren: \"Git hash: \"\n\t\t\t\t}), info.gitUrl ? /* @__PURE__ */ jsx(\"a\", {\n\t\t\t\t\tclassName: \"font-mono hover:underline\",\n\t\t\t\t\thref: info.gitUrl,\n\t\t\t\t\ttarget: \"_blank\",\n\t\t\t\t\trel: \"noreferrer noopener\",\n\t\t\t\t\ttitle: info.gitHash,\n\t\t\t\t\tchildren: shortGitSha(info.gitHash)\n\t\t\t\t}) : /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tclassName: \"font-mono\",\n\t\t\t\t\ttitle: info.gitHash,\n\t\t\t\t\tchildren: shortGitSha(info.gitHash)\n\t\t\t\t})] })]\n\t\t\t}),\n\t\t\tinfo.status === \"local\" && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"mt-1 text-xs text-muted-foreground\",\n\t\t\t\tchildren: \"Local drive — N/A\"\n\t\t\t})\n\t\t]\n\t});\n}\n//#endregion\n//#region src/components/modal/modals/settings/danger-zone.tsx\nconst DangerZone$1 = () => {\n\tconst drives = useDrives();\n\tconst handleDeleteDrive = async (drive) => {\n\t\tawait deleteDrive(drive.header.id);\n\t\tsetSelectedDrive(void 0);\n\t};\n\tconst handleClearStorage = () => {\n\t\tshowPHModal({ type: \"clearStorage\" });\n\t};\n\treturn /* @__PURE__ */ jsx(DangerZone, {\n\t\tdrives: drives ?? [],\n\t\tonDeleteDrive: (drive) => {\n\t\t\thandleDeleteDrive(drive);\n\t\t},\n\t\tonClearStorage: handleClearStorage\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/settings/default-editor.tsx\nconst documentModelEditorOptions = [{\n\tlabel: \"V1\",\n\tvalue: \"document-model-editor\"\n}, {\n\tlabel: \"V2\",\n\tvalue: \"document-model-editor-v2\"\n}];\nconst DefaultEditor$1 = () => {\n\tconst [documentModelEditor, setDocumentModelEditor] = useState(documentModelEditorOptions[1]);\n\tconst handleSetDocumentEditor = useCallback((value) => {\n\t\tconst option = documentModelEditorOptions.find((dm) => dm.value == value);\n\t\tif (option) setDocumentModelEditor(option);\n\t}, []);\n\treturn /* @__PURE__ */ jsx(DefaultEditor, {\n\t\tdocumentModelEditor: documentModelEditor.value,\n\t\tsetDocumentModelEditor: handleSetDocumentEditor,\n\t\tdocumentModelEditorOptions\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/settings/package-manager.tsx\n/**\n* Split a `name@tag` spec into its bare package name. Mirrors the design-system's\n* `parsePackageSpec` — duplicated here to avoid reaching into a deep subpath\n* export. Scoped names split on the LAST `@`, unscoped on the first.\n*/\nfunction parseBareName(spec) {\n\tconst trimmed = spec.trim();\n\tconst at = trimmed.startsWith(\"@\") ? trimmed.lastIndexOf(\"@\") : trimmed.indexOf(\"@\");\n\treturn at > 0 ? trimmed.slice(0, at) : trimmed;\n}\nconst ConnectPackageManager = () => {\n\tconst packageManager = useVetraPackageManager();\n\tconst { registryPackageList, updateRegistryPackageStatus, registerFallbackRegistryPackage } = useRegistryPackages();\n\tasync function handleInstall(packageSpec) {\n\t\tif (!packageManager) return;\n\t\tconst bareName = parseBareName(packageSpec);\n\t\tconst wasKnownToRegistry = registryPackageList.some((p) => p.name === bareName);\n\t\tconst result = await packageManager.addPackage(packageSpec);\n\t\tif (result.type === \"success\") {\n\t\t\tif (wasKnownToRegistry) updateRegistryPackageStatus(bareName, \"registry-install\");\n\t\t\telse registerFallbackRegistryPackage(bareName, result.package, packageManager.getPackageVersion(bareName) ?? packageManager.getPackageVersion(packageSpec), \"registry-install\");\n\t\t\ttoast(`Package \"${packageSpec}\" installed successfully`, { type: \"connect-success\" });\n\t\t} else {\n\t\t\tconst message = result.error.message;\n\t\t\ttoast(/failed to fetch|404|not found/i.test(message) ? `Could not install \"${packageSpec}\". The package isn't available on this registry, and the npmjs.org fallback could not resolve it either.` : `Failed to install \"${packageSpec}\": ${message}`, { type: \"error\" });\n\t\t}\n\t}\n\tfunction handleUninstall(packageName) {\n\t\tif (!packageManager) return;\n\t\ttry {\n\t\t\tpackageManager.removePackage(packageName);\n\t\t\tupdateRegistryPackageStatus(packageName, \"available\");\n\t\t\ttoast(`Package \"${packageName}\" uninstalled successfully`, { type: \"connect-success\" });\n\t\t} catch (error) {\n\t\t\ttoast(`Failed to uninstall \"${packageName}\": ${error instanceof Error ? error.message : \"Unknown error\"}`, { type: \"error\" });\n\t\t}\n\t}\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: \"flex h-full flex-1 flex-col\",\n\t\tchildren: /* @__PURE__ */ jsx(PackageManager, {\n\t\t\tmutable: true,\n\t\t\tregistryPackageList,\n\t\t\tonInstall: handleInstall,\n\t\t\tonUninstall: handleUninstall\n\t\t})\n\t});\n};\n//#endregion\n//#region src/components/modal/modals/SettingsModal.tsx\nconst iconProps = { size: 16 };\nconst SettingsModal = () => {\n\tconst open = usePHModal()?.type === \"settings\";\n\tconst tabs = useMemo(() => [\n\t\t{\n\t\t\tid: \"package-manager\",\n\t\t\ticon: /* @__PURE__ */ jsx(Package, { ...iconProps }),\n\t\t\tlabel: \"Package Manager\",\n\t\t\tcontent: ConnectPackageManager\n\t\t},\n\t\t{\n\t\t\tid: \"default-editors\",\n\t\t\ticon: /* @__PURE__ */ jsx(PenLine, { ...iconProps }),\n\t\t\tlabel: \"Default Editors\",\n\t\t\tcontent: DefaultEditor$1\n\t\t},\n\t\t{\n\t\t\tid: \"danger-zone\",\n\t\t\ticon: /* @__PURE__ */ jsx(TriangleAlert, {\n\t\t\t\t...iconProps,\n\t\t\t\tclassName: \"text-destructive\"\n\t\t\t}),\n\t\t\tlabel: /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: \"text-destructive\",\n\t\t\t\tchildren: \"Danger Zone\"\n\t\t\t}),\n\t\t\tcontent: () => /* @__PURE__ */ jsx(DangerZone$1, {})\n\t\t},\n\t\t{\n\t\t\tid: \"about\",\n\t\t\ticon: /* @__PURE__ */ jsx(CircleHelp, { ...iconProps }),\n\t\t\tlabel: \"About\",\n\t\t\tcontent: About$1\n\t\t}\n\t], []);\n\treturn /* @__PURE__ */ jsx(SettingsModal$1, {\n\t\topen,\n\t\ttitle: t(\"modals.connectSettings.title\"),\n\t\tonOpenChange: (status) => {\n\t\t\tif (!status) return closePHModal();\n\t\t},\n\t\ttabs,\n\t\tnavFooter: /* @__PURE__ */ jsx(ThemeSwitch, { horizontal: true })\n\t});\n};\n//#endregion\nexport { SettingsModal };\n\n//# sourceMappingURL=SettingsModal-S_A5qf95.js.map\n//# debugId=df8e32ca-26bb-518f-b60b-821f1f094018\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":"6sBAcA,IAAM,EAAqB,EAAiB,uBAAwBA,CAJlE,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,SAAU,CAAC,CAC1D,CAAC,OAAQ,CAAE,EAAG,uCAAwC,IAAK,SAAU,CAAC,CACtE,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,SAAU,CAAC,CAEsBA,CAAW,CCOzE,EAAU,EAAiB,UAAWC,CAX1C,CACE,OACA,CACE,EAAG,2HACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAC3C,CAAC,WAAY,CAAE,OAAQ,uBAAwB,IAAK,SAAU,CAAC,CAC/D,CAAC,OAAQ,CAAE,EAAG,mBAAoB,IAAK,SAAU,CAAC,CAERA,CAAW,CCFjD,EAAU,EAAiB,WAAYC,CAT3C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CACE,OACA,CACE,EAAG,mIACH,IAAK,SACN,CACF,CAE0CA,CAAW,CCClD,EAAgB,EAAiB,iBAAkB,CAVvD,CACE,OACA,CACE,EAAG,2EACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,SAAU,CAAC,CACzC,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,SAAU,CAAC,CAEW,CAAW,ECnBnE,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,WAApB,IAA+B,WAAwB,OAAO,KAApB,IAAyB,KAAK,EAAE,CAAC,EAAG,IAAI,EAAE,OAAK,CAAE,MAAM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