@abtnode/webapp 1.16.19-beta-630ac853 → 1.16.19-beta-626e4d43
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.yml +1 -1
- package/build/asset-manifest.json +12 -11
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/1185.1a9d8166.chunk.js +2 -0
- package/build/static/js/1386.1154f36f.chunk.js +2 -0
- package/build/static/js/{2334.beff29a4.chunk.js → 2334.66fda96c.chunk.js} +1 -1
- package/build/static/js/2365.a3571172.chunk.js +1 -0
- package/build/static/js/4435.3eb0657b.chunk.js +1 -0
- package/build/static/js/4766.7d4c14ad.chunk.js +2 -0
- package/build/static/js/{5526.4efb7a08.chunk.js → 5526.8e2eb7bc.chunk.js} +2 -2
- package/build/static/js/6511.787aeed0.chunk.js +1 -0
- package/build/static/js/{7657.30740d96.chunk.js → 7657.07736e3e.chunk.js} +2 -2
- package/build/static/js/9277.076f148a.chunk.js +1 -0
- package/build/static/js/main.99dc2aa9.js +2 -0
- package/package.json +1 -1
- package/build/static/js/1185.258cd330.chunk.js +0 -2
- package/build/static/js/1386.51a2c0a6.chunk.js +0 -2
- package/build/static/js/4766.efaa8a70.chunk.js +0 -2
- package/build/static/js/6511.cad24976.chunk.js +0 -1
- package/build/static/js/9277.c46fde66.chunk.js +0 -1
- package/build/static/js/999.d77f4e1e.chunk.js +0 -1
- package/build/static/js/main.bf8af571.js +0 -2
- /package/build/static/js/{1185.258cd330.chunk.js.LICENSE.txt → 1185.1a9d8166.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1386.51a2c0a6.chunk.js.LICENSE.txt → 1386.1154f36f.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4766.efaa8a70.chunk.js.LICENSE.txt → 4766.7d4c14ad.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5526.4efb7a08.chunk.js.LICENSE.txt → 5526.8e2eb7bc.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7657.30740d96.chunk.js.LICENSE.txt → 7657.07736e3e.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.bf8af571.js.LICENSE.txt → main.99dc2aa9.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:function(e,n,t){t.r(n),t.d(n,{default:function(){return re}});var r=t(71171),a=t(5057),i=t(33518),o=t(85493),c=t(15849),u=t(68420),s=t(11750),l=t(39434),p=t(39948),d=t(10697),f=t(94464),v=t(88574),m=t(28726),h=t(38242),b=t(81010),x=t(87363),g=(t(68534),t(86229)),k=t(1722),Z=t(96234),w=t(35432),y=t(49983),P=t(58238),j=t(29054),B=t(73545),S=t(14491),E=t(4651),L=t(96266),_=function(e){var n={},t=null;return(0,h.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,h.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},D=function(e,n,t){var r=e.hostname,a=e.href;if(!n)return a;if(t){var i,o=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!o)return a;var c=o[0],u=(((null===(i=n.site)||void 0===i?void 0:i.domainAliases)||[]).map((function(e){return e.value})).filter(Boolean).find((function(e){return e.endsWith(w.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(w.DEFAULT_DID_DOMAIN),"");return u?a.replace(r,"".concat(u,"-").concat(c,".").concat(w.DEFAULT_IP_DOMAIN_SUFFIX)):a}return a.replace(n.meta.bundleDid,n.appPid)};function C(){var e=(0,u.PE)().t,n=(0,B.T)().api,t=(0,j.y0)().blocklet,r=(0,P.h6)().inService,i=(0,a.useState)(!1),o=(0,Z.Z)(i,2),c=o[0],s=o[1],l=(0,a.useState)(5),d=(0,Z.Z)(l,2),f=d[0],b=d[1],x=t&&t.structVersion!==w.APP_STRUCT_VERSION;return[x&&(0,L.jsxs)(v.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(m.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void g.Z.error(e("blocklet.migrate.tip.running"));var n=_(t);if(n)return void g.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));s(!0)}catch(r){g.Z.error((0,S.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,L.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,L.jsx)(p.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,L.jsx)(y.Z,{popup:!0,open:c,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=D(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),b(5),setInterval((function(){b((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,E.iK)(t,!0),title:(0,h.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:f>=0?e("blocklet.migrate.success",{sec:f}):"Redirecting..."},onClose:function(){return s(!1)}},"connect")]}C.propTypes={};var N,A=t(35966),G=t(43019),T=t(44846),I=t(78123),O=t(75793),U=t(17022),K=t(13671),z=t(74094),R=t(7199),F=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(4435),t.e(9277)]).then(t.bind(t,99277))})),M=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(6547),t.e(5760),t.e(506),t.e(7150),t.e(6791),t.e(8499),t.e(4404),t.e(8973)]).then(t.bind(t,5119))})),V=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(105),t.e(6547),t.e(506),t.e(1294),t.e(4766),t.e(4775)]).then(t.bind(t,14775))})),Y=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(442),t.e(9662),t.e(7676),t.e(8986)]).then(t.bind(t,13239))})),$=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(7687),t.e(1185),t.e(5979),t.e(2537)]).then(t.bind(t,75979))})),W=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(6547),t.e(5760),t.e(1494),t.e(5672),t.e(3216)]).then(t.bind(t,75672))})),X=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(4901),t.e(1685),t.e(5555)]).then(t.bind(t,85555))})),J=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(2911),t.e(4901),t.e(442),t.e(5526),t.e(7687),t.e(7638),t.e(1685),t.e(7657),t.e(3135),t.e(4240),t.e(5396),t.e(4404),t.e(2264),t.e(1386)]).then(t.bind(t,35804))})),Q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(9327),t.e(8219)]).then(t.bind(t,92379))})),q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(6547),t.e(5760),t.e(7534)]).then(t.bind(t,87534))})),H=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(4901),t.e(3896),t.e(2611)]).then(t.bind(t,42611))})),ee=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(95),t.e(6547),t.e(5760),t.e(4240),t.e(5396),t.e(9552)]).then(t.bind(t,39552))})),ne=function(e){return e.children};function te(){var e,n=(0,o.useNavigate)(),t=(0,o.useParams)().tab,r=void 0===t?"overview":t,i=(0,K.y0)(),Z=i.did,y=i.blocklet,P=i.error,j=i.client,B=i.actions,S=B.setBlocklet,E=B.refreshBlocklet,_=(0,O.h6)().refresh,D=(0,u.PE)().t,N=(0,a.useCallback)((function(){return(0,L.jsx)(Y,{scope:Z})}),[Z]),G=(null===y||void 0===y||null===(e=y.environments.find((function(e){return"BLOCKLET_APP_URL"===e.key})))||void 0===e?void 0:e.value)||window.location.origin,te=function(e){return(0,z.bV)(e,G)},re=function(e){n("/blocklets/".concat(Z,"/").concat(e))},ie=!y||(0,z.wS)(y.status)?[]:(0,h.getAppMissingConfigs)(y),oe=null,ce=[{label:D("common.overview"),value:"overview"},{breadcrumbsLabel:D("common.components"),label:(0,L.jsx)(d.Z,{color:"error",variant:"dot",invisible:!ie.length,children:D("common.components")}),value:"components"}];if(P)oe=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(v.Z,{type:"error",variant:"icon",children:(0,z.Z)(P)}),(0,L.jsx)(m.Z,{onClick:function(){return E()},children:(0,L.jsx)("span",{style:{textDecoration:"underline"},children:D("common.retry")})})]});else if(y){var ue,se={overview:(0,L.jsx)(F,{}),configuration:M,navigation:V,services:X,members:(0,L.jsx)(W,{type:"blocklet",createPassportSvg:te}),passports:$,components:J,"audit-logs":N,logs:Q,runtime:(0,L.jsx)(q,{}),traffic:(0,L.jsx)(H,{client:j,did:Z}),storage:(0,L.jsx)(ee,{})};"configuration"===r&&(0,z.wS)(y.status)&&re("overview"),(0,z.wS)(y.status)||(ce.push({label:D("common.members"),value:"members"}),ce.push({label:D("common.passport"),value:"passports"}),ce.push({label:D("common.configuration"),value:"configuration"})),ce.push({label:D("common.auditLogs"),value:"audit-logs"}),y&&null!==(ue=y.children)&&void 0!==ue&&ue.length&&y.structVersion===w.APP_STRUCT_VERSION&&ce.push({label:D("common.logs"),value:"logs"}),ce.push({label:D("common.configNavigation"),value:"navigation"}),ce.push({label:D("common.runtime"),value:"runtime"}),ce.push({label:D("common.traffic"),value:"traffic"}),ce.push({label:D("common.storage"),value:"storage"}),(0,h.getBlockletServices)(y).length&&ce.splice(2,0,{label:D("blocklet.services"),value:"services"});var le=se[r]||se.overview;oe=(0,L.jsxs)(x.g,{type:"components",children:[!(0,h.isExternalBlocklet)(y)&&(0,L.jsx)(f.Z,{tabs:ce,current:r,onChange:re,scrollButtons:"auto"}),(0,L.jsx)("div",{className:"page-content",children:(0,L.jsx)(a.Suspense,{fallback:(0,L.jsx)(A.Z,{relative:"parent",children:(0,L.jsx)(T.Z,{})}),children:(0,a.isValidElement)(le)?le:(0,L.jsx)(le,{blocklet:y,onUpdate:function(e){e&&S(e),E()},createPassportSvg:te})})})]})}else oe=(0,L.jsx)(A.Z,{relative:"parent",children:(0,L.jsx)(T.Z,{})});var pe=ce.find((function(e){return e.value===r})),de=y?U.G6:ne;return(0,L.jsx)(de,{teamDid:Z,children:(0,L.jsxs)(ae,{children:[(0,L.jsxs)(l.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,L.jsx)(c.Link,{color:"textSecondary",to:"/blocklets",children:D("common.blocklets")}),(0,L.jsx)(c.NavLink,{to:"/blocklets/".concat(Z,"/overview"),style:function(e){return e?{color:"inherit"}:{}},children:D("common.detail")}),(0,L.jsx)(s.Z,{color:"textSecondary",children:pe?pe.breadcrumbsLabel||pe.label:""})]}),(0,L.jsxs)(s.Z,{component:"div",className:"page-header",children:[(0,L.jsxs)(s.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[y?(0,L.jsx)(k.Z,{blocklet:y,style:{marginRight:16}}):null,y?(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[(0,L.jsx)(p.Z,{children:(0,h.getDisplayName)(y)}),"unknown"!==(null===y||void 0===y?void 0:y.status)&&(0,L.jsx)(b.Z,{size:"12px",status:y.status,source:y.source})]}):"".concat(D("common.blocklet")," ").concat(D("common.detail"))]}),(0,L.jsx)(R.Z,{permission:"mutate_blocklets",children:!!y&&!(0,h.isExternalBlocklet)(y)&&(0,L.jsx)(I.Z,{className:"page-actions",blocklet:y,onStart:function(){},onComplete:function(e){var t=e.action,r=e.error;r?g.Z.error(r.message):"remove"===t?(_(),n("/blocklets")):E()},variant:"group"})})]}),(0,L.jsx)(C,{}),oe]})})}function re(){var e=(0,o.useParams)().did;return e?(0,L.jsx)(K.$8,{did:e,children:(0,L.jsx)(G.wV,{children:(0,L.jsx)(te,{})})}):null}var ae=i.Z.main(N||(N=(0,r.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 16px;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.md}))},43019:function(e,n,t){t.d(n,{wV:function(){return S},XN:function(){return E}});var r=t(32723),a=t(33028),i=t(34795),o=t(96234),c=t(5057),u=t(55898),s=t.n(u),l=t(86229),p=t(68420),d=t(76811),f=t(29054),v=t(84584),m=t(41899),h=t(58238),b=t(65873);function x(e){return g.apply(this,arguments)}function g(){return g=(0,i.Z)((0,r.Z)().mark((function e(n){var t,o,c,u,s;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,o=n.nodeApi,c=n.spaceGateways,u=!1,e.next=4,Promise.all(c.map(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var t,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,v.nU)(n.endpoint);case 3:return i=e.sent,(0,b.isEmpty)(i)||i===t||(t=i,u=!0),e.abrupt("return",(0,a.Z)((0,a.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(s=e.sent,!u){e.next=8;break}return e.next=8,Promise.all(s.filter((function(e){return e.did})).map((function(e){return o.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,a.Z)({},e)}})})));case 8:return e.abrupt("return",s);case 9:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)}var k=t(99875);var Z=t(14491);function w(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:function(){}},t=n.deps,a=n.setLoading,u=(0,f.y0)().blocklet,s=(0,c.useState)([]),p=(0,o.Z)(s,2),d=p[0],v=p[1],x=(0,h.h6)().api,g=(0,b.debounce)((0,i.Z)((0,r.Z)().mark((function e(){var n,t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a(!0),u){e.next=5;break}return v([]),e.abrupt("return");case 5:return e.next=7,x.getBlockletBackups({input:{did:u.meta.did}});case 7:n=e.sent,t=n.backups,v(null!==t&&void 0!==t?t:[]),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,Z.Z)(e.t0));case 16:return e.prev=16,a(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])}))),2e3);return(0,m.Z)((0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g();case 1:case"end":return e.stop()}}),e)}))),[null===u||void 0===u||null===(e=u.meta)||void 0===e?void 0:e.did].concat(t)),{backups:d}}var y=function(e){var n=e.appDid,t=w().backups,r=(0,c.useState)({message:"",progress:0,completed:!1}),i=(0,o.Z)(r,2),u=i[0],s=i[1];return(0,(0,h.h6)().ws.useSubscription)(d.BlockletEvents.backupProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&s((function(){return(0,a.Z)({},e)}))}),[n]),(0,c.useEffect)((function(){var e;if(null!==t&&void 0!==t&&t.length&&(0,b.isNull)(null===(e=t[0])||void 0===e?void 0:e.status)){var n=(0,o.Z)(t,1)[0];s((function(){return{message:n.message,progress:n.progress,completed:Boolean(n.progress>=100)}}))}}),[t]),u};var P=t(96266),j=(0,c.createContext)({}),B=j.Provider;j.Consumer;function S(e){var n=e.children,t=(0,p.PE)().t,u=(0,h.h6)().api,s=(0,f.y0)().blocklet,b=(0,c.useState)(!1),g=(0,o.Z)(b,2),Z=g[0],j=g[1],S=(0,c.useState)(!1),E=(0,o.Z)(S,2),L=E[0],_=E[1],D=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.setLoading,a=n.refresh,u=(0,f.y0)(),s=u.blocklet,p=u.actions.refreshBlocklet,d=null===s||void 0===s||null===(e=s.meta)||void 0===e?void 0:e.did,v=(0,c.useState)([]),b=(0,o.Z)(v,2),g=b[0],Z=b[1],w=(0,h.h6)().api;return(0,m.Z)((0,i.Z)((0,r.Z)().mark((function e(){var n,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d){e.next=4;break}return Z([]),e.abrupt("return");case 4:return null===t||void 0===t||t(!0),e.next=7,w.getBlockletSpaceGateways({input:{did:d}});case 7:return n=e.sent,a=n.spaceGateways,e.next=11,x({blockletDid:d,nodeApi:w,spaceGateways:a});case 11:i=e.sent,Z(null!==i&&void 0!==i?i:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,k.Z)(e.t0));case 19:return e.prev=19,null===t||void 0===t||t(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[d,p,a]),{spaceGateways:g}}({refresh:L,setLoading:j}),C=D.spaceGateways,N=y({appDid:null===s||void 0===s?void 0:s.appDid}),A=(0,c.useState)(!1),G=(0,o.Z)(A,2),T=G[0],I=G[1],O=(0,c.useMemo)((function(){return(0,v.mo)(null===s||void 0===s?void 0:s.environments)}),[s,L,T]),U=(0,c.useState)(!1),K=(0,o.Z)(U,2),z=K[0],R=w({deps:[N],setLoading:K[1]}).backups,F=(0,c.useState)(null===C||void 0===C?void 0:C.find((function(e){return e.endpoint===O}))),M=(0,o.Z)(F,2),V=M[0],Y=M[1],$=(0,c.useState)(!1),W=(0,o.Z)($,2),X=W[0],J=W[1],Q=function(){var e,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[]}).deps,t=(0,f.y0)().blocklet,a=(0,h.h6)().api,u=(0,c.useState)(null),s=(0,o.Z)(u,2),l=s[0],p=s[1];return(0,m.Z)((0,i.Z)((0,r.Z)().mark((function e(){var n,i,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t||void 0===t||null===(n=t.meta)||void 0===n||!n.did){e.next=6;break}return e.next=3,a.getAutoBackup({input:{did:t.meta.did}});case 3:i=e.sent,o=i.autoBackup,p(o);case 6:case"end":return e.stop()}}),e)}))),[null===t||void 0===t||null===(e=t.meta)||void 0===e?void 0:e.did].concat(n)),l}({deps:[X]}),q=function(){_((function(e){return!e}))},H=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n,t){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C.push((0,a.Z)((0,a.Z)({},n),{},{loading:!0})),e.next=3,u.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:n}});case 3:if(O===t){e.next=6;break}return e.next=6,u.configBlocklet({input:{did:[s.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}});case 6:q(),Y(n);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ee=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(n.endpoint!==O){e.next=5;break}return l.Z.warning(t("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,u.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:null===n||void 0===n?void 0:n.did}});case 7:q(),Y(n);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ne=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:n.did},spaceGateway:n}});case 2:if(O===n.endpoint){e.next=5;break}return e.next=5,u.configBlocklet({input:{did:[s.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 5:l.Z.success(t("storage.spaces.connectedWithName",{name:null!==(a=null===n||void 0===n?void 0:n.name)&&void 0!==a?a:"DID Spaces"})),q();case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),te=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.updateAutoBackup({input:{did:s.meta.did,autoBackup:n}});case 2:J((function(e){return!e}));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,P.jsx)(B,{value:{spaceGateways:C,selectedSpaceGateway:V,addSpaceGateway:H,deleteSpaceGateway:ee,updateSpaceGateway:ne,refreshSpaceGateways:q,spaceGatewaysLoading:Z,spaceGatewayIsSelected:function(e){return(null===e||void 0===e?void 0:e.endpoint)===O},updateAutoBackup:te,backupEndpoint:O,backupProgress:N,backups:R,backupsLoading:z,refreshBackupEndpoint:function(){I((function(e){return!e}))},autoBackup:Q},children:n})}function E(){return(0,c.useContext)(j)}S.propTypes={children:s().any.isRequired},S.defaultProps={}},60344:function(e,n,t){t.d(n,{hi:function(){return i},od:function(){return a.a}});var r=t(10458),a=t.n(r);a().defaults.timeout=1e4;var i=a().create()},84584:function(e,n,t){t.d(n,{EJ:function(){return P},Jf:function(){return y},LQ:function(){return f},Nb:function(){return v},UV:function(){return j},Xv:function(){return p},Z3:function(){return S},ag:function(){return x},mo:function(){return h},nD:function(){return d},nU:function(){return Z},w2:function(){return g}});var r=t(32723),a=t(34795),i=t(82434),o=t.n(i),c=t(76811),u=t(65873),s=t(2842),l=t(60344);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return(0,s.xn)(n,"space",r,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function v(e){return m.apply(this,arguments)}function m(){return(m=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,l.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function h(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function b(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}function x(e){var n=new URL(e);return(0,s.xn)(n.origin,n.pathname)}function g(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,c,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=x(n),a=(0,s.xn)(t,"space/api/did/one-click-authorization/token"),e.next=7,l.hi.get(a,{timeout:5e3});case 7:return i=e.sent,c=i.status,p=i.data,e.abrupt("return",200===c&&(0,u.isObject)(p));case 13:return e.prev=13,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function Z(e){return w.apply(this,arguments)}function w(){return w=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,c,u=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(u.length>1&&void 0!==u[1]?u[1]:{timeout:3e3}).timeout,e.prev=1,o()(n)){e.next=4;break}return e.abrupt("return","");case 4:return e.next=6,l.hi.head(n,{timeout:t});case 6:return a=e.sent,i=a.headers,c=i["x-space-name"],e.abrupt("return",c?decodeURIComponent(c):"");case 12:return e.prev=12,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return","");case 16:case"end":return e.stop()}}),e,null,[[1,12]])}))),w.apply(this,arguments)}function y(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(n,"/api/space/nft/display?spaceDid=".concat(t))}var P=function(e){var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null};function j(e){return B.apply(this,arguments)}function B(){return(B=(0,a.Z)((0,r.Z)().mark((function e(n){var t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t={}).did=f(n),e.next=4,Z(n);case 4:return t.name=e.sent,t.url=b(n),t.endpoint=n,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e){return E.apply(this,arguments)}function E(){return E=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,o,c,p,d,f,v,m=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=m.length>1&&void 0!==m[1]?m[1]:{timeout:3e4,withSearchParams:!0},(0,u.isString)(n)){e.next=3;break}throw new Error("url(".concat(n,") must be a string"));case 3:return i=n.startsWith("http")?n:"https://".concat(n),o=new URL(i),e.next=7,l.hi.get((0,s.xn)(o.origin,"/__blocklet__.js?type=json"),{timeout:a.timeout});case 7:if(c=e.sent,p=c.data,d=null===(t=p.componentMountPoints.findLast((function(e){return"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did})))||void 0===t?void 0:t.mountPoint){e.next=12;break}throw new Error("MountPoint(".concat(d,") not found"));case 12:return f=(0,s.xn)(o.origin,d),v=a.withSearchParams&&o.searchParams.get("spaceDid")?(0,s.xn)(f,"?spaceDid=".concat(o.searchParams.get("spaceDid"))):f,e.abrupt("return",v);case 15:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}}}]);
|