@abtnode/webapp 1.16.52-beta-20250916-025146-35d976f4 → 1.16.52-beta-20250918-114058-f5efc10b
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DarkZR9j.js → AdapterDayjs-BQ6X5ALq.js} +1 -1
- package/dist/assets/{Add-BsCasUcs.js → Add-DTGe-ZCp.js} +1 -1
- package/dist/assets/ArrowDropDown-Doc7Mi-x.js +1 -0
- package/dist/assets/{Autocomplete-DjYVg0xw.js → Autocomplete-COrgl8lD.js} +1 -1
- package/dist/assets/{Breadcrumbs-vVVRZsjN.js → Breadcrumbs-CnuJDEjA.js} +1 -1
- package/dist/assets/{ButtonGroup-CF6fFlve.js → ButtonGroup-NHFraP5W.js} +1 -1
- package/dist/assets/{CSSTransition-DSxV7K4V.js → CSSTransition-C1WKDxhV.js} +1 -1
- package/dist/assets/{CallMerge-odntUl5s.js → CallMerge-C7y141G5.js} +1 -1
- package/dist/assets/{CardContent-Bx23N-y1.js → CardContent-CZZD5uxd.js} +1 -1
- package/dist/assets/{ChevronLeft-DneAQDKO.js → ChevronLeft-BB-pXpah.js} +1 -1
- package/dist/assets/{ChevronRight-C_XYjhxd.js → ChevronRight-DHrS44VT.js} +1 -1
- package/dist/assets/{Clear-dbJWv3QG.js → Clear-x8R7nP_3.js} +1 -1
- package/dist/assets/{DeleteOutline-BQGJu1ed.js → DeleteOutline-Ck93qCLA.js} +1 -1
- package/dist/assets/{Done-BjzLVAB9.js → Done-BwdDX1O2.js} +1 -1
- package/dist/assets/{Edit-CbphF2M-.js → Edit-BgTAfG26.js} +1 -1
- package/dist/assets/{ErrorOutline-BL3sEekq.js → ErrorOutline-DCFmKF-T.js} +1 -1
- package/dist/assets/{FilterList-DgzeYNjK.js → FilterList-CKBf2Vv9.js} +1 -1
- package/dist/assets/{Google-BklBOHcq.js → Google-D7Cw8qDf.js} +1 -1
- package/dist/assets/{HelpOutline-B9rq5AT4.js → HelpOutline-lBsTb1UP.js} +1 -1
- package/dist/assets/{Launch-D-Zf7oaA.js → Launch-3zWvKZty.js} +1 -1
- package/dist/assets/{Link-Lf9shwST.js → Link-DIxdmuQI.js} +1 -1
- package/dist/assets/{ListItemButton-CBCcz25V.js → ListItemButton-BQsG34ZB.js} +1 -1
- package/dist/assets/{ListSubheader-BYRJFOMa.js → ListSubheader-B7M9oqxC.js} +1 -1
- package/dist/assets/{LoadingButton-B2KbS3tl.js → LoadingButton-C77eMd86.js} +1 -1
- package/dist/assets/{MoreVert-B0v12xlt.js → MoreVert-VfUY7lzP.js} +1 -1
- package/dist/assets/{OpenInNew-DpFE4qHg.js → OpenInNew-xMrJenFO.js} +1 -1
- package/dist/assets/{Refresh-DYNB8V6v.js → Refresh-qp15zbM1.js} +1 -1
- package/dist/assets/{Search-TKSWz34N.js → Search-DCwzmPfi.js} +1 -1
- package/dist/assets/{Stepper-C1wqVhiQ.js → Stepper-CLAbE0Vc.js} +1 -1
- package/dist/assets/{Switch-p1fa_uPC.js → Switch-1ujfhKkZ.js} +1 -1
- package/dist/assets/{TableSearch-DH2QxdMb.js → TableSearch-CsIYJ-Mc.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BtechD_B.js → ToggleButtonGroup-Ptog4kG8.js} +1 -1
- package/dist/assets/{Verified-zfe6nsBp.js → Verified-COZ1DW29.js} +1 -1
- package/dist/assets/{VerifiedUser-2_jqMje1.js → VerifiedUser-ErX6tKMG.js} +1 -1
- package/dist/assets/{ViewList-5h6twi3p.js → ViewList-BhhJ-2er.js} +1 -1
- package/dist/assets/{_createAggregator-BRC6hvO7.js → _createAggregator-uNFm8UBS.js} +1 -1
- package/dist/assets/{actions-DwZg2R6k.js → actions-DYQCHviz.js} +1 -1
- package/dist/assets/{actions-D8IVwECn.js → actions-rW-FK_P1.js} +1 -1
- package/dist/assets/{agreement-BPDJWeCJ.js → agreement-DCe8UCmn.js} +1 -1
- package/dist/assets/api-YN3oror6.js +1 -0
- package/dist/assets/{appearance-BiVRoiwT.js → appearance-Bvz7Ih_G.js} +1 -1
- package/dist/assets/{audit-logs-BQFBhT5n.js → audit-logs-Cls9UmS0.js} +1 -1
- package/dist/assets/{base-chart-Zi8pdr17.js → base-chart-D-7ZSxC-.js} +1 -1
- package/dist/assets/{blocklet-C03sDJ1i.js → blocklet-Ho3KwOsh.js} +1 -1
- package/dist/assets/{chain-CKxf9AdU.js → chain-8eWVoTb9.js} +1 -1
- package/dist/assets/{click-to-copy-OQVm3W8D.js → click-to-copy-Dge9fppM.js} +1 -1
- package/dist/assets/client-BSdzIVHz.js +1 -0
- package/dist/assets/cloneDeep-DRPmP8MR.js +1 -0
- package/dist/assets/{collapse-CmEfNn01.js → collapse-Ccf8f09m.js} +1 -1
- package/dist/assets/{config-navigation-BUpRpuRp.js → config-navigation-iqzME752.js} +3 -3
- package/dist/assets/{connect-to-Ccnb4QWA.js → connect-to-B-eSBX-W.js} +2 -2
- package/dist/assets/{cssMode-BDx-0Yhk.js → cssMode-K-EHU0PU.js} +1 -1
- package/dist/assets/{delete-confirm-B4ZWgco3.js → delete-confirm-C2Bokk_z.js} +1 -1
- package/dist/assets/{depsEqual-DUSDIMu_.js → depsEqual-CDHvTR0w.js} +1 -1
- package/dist/assets/{detail-DD7Yilol.js → detail-CEyFeMrm.js} +3 -3
- package/dist/assets/{domains-tnLuDLA-.js → domains-CtNDqREN.js} +1 -1
- package/dist/assets/{download-DHO_qxiG.js → download-GWnxmvAC.js} +1 -1
- package/dist/assets/{edit.svg-CaGUvrvT.js → edit.svg-UWFKFe9C.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-DCbFVNUX.js +1 -0
- package/dist/assets/engine-n_dB0poi.js +1 -0
- package/dist/assets/{freemarker2-CvE_6GlU.js → freemarker2-DxLjeCta.js} +1 -1
- package/dist/assets/{get-safe-url-DL1Ksc1t.js → get-safe-url-904a-sst.js} +1 -1
- package/dist/assets/getValidReactChildren-CuqzhDUA.js +1 -0
- package/dist/assets/{graphqlMode-DgW4p_1y.js → graphqlMode-D0Lcd6qY.js} +2 -2
- package/dist/assets/{handlebars-B0Tsx3G2.js → handlebars-CGkm6guH.js} +1 -1
- package/dist/assets/{html-DPsrcobJ.js → html-Df1MBhzv.js} +1 -1
- package/dist/assets/{html-title-CLvLOLbR.js → html-title-CZ5JcCBv.js} +1 -1
- package/dist/assets/{htmlMode-C2oN13HO.js → htmlMode-DGZ0WwLc.js} +1 -1
- package/dist/assets/{iframe-CujpH5O-.js → iframe-Brx5OwuI.js} +1 -1
- package/dist/assets/{index-DCnEvnl6.js → index-0vNZ7AEu.js} +1 -1
- package/dist/assets/{index-IE_xZtXx.js → index-B3Oc6om-.js} +1 -1
- package/dist/assets/{index-DIyvBU1o.js → index-B4mPHi-Q.js} +1 -1
- package/dist/assets/{index-BbhrM_fS.js → index-B9ffq1Aq.js} +2 -2
- package/dist/assets/{index-DFduzc0K.js → index-B9jXnde-.js} +1 -1
- package/dist/assets/{index-xP3FaEcA.js → index-BC50VoNY.js} +1 -1
- package/dist/assets/{index-C0GpgF9K.js → index-BGR-_3k-.js} +1 -1
- package/dist/assets/{index-Xwhm3Zp4.js → index-BTMZN2df.js} +1 -1
- package/dist/assets/{index-CvrjkLlP.js → index-BU51lRJo.js} +1 -1
- package/dist/assets/{index-Dk3siGj5.js → index-BYtw5o5b.js} +1 -1
- package/dist/assets/{index-CzpTfDdp.js → index-B_-T0wck.js} +1 -1
- package/dist/assets/{index-gyjan-8E.js → index-BcBAaNDP.js} +1 -1
- package/dist/assets/{index-Bc-kttJk.js → index-Bh1rufH4.js} +1 -1
- package/dist/assets/{index-D1rBdThL.js → index-Bn30Hrji.js} +1 -1
- package/dist/assets/{index-CMwvr3Aw.js → index-Bp5-go9U.js} +1 -1
- package/dist/assets/{index-NuBAdQKe.js → index-BwC1WKA0.js} +1 -1
- package/dist/assets/index-C35YhCHh.js +1 -0
- package/dist/assets/{index-tJqcQJw8.js → index-CI0UsYER.js} +34 -34
- package/dist/assets/{index-i6PKUbUv.js → index-CKKPbTJM.js} +1 -1
- package/dist/assets/{index-BPByI5gc.js → index-CKMXkLAj.js} +1 -1
- package/dist/assets/{index-DEhIkivP.js → index-COZUVDs_.js} +1 -1
- package/dist/assets/{index-CGv5PXND.js → index-CZJa5rYO.js} +1 -1
- package/dist/assets/{index-BwFgT4f9.js → index-CeFaduiH.js} +1 -1
- package/dist/assets/{index-PGkZ-p10.js → index-CmGtSUKs.js} +9 -9
- package/dist/assets/{index-CT2y-lAr.js → index-CpkDkxbl.js} +1 -1
- package/dist/assets/{index-CIs0ueGA.js → index-CrdG-tHx.js} +1 -1
- package/dist/assets/{index-DzXOEuwn.js → index-D3pkr7vY.js} +1 -1
- package/dist/assets/{index-Dor9E-YG.js → index-D5nLng0M.js} +1 -1
- package/dist/assets/{index-MlQbgg84.js → index-DC_t5IrF.js} +1 -1
- package/dist/assets/{index-BGsVf6ce.js → index-DIlhgeDx.js} +1 -1
- package/dist/assets/{index-DPBo5dxQ.js → index-DL9WFbI3.js} +1 -1
- package/dist/assets/{index-BDnrYBbd.js → index-Dczm0ciF.js} +3 -3
- package/dist/assets/{index-BpHIZRoQ.js → index-DibtYVCM.js} +1 -1
- package/dist/assets/{index-DVDt5rkZ.js → index-DvXF3edn.js} +1 -1
- package/dist/assets/{index-DOu4zwZ4.js → index-HLx20Dfh.js} +1 -1
- package/dist/assets/{index-hv--3OFd.js → index-Lr_zCh3w.js} +1 -1
- package/dist/assets/{index-BwW-ib72.js → index-YDuxnNHU.js} +1 -1
- package/dist/assets/{index-DL6_plGD.js → index-YcYAmiqY.js} +3 -3
- package/dist/assets/{index-BFj_BZkU.js → index-gbJS2iWq.js} +1 -1
- package/dist/assets/{index-KQW85_sG.js → index-r8P2C1jY.js} +1 -1
- package/dist/assets/{index-uvPvZoSt.js → index-rgZafSNx.js} +1 -1
- package/dist/assets/{index-CW58JS3K.js → index-t53zoO86.js} +3 -3
- package/dist/assets/{index-TIc9HsMr.js → index-vsYl-Coo.js} +1 -1
- package/dist/assets/{index-DPXRDGCk.js → index-wprZzohw.js} +3 -3
- package/dist/assets/{index-DoLLHsgg.js → index-zevfx5hg.js} +1 -1
- package/dist/assets/{index.esm-DEWYqPkv.js → index.esm-BQAoYQrS.js} +1 -1
- package/dist/assets/{install-from-url-R3-z-Na6.js → install-from-url-IsaoWEsr.js} +1 -1
- package/dist/assets/{invitation-DnVLx9Vx.js → invitation-C5_UDplP.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-D8k2SijE.js → is-path-prefix-equal-BGtI1xmD.js} +1 -1
- package/dist/assets/{item-MmXt9J3K.js → item-DbR_Qonp.js} +1 -1
- package/dist/assets/{javascript-BlyEC1iq.js → javascript-DkXHxlH1.js} +1 -1
- package/dist/assets/{jsonMode-CCzgkgmt.js → jsonMode-CGwcJxW1.js} +1 -1
- package/dist/assets/{liquid-BAEm0H2r.js → liquid-CAttQQg5.js} +1 -1
- package/dist/assets/{list-header-Crj7BNKL.js → list-header-BDHTrIR7.js} +1 -1
- package/dist/assets/{log-DhVLnKso.js → log-YBA0AQwS.js} +1 -1
- package/dist/assets/{lottie-react.esm-DvvAHvj1.js → lottie-react.esm-BDS-spvg.js} +1 -1
- package/dist/assets/{mdx-BamtHgoS.js → mdx-B8IKS0Gi.js} +1 -1
- package/dist/assets/{memory-CFo0vaiY.js → memory-D1vRidmB.js} +1 -1
- package/dist/assets/{metric-K7UZeWUX.js → metric-CCZ8GIKv.js} +1 -1
- package/dist/assets/omit-BKpaopbT.js +1 -0
- package/dist/assets/{overview-HLtH-yCi.js → overview-lwcVaTjE.js} +1 -1
- package/dist/assets/{permission-BdpMR93f.js → permission-C38ouogl.js} +1 -1
- package/dist/assets/{preference-Lv54_1NQ.js → preference-A8RbnsFJ.js} +3 -3
- package/dist/assets/{python-amBHGt1r.js → python-ob3MVBAf.js} +1 -1
- package/dist/assets/{raf-schd.esm-CLovL9Is.js → raf-schd.esm-Srh73OZ3.js} +1 -1
- package/dist/assets/{razor-BkTz5FTM.js → razor-CqXOZHtS.js} +1 -1
- package/dist/assets/{rotate-session-key-BQCEdH4H.js → rotate-session-key-D0BtnLpd.js} +1 -1
- package/dist/assets/{runtime-BGo7IAbs.js → runtime-D0jvHCY9.js} +1 -1
- package/dist/assets/schema-CjBxKpCX.js +1 -0
- package/dist/assets/sdk-DyID4gpA.js +1 -0
- package/dist/assets/{service-Bz07Hd--.js → service-D5pzJKlx.js} +1 -1
- package/dist/assets/{shorten-label-L8CW1JMg.js → shorten-label-BkkyIh2O.js} +1 -1
- package/dist/assets/{simple-select-CEHYECyj.js → simple-select-BrcGp9-q.js} +1 -1
- package/dist/assets/{spaces-zGV6wwqp.js → spaces-DLMhU3hk.js} +1 -1
- package/dist/assets/{status-BQ8pfSo7.js → status-CJUsFots.js} +1 -1
- package/dist/assets/{status-vgu2kfq8.js → status-DjFfQvDr.js} +1 -1
- package/dist/assets/{switch-control-CLcUFpZi.js → switch-control-BcyytepR.js} +1 -1
- package/dist/assets/{table-icons-PFo7EdLg.js → table-icons-IcqjoaWm.js} +1 -1
- package/dist/assets/{team-DV-g0zdM.js → team-95t9JyF5.js} +1 -1
- package/dist/assets/{toLower-DPcdQ2gg.js → toLower-DkUK7eQ7.js} +1 -1
- package/dist/assets/toUpper-CILdyLjF.js +1 -0
- package/dist/assets/{traffic-CsK46tzJ.js → traffic-Cg41H_Ty.js} +1 -1
- package/dist/assets/{tsMode-CuWtRqWJ.js → tsMode-B5qT7PQL.js} +1 -1
- package/dist/assets/{typescript-DJDXMz0W.js → typescript-Cm-WHdsg.js} +1 -1
- package/dist/assets/{url-evaluation-DWvC8Wb1.js → url-evaluation-CtukTo4p.js} +1 -1
- package/dist/assets/{url-join-DekEkeTk.js → url-join-CaiV3nSu.js} +1 -1
- package/dist/assets/{use-mobile-CnqtSdkW.js → use-mobile-C4uNTozm.js} +1 -1
- package/dist/assets/{use-mobile-TlnW5eR4.js → use-mobile-DOyOocoE.js} +1 -1
- package/dist/assets/{useAsync-VFQB7kMj.js → useAsync-D1r7tRgT.js} +1 -1
- package/dist/assets/{useAsyncRetry-F-WE12rr.js → useAsyncRetry-DAJQCtzl.js} +1 -1
- package/dist/assets/{useLocalStorage-DnHseBMC.js → useLocalStorage-DwEccSW6.js} +1 -1
- package/dist/assets/{useThemeProps-C2xCEKGa.js → useThemeProps-CsMEzzrN.js} +1 -1
- package/dist/assets/{util-C1MSkSwp.js → util-BGjS1yxA.js} +1 -1
- package/dist/assets/{wait-container-C6RHwOqU.js → wait-container-BAhhGuAo.js} +1 -1
- package/dist/assets/{without-wallet-CavlEQVy.js → without-wallet-BJvNbqrr.js} +1 -1
- package/dist/assets/{wrap-locale-DSFFbKk8.js → wrap-locale-DIuDEP17.js} +1 -1
- package/dist/assets/{xml-eGuTgAY9.js → xml-CL4Ygw15.js} +1 -1
- package/dist/assets/{yaml-1CNB3lwQ.js → yaml-B3hFV4xP.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-BbXAaeVr.js +0 -1
- package/dist/assets/api-TFCv4qOf.js +0 -1
- package/dist/assets/client-1fyhaZ1u.js +0 -1
- package/dist/assets/cloneDeep-DiUBoCJs.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-DzLuQ31t.js +0 -1
- package/dist/assets/engine-BTmStHRK.js +0 -1
- package/dist/assets/getValidReactChildren-DV_bKjsu.js +0 -1
- package/dist/assets/index-BzS7dp1G.js +0 -1
- package/dist/assets/omit-Dd3E6q9F.js +0 -1
- package/dist/assets/schema-wSADEA-R.js +0 -1
- package/dist/assets/sdk-Cav0C3IX.js +0 -1
- package/dist/assets/toUpper-DFzZf5e9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-
|
|
1
|
+
import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-CI0UsYER.js";import{L as S,D as j}from"./download-GWnxmvAC.js";import{u as L}from"./useLocalStorage-DwEccSW6.js";import"./ButtonGroup-NHFraP5W.js";import"./getValidReactChildren-CuqzhDUA.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-
|
|
1
|
+
import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-CI0UsYER.js";function w({name:t,nameFormatter:r=e=>typeof e=="string"?e.split(" ").map(c=>d(x(c))).join(" "):e,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return o.jsxs(p,{layout:n,width:m,...s,children:[o.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&o.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const p=f("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
|
|
4
4
|
justify-content: flex-start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u,j as s,C as d,A as x,ay as v,cq as C,cr as f,af as j,E as I,N as P,bw as E}from"./index-
|
|
1
|
+
import{u,j as s,C as d,A as x,ay as v,cq as C,cr as f,af as j,E as I,N as P,bw as E}from"./index-CI0UsYER.js";import{I as S}from"./invitation-C5_UDplP.js";import{g as N}from"./get-safe-url-904a-sst.js";import"./index-BYtw5o5b.js";import"./index-B9jXnde-.js";import"./emotion-cache.browser.esm-DCbFVNUX.js";import"./sdk-DyID4gpA.js";import"./wrap-locale-DIuDEP17.js";function R(n){const{searchParams:a}=new URL(window.location.href),g=x(),{api:i,session:r}=v(),{info:l}=u(),c=a.get("redirect"),p=a.get("id"),o=C(async()=>{if(!p)return null;const{data:t}=await i.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return t}),m=f(()=>{if(o.error)throw o.error;return o?.data}),h=f(async(t,w=e=>e)=>{t&&(t.sessionToken&&j(w(t.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const e=decodeURIComponent(c);e.startsWith(I.WELLKNOWN_SERVICE_PATH_PREFIX)?g(e,{replace:!0}):window.location.href=N(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return o.loading?s.jsx(d,{}):s.jsx(P,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:s.jsx(S,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:t=>E(t,l),checkFn:i.get,onLoginSuccess:h,passportColor:"default",onLogin:r.login})})}function b(){return u().loading?s.jsx(d,{}):s.jsx(R,{})}export{b as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dn as Skeleton,cP as M$1,_ as CheckIcon,az as Tooltip,dH as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dB as isObject,e$ as mergeThemeOptions,f0 as StyledEngineProvider,f1 as ThemeProvider,f2 as ThemeProvider$1,f3 as s,Z as o$1,b8 as styled$1,f4 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dG as noop,dd as l$2}from"./index-
|
|
1
|
+
import{aG as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dn as Skeleton,cP as M$1,_ as CheckIcon,az as Tooltip,dH as Button,T as Typography,N as Box,C as CircularProgress,f as useTheme,dB as isObject,e$ as mergeThemeOptions,f0 as StyledEngineProvider,f1 as ThemeProvider,f2 as ThemeProvider$1,f3 as s,Z as o$1,b8 as styled$1,f4 as CloseIcon,cE as Buffer,be as U,bE as __vitePreload,dG as noop,dd as l$2}from"./index-CI0UsYER.js";import{j as joinUrl}from"./url-join-CaiV3nSu.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as de,j as e,hg as Ps,hh as Ts,bL as Es,r as L,s as ve,N as A,f4 as wt,t as U,eN as ht,a4 as ne,C as Ee,bi as zt,dK as Is,o as T,hi as Ds,b2 as Bt,cw as Ls,cP as qs,dn as Ms,T as K,dF as at,bn as re,bz as ft,g as ue,hj as zs,bA as mt,b as W,bg as X,dH as Q,H as Z,aV as ie,m as ae,n as Ht,q as Bs,w as Nt,ad as Hs,J as Ft,ga as Ns,hk as Fs,au as Zs,aU as G,V as Te,$ as ke,D as Vs,X as Us,v as se,Y as it,hl as Ws,hm as Js,ez as Ks,eB as Gs,I as je,E as J,hn as Ys,cX as kt,W as Xs,fl as Zt,az as ee,aR as St,ho as Qs,f8 as Re,cr as I,by as ge,aE as te,Q as Y,aP as ye,hp as qe,a2 as er,hq as Je,c2 as Ce,eC as tr,hr as sr,dG as ce,f as $e,y as Vt,bv as ot,O as rr,cD as Ut,g9 as nr,fO as Ze,hs as ar,b9 as ir,L as or,cq as ze,aK as He,ht as lr,U as cr,ag as Ct,a3 as Wt,bj as Ne,hu as Jt,b6 as dr,gz as we,f9 as Kt,cV as Gt,B as ur,b5 as Rt,fa as hr,ff as fr,G as Ke,M as mr,bt as pr}from"./index-tJqcQJw8.js";import{F as gr,a as yr,s as vr,L as _e,S as xr,B as br}from"./preference-Lv54_1NQ.js";import{N as $t}from"./ChevronRight-C_XYjhxd.js";import{T as Fe}from"./html-title-CLvLOLbR.js";import{w as Ie,P as jr}from"./permission-BdpMR93f.js";import{u as pt}from"./index-BzS7dp1G.js";import{D as _r}from"./Done-BjzLVAB9.js";import{R as wr,S as M}from"./collapse-CmEfNn01.js";import{A as kr,a as At}from"./Autocomplete-DjYVg0xw.js";import{C as Sr,R as Cr,S as Rr,P as $r}from"./rotate-session-key-BQCEdH4H.js";import{u as oe}from"./blocklet-C03sDJ1i.js";import{C as Ar}from"./click-to-copy-OQVm3W8D.js";import{u as Ve}from"./team-DV-g0zdM.js";import{v as Yt}from"./index-gyjan-8E.js";import{g as Or}from"./chain-CKxf9AdU.js";import{V as Pr,d as Tr}from"./status-BQ8pfSo7.js";import{S as pe}from"./Switch-p1fa_uPC.js";import{B as Er}from"./index-CIs0ueGA.js";import{y as Ir}from"./index-BPByI5gc.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-hv--3OFd.js";import{u as xe,C as B,b as Ot}from"./index.esm-DEWYqPkv.js";import{S as Be,u as zr}from"./switch-control-CLcUFpZi.js";import{D as Pt,R as Xt,a as Qt}from"./url-evaluation-DWvC8Wb1.js";import{A as Tt}from"./Add-BsCasUcs.js";import{H as Ue}from"./index-DzXOEuwn.js";import{l as Br}from"./index-i6PKUbUv.js";import{u as es}from"./use-mobile-TlnW5eR4.js";import{S as Ge}from"./simple-select-CEHYECyj.js";import{G as Hr}from"./actions-D8IVwECn.js";import{C as Nr}from"./CardContent-Bx23N-y1.js";import"./omit-Dd3E6q9F.js";import"./index-BFj_BZkU.js";import"./edit.svg-CaGUvrvT.js";import"./ArrowDropDown-BbXAaeVr.js";import"./ButtonGroup-CF6fFlve.js";import"./getValidReactChildren-DV_bKjsu.js";import"./index-BpHIZRoQ.js";import"./iframe-CujpH5O-.js";import"./ListSubheader-BYRJFOMa.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-BL3sEekq.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-DgzeYNjK.js";import"./CSSTransition-DSxV7K4V.js";import"./emotion-cache.browser.esm-DzLuQ31t.js";import"./depsEqual-DUSDIMu_.js";import"./TableSearch-DH2QxdMb.js";import"./Search-TKSWz34N.js";import"./Clear-dbJWv3QG.js";import"./MoreVert-B0v12xlt.js";import"./useLocalStorage-DnHseBMC.js";import"./get-safe-url-DL1Ksc1t.js";const ts=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),lt=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ss=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,Et=Qr.splice;function en(x,R,$,C){var _=Ts,j=-1,p=R.length,a=x;for(x===R&&(R=Ps(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==x&&Et.call(a,m,1),Et.call(x,m,1);return x}function tn(x,R){return x&&x.length&&R&&R.length?en(x,R):x}var sn=Es(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function rs({label:x="",disabled:R=!1,required:$=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=L.useState(!1),[u,g]=L.useState(!1),[y,k]=L.useState(""),w=L.useRef(null),[d,v]=L.useState(C),[b,S]=L.useState(d),O=L.useMemo(()=>{if(!m)return{};const q={};return m.forEach(z=>{q[z.code]=z}),q},[m]),P=()=>{if(!m)return[];if(!y)return m.map(z=>z.code);const q=new RegExp(y.toLowerCase());return m.filter(z=>{for(let N=0;N<r.length;N++){const V=r[N];if(q.test(z[V]?.toLowerCase()))return!0}return!1}).map(z=>z.code)},D=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),v(C)):(S(b),v(b))}catch{S(d)}finally{g(!1),i(!1)}},E=(q,z)=>{if(!Array.isArray(z)){S([]),_([]);return}const N=z.filter(V=>O[V]);if(!N.length){S([]),_([]);return}S(N),_(N)},H=q=>{q.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const z=w.current.querySelector("input");z&&z.focus()}},500)},F=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:E,inputValue:y,onInputChange:(q,z)=>{k(z)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:q=>O[q]?.name,renderInput:q=>e.jsx(U,{...q,label:"",placeholder:t}),renderOption:(q,z)=>{const N=b.indexOf(z)!==-1;return L.createElement(nn,{component:"li",...q,key:z},l(O[z]||{}),e.jsx(A,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:o(z,O[z])||O[z]?.name}),e.jsx(A,{component:wt,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx(A,{className:"form-item-input slot",onClick:H,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(q=>m.some(z=>z.code===q)).map(q=>e.jsx(ht,{label:m.find(z=>z.code===q).name,style:{marginRight:8},size:"small"},q))});return e.jsx(gr,{className:"form",style:j,children:e.jsxs(A,{className:"form-item",children:[e.jsxs(A,{className:"form-item-label",children:[x,$&&e.jsx(wr,{})]}),e.jsxs(A,{className:"form-item-body",children:[e.jsx(A,{className:"form-item-input",children:F}),n?e.jsx(A,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ne,{"data-cy":"schema-form-item-confirm",onClick:D,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ne,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(wt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}rs.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=ve.div`
|
|
1
|
+
import{aG as de,j as e,hg as Ps,hh as Ts,bL as Es,r as L,s as ve,N as A,f4 as wt,t as U,eN as ht,a4 as ne,C as Ee,bi as zt,dK as Is,o as T,hi as Ds,b2 as Bt,cw as Ls,cP as qs,dn as Ms,T as K,dF as at,bn as re,bz as ft,g as ue,hj as zs,bA as mt,b as W,bg as X,dH as Q,H as Z,aV as ie,m as ae,n as Ht,q as Bs,w as Nt,ad as Hs,J as Ft,ga as Ns,hk as Fs,au as Zs,aU as G,V as Te,$ as ke,D as Vs,X as Us,v as se,Y as it,hl as Ws,hm as Js,ez as Ks,eB as Gs,I as je,E as J,hn as Ys,cX as kt,W as Xs,fl as Zt,az as ee,aR as St,ho as Qs,f8 as Re,cr as I,by as ge,aE as te,Q as Y,aP as ye,hp as qe,a2 as er,hq as Je,c2 as Ce,eC as tr,hr as sr,dG as ce,f as $e,y as Vt,bv as ot,O as rr,cD as Ut,g9 as nr,fO as Ze,hs as ar,b9 as ir,L as or,cq as ze,aK as He,ht as lr,U as cr,ag as Ct,a3 as Wt,bj as Ne,hu as Jt,b6 as dr,gz as we,f9 as Kt,cV as Gt,B as ur,b5 as Rt,fa as hr,ff as fr,G as Ke,M as mr,bt as pr}from"./index-CI0UsYER.js";import{F as gr,a as yr,s as vr,L as _e,S as xr,B as br}from"./preference-A8RbnsFJ.js";import{N as $t}from"./ChevronRight-DHrS44VT.js";import{T as Fe}from"./html-title-CZ5JcCBv.js";import{w as Ie,P as jr}from"./permission-C38ouogl.js";import{u as pt}from"./index-C35YhCHh.js";import{D as _r}from"./Done-BwdDX1O2.js";import{R as wr,S as M}from"./collapse-Ccf8f09m.js";import{A as kr,a as At}from"./Autocomplete-COrgl8lD.js";import{C as Sr,R as Cr,S as Rr,P as $r}from"./rotate-session-key-D0BtnLpd.js";import{u as oe}from"./blocklet-Ho3KwOsh.js";import{C as Ar}from"./click-to-copy-Dge9fppM.js";import{u as Ve}from"./team-95t9JyF5.js";import{v as Yt}from"./index-BcBAaNDP.js";import{g as Or}from"./chain-8eWVoTb9.js";import{V as Pr,d as Tr}from"./status-CJUsFots.js";import{S as pe}from"./Switch-1ujfhKkZ.js";import{B as Er}from"./index-CrdG-tHx.js";import{y as Ir}from"./index-CKMXkLAj.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-Lr_zCh3w.js";import{u as xe,C as B,b as Ot}from"./index.esm-BQAoYQrS.js";import{S as Be,u as zr}from"./switch-control-BcyytepR.js";import{D as Pt,R as Xt,a as Qt}from"./url-evaluation-CtukTo4p.js";import{A as Tt}from"./Add-DTGe-ZCp.js";import{H as Ue}from"./index-D3pkr7vY.js";import{l as Br}from"./index-CKKPbTJM.js";import{u as es}from"./use-mobile-DOyOocoE.js";import{S as Ge}from"./simple-select-BrcGp9-q.js";import{G as Hr}from"./actions-rW-FK_P1.js";import{C as Nr}from"./CardContent-CZZD5uxd.js";import"./omit-BKpaopbT.js";import"./index-gbJS2iWq.js";import"./edit.svg-UWFKFe9C.js";import"./ArrowDropDown-Doc7Mi-x.js";import"./ButtonGroup-NHFraP5W.js";import"./getValidReactChildren-CuqzhDUA.js";import"./index-DibtYVCM.js";import"./iframe-Brx5OwuI.js";import"./ListSubheader-B7M9oqxC.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-DCFmKF-T.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-CKBf2Vv9.js";import"./CSSTransition-C1WKDxhV.js";import"./emotion-cache.browser.esm-DCbFVNUX.js";import"./depsEqual-CDHvTR0w.js";import"./TableSearch-CsIYJ-Mc.js";import"./Search-DCwzmPfi.js";import"./Clear-x8R7nP_3.js";import"./MoreVert-VfUY7lzP.js";import"./useLocalStorage-DwEccSW6.js";import"./get-safe-url-904a-sst.js";const ts=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),lt=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ss=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,Et=Qr.splice;function en(x,R,$,C){var _=Ts,j=-1,p=R.length,a=x;for(x===R&&(R=Ps(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==x&&Et.call(a,m,1),Et.call(x,m,1);return x}function tn(x,R){return x&&x.length&&R&&R.length?en(x,R):x}var sn=Es(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function rs({label:x="",disabled:R=!1,required:$=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=L.useState(!1),[u,g]=L.useState(!1),[y,k]=L.useState(""),w=L.useRef(null),[d,v]=L.useState(C),[b,S]=L.useState(d),O=L.useMemo(()=>{if(!m)return{};const q={};return m.forEach(z=>{q[z.code]=z}),q},[m]),P=()=>{if(!m)return[];if(!y)return m.map(z=>z.code);const q=new RegExp(y.toLowerCase());return m.filter(z=>{for(let N=0;N<r.length;N++){const V=r[N];if(q.test(z[V]?.toLowerCase()))return!0}return!1}).map(z=>z.code)},D=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),v(C)):(S(b),v(b))}catch{S(d)}finally{g(!1),i(!1)}},E=(q,z)=>{if(!Array.isArray(z)){S([]),_([]);return}const N=z.filter(V=>O[V]);if(!N.length){S([]),_([]);return}S(N),_(N)},H=q=>{q.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const z=w.current.querySelector("input");z&&z.focus()}},500)},F=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:E,inputValue:y,onInputChange:(q,z)=>{k(z)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:q=>O[q]?.name,renderInput:q=>e.jsx(U,{...q,label:"",placeholder:t}),renderOption:(q,z)=>{const N=b.indexOf(z)!==-1;return L.createElement(nn,{component:"li",...q,key:z},l(O[z]||{}),e.jsx(A,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:o(z,O[z])||O[z]?.name}),e.jsx(A,{component:wt,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx(A,{className:"form-item-input slot",onClick:H,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(q=>m.some(z=>z.code===q)).map(q=>e.jsx(ht,{label:m.find(z=>z.code===q).name,style:{marginRight:8},size:"small"},q))});return e.jsx(gr,{className:"form",style:j,children:e.jsxs(A,{className:"form-item",children:[e.jsxs(A,{className:"form-item-label",children:[x,$&&e.jsx(wr,{})]}),e.jsxs(A,{className:"form-item-body",children:[e.jsx(A,{className:"form-item-input",children:F}),n?e.jsx(A,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ne,{"data-cy":"schema-form-item-confirm",onClick:D,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ne,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(wt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}rs.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-tJqcQJw8.js";import{T as ut}from"./html-title-CLvLOLbR.js";import{u as L}from"./blocklet-C03sDJ1i.js";import{u as mt}from"./use-mobile-TlnW5eR4.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-Ccnb4QWA.js";import"./index-KQW85_sG.js";import"./index-BojVbZw0.js";import"./api-TFCv4qOf.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-zGV6wwqp.js";import{v as Rt}from"./index-gyjan-8E.js";import{E as zt}from"./index-BwFgT4f9.js";import{H as vt}from"./HelpOutline-B9rq5AT4.js";import{H as Pt}from"./index-DzXOEuwn.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-D8IVwECn.js";import{D as Lt}from"./DeleteOutline-BQGJu1ed.js";import{g as ke}from"./get-safe-url-DL1Ksc1t.js";import{S as Ot}from"./switch-control-CLcUFpZi.js";import{L as je}from"./list-header-Crj7BNKL.js";import"./OpenInNew-DpFE4qHg.js";import"./ButtonGroup-CF6fFlve.js";import"./getValidReactChildren-DV_bKjsu.js";import"./FilterList-DgzeYNjK.js";import"./CSSTransition-DSxV7K4V.js";import"./emotion-cache.browser.esm-DzLuQ31t.js";import"./index-hv--3OFd.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DUSDIMu_.js";import"./index-BPByI5gc.js";import"./TableSearch-DH2QxdMb.js";import"./Search-TKSWz34N.js";import"./Clear-dbJWv3QG.js";import"./MoreVert-B0v12xlt.js";import"./useLocalStorage-DnHseBMC.js";import"./url-evaluation-DWvC8Wb1.js";import"./permission-BdpMR93f.js";import"./Switch-p1fa_uPC.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as Ye,cb as J,b$ as $e,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j1 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j2 as X,hY as Z,j3 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as Y,a9 as $,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-CI0UsYER.js";import{T as ut}from"./html-title-CZ5JcCBv.js";import{u as L}from"./blocklet-Ho3KwOsh.js";import{u as mt}from"./use-mobile-DOyOocoE.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-B-eSBX-W.js";import"./index-r8P2C1jY.js";import"./index-BojVbZw0.js";import"./api-YN3oror6.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-DLMhU3hk.js";import{v as Rt}from"./index-BcBAaNDP.js";import{E as zt}from"./index-CeFaduiH.js";import{H as vt}from"./HelpOutline-lBsTb1UP.js";import{H as Pt}from"./index-D3pkr7vY.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-rW-FK_P1.js";import{D as Lt}from"./DeleteOutline-Ck93qCLA.js";import{g as ke}from"./get-safe-url-904a-sst.js";import{S as Ot}from"./switch-control-BcyytepR.js";import{L as je}from"./list-header-BDHTrIR7.js";import"./OpenInNew-xMrJenFO.js";import"./ButtonGroup-NHFraP5W.js";import"./getValidReactChildren-CuqzhDUA.js";import"./FilterList-CKBf2Vv9.js";import"./CSSTransition-C1WKDxhV.js";import"./emotion-cache.browser.esm-DCbFVNUX.js";import"./index-Lr_zCh3w.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CDHvTR0w.js";import"./index-CKMXkLAj.js";import"./TableSearch-CsIYJ-Mc.js";import"./Search-DCwzmPfi.js";import"./Clear-x8R7nP_3.js";import"./MoreVert-VfUY7lzP.js";import"./useLocalStorage-DwEccSW6.js";import"./url-evaluation-CtukTo4p.js";import"./permission-C38ouogl.js";import"./Switch-1ujfhKkZ.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return $e(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:$s}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),f=Qe(d),x=$t({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c0 as c,r as _,cr as f,h0 as S,cR as r}from"./index-CI0UsYER.js";var d=function(n){var a=c(_.useState(n),2),u=a[0],o=a[1],i=f(function(t){o(function(e){var s=S(t)?t(e):t;return s?r(r({},e),s):e})});return[u,i]};export{d as u};
|