@abtnode/webapp 1.16.21-beta-2e75c75c → 1.16.21-beta-725f6059

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +11 -11
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/{1366.f2fe8ce7.chunk.js → 1366.8a167e7a.chunk.js} +2 -2
  7. package/build/static/js/1667.ae711e87.chunk.js +1 -0
  8. package/build/static/js/{2334.2b408137.chunk.js → 2334.7bcaaba9.chunk.js} +1 -1
  9. package/build/static/js/3389.d92ce0a7.chunk.js +1 -0
  10. package/build/static/js/5914.fbf45688.chunk.js +2 -0
  11. package/build/static/js/6780.dfa6fda3.chunk.js +1 -0
  12. package/build/static/js/{6950.29776777.chunk.js → 6950.fc163899.chunk.js} +1 -1
  13. package/build/static/js/7913.b1fac176.chunk.js +1 -0
  14. package/build/static/js/9249.f273bde9.chunk.js +1 -0
  15. package/build/static/js/main.8a9d4464.js +2 -0
  16. package/package.json +1 -1
  17. package/build/static/js/1667.4403e42c.chunk.js +0 -1
  18. package/build/static/js/3389.1c4a79ac.chunk.js +0 -1
  19. package/build/static/js/5914.593c14f7.chunk.js +0 -2
  20. package/build/static/js/6780.aa9fb3ec.chunk.js +0 -1
  21. package/build/static/js/7913.6ff42e1a.chunk.js +0 -1
  22. package/build/static/js/9249.e1b97ff3.chunk.js +0 -1
  23. package/build/static/js/main.b030daf3.js +0 -2
  24. /package/build/static/js/{1366.f2fe8ce7.chunk.js.LICENSE.txt → 1366.8a167e7a.chunk.js.LICENSE.txt} +0 -0
  25. /package/build/static/js/{5914.593c14f7.chunk.js.LICENSE.txt → 5914.fbf45688.chunk.js.LICENSE.txt} +0 -0
  26. /package/build/static/js/{main.b030daf3.js.LICENSE.txt → main.8a9d4464.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[1667],{13455:(e,n,t)=>{t.d(n,{Z:()=>d});var a=t(55898),l=t.n(a),o=t(36687),s=t(72333);const i="data:image/png;base64,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";var r=t(74094),c=t(96266);function d(e){let{blocklet:n,blockletMetaUrl:t}=e;const{did:a,logo:l}=n.meta;let d;return d=l?(0,c.jsx)(o.Z,{src:(0,r.aZ)({did:a,logoPath:l,baseUrl:new URL(t).origin}),fallback:i,width:64,size:"contain",placeholder:"application logo"}):(0,c.jsx)(s.Z,{did:a,size:64}),d}d.propTypes={blocklet:l().object.isRequired,blockletMetaUrl:l().string.isRequired}},13932:(e,n,t)=>{t.d(n,{Z:()=>f});var a,l=t(71171),o=t(68420),s=t(77277),i=t(33518),r=t(39948),c=t(5057),d=t(11397),u=t.n(d),h=t(34937),p=t(96266);const m=u()("@abtnode/webapp:launch-blocklet:download-progress");const g=(e,n)=>{m("getDownloadBundleStep",e);return(e||[]).map((e=>{var t;const a=n("launchBlocklet.waiting.".concat("extracting"===e.status?"extractingComponent":"downloadingComponent"),{name:(null===(t=e.component)||void 0===t?void 0:t.title)||""}),l=e.total&&e.current?": ".concat(Math.floor(e.current/e.total*100)," %"):"";let o=e.name?": ".concat(e.name):"";return l||(o+="..."),"".concat(a).concat(l).concat(o)})).join("\n")};function f(e){let{appDid:n,visible:t}=e;const{t:a}=(0,o.PE)(),l=function(e){let{appDid:n}=e;const[t,a]=(0,c.useState)([]),l=(0,h.ZP)();return(0,c.useEffect)((()=>(l.on(s.BlockletEvents.downloadBundleProgress,(e=>{n&&n===(null===e||void 0===e?void 0:e.appDid)&&a((n=>{const t=[...n],a=t.findIndex((n=>{var t,a;return(null===(t=n.component)||void 0===t?void 0:t.did)===(null===(a=e.component)||void 0===a?void 0:a.did)}));return"completed"===e.status?-1!==a&&t.splice(a,1):-1!==a?t[a]=e:t.push(e),[...t]}))})),()=>{l.off(s.BlockletEvents.downloadBundleProgress)})),[n,l]),t}({appDid:n});return(0,p.jsx)(x,{style:{display:t?"block":"none"},children:g(l,a)})}f.defaultProps={appDid:"",visible:!0};const x=(0,i.Z)(r.Z)(a||(a=(0,l.Z)(["\n flex: 0 0 auto;\n white-space: pre;\n overflow-y: auto;\n overflow-x: auto;\n max-height: 10em;\n max-width: 500px;\n min-width: auto;\n @media (max-width: ","px) {\n max-width: 90%;\n max-height: 30vh;\n }\n"])),(e=>e.theme.breakpoints.values.md))},66436:(e,n,t)=>{t.d(n,{Z:()=>i});var a,l=t(71171),o=t(33518),s=t(96266);function i(e){let{children:n}=e;return(0,s.jsx)(r,{children:n})}const r=o.Z.div(a||(a=(0,l.Z)(["\n color: #1dc1c7;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])))},11476:(e,n,t)=>{t.d(n,{Z:()=>x});var a=t(5057),l=t(77277),o=t(31853),s=t(11397),i=t.n(s),r=t(34937),c=t(10155);const d=i()("@abtnode/webapp:launch-blocklet:runtime-state"),u=Object.keys(l.BlockletStatus),h=Object.values(l.BlockletStatus),p=Object.values(l.BlockletEvents).filter((e=>![l.BlockletEvents.purchaseChange,l.BlockletEvents.domainStatus].includes(e))),m=(e,n)=>{var t;return(null===e||void 0===e?void 0:e.appDid)===n||(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.did)===n},g=8e3,f=2e3;function x(e){const n=(0,c.Z)(),t=(0,r.ZP)(),l=(0,a.useRef)(null),s=()=>{e&&!l.current&&(l.current=setInterval((()=>{e&&(d("polling blocklet state"),v())}),f))},[i,x]=(0,o.Z)({status:null,eventName:"",runtimeBlocklet:null,error:"",isGetBlocklet:!1,startPolling:s,stopPolling:()=>{l.current&&clearInterval(l.current)}}),v=()=>{n.getBlocklet({input:{did:e,attachRuntimeInfo:!0}}).then((e=>{x({status:e.blocklet?e.blocklet.status:"",eventName:"",runtimeBlocklet:e.blocklet,isGetBlocklet:!0})})).catch((e=>{console.error("get blocklet failed",e)}))};(0,a.useEffect)((()=>{let n=null;return e&&(d("schedule polling blocklet state"),n=setTimeout((()=>{s()}),g)),()=>{n&&clearInterval(n)}}),[e]),(0,a.useEffect)((()=>{e?null===i.status&&(d("polling blocklet state on start"),v()):x({status:"",eventName:"",runtimeBlocklet:null})}),[e,i.status]);const b=n=>t=>{if(m(t,e)){const e={status:null,eventName:n,runtimeBlocklet:t,isGetBlocklet:!1};if(t.error)d("blocklet error",{blockletEventName:n,error:t.error}),e.status="error",e.error=t.error;else{const a=u[h.indexOf(t.status)];d("blocklet event",{blockletEventName:n,status:a}),a&&(e.status=a)}x(e)}};for(const o of p)(0,a.useEffect)((()=>{const n=b(o);return e&&t.on(o,n),()=>{e&&t.off(o,n)}}),[e]);return i}},71667:(e,n,t)=>{t.r(n),t.d(n,{default:()=>Ue});var a,l,o=t(71171),s=t(85493),i=t(6352),r=t.n(i),c=t(21371),d=t(72904),u=t(33518),h=t(68420),p=t(63902),m=t(51703),g=t(12073),f=t(15959),x=t(10866),v=t(4456),b=t(28864),k=t(99641),y=t(44846),j=t(88574),w=t(35966),A=t(75793),E=t(38242),C=t(55309),Z=t(8790),B=t(77609),L=t(23484),N=t(96266);const M=u.Z.a(a||(a=(0,o.Z)(["\n display: block;\n height: 36px;\n color: ",";\n"])),(e=>e.theme.palette.primary.main)),P=(0,u.Z)(Z.Z)(l||(l=(0,o.Z)(["\n .app-info_desc {\n font-weight: 400;\n margin-top: 40px;\n font-size: 18px;\n line-height: 21px;\n color: #222222;\n }\n\n .body {\n text-align: center;\n }\n\n "," {\n .app-info_desc {\n font-size: 16px;\n }\n }\n\n .circle_icon {\n font-size: 58px;\n color: ",";\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>"error"===e.variant?e.theme.palette.error.main:e.theme.palette.success.main)),D=function(){const{t:e}=(0,h.PE)(),{info:n}=(0,A.h6)(),t=(0,L.Z)(),a=decodeURIComponent(t.get("accessUrl")||""),{meta:l}=(0,B.H0)();return(0,N.jsx)(P,{children:(0,N.jsx)("div",{className:"body",children:(0,N.jsx)(C.Z,{variant:"success",title:(0,E.getDisplayName)({meta:l},!0),subTitle:e("launchBlocklet.installSuccess",{serverName:n.name}),footer:(0,N.jsx)(M,{href:a,rel:"noreferrer","data-cy":"open-blocklet",children:e("common.open")})})})})};var I=t(39463),R=t(4651),Q=t(86229),T=t(14491),O=t(60344),S=t(17450),z=t(43316),U=t(35266),J=t(77277),F=t(2660),H=t(77429),X=t(48086),K=t(38898),V=t(75506),G=t.n(V),Y=t(50482),W=t.n(Y),_=t(5057),q=t(15849),$=t(67654),ee=t(31853),ne=t(11397),te=t.n(ne),ae=t(52581),le=t(11476),oe=t(25339),se=t(74094),ie=t(13455),re=t(28726);function ce(e){let{children:n,...t}=e;return(0,N.jsx)(re.Z,{variant:"contained",color:"primary",...t,children:n})}const de=(0,_.forwardRef)(((e,n)=>(0,N.jsx)(ce,{...e,forwardedRef:n})));var ue,he,pe,me,ge=t(13932),fe=t(93040),xe=t(66436);const ve=te()("@abtnode/webapp:launch-blocklet:step-install"),be=(e,n)=>!n.statusChanged&&("installed"===e||"running"===e)&&!n.launching,ke=(e,n,t)=>t("nft"===n?e?"launchBlocklet.dialog.nftFreeDescription":"launchBlocklet.dialog.nftPaidDescription":e?"launchBlocklet.dialog.freeDescription":"launchBlocklet.dialog.paidDescription"),ye="setup_token",je=e=>{sessionStorage.setItem(ye,e)},we=()=>{sessionStorage.removeItem(ye)},Ae=()=>sessionStorage.getItem(ye);function Ee(){const e=(0,L.Z)(),{t:n,locale:t}=(0,h.PE)(),{api:a,info:l}=(0,A.h6)(),{session:o,api:i}=(0,oe.Tt)(),c=(0,s.useNavigate)(),{loading:d,meta:u,isFree:p,appDid:m,sessionId:g,storeUrl:f,blockletMetaUrl:x,isExternal:v,setAppDid:b,launcherUrl:k,launcherSessionId:j,isInstalling:C,isInstalled:Z}=(0,B.H0)(),M=u?(0,E.getDisplayName)({meta:u},!0):null,P=e.get("launchType"),D=e.get("chainHost"),V=e.get("nftId"),Y=(0,_.useRef)(null),{decrypt:ne,encryptKey:te}=(0,z.R)(),[re]=(0,$.Z)("skip-blocklet-setup",!1),[ce,ue]=(0,ee.Z)({launching:!1,visiting:!1,statusChanged:!1,isConnectOpen:!1,nextAccessUrl:"",loaded:!1,installError:null,progressIndex:0,connectData:{action:"",baseUrl:"",checkFn:()=>{},extraParams:{}}}),he=(0,fe.Iq)({user:o.user,launchType:P,nftId:V}),pe=(0,I.getServerAuthMethod)(l,P,j,he),me=(0,le.Z)(he?m:""),{status:ye,eventName:Ee}=me,Ne=e.get("from");(0,_.useEffect)((()=>{d||(Z||C||Me(),ue({loaded:!0}))}),[d]);const Me=async()=>{const e=o.user?"".concat(o.user.fullName,"'s ").concat(M):M;if(ue({installError:null}),null!==o&&void 0!==o&&o.user&&!v&&"serverless"!==P)try{await(async()=>{const{isNew:e,decoded:n}=(0,se.bQ)(f,l.blockletRegistryList);e&&await a.addBlockletStore({input:{teamDid:l.did,url:n}})})()}catch(h){console.error("addNewRegistryToRegistryList error:",h)}if(p){var n,t,s;const a="launch-free-blocklet-by-".concat(pe);ue({isConnectOpen:!0,connectData:{action:a,baseUrl:"",checkFn:O.od.create({baseURL:null!==(n=null===(t=window)||void 0===t||null===(s=t.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==n?n:"/"}).get,extraParams:{wt:(0,R.iK)(u),title:e,blockletMetaUrl:x,launchType:P,nftId:V,chainHost:decodeURIComponent(D),launcherUrl:k,launcherSessionId:j}}})}else{var i,c,d;const n="launch-paid-blocklet-by-".concat(pe),t=new URL(window.location.href);t.pathname=r()(null!==(i=null===(c=window)||void 0===c||null===(d=c.env)||void 0===d?void 0:d.apiPrefix)&&void 0!==i?i:"/","/api/did/".concat(n,"/token")),t.searchParams.set("wt",(0,R.iK)(u)),t.searchParams.set("_ek_",te),t.searchParams.set("title",e),t.searchParams.set("autoConnect",!1),t.searchParams.set("blockletMetaUrl",x),P&&t.searchParams.set("launchType",P),V&&t.searchParams.set("nftId",V),k&&t.searchParams.set("launcherUrl",k),j&&t.searchParams.set("launcherSessionId",j);const{data:a}=await O.hi.get(t.href);ue({isConnectOpen:!0,connectData:{action:"verify-purchase-blocklet",baseUrl:new URL(x).origin,checkFn:O.od.create({baseURL:new URL(x).origin}).get,extraParams:{serverDid:l.did,blockletDid:null===u||void 0===u?void 0:u.did,nw:a.url}}})}},Pe=async n=>{if(ve("visitBlocklet",{status:ye,state:ce,appDid:m}),ce.visiting)return;ue({visiting:!0});const t=(0,T.A6)({blocklet:n}),a=await(0,se.D)(t);if(G()(a)&&"serverless"!==P||re)return ue({visiting:!1}),void setTimeout((()=>{(n=>{const t="/".concat(l.routing.adminPath,"/blocklets/").concat(n.meta.did,"/configuration").replace(/\/+/g,"/");let a="/launch-blocklet/complete?status=installed&name=".concat(encodeURIComponent(M),"&accessUrl=").concat(encodeURIComponent(t),"&blocklet_meta_url=").concat(x);const o=e.get("fromLauncher");o&&(a+="&fromLauncher=".concat(o)),P&&(a+="&launchType=".concat(P)),D&&(a+="&chainHost=".concat(D)),c(a)})(n)}),1e3);if(G()(a))return void ue({visiting:!1});if(!1===be(ye,ce))try{await i.post("/api/launch/".concat(g))}catch(d){ve("end launch failed",{error:(0,se.Z)(d)})}const o=new URL(a);o.searchParams.set("serverUrl",(0,R.RU)(l)),"running"!==n.status&&o.searchParams.set("__start__","1");const s=e.get("fromLauncher");s&&o.searchParams.set("fromLauncher",s),P&&o.searchParams.set("launchType",P),V&&o.searchParams.set("nftId",V),D&&o.searchParams.set("chainHost",D);const r=Ae();r&&o.searchParams.set("setupToken",r),ue({nextAccessUrl:o.href,visiting:!1}),setTimeout((()=>{we(),window.location.href=o.href}),1e3)},De=[n("launchBlocklet.waiting.verifying"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.extracting"),n("upgrading"===ye?"common.upgrading":"launchBlocklet.waiting.installing"),n("launchBlocklet.waiting.done")],Ie=()=>{ve("handleInstalledProgress",{status:ye,state:ce}),ye&&(ue({progressIndex:4}),Y.current&&(clearTimeout(Y.current),Y.current=null),Y.current=setTimeout((()=>{a.getBlocklet({input:{did:m,attachRuntimeInfo:!0}}).then((e=>{e.blocklet&&Pe(e.blocklet)}))}),500))};if((0,_.useEffect)((()=>{C&&ue({launching:!0}),Z&&Ie()}),[Z,C]),(0,_.useEffect)((()=>{if("serverless"!==P||Ee!==J.BlockletEvents.nftConsumed)switch(ye){case"waiting":ue({progressIndex:1,statusChanged:!0});break;case"downloading":ue({progressIndex:2,statusChanged:!0});break;case"installing":case"upgrading":ue({progressIndex:3,statusChanged:!0});break;case"installed":if("serverless"===P&&!(0,fe.MZ)(me))break;Ie();break;case"starting":case"running":case"stopped":Ie();break;case"corrupted":case"error":{const n={message:me.error.message,name:me.eventName};var e;if([J.BlockletEvents.downloadFailed,J.BlockletEvents.installFailed].includes(me.eventName)?n.action="retry":"error"!==ye&&"corrupted"!==ye||(n.action="view"),!W()(n,ce.installError))null!==me&&void 0!==me&&null!==(e=me.error)&&void 0!==e&&e.message&&Q.Z.error((0,se.Z)(me.error))}}else Ie()}),[ye,Ee,me]),ve("render",{status:ye,eventName:Ee,launchType:P,runtimeBlockletState:me,state:ce}),d||o.user&&null===ye||G()(u))return(0,N.jsx)(w.Z,{relative:"parent",children:(0,N.jsx)(y.Z,{})});if(ce.installError){const e={view:!v&&(0,N.jsx)(de,{className:"bottom-button",component:q.Link,to:"/blocklets/".concat(m,"/overview"),"data-cy":"view-blocklet",color:"primary",variant:"contained",children:n("launchBlocklet.viewApplication")}),retry:(0,N.jsxs)(Be,{children:[Ne&&(0,N.jsx)(de,{variant:"text",className:"bottom-button","data-cy":"go-back",disabled:ce.isConnectOpen,onClick:()=>{window.location.href=Ne},children:n("common.back")}),(0,N.jsxs)(de,{className:"bottom-button","data-cy":"retry-install",disabled:ce.isConnectOpen,onClick:Me,children:[ce.isConnectOpen&&(0,N.jsx)(y.Z,{size:16}),n("common.retry")]})]})},t=ce.installError.name?ce.installError.name.replace("blocklet.",""):"installFailed";return(0,N.jsx)(Le,{variant:"error",title:M,subTitle:(0,N.jsxs)(Ze,{children:[(0,N.jsx)("div",{children:n("launchBlocklet.error.".concat(t))}),ce.installError.message&&(0,N.jsx)("div",{className:"error-desc",children:n("common.errorMessage")+ce.installError.message})]}),footer:e[ce.installError.action]})}if(be(ye,ce))return ve("alreadyExists",{status:ye,state:ce,runtimeBlockletState:me}),(0,N.jsx)(Le,{variant:"info",title:n("common.reminder"),subTitle:n("launchBlocklet.alreadyExists",{name:(0,E.getDisplayName)({meta:u},!0)}),footer:(0,N.jsxs)("div",{children:[!ce.nextAccessUrl&&(0,N.jsx)(y.Z,{size:16}),ce.nextAccessUrl&&(0,N.jsx)(K.Z,{href:ce.nextAccessUrl,"data-cy":"open-blocklet",children:n("launchBlocklet.redirect")})]})});const Re=!ce.launching&&!ye;return(0,N.jsxs)(Ce,{children:[(0,N.jsx)("div",{className:"header",children:(0,N.jsx)(F.Z,{title:n(Re?"common.install":"common.installing"),subTitle:Re?n("launchBlocklet.subTitle",{appName:M,serverName:l.name}):""})}),(0,N.jsxs)("div",{className:"body",children:[Re&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"illustrations",children:[(0,N.jsx)("div",{className:"ills-block ills-block-left",children:(0,N.jsxs)("div",{className:"ills-block-inner",children:[(0,N.jsx)(ie.Z,{className:"i-icon",blocklet:{meta:u},blockletMetaUrl:x}),(0,N.jsx)("div",{className:"i-name",children:M})]})}),(0,N.jsx)(X.Z,{className:"arrow-icon"}),(0,N.jsx)("div",{className:"ills-block ills-block-right",children:(0,N.jsxs)("div",{className:"ills-block-inner",children:[(0,N.jsx)("img",{width:"64",height:"64",src:ae.Z,alt:""}),(0,N.jsx)("div",{className:"i-name",children:l.name}),(0,N.jsx)(S.Z,{size:12,responsive:!1,compact:!0,did:l.did})]})})]}),ce.loaded&&!Z&&!ce.launching&&(0,N.jsxs)(de,{className:"bottom-button","data-cy":"start-launch",disabled:ce.isConnectOpen,onClick:Me,children:[ce.isConnectOpen&&(0,N.jsx)(y.Z,{size:16}),n("launchBlocklet.confirmInstall")]})]}),ce.launching&&(0,N.jsxs)(xe.Z,{children:[(0,N.jsx)(U.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,N.jsx)(H.Z,{steps:De,stepIndex:ce.progressIndex,autoGrowth:4===ce.progressIndex?1e3:4e3})}),[1,2].includes(ce.progressIndex)&&(0,N.jsx)(ge.Z,{appDid:m})]})]}),ce.isConnectOpen&&(0,N.jsx)(ge.Z,{appDid:m,visible:!1}),(0,N.jsx)(z.Z,{open:ce.isConnectOpen,popup:!0,saveConnect:!1,className:"connect",baseUrl:ce.connectData.baseUrl,action:ce.connectData.action,checkFn:ce.connectData.checkFn,extraParams:ce.connectData.extraParams,checkTimeout:6e5,webWalletUrl:(0,se.yP)(l),onSuccess:async e=>{Q.Z.success(n("launchBlocklet.dialog.success"));const t=Array.isArray(e)?e[e.length-1]:e;if(t.sessionToken&&((0,se.ZB)(ne(t.sessionToken)),await o.refresh()),t.setupToken&&je(t.setupToken),ue({launching:!t.isInstalled,isConnectOpen:!1}),t.appDid){b(t.appDid,t.sessionId);const e=new URL(window.location.href);e.searchParams.set("appDid",t.appDid),e.searchParams.set("sessionId",t.sessionId),window.history.replaceState(null,"",e.toString())}},onClose:()=>ue({isConnectOpen:!1}),locale:t,messages:{title:"".concat(n("launchBlocklet.dialog.title")),scan:ke(p,pe,n),confirm:n("launchBlocklet.dialog.confirm"),success:n("launchBlocklet.dialog.success")}})]})}const Ce=(0,u.Z)(Z.Z)(ue||(ue=(0,o.Z)(["\n .body {\n align-items: center;\n animation: fadein ease 0.3s;\n }\n\n .illustrations {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: start;\n text-align: center;\n margin-top: 16px;\n margin-bottom: 40px;\n width: 100%;\n }\n\n .ills-block,\n .ills-block-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n flex: 1;\n }\n .ills-block {\n max-width: 220px;\n .i-icon {\n width: 64px;\n height: 64px;\n }\n\n .i-name {\n margin-top: 16px;\n font-weight: 400;\n font-size: 16px;\n color: #222222;\n }\n\n .i-sub-name {\n color: #999999;\n }\n }\n\n .arrow-icon {\n align-self: start;\n color: #c4c5ca;\n font-size: 30px;\n margin: 16px 0 0;\n "," {\n margin: 25px 24px 0;\n }\n }\n\n @keyframes fadein {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md"))),Ze=u.Z.div(he||(he=(0,o.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(e=>e.theme.palette.grey[500])),Be=u.Z.div(pe||(pe=(0,o.Z)(["\n display: flex;\n justify-content: space-around;\n flex-wrap: wrap;\n button {\n margin: 0 10px 18px;\n }\n"]))),Le=(0,u.Z)(C.Z)(me||(me=(0,o.Z)(["\n .result-footer {\n height: auto;\n }\n"])));var Ne,Me,Pe=t(31440),De=t(35432),Ie=t(32828);function Re(e){var n;let{onClickNext:t,handleDescEle:a,showPageHeader:l}=e;const o=(0,s.useNavigate)(),[i,r]=(0,_.useState)(null),[c,d]=(0,_.useState)(!1),{t:u}=(0,h.PE)(),{info:p,api:m}=(0,A.h6)(),{loading:g,meta:f,isRunning:x,isInstalled:v,isInstalling:b,appDid:k,isExternal:j}=(0,B.H0)(),Z=(0,_.useMemo)((()=>{if(!j)return"/blocklets/".concat(k,"/overview");if(!i)return"";const e=new URL(i);return"".concat(e.origin).concat(De.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin")}),[i,j,k]),L=()=>{o("/launch-blocklet/install".concat(window.location.search))},M=t||L;if((0,_.useEffect)((()=>{g||(b?L():(x||v&&j)&&(async()=>{try{d(!0);const{blocklet:e}=await m.getBlocklet({input:{did:f.did,attachRuntimeInfo:!0}}),n=(0,T.A6)({blocklet:e}),t=await(0,se.D)(n);if(!t&&G()(t))return void r(null);r(new URL(t).href)}catch(e){Q.Z.error(e.message)}finally{d(!1)}})())}),[x,j,v,b]),v){const e=x?"alreadyRunning":"alreadyInstalled";return(0,N.jsx)(C.Z,{variant:"info",title:u("common.reminder"),subTitle:u("launchBlocklet.".concat(e),{name:(0,E.getDisplayName)({meta:f},!0)}),footer:(0,N.jsxs)(Te,{children:[(0,N.jsx)(de,{loading:!Z,"data-cy":"view-blocklet",component:j?void 0:q.Link,to:Z,href:Z,variant:x?"outlined":"contained",color:"primary",children:u("launchBlocklet.viewApplication")}),x&&(0,N.jsx)(de,{loading:c,className:"last-button",disabled:!i,href:i,"data-cy":"open-blocklet",children:u("common.open")})]})})}return p?(0,Ie.default)(f)||null!==f&&void 0!==f&&null!==(n=f.components)&&void 0!==n&&n.length?(0,N.jsxs)(Qe,{children:[l&&(0,N.jsx)(F.Z,{title:u("launchBlocklet.introduction"),subTitle:u("launchBlocklet.welcome")}),(0,N.jsx)(Pe.Z,{meta:f,onClickNext:M,handleDescEle:a})]}):(0,N.jsx)(Qe,{className:"center",children:(0,N.jsx)(C.Z,{variant:"error",subTitle:u("launchBlocklet.error.resourceBlocklet")})}):(0,N.jsx)(w.Z,{relative:"parent",children:(0,N.jsx)(y.Z,{})})}Re.defaultProps={onClickNext:null,handleDescEle:"",showPageHeader:!0};const Qe=u.Z.div(Ne||(Ne=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n &.center {\n justify-content: center;\n }\n"]))),Te=u.Z.div(Me||(Me=(0,o.Z)(["\n .MuiButton-root {\n "," {\n min-width: 200px;\n }\n }\n .last-button {\n margin-left: ",";\n }\n"])),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.spacing(2)));var Oe,Se,ze;function Ue(){const e=(0,d.Z)((e=>e.breakpoints.down("md"))),{t:n,locale:t}=(0,h.PE)(),{info:a}=(0,A.h6)(),l=(0,se.yP)(a),{serverUrl:o,fromLauncher:i,meta:u,isFree:E,loading:C,error:Z,storeUrl:L}=(0,B.H0)(),M=r()((0,se.Y5)(),"/launch-blocklet"),P=[{key:"install",name:n("launchBlocklet.steps.installApp"),path:r()(M,"install")},{key:"setup",name:n("setup.steps.launchApp")}];let I=[{key:"agreement",name:n("launchBlocklet.introduction"),path:r()(M,"agreement")},...P];const R=()=>{o&&window.open(o)};let Q=(0,N.jsx)(He,{className:"".concat(o?"logo-can-click":""),children:(0,N.jsx)(k.Z,{onClick:R,logo:e?(0,N.jsx)(x.Z,{width:"32",height:"32"}):(0,N.jsx)(v.Z,{width:"128",height:"48"})})});i&&(I=[{key:"purchase-space",name:n("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:n("launchBlocklet.steps.prepareSpace")},...P],Q=(0,N.jsx)(He,{className:"".concat(o?"logo-can-click":""),children:(0,N.jsx)(k.Z,{logo:e?(0,N.jsx)(x.Z,{onClick:R,width:"32",height:"32"}):(0,N.jsx)(v.Z,{onClick:R,width:"128",height:"48"}),previousData:{logo:e?(0,N.jsx)(f.Z,{width:"32",height:"32"}):(0,N.jsx)(b.Z,{width:"145",height:"48"})}})}));const T={meta:u,isFree:E};return(0,N.jsx)(m.W,{steps:I,children:(0,N.jsx)(p.Z,{locale:t,loading:C,blockletMeta:{...u,isFree:E},useOfSkeleton:!1,navLogo:Q,headerEndAddons:(0,N.jsx)(g.Z,{webWalletUrl:l,SessionContext:oe.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:u&&u.logo?(0,se.aZ)({did:u.did,baseUrl:L,logoPath:u.logo}):null,children:(0,N.jsxs)(Fe,{children:[(0,N.jsx)(c.Global,{styles:Je}),C&&(0,N.jsx)(w.Z,{relative:"parent",children:(0,N.jsx)(y.Z,{})}),!C&&Z&&(0,N.jsx)(w.Z,{relative:"parent",children:(0,N.jsx)(j.Z,{style:{wordBreak:"break-all"},variant:"icon",type:"error",children:Z})}),!C&&!Z&&(0,N.jsxs)(s.Routes,{children:[(0,N.jsx)(s.Route,{path:"agreement",element:(0,N.jsx)(Re,{})}),(0,N.jsx)(s.Route,{path:"install",element:(0,N.jsx)(Ee,{})}),(0,N.jsx)(s.Route,{path:"complete",element:(0,N.jsx)(D,{blocklet:T})}),(0,N.jsx)(s.Route,{path:"*",element:(0,N.jsx)(s.Navigate,{to:"agreement".concat(window.location.search),replace:!0})})]})]})})})}const Je=(0,c.css)(Oe||(Oe=(0,o.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Fe=u.Z.div(Se||(Se=(0,o.Z)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"]))),He=u.Z.div(ze||(ze=(0,o.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])))},31440:(e,n,t)=>{t.d(n,{Z:()=>g});var a,l=t(71171),o=t(55898),s=t.n(o),i=t(85493),r=t(33518),c=t(68420),d=t(40265),u=t(44566),h=t(35432),p=t(96266);function m(e){let{...n}=e;return(0,p.jsxs)("div",{...n,style:{width:"100%"},children:[(0,p.jsx)("h3",{children:"End User License Agreement for Application"}),(0,p.jsxs)("p",{children:["Blocklet Server License Agreement ",h.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,p.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,p.jsx)("p",{children:"\u6682\u65e0"})]})}function g(e){let{meta:n,onClickNext:t,handleDescEle:a}=e;const l=(0,i.useNavigate)(),{t:o,locale:s}=(0,c.PE)(),r=t||(()=>{l("/launch-blocklet/install".concat(window.location.search))});return(0,p.jsxs)(f,{children:[(0,p.jsx)("div",{className:"app-content",children:(0,p.jsx)("div",{className:"agreement",children:(0,p.jsx)("div",{className:"agreement-content",children:(0,p.jsx)(u.Z,{blockletMeta:{data:n},locale:s,handleDescEle:a})})})}),(0,p.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,p.jsx)(d.Z,{onContinue:r,description:(0,p.jsx)(m,{}),texts:{listenName:o("launchBlocklet.license"),buttonNext:o("launchBlocklet.next")}})})]})}g.propTypes={meta:s().object.isRequired,onClickNext:s().func,handleDescEle:s().node},g.defaultProps={onClickNext:null,handleDescEle:""};const f=r.Z.div(a||(a=(0,l.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.palette.grey[100]),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")))},8790:(e,n,t)=>{t.d(n,{Z:()=>c});var a,l=t(71171),o=t(33518),s=t(55898),i=t.n(s),r=t(96266);function c(e){let{children:n,...t}=e;return(0,r.jsx)(d,{...t,children:n})}c.propTypes={children:i().any.isRequired};const d=o.Z.div(a||(a=(0,l.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("md")))},99641:(e,n,t)=>{t.d(n,{Z:()=>d});var a,l,o=t(71171),s=t(55898),i=t.n(s),r=t(33518),c=t(96266);function d(e){let{logo:n,name:t,subname:a,previousData:l,...o}=e,s=(0,c.jsx)(u,{logo:n}),i=t,r=a;return l.logo&&(s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(u,{logo:n,className:"left-fade-in-ele"}),(0,c.jsx)(u,{logo:l.logo,className:"postion-abs left-fade-out-ele"})]})),l.name&&l.name!==t&&(i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:t}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:l.name})]})),l.subname&&l.subname!==a&&(r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:a}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:l.subname})]})),(0,c.jsx)(p,{...o,children:(0,c.jsxs)("div",{className:"logo-inner",children:[(0,c.jsx)("div",{className:"logo-img-content",children:s}),(0,c.jsxs)("div",{className:"logo-info ".concat(t||a?"":"zero-left"),children:[(0,c.jsx)("div",{className:"logo-name",children:i}),(0,c.jsx)("div",{className:"logo-subname",children:r})]})]})})}function u(e){let{logo:n,...t}=e;return(0,c.jsx)(h,{...t,children:n})}d.propTypes={logo:i().element.isRequired,name:i().string,subname:i().string,previousData:i().object},d.defaultProps={name:"",subname:"",previousData:{logo:"",name:"",subname:""}};const h=r.Z.div(a||(a=(0,o.Z)(["\n display: block;\n > * {\n display: block;\n }\n"]))),p=r.Z.div(l||(l=(0,o.Z)(["\n position: relative;\n display: block;\n\n .logo-inner {\n display: flex;\n align-items: center;\n height: 100%;\n .logo-img-content {\n position: relative;\n display: block;\n }\n .logo-info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 10px;\n letter-spacing: 0.1px;\n &.zero-left {\n margin-left: 0%;\n }\n .logo-name {\n position: relative;\n line-height: 16px;\n font-size: 16px;\n color: #121319;\n }\n .logo-subname {\n position: relative;\n line-height: 13px;\n font-size: 13px;\n color: #7d8085;\n }\n }\n }\n\n .postion-abs {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n }\n\n .right-fade-out-ele {\n animation: right-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .right-fade-in-ele {\n animation: right-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes right-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n }\n\n @keyframes right-fade-in {\n 0% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n\n .left-fade-out-ele {\n animation: left-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .left-fade-in-ele {\n animation: left-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes left-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n }\n\n @keyframes left-fade-in {\n 0% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n"])))},60344:(e,n,t)=>{t.d(n,{hi:()=>o,od:()=>l.a});var a=t(10458),l=t.n(a);l().defaults.timeout=1e4;const o=l().create()},28864:(e,n,t)=>{n.Z=void 0;(a=t(5057))&&a.__esModule;var a,l=t(96266);function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){i(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function i(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!==typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var r=function(e){return(0,l.jsxs)("svg",s(s({},e),{},{children:[(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M80.005 25.994V10h7.737a3.79 3.79 0 0 1 3.79 3.79v1.149a3.777 3.777 0 0 1-1.035 2.602 3.788 3.788 0 0 1 1.901 3.286v1.377a3.79 3.79 0 0 1-3.79 3.79h-8.603zm1.684-8.957h6.226a2.105 2.105 0 0 0 1.932-2.098v-1.15a2.105 2.105 0 0 0-2.105-2.105h-6.053v5.353zm0 7.273v-5.582l6.92-.007c1.163 0 2.105.943 2.105 2.106v1.377a2.105 2.105 0 0 1-2.105 2.106h-6.92zM97.255 10v15.994h-1.762V10h1.762zm8.733 4.319h-1.827a3.81 3.81 0 0 0-3.811 3.81v4.054a3.81 3.81 0 0 0 3.811 3.81h1.827a3.811 3.811 0 0 0 3.811-3.81V18.13a3.811 3.811 0 0 0-3.811-3.81zm-1.827 1.762a2.05 2.05 0 0 0-2.049 2.048v4.054a2.05 2.05 0 0 0 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049V18.13a2.048 2.048 0 0 0-2.048-2.048h-1.827zM125.204 26v-5.754h2.148L130.674 26h2.035l-3.821-6.618 2.993-5.184h-2.035l-2.474 4.286h-2.168V10h-1.762v16h1.762zm-5.556-7.56v-.31a2.048 2.048 0 0 0-2.048-2.05h-1.827a2.048 2.048 0 0 0-2.049 2.05v4.053c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.312h-1.762zm17.918 7.554V10h-1.762v15.994h1.762zm4.989-5.357v1.546c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.746h.001v1.762h-7.687zm5.924-1.762h-5.924v-.746c0-1.131.917-2.048 2.049-2.048h1.827c1.131 0 2.048.917 2.048 2.048v.746zm5.489-1.912H152.4v-1.762h1.568v-2.848h1.684v2.848h4.077v1.762h-4.077v5.677a1.669 1.669 0 1 0 3.339 0v-.35h1.684v.35a3.353 3.353 0 1 1-6.707 0v-5.677z",fill:"#121319"}),(0,l.jsx)("path",{d:"M92.112 50.259v3.108H80.254V33.123h3.766v17.136h8.092zM101.843 47.235c-.999.047-1.839.135-2.52.266-.681.121-1.227.28-1.638.476-.41.196-.705.425-.882.686a1.49 1.49 0 0 0-.266.854c0 .606.177 1.04.532 1.302.364.261.835.392 1.414.392.71 0 1.32-.126 1.834-.378.523-.261 1.031-.654 1.526-1.176v-2.422zm-7.924-6.23c1.652-1.512 3.64-2.268 5.964-2.268.84 0 1.591.14 2.254.42.663.27 1.223.653 1.68 1.148a4.765 4.765 0 0 1 1.036 1.75c.243.681.364 1.428.364 2.24v9.072h-1.568c-.327 0-.579-.047-.756-.14-.177-.103-.317-.303-.42-.602l-.308-1.036c-.364.327-.719.616-1.064.868a6.54 6.54 0 0 1-1.078.616 5.498 5.498 0 0 1-1.204.378c-.42.093-.887.14-1.4.14-.607 0-1.167-.08-1.68-.238a3.775 3.775 0 0 1-1.33-.742 3.297 3.297 0 0 1-.868-1.218c-.206-.486-.308-1.05-.308-1.694a3.308 3.308 0 0 1 .77-2.114 5.12 5.12 0 0 1 1.078-.924c.438-.29.975-.541 1.61-.756a13.74 13.74 0 0 1 2.24-.518c.85-.14 1.82-.224 2.912-.252v-.84c0-.962-.205-1.67-.616-2.128-.411-.467-1.003-.7-1.778-.7-.56 0-1.027.065-1.4.196-.364.13-.686.28-.966.448-.28.159-.537.303-.77.434-.224.13-.476.196-.756.196-.243 0-.448-.06-.616-.182a1.67 1.67 0 0 1-.406-.448l-.616-1.106zM120.85 39.003v14.364h-2.114c-.458 0-.747-.21-.868-.63l-.238-1.148a7.862 7.862 0 0 1-1.946 1.456c-.71.364-1.545.546-2.506.546-.784 0-1.48-.13-2.086-.392a4.236 4.236 0 0 1-1.512-1.134 5.016 5.016 0 0 1-.938-1.722 7.52 7.52 0 0 1-.308-2.212v-9.128h3.458v9.128c0 .877.2 1.559.602 2.044.41.476 1.022.714 1.834.714.597 0 1.157-.13 1.68-.392a6.037 6.037 0 0 0 1.484-1.106V39.003h3.458zM127.512 40.767c.29-.29.593-.556.91-.798a5.623 5.623 0 0 1 2.184-1.036 5.542 5.542 0 0 1 1.344-.154c.784 0 1.48.135 2.086.406a3.957 3.957 0 0 1 1.512 1.12 4.69 4.69 0 0 1 .924 1.722c.215.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.2-1.554-.602-2.03-.401-.486-1.012-.728-1.834-.728-.597 0-1.157.135-1.68.406-.522.27-1.017.64-1.484 1.106v10.388h-3.458V39.003h2.114c.448 0 .742.21.882.63l.238 1.134zM150.373 42.04c-.103.132-.205.234-.308.309-.093.075-.233.112-.42.112a.982.982 0 0 1-.518-.154 9.315 9.315 0 0 0-.602-.364 3.902 3.902 0 0 0-.84-.364c-.317-.112-.714-.168-1.19-.168-.607 0-1.139.112-1.596.336-.457.215-.84.527-1.148.938-.299.41-.523.91-.672 1.498-.149.578-.224 1.236-.224 1.974 0 .765.079 1.447.238 2.044.168.597.406 1.101.714 1.512.308.401.681.71 1.12.924.439.205.933.308 1.484.308.551 0 .994-.066 1.33-.196.345-.14.635-.29.868-.448.233-.168.434-.318.602-.448a.925.925 0 0 1 .588-.21c.28 0 .49.107.63.322l.994 1.26a6.449 6.449 0 0 1-1.246 1.134 7.144 7.144 0 0 1-1.4.728 7.208 7.208 0 0 1-1.484.378 10.3 10.3 0 0 1-1.512.112 6.448 6.448 0 0 1-2.506-.49 6 6 0 0 1-2.058-1.456c-.588-.635-1.055-1.41-1.4-2.324-.336-.924-.504-1.974-.504-3.15 0-1.055.149-2.03.448-2.926.308-.906.756-1.685 1.344-2.338a6.09 6.09 0 0 1 2.184-1.554c.868-.373 1.867-.56 2.996-.56 1.073 0 2.011.172 2.814.518.812.345 1.54.84 2.184 1.484l-.91 1.26zM157.049 40.543a7.51 7.51 0 0 1 1.848-1.274c.672-.327 1.46-.49 2.366-.49.784 0 1.479.135 2.086.406.606.261 1.11.634 1.512 1.12.41.476.718 1.05.924 1.722.214.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.201-1.554-.602-2.03-.402-.486-1.013-.728-1.834-.728-.598 0-1.158.135-1.68.406-.523.27-1.018.64-1.484 1.106v10.388h-3.458V32.563h3.458v7.98zM178.649 44.533a3.95 3.95 0 0 0-.196-1.26 2.908 2.908 0 0 0-.559-1.05 2.562 2.562 0 0 0-.967-.7c-.382-.178-.83-.266-1.343-.266-.999 0-1.788.285-2.367.854-.569.57-.933 1.377-1.091 2.422h6.523zm-6.593 2.086c.056.737.186 1.377.392 1.918.205.532.475.975.811 1.33.336.345.733.607 1.191.784.466.168.98.252 1.54.252s1.04-.066 1.442-.196c.41-.13.765-.276 1.063-.434.308-.159.575-.304.799-.434.233-.13.457-.196.671-.196.29 0 .504.107.644.322l.995 1.26a5.93 5.93 0 0 1-1.289 1.134 7.641 7.641 0 0 1-1.498.728 8.291 8.291 0 0 1-1.581.378c-.532.074-1.05.112-1.554.112a7.766 7.766 0 0 1-2.786-.49 6.352 6.352 0 0 1-2.24-1.47c-.635-.653-1.134-1.456-1.498-2.408-.364-.962-.546-2.072-.546-3.332 0-.98.158-1.9.476-2.758.317-.868.77-1.62 1.358-2.254a6.462 6.462 0 0 1 2.17-1.526c.858-.373 1.824-.56 2.898-.56.905 0 1.74.144 2.506.434a5.41 5.41 0 0 1 1.973 1.274c.551.55.981 1.232 1.289 2.044.317.803.475 1.722.475 2.758 0 .523-.055.877-.167 1.064-.112.177-.327.266-.644.266h-8.89zM187.615 41.495c.448-.859.98-1.53 1.596-2.016.616-.495 1.344-.742 2.184-.742.662 0 1.194.145 1.596.434l-.224 2.59c-.047.168-.117.29-.21.364a.558.558 0 0 1-.35.098c-.14 0-.35-.023-.63-.07a4.704 4.704 0 0 0-.798-.07c-.383 0-.724.056-1.022.168-.299.112-.57.275-.812.49a3.359 3.359 0 0 0-.63.756c-.178.298-.346.64-.504 1.022v8.848h-3.458V39.003h2.03c.354 0 .602.065.742.196.14.121.233.345.28.672l.21 1.624z",fill:"#121319"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 10.642L30.72 0 12.288 10.642v14.152L0 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L61.44 53.172V31.89l-12.288-7.095V10.642zM59.52 32.997l-12.288-7.094V11.75L30.72 2.217 14.208 11.75v14.153L1.92 32.997v19.067l16.512 9.533L30.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_416)"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 24.83L30.72 14.19 12.288 24.831v21.283L30.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L30.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L28.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L37.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_416)"}),(0,l.jsxs)("defs",{children:[(0,l.jsxs)("linearGradient",{id:"paint0_linear_615_416",x1:"30.72",y1:"95.721",x2:"94.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:"#0FA4B7"}),(0,l.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,l.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,l.jsxs)("linearGradient",{id:"paint1_linear_615_416",x1:"27.437",y1:"99.246",x2:"97.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:"#0FA4B7"}),(0,l.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,l.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};r.defaultProps={width:"193",height:"64",viewBox:"0 0 193 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.displayName="launcher-logo";var c=r;n.Z=c},15959:(e,n,t)=>{n.Z=void 0;(a=t(5057))&&a.__esModule;var a,l=t(96266);function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){i(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function i(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!==typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var r=function(e){return(0,l.jsxs)("svg",s(s({},e),{},{children:[(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.642L31.72 0 13.288 10.642v14.152L1 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L62.44 53.172V31.89l-12.288-7.095V10.642zM60.52 32.997l-12.288-7.094V11.75L31.72 2.217 15.208 11.75v14.153L2.92 32.997v19.067l16.512 9.533L31.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_428)"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 24.83L31.72 14.19 13.288 24.831v21.283L31.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L31.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L29.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L38.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_428)"}),(0,l.jsxs)("defs",{children:[(0,l.jsxs)("linearGradient",{id:"paint0_linear_615_428",x1:"31.72",y1:"95.721",x2:"95.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:"#0FA4B7"}),(0,l.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,l.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,l.jsxs)("linearGradient",{id:"paint1_linear_615_428",x1:"28.437",y1:"99.246",x2:"98.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,l.jsx)("stop",{stopColor:"#0FA4B7"}),(0,l.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,l.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};r.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.displayName="launcher-logo-notext";var c=r;n.Z=c}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2334],{22334:(e,n,t)=>{t.r(n),t.d(n,{default:()=>U});var s,a=t(71171),o=t(5057),r=t(33518),i=t(85493),l=t(15849),c=t(11750),d=t(22139),p=t(76005),u=t(39948),h=t(20870),m=t(31089),x=t(71767),g=t(64185),v=t(41105),f=t(56184),w=t(62681),b=t(28726),j=t(68420),Z=t(60829),S=t(43316),y=t(35432),P=t(12673),k=t(55898),C=t.n(k),N=t(96266);function L(e){let{list:n,width:t,height:s,cardSpace:a,onSelect:r,defaultIndex:i}=e;const[l,c]=(0,o.useState)(0),[d,p]=(0,o.useState)(0),u=(0,o.useRef)(null),h=e=>{if(e<0||e>n.length-1)return;c(e);const s=u.current.clientWidth;p(e*(t+a)-(s-t)/2+.5*a),r(e)};let m;(0,o.useEffect)((()=>{h(i);u.current.addEventListener("touchmove",(e=>e.preventDefault()),{passive:!1})}),[]);return(0,N.jsx)(z,{ref:u,onTouchStart:e=>{const n=e.touches[0];m=n.clientX},onTouchEnd:e=>{const n=e.changedTouches[0],t=m-n.clientX;Math.abs(t)>60&&h(t>0?l+1:l-1)},children:(0,N.jsx)("div",{className:"card-container",style:{transform:"translate(".concat(-d,"px, 0)")},children:n.map(((e,n)=>(0,N.jsx)("div",{className:"card-item ".concat(n===l?"selected":""),style:{width:t,height:s,margin:a/2},onClick:()=>h(n),children:(0,N.jsx)("div",{className:"card-content",dangerouslySetInnerHTML:{__html:e.src}})},e.id)))})})}const z=r.Z.div(s||(s=(0,a.Z)(["\n overflow: hidden;\n mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);\n overflow: hidden;\n .card-container {\n display: flex;\n white-space: nowrap;\n width: max-content;\n transition: all ease 0.3s;\n }\n .card-item {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n\n .card-content {\n pointer-events: none;\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n outline: #526ded solid 0;\n transition: all ease 0.2s;\n box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px;\n }\n &.selected {\n cursor: default;\n .card-content {\n outline: #526ded solid 5px;\n }\n }\n }\n"])));L.propTypes={list:C().array,width:C().number,height:C().number,cardSpace:C().number,onSelect:C().func,defaultIndex:C().number},L.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};var I,H=t(17450),M=t(5766),T=t(70284);function W(e){let{icon:n,active:t,completed:s}=e;const a={1:(0,N.jsx)(g.Z,{className:"step-icon"}),2:(0,N.jsx)(v.Z,{className:"step-icon"}),3:(0,N.jsx)(f.Z,{className:"step-icon"})},o=["step-icon-w"];return t&&o.push("step-icon-w--active"),s&&o.push("step-icon-w--completed"),(0,N.jsx)("div",{className:o.join(" "),children:a[String(n)]})}const _=(0,r.Z)(d.Z)(I||(I=(0,a.Z)(["\n padding-top: 46px;\n padding-bottom: 46px;\n height: 100%;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n @media (max-width: ","px) {\n display: block;\n }\n .header {\n text-align: center;\n margin-bottom: 24px;\n }\n\n .stepper {\n padding: 24px;\n height: auto;\n width: 100%;\n min-height: 640px;\n display: flex;\n flex-direction: column;\n\n .stepper-progress {\n padding: 0;\n flex: 0;\n margin-bottom: 24px;\n\n .MuiStepLabel-label.MuiStepLabel-alternativeLabel {\n margin-top: 8px;\n }\n\n .MuiStepConnector-alternativeLabel {\n top: 24px;\n }\n\n .MuiStepConnector-lineHorizontal {\n height: 3px;\n border: none;\n background-color: #eaeaf0;\n border-radius: 1px;\n }\n\n .step-icon-w {\n background-color: ",";\n z-index: 1;\n color: ",";\n width: 50px;\n height: 50px;\n display: flex;\n border-radius: 50%;\n justify-content: center;\n align-items: center;\n .step-icon {\n font-size: 30px;\n }\n }\n\n .step-icon-w--active {\n background-color: ",";\n }\n\n .step-icon-w--completed {\n background-color: ",";\n }\n }\n\n .stepper-content {\n padding: 0 64px;\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 24px;\n\n .stepper-icon {\n margin-left: 40px;\n }\n\n .stepper-auth {\n padding: 0;\n\n .auth-title {\n margin-bottom: 16px;\n }\n }\n\n .stepper-tip {\n text-align: center;\n margin-bottom: 16px;\n }\n @media (max-width: ","px) {\n padding: 0;\n }\n }\n\n .stepper-actions {\n flex: 0;\n text-align: right;\n padding: 0 64px;\n display: none;\n .step-button {\n margin-right: 8px;\n }\n }\n\n .select-passport {\n width: 80%;\n @media (max-width: ","px) {\n width: 100%;\n }\n }\n\n .user-info {\n .name {\n font-weight: 500;\n font-size: 18px;\n line-height: 25px;\n color: #222222;\n }\n }\n }\n\n .connect {\n background: #fafafa;\n }\n"])),(e=>e.theme.breakpoints.values.sm),(e=>e.theme.palette.grey[500]),(e=>e.theme.palette.common.white),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.secondary.main),(e=>e.theme.breakpoints.values.sm),(e=>e.theme.breakpoints.values.sm)),E=(0,M.Z)((function(e){let{SessionContext:n,webWalletUrl:s,createPassportSvg:a,passportColor:r}=e;const{api:d,session:g}=(0,o.useContext)(n),v=(0,P.Z)({user:null,passport:null,success:!1,activeStep:0}),{setPassportId:f,clearPassportId:k}=(0,T.Z)(),{t:C,locale:z}=(0,o.useContext)(j.RD),I=(0,i.useNavigate)(),{wallet:M}=(0,Z.Z)(),{searchParams:E}=new URL(window.location.href),R=()=>{v.activeStep++},A=e=>{v.user=e.user},D=e=>{null!==e&&void 0!==e&&e.passportId&&f(e.passportId),v.success=!0,R()},U=()=>{var e;if(M&&(()=>{const{searchParams:e}=new URL(window.location.href);return"1"===e.get("fromWallet")})())return void t.e(2365).then(t.t.bind(t,72365,23)).then((e=>{e.call("arcClosePage")}));try{g.logout()}catch(s){}const n=E.get("redirect");n?window.location.replace(n):((null===(e=window.env)||void 0===e?void 0:e.apiPrefix)||"").startsWith(y.WELLKNOWN_SERVICE_PATH_PREFIX)?I("".concat(y.WELLKNOWN_SERVICE_PATH_PREFIX,"/connect"),{replace:!0}):(k(),window.location.replace("/"))},V=[{label:C("lostPassport.selectPassport"),content:()=>v.user?(0,N.jsxs)(u.Z,{className:"select-passport",children:[(0,N.jsxs)(u.Z,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[(0,N.jsx)(w.Z,{src:v.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),(0,N.jsxs)(u.Z,{children:[(0,N.jsx)(u.Z,{className:"name",children:v.user.fullName}),(0,N.jsx)(u.Z,{className:"did",mt:1,children:(0,N.jsx)(H.Z,{did:v.user.did})})]})]}),(0,N.jsx)("div",{children:(0,N.jsx)(L,{width:230,height:306,cardSpace:24,list:v.user.passportTypes.map((e=>({src:a({title:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:v.user.did,ownerName:v.user.fullName,ownerAvatarUrl:v.user.avatar,preferredColor:r||"auto"}),name:e.title,id:e.id}))),onSelect:e=>{return n={target:{value:v.user.passportTypes[e].name}},void(v.passport=n.target.value);var n},defaultIndex:0})}),(0,N.jsx)(u.Z,{textAlign:"center",children:(0,N.jsx)(b.Z,{variant:"contained",color:"primary",onClick:()=>{R()},disabled:!v.passport,children:C("common.next")})})]}):(0,N.jsx)(S.Z,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:d.get,checkTimeout:6e5,webWalletUrl:s,onSuccess:A,locale:z,messages:{title:C("lostPassport.dialog.title"),scan:C("lostPassport.dialog.scan"),confirm:C("lostPassport.dialog.confirm"),success:C("lostPassport.dialog.success")}})},{label:C("lostPassport.receivePassport"),content:()=>{var e,n;const t={receiverDid:v.user.did,passportName:v.passport,teamDid:(null===(e=window)||void 0===e||null===(n=e.blocklet)||void 0===n?void 0:n.did)||""};return(0,N.jsx)(S.Z,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:d.get,checkTimeout:6e5,webWalletUrl:s,onSuccess:D,locale:z,messages:{title:"".concat(C("lostPassport.dialog.title")),scan:C("lostPassport.dialog.scan"),confirm:C("lostPassport.dialog.confirm"),success:C("lostPassport.dialog.success")},extraParams:t})}},{label:C("common.complete"),content:()=>(0,N.jsxs)(u.Z,{textAlign:"center",children:[(0,N.jsx)(u.Z,{mb:3,color:"success.main",children:(0,N.jsx)(p.Z,{style:{fontSize:60}})}),(0,N.jsx)(c.Z,{component:"p",variant:"body1",className:"subheader",children:C("issuePassport.dialog.success")}),(0,N.jsx)(b.Z,{style:{marginTop:40},variant:"contained",color:"primary",onClick:U,children:C("issuePassport.dialog.loginWithPassport")})]})}];return(0,N.jsx)(_,{children:(0,N.jsxs)("div",{className:"stepper",children:[(0,N.jsx)(h.Z,{className:"stepper-progress",alternativeLabel:!0,activeStep:v.activeStep,children:V.map((e=>{let{label:n}=e;return(0,N.jsx)(m.Z,{children:(0,N.jsx)(x.Z,{StepIconComponent:W,children:n})},n)}))}),(0,N.jsx)("div",{className:"stepper-content",children:V[v.activeStep].content()}),!v.success&&(0,N.jsx)(u.Z,{textAlign:"center",fontSize:12,children:(0,N.jsx)(l.Link,{to:"/",style:{color:"#4598FA"},children:C("lostPassport.return")})})]})})}));var R=t(25339),A=t(74094),D=t(75793);function U(){const{info:e}=(0,D.h6)(),n=(0,A.yP)(e);return(0,N.jsx)(E,{SessionContext:R.B3,webWalletUrl:n,createPassportSvg:n=>(0,A.Ju)(n,e),passportColor:"default"})}},5766:(e,n,t)=>{t.d(n,{Z:()=>d});var s=t(68420),a=t(77668),o=t.n(a),r=t(2586),i=t(56944);const l={zh:o()(i.Z),en:o()(r.Z)};var c=t(96266);function d(e){return function(n){return(0,c.jsx)(s.Iw,{translations:l,children:(0,c.jsx)(e,{...n})})}}},76005:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");n.Z=r},56184:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");n.Z=r},41105:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),"GetApp");n.Z=r},64185:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M3 14h4v-4H3v4zm0 5h4v-4H3v4zM3 9h4V5H3v4zm5 5h13v-4H8v4zm0 5h13v-4H8v4zM8 5v4h13V5H8z"}),"ViewList");n.Z=r}}]);
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2334],{22334:(e,n,t)=>{t.r(n),t.d(n,{default:()=>U});var s,a=t(71171),o=t(5057),r=t(33518),i=t(85493),l=t(15849),c=t(11750),d=t(22139),p=t(76005),u=t(39948),h=t(20870),m=t(31089),x=t(71767),g=t(64185),v=t(41105),f=t(56184),w=t(62681),Z=t(28726),b=t(68420),j=t(60829),S=t(43316),y=t(35432),P=t(12673),k=t(55898),C=t.n(k),N=t(96266);function z(e){let{list:n,width:t,height:s,cardSpace:a,onSelect:r,defaultIndex:i}=e;const[l,c]=(0,o.useState)(0),[d,p]=(0,o.useState)(0),u=(0,o.useRef)(null),h=e=>{if(e<0||e>n.length-1)return;c(e);const s=u.current.clientWidth;p(e*(t+a)-(s-t)/2+.5*a),r(e)};let m;(0,o.useEffect)((()=>{h(i);u.current.addEventListener("touchmove",(e=>e.preventDefault()),{passive:!1})}),[]);return(0,N.jsx)(L,{ref:u,onTouchStart:e=>{const n=e.touches[0];m=n.clientX},onTouchEnd:e=>{const n=e.changedTouches[0],t=m-n.clientX;Math.abs(t)>60&&h(t>0?l+1:l-1)},children:(0,N.jsx)("div",{className:"card-container",style:{transform:"translate(".concat(-d,"px, 0)")},children:n.map(((e,n)=>(0,N.jsx)("div",{className:"card-item ".concat(n===l?"selected":""),style:{width:t,height:s,margin:a/2},onClick:()=>h(n),children:(0,N.jsx)("div",{className:"card-content",dangerouslySetInnerHTML:{__html:e.src}})},e.id)))})})}const L=r.Z.div(s||(s=(0,a.Z)(["\n overflow: hidden;\n mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);\n overflow: hidden;\n .card-container {\n display: flex;\n white-space: nowrap;\n width: max-content;\n transition: all ease 0.3s;\n }\n .card-item {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n\n .card-content {\n pointer-events: none;\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n outline: #526ded solid 0;\n transition: all ease 0.2s;\n box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px;\n }\n &.selected {\n cursor: default;\n .card-content {\n outline: #526ded solid 5px;\n }\n }\n }\n"])));z.propTypes={list:C().array,width:C().number,height:C().number,cardSpace:C().number,onSelect:C().func,defaultIndex:C().number},z.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};var I,H=t(17450),M=t(5766),T=t(70284);function W(e){let{icon:n,active:t,completed:s}=e;const a={1:(0,N.jsx)(g.Z,{className:"step-icon"}),2:(0,N.jsx)(v.Z,{className:"step-icon"}),3:(0,N.jsx)(f.Z,{className:"step-icon"})},o=["step-icon-w"];return t&&o.push("step-icon-w--active"),s&&o.push("step-icon-w--completed"),(0,N.jsx)("div",{className:o.join(" "),children:a[String(n)]})}const _=(0,r.Z)(d.Z)(I||(I=(0,a.Z)(["\n padding-top: 46px;\n padding-bottom: 46px;\n height: 100%;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n @media (max-width: ","px) {\n display: block;\n }\n .header {\n text-align: center;\n margin-bottom: 24px;\n }\n\n .stepper {\n padding: 24px;\n height: auto;\n width: 100%;\n min-height: 640px;\n display: flex;\n flex-direction: column;\n\n .stepper-progress {\n padding: 0;\n flex: 0;\n margin-bottom: 24px;\n\n .MuiStepLabel-label.MuiStepLabel-alternativeLabel {\n margin-top: 8px;\n }\n\n .MuiStepConnector-alternativeLabel {\n top: 24px;\n }\n\n .MuiStepConnector-lineHorizontal {\n height: 3px;\n border: none;\n background-color: #eaeaf0;\n border-radius: 1px;\n }\n\n .step-icon-w {\n background-color: ",";\n z-index: 1;\n color: ",";\n width: 50px;\n height: 50px;\n display: flex;\n border-radius: 50%;\n justify-content: center;\n align-items: center;\n .step-icon {\n font-size: 30px;\n }\n }\n\n .step-icon-w--active {\n background-color: ",";\n }\n\n .step-icon-w--completed {\n background-color: ",";\n }\n }\n\n .stepper-content {\n padding: 0 64px;\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 24px;\n\n .stepper-icon {\n margin-left: 40px;\n }\n\n .stepper-auth {\n padding: 0;\n\n .auth-title {\n margin-bottom: 16px;\n }\n }\n\n .stepper-tip {\n text-align: center;\n margin-bottom: 16px;\n }\n @media (max-width: ","px) {\n padding: 0;\n }\n }\n\n .stepper-actions {\n flex: 0;\n text-align: right;\n padding: 0 64px;\n display: none;\n .step-button {\n margin-right: 8px;\n }\n }\n\n .select-passport {\n width: 80%;\n @media (max-width: ","px) {\n width: 100%;\n }\n }\n\n .user-info {\n .name {\n font-weight: 500;\n font-size: 18px;\n line-height: 25px;\n color: #222222;\n }\n }\n }\n\n .connect {\n background: #fafafa;\n }\n"])),(e=>e.theme.breakpoints.values.sm),(e=>e.theme.palette.grey[500]),(e=>e.theme.palette.common.white),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.secondary.main),(e=>e.theme.breakpoints.values.sm),(e=>e.theme.breakpoints.values.sm)),E=(0,M.Z)((function(e){let{SessionContext:n,webWalletUrl:s,createPassportSvg:a,passportColor:r}=e;const{api:d,session:g}=(0,o.useContext)(n),v=(0,P.Z)({user:null,passport:null,success:!1,activeStep:0}),{setPassportId:f,clearPassportId:k}=(0,T.Z)(),{t:C,locale:L}=(0,o.useContext)(b.RD),I=(0,i.useNavigate)(),{wallet:M}=(0,j.Z)(),{searchParams:E}=new URL(window.location.href),R=()=>{v.activeStep++},A=e=>{v.user=e.user},D=e=>{null!==e&&void 0!==e&&e.passportId&&f(e.passportId),v.success=!0,R()},U=()=>{var e;if(M&&(()=>{const{searchParams:e}=new URL(window.location.href);return"1"===e.get("fromWallet")})())return void t.e(2365).then(t.t.bind(t,72365,23)).then((e=>{e.call("arcClosePage")}));try{g.logout()}catch(s){}const n=E.get("redirect");n?window.location.replace(n):((null===(e=window.env)||void 0===e?void 0:e.apiPrefix)||"").startsWith(y.WELLKNOWN_SERVICE_PATH_PREFIX)?I("".concat(y.WELLKNOWN_SERVICE_PATH_PREFIX,"/connect"),{replace:!0}):(k(),window.location.replace("/"))},V=[{label:C("lostPassport.selectPassport"),content:()=>v.user?(0,N.jsxs)(u.Z,{className:"select-passport",children:[(0,N.jsxs)(u.Z,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[(0,N.jsx)(w.Z,{src:v.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),(0,N.jsxs)(u.Z,{children:[(0,N.jsx)(u.Z,{className:"name",children:v.user.fullName}),(0,N.jsx)(u.Z,{className:"did",mt:1,children:(0,N.jsx)(H.Z,{did:v.user.did})})]})]}),(0,N.jsx)("div",{children:(0,N.jsx)(z,{width:230,height:306,cardSpace:24,list:v.user.passportTypes.map((e=>({src:a({title:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:v.user.did,ownerName:v.user.fullName,ownerAvatarUrl:v.user.avatar,preferredColor:r||"auto"}),name:e.title,id:e.id}))),onSelect:e=>{return n={target:{value:v.user.passportTypes[e].name}},void(v.passport=n.target.value);var n},defaultIndex:0})}),(0,N.jsx)(u.Z,{textAlign:"center",children:(0,N.jsx)(Z.Z,{variant:"contained",color:"primary",onClick:()=>{R()},disabled:!v.passport,children:C("common.next")})})]}):(0,N.jsx)(S.Z,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:d.get,checkTimeout:6e5,webWalletUrl:s,onSuccess:A,locale:L,messages:{title:C("lostPassport.dialog.title"),scan:C("lostPassport.dialog.scan"),confirm:C("lostPassport.dialog.confirm"),success:C("lostPassport.dialog.success")}})},{label:C("lostPassport.receivePassport"),content:()=>{var e,n;const t={receiverDid:v.user.did,passportName:v.passport,teamDid:(null===(e=window)||void 0===e||null===(n=e.blocklet)||void 0===n?void 0:n.did)||""};return(0,N.jsx)(S.Z,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:d.get,checkTimeout:6e5,webWalletUrl:s,onSuccess:D,locale:L,messages:{title:"".concat(C("lostPassport.dialog.title")),scan:C("lostPassport.dialog.scan"),confirm:C("lostPassport.dialog.confirm"),success:C("lostPassport.dialog.success")},extraParams:t})}},{label:C("common.complete"),content:()=>(0,N.jsxs)(u.Z,{textAlign:"center",children:[(0,N.jsx)(u.Z,{mb:3,color:"success.main",children:(0,N.jsx)(p.Z,{style:{fontSize:60}})}),(0,N.jsx)(c.Z,{component:"p",variant:"body1",className:"subheader",children:C("issuePassport.dialog.success")}),(0,N.jsx)(Z.Z,{style:{marginTop:40},variant:"contained",color:"primary",onClick:U,children:C("issuePassport.dialog.loginWithPassport")})]})}];return(0,N.jsx)(_,{children:(0,N.jsxs)("div",{className:"stepper",children:[(0,N.jsx)(h.Z,{className:"stepper-progress",alternativeLabel:!0,activeStep:v.activeStep,children:V.map((e=>{let{label:n}=e;return(0,N.jsx)(m.Z,{children:(0,N.jsx)(x.Z,{StepIconComponent:W,children:n})},n)}))}),(0,N.jsx)("div",{className:"stepper-content",children:V[v.activeStep].content()}),!v.success&&(0,N.jsx)(u.Z,{textAlign:"center",fontSize:12,children:(0,N.jsx)(l.Link,{to:"/",style:{color:"#4598FA"},children:C("lostPassport.return")})})]})})}));var R=t(25339),A=t(74094),D=t(75793);function U(){const{info:e}=(0,D.h6)(),n=(0,A.yP)(e);return(0,N.jsx)(E,{SessionContext:R.B3,webWalletUrl:n,createPassportSvg:n=>(0,A.Ju)(n,e),passportColor:"default"})}},5766:(e,n,t)=>{t.d(n,{Z:()=>S});var s=t(68420),a=t(77668),o=t.n(a),r=t(2586),i=t(56944),l=t(4465),c=t(43803),d=t(23930),p=t(82019),u=t(8590),h=t(61575),m=t(90233),x=t(48170),g=t(69586),v=t(81059),f=t(55748),w=t(56906),Z=t(64423);const b={ar:o()(l.Z),de:o()(c.Z),en:o()(r.Z),es:o()(d.Z),fr:o()(p.Z),hi:o()(u.Z),id:o()(h.Z),ja:o()(m.Z),ko:o()(x.Z),pt:o()(g.Z),ru:o()(v.Z),th:o()(f.Z),vi:o()(w.Z),"zh-TW":o()(Z.Z),zh:o()(i.Z)};var j=t(96266);function S(e){return function(n){return(0,j.jsx)(s.Iw,{translations:b,children:(0,j.jsx)(e,{...n})})}}},76005:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");n.Z=r},56184:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");n.Z=r},41105:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),"GetApp");n.Z=r},64185:(e,n,t)=>{var s=t(71600);n.Z=void 0;var a=s(t(56930)),o=t(96266),r=(0,a.default)((0,o.jsx)("path",{d:"M3 14h4v-4H3v4zm0 5h4v-4H3v4zM3 9h4V5H3v4zm5 5h13v-4H8v4zm0 5h13v-4H8v4zM8 5v4h13V5H8z"}),"ViewList");n.Z=r}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3389],{13455:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(55898),a=n.n(o),s=n(36687),r=n(72333);const l="data:image/png;base64,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";var i=n(74094),c=n(96266);function d(e){let{blocklet:t,blockletMetaUrl:n}=e;const{did:o,logo:a}=t.meta;let d;return d=a?(0,c.jsx)(s.Z,{src:(0,i.aZ)({did:o,logoPath:a,baseUrl:new URL(n).origin}),fallback:l,width:64,size:"contain",placeholder:"application logo"}):(0,c.jsx)(r.Z,{did:o,size:64}),d}d.propTypes={blocklet:a().object.isRequired,blockletMetaUrl:a().string.isRequired}},13932:(e,t,n)=>{n.d(t,{Z:()=>x});var o,a=n(71171),s=n(68420),r=n(77277),l=n(33518),i=n(39948),c=n(5057),d=n(11397),p=n.n(d),u=n(34937),h=n(96266);const m=p()("@abtnode/webapp:launch-blocklet:download-progress");const f=(e,t)=>{m("getDownloadBundleStep",e);return(e||[]).map((e=>{var n;const o=t("launchBlocklet.waiting.".concat("extracting"===e.status?"extractingComponent":"downloadingComponent"),{name:(null===(n=e.component)||void 0===n?void 0:n.title)||""}),a=e.total&&e.current?": ".concat(Math.floor(e.current/e.total*100)," %"):"";let s=e.name?": ".concat(e.name):"";return a||(s+="..."),"".concat(o).concat(a).concat(s)})).join("\n")};function x(e){let{appDid:t,visible:n}=e;const{t:o}=(0,s.PE)(),a=function(e){let{appDid:t}=e;const[n,o]=(0,c.useState)([]),a=(0,u.ZP)();return(0,c.useEffect)((()=>(a.on(r.BlockletEvents.downloadBundleProgress,(e=>{t&&t===(null===e||void 0===e?void 0:e.appDid)&&o((t=>{const n=[...t],o=n.findIndex((t=>{var n,o;return(null===(n=t.component)||void 0===n?void 0:n.did)===(null===(o=e.component)||void 0===o?void 0:o.did)}));return"completed"===e.status?-1!==o&&n.splice(o,1):-1!==o?n[o]=e:n.push(e),[...n]}))})),()=>{a.off(r.BlockletEvents.downloadBundleProgress)})),[t,a]),n}({appDid:t});return(0,h.jsx)(g,{style:{display:n?"block":"none"},children:f(a,o)})}x.defaultProps={appDid:"",visible:!0};const g=(0,l.Z)(i.Z)(o||(o=(0,a.Z)(["\n flex: 0 0 auto;\n white-space: pre;\n overflow-y: auto;\n overflow-x: auto;\n max-height: 10em;\n max-width: 500px;\n min-width: auto;\n @media (max-width: ","px) {\n max-width: 90%;\n max-height: 30vh;\n }\n"])),(e=>e.theme.breakpoints.values.md))},66436:(e,t,n)=>{n.d(t,{Z:()=>l});var o,a=n(71171),s=n(33518),r=n(96266);function l(e){let{children:t}=e;return(0,r.jsx)(i,{children:t})}const i=s.Z.div(o||(o=(0,a.Z)(["\n color: #1dc1c7;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])))},11476:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(5057),a=n(77277),s=n(31853),r=n(11397),l=n.n(r),i=n(34937),c=n(10155);const d=l()("@abtnode/webapp:launch-blocklet:runtime-state"),p=Object.keys(a.BlockletStatus),u=Object.values(a.BlockletStatus),h=Object.values(a.BlockletEvents).filter((e=>![a.BlockletEvents.purchaseChange,a.BlockletEvents.domainStatus].includes(e))),m=(e,t)=>{var n;return(null===e||void 0===e?void 0:e.appDid)===t||(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.did)===t},f=8e3,x=2e3;function g(e){const t=(0,c.Z)(),n=(0,i.ZP)(),a=(0,o.useRef)(null),r=()=>{e&&!a.current&&(a.current=setInterval((()=>{e&&(d("polling blocklet state"),v())}),x))},[l,g]=(0,s.Z)({status:null,eventName:"",runtimeBlocklet:null,error:"",isGetBlocklet:!1,startPolling:r,stopPolling:()=>{a.current&&clearInterval(a.current)}}),v=()=>{t.getBlocklet({input:{did:e,attachRuntimeInfo:!0}}).then((e=>{g({status:e.blocklet?e.blocklet.status:"",eventName:"",runtimeBlocklet:e.blocklet,isGetBlocklet:!0})})).catch((e=>{console.error("get blocklet failed",e)}))};(0,o.useEffect)((()=>{let t=null;return e&&(d("schedule polling blocklet state"),t=setTimeout((()=>{r()}),f)),()=>{t&&clearInterval(t)}}),[e]),(0,o.useEffect)((()=>{e?null===l.status&&(d("polling blocklet state on start"),v()):g({status:"",eventName:"",runtimeBlocklet:null})}),[e,l.status]);const k=t=>n=>{if(m(n,e)){const e={status:null,eventName:t,runtimeBlocklet:n,isGetBlocklet:!1};if(n.error)d("blocklet error",{blockletEventName:t,error:n.error}),e.status="error",e.error=n.error;else{const o=p[u.indexOf(n.status)];d("blocklet event",{blockletEventName:t,status:o}),o&&(e.status=o)}g(e)}};for(const s of h)(0,o.useEffect)((()=>{const t=k(s);return e&&n.on(s,t),()=>{e&&n.off(s,t)}}),[e]);return l}},53389:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ut});var o,a=n(71171),s=n(5057),r=n(53616),l=n.n(r),i=n(85493),c=n(6352),d=n.n(c),p=n(21371),u=n(72904),h=n(33518),m=n(68420),f=n(63902),x=n(51703),g=n(12073),v=n(10866),k=n(4456),w=n(99641),y=n(4651),b=n(14491),j=n(25339),A=n(75793),Z=n(2660),E=n(39948),S=n(19577),C=n(2478),P=n(44067),B=n(28726),T=n(42876),D=n(55898),R=n(96266);function M(e){let{children:t,selected:n}=e;return(0,R.jsxs)(L,{children:[t,(0,R.jsx)(E.Z,{className:"selected-container ".concat(n?"selected":""),children:(0,R.jsx)(T.default,{className:"selected-icon"})})]})}const L=(0,h.Z)(E.Z)(o||(o=(0,a.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));M.propTypes={children:D.node.isRequired,selected:D.bool},M.defaultProps={selected:!1};var N=n(67654),F=n(65873),Q=n(94639);const U=(0,s.createContext)({}),{Provider:O,Consumer:G}=U;function I(e){let{children:t}=e;const{t:n}=(0,m.PE)(),[o,a]=(0,N.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[r,l]=(0,N.Z)("selectedSpaceGatewayForRestore",o.find((e=>"https://www.didspaces.com/app"===e.url)));return(0,s.useEffect)((()=>{!async function(){const e=await Promise.all(o.map((async e=>{var t;const{data:n}=await Q.Z.get(d()(e.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((e=>(console.error(e),{data:{}}))),o=null!==(t=n.appName)&&void 0!==t?t:e.name;return(0,F.merge)(e,{name:o})})));a(e)}()}),[]),(0,R.jsx)(O,{value:{spaceGateways:o,selectedSpaceGateway:r,addSpaceGateway:e=>{const t=o.find((t=>e.url===t.url));if(t)throw new Error(n("storage.spaces.gateway.add.duplicate",{name:t.name}));a((()=>[...o,(0,F.cloneDeep)(e)])),l(e)},deleteSpaceGateway:e=>{if(e.url===r.url)throw new Error(n("storage.spaces.gateway.delete.failedForSelected"));a((()=>o.filter((t=>t.url!==e.url))))},handleSelectSpaceGateway:e=>{l(e)}},children:t})}I.defaultProps={};var J=n(92877),z=n(11750),H=n(83580),X=n(94552),K=n(67680),Y=n(19778),W=n(47595),_=n(60939),V=n(86229),q=n(72443),$=n.n(q);function ee(e){let{spaceGateway:t,onDeleteSpaceGateway:n}=e;const{t:o}=(0,m.PE)(),[a,r]=(0,s.useState)(!1),[l,i]=(0,s.useState)(!1),c=(e,t)=>{null===e||void 0===e||e.stopPropagation(),r(t)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K.Z,{size:"small",onClick:e=>c(e,!0),children:(0,R.jsx)(W.default,{})}),(0,R.jsx)(_.Z,{title:o("common.delConfirmDescription",{data:"".concat(null===t||void 0===t?void 0:t.name)}),open:a,confirmButton:{text:o("common.confirm"),props:{variant:"contained",color:"error",loading:l}},cancelButton:{text:o("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),i(!0),await n(t),r(!1)}catch(a){console.error(a),V.Z.error("".concat(o("storage.spaces.gateway.delete.failed"),": ").concat($()(a)))}finally{i(!1)}},onCancel:e=>c(e,!1)})]})}ee.defaultProps={onDeleteSpaceGateway:()=>{}};const te=ee;var ne=n(95335);const oe=function(){const e=(0,ne.Z)(),t=(0,u.Z)(e.breakpoints.down("md"));return{minWidth:t?300:e.breakpoints.values.sm,isMobile:t}};var ae,se=n(74094);const re=(0,J.Z)((()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function le(e){let{spaceGateway:t,selected:n,onDeleteSpaceGateway:o,onSelectGateway:a,...s}=e;const r=re(),{t:l}=(0,m.PE)(),{isMobile:i}=oe();return(0,R.jsxs)(ie,{...s,children:[(0,R.jsx)(E.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,R.jsx)("img",{alt:t.name,src:d()(t.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,R.jsxs)(E.Z,{className:r.menuName,onClick:a,children:[(0,R.jsxs)(z.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===t||void 0===t?void 0:t.name," ",n&&(0,R.jsx)(Y.Z,{color:"primary",style:{marginLeft:"8px"},children:l("common.selected")})]}),(0,R.jsx)(z.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(i?(0,se.aS)(null===t||void 0===t?void 0:t.url,38):null===t||void 0===t?void 0:t.url)})]}),(0,R.jsxs)(H.Z,{children:[(0,R.jsx)(K.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"small",children:(0,R.jsx)(X.Z,{})}),!0!==(null===t||void 0===t?void 0:t.protected)&&(0,R.jsx)(te,{spaceGateway:t,onDeleteSpaceGateway:async()=>{await o(t)}})]})]})}const ie=(0,h.Z)(E.Z)(ae||(ae=(0,a.Z)(["\n display: flex;\n"])));le.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};var ce=n(13128),de=n(44846),pe=n(47020),ue=n(55372),he=n(88574),me=n(84584);function fe(e){let{onAddGateway:t,...n}=e;const{t:o,locale:a}=(0,m.PE)(),[r,l]=(0,s.useState)(""),[i,c]=(0,s.useState)(!1),[p,u]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),x=async()=>{try{c(!0);const e=await(0,me.Z3)(r,{withSearchParams:!1});if(!await(0,me.w2)(e))throw new Error(o("storage.spaces.gateway.add.invalidUrl"));const{data:n}=await Q.Z.get(d()(new URL(e).origin,"/__blocklet__.js?type=json")),a={name:n.appName,url:e,protected:!1};await t(a),V.Z.success(o("storage.spaces.addedWithName",{name:a.name})),u(!1)}catch(e){f("".concat(o("storage.spaces.gateway.add.failed",a),": ").concat($()(e)))}finally{c(!1)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{size:"middle",color:"primary",variant:"outlined",onClick:()=>u(!0),...n,children:o("storage.spaces.gateway.add.title")}),(0,R.jsxs)(ce.ZP,{title:o("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>u(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{onClick:e=>{e.stopPropagation(),u(!1)},color:"inherit",children:o("common.cancel")}),(0,R.jsxs)(B.Z,{onClick:e=>{e.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",disabled:i||!r,variant:"contained",autoFocus:!0,children:[i&&(0,R.jsx)(de.Z,{size:16}),o("common.confirm")]})]}),children:[(0,R.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,R.jsx)(ue.Z,{component:"div",children:(0,R.jsx)(z.Z,{component:"div",children:(0,R.jsx)(pe.Z,{label:o("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:r,onChange:e=>{f(null),l(e.target.value)},disabled:i,onKeyPress:async e=>{"Enter"===e.key&&(e.preventDefault(),await x())},autoFocus:!0})})})}),!!h&&(0,R.jsx)(he.Z,{type:"error",style:{width:"100%"},children:h})]})]})}fe.defaultProps={onAddGateway:()=>{}};const xe=fe;function ge(e){let{onConnect:t,...n}=e;const{spaceGateways:o,selectedSpaceGateway:a,handleSelectSpaceGateway:r,addSpaceGateway:l,deleteSpaceGateway:i}=(0,s.useContext)(U),{t:c}=(0,m.PE)(),d=async e=>{await i(e)};return(0,R.jsxs)(E.Z,{...n,children:[(0,R.jsx)(S.Z,{children:o.map((e=>{const t=(null===e||void 0===e?void 0:e.url)===a.url;return(0,R.jsx)(M,{selected:t,children:(0,R.jsx)(C.ZP,{button:!0,selected:t,"data-cy":"get-space-endpoint-for-restore",children:(0,R.jsx)(P.Z,{children:(0,R.jsx)(le,{spaceGateway:e,onDeleteSpaceGateway:d,selected:t,onSelectGateway:()=>(e=>{r(e)})(e)})})},e.url)})}))}),(0,R.jsxs)(E.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,R.jsx)(xe,{onAddGateway:async e=>{await l(e)}}),(0,R.jsx)(B.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:()=>{t(a)},children:c("storage.spaces.connect.now")})]})]})}ge.defaultProps={onConnect:()=>{}};const ve=ge;var ke;const we=(0,h.Z)("div")(ke||(ke=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));const ye=function(){const{info:e}=(0,A.h6)(),{t:t,locale:n}=(0,s.useContext)(m.RD),o=(0,s.useMemo)((()=>e?(0,y.RU)(e):""),[e]);return(0,R.jsx)(I,{children:(0,R.jsxs)(we,{children:[(0,R.jsx)(Z.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsx)(E.Z,{display:"flex",justifyContent:"center",children:(0,R.jsx)(ve,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:e=>{const t=new URL(d()(e.url,"restore")),a=d()(o,"blocklets/restore/verify-ownership");t.searchParams.set("redirectUrl",a),t.searchParams.set("locale",n),window.location.href=t.toString()}})})]})})};var be,je=n(15849),Ae=n(73545),Ze=n(43316),Ee=n(17450),Se=n(38898),Ce=n(39463),Pe=n(70461),Be=n(31853),Te=n(13455),De=n(13932),Re=n(31910),Me=n(93040);const Le=(0,h.Z)("div")(be||(be=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ne="verify-app-ownership-spaces";const Fe=function(){const{session:e}=(0,Ae.T)(),[t]=(0,je.useSearchParams)(),{t:n}=(0,m.PE)(),{api:o,info:a}=(0,A.h6)(),{api:r}=(0,Ae.T)(),{meta:l}=(0,Re.J_)(),c=(0,i.useNavigate)(),p=(0,s.useMemo)((()=>a?(0,y.RU)(a):""),[a]),[u,h]=(0,Be.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),f=t.get("launchType"),x=t.get("nftId"),g=t.get("chainHost"),v=t.get("from"),k=t.get("blocklet_meta_url"),w=t.get("launcherSessionId")||"",b=t.get("launcherUrl")||"",j=(e=>{const t=e.split("/").filter(Boolean);return t[t.length-2]})(l.spaceEndpoint),S=(0,Ce.getServerAuthMethod)(a,f,w,e.user),C=async(t,n)=>{const o=Array.isArray(t)?t.find((e=>!!e.sessionToken)):t;null!==o&&void 0!==o&&o.sessionToken&&((0,se.ZB)(n(o.sessionToken)),await e.refresh()),h({isConnectOpen:!1}),setTimeout((()=>{const e=new URLSearchParams({appDid:j});[{name:"launchType",value:f},{name:"nftId",value:x},{name:"from",value:v},{name:"blocklet_meta_url",value:k},{name:"chainHost",value:g}].forEach((t=>{let{name:n,value:o}=t;o&&e.set(n,o)})),c("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0)},P=async function(){var t,a,s;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!i){if(u.shouldReconnect)return void(window.location.href=d()(p,"blocklets/restore/connect-space"));if(e.user){const e=await o.getBlocklet({input:{did:j,attachRuntimeInfo:!0}});if(e.blocklet){const t=await(0,Me.DB)(e.blocklet);if(t){const n=new URL(t);"running"!==e.blocklet.status&&n.searchParams.set("__start__","1"),h({shouldReconnect:!0,exists:!0,accessUrl:n.href})}return}}}if("nft"===S){var c,m,v;const e=new URL(window.location.href);e.pathname=d()(null!==(c=null===(m=window)||void 0===m||null===(v=m.env)||void 0===v?void 0:v.apiPrefix)&&void 0!==c?c:"/","/api/did/".concat(Ne,"/token")),e.searchParams.set("appDid",j),e.searchParams.set("endpoint",l.spaceEndpoint),e.searchParams.set("referrer",window.location.href),e.searchParams.set("nftId",x),e.searchParams.set("appPid",l.did);const t={autoConnect:!1,launchType:f,nftId:x};g&&(e.searchParams.set("chainHost",g),t.chainHost=g),i&&e.searchParams.set("overwrite","1");const{data:o}=await r.get(e.href);return o.error?void V.Z.error(o.error):(t.nw=o.url,void h({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:t},connectMessages:{title:n("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:n("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:n("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:n("blocklet.restoreFromSpaces.nftAuthDialog.success")}}))}if("launcher"===S){const{launcherSession:e,error:t}=await o.getLauncherSession({input:{launcherUrl:b,launcherSessionId:w}});return void(e?h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:i?"1":void 0,launcherUrl:b,launcherSessionId:w,chainHost:g}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}}):V.Z.error("Launch session invalid: ".concat(t)))}if("session"===S)return void h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,overwrite:i?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}});const k=new URL(window.location.href);k.pathname=d()(null!==(t=null===(a=window)||void 0===a||null===(s=a.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ne,"/token")),k.searchParams.set("appDid",j),k.searchParams.set("appPid",l.did),k.searchParams.set("endpoint",l.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("restoreFrom","spaces");const{data:y}=await r.get(k.href);e.login(C,{nw:y.url,openMode:"popup"})};return(0,s.useEffect)((()=>{P()}),[]),(0,R.jsxs)(Le,{children:[(0,R.jsx)(Z.Z,{title:n("blocklet.restoreBlocklet.verify.title"),subTitle:n("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Te.Z,{blocklet:{meta:l},blockletMetaUrl:k}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:l.title}),(0,R.jsx)(Ee.Z,{did:j})]}),u.exists&&u.accessUrl&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:n("blocklet.restoreBlocklet.verify.exists")}),(0,R.jsxs)(z.Z,{component:"div",sx:{marginTop:"32px"},children:[u.accessUrl&&(0,R.jsx)(B.Z,{variant:"contained",component:Se.Z,href:u.accessUrl,sx:{width:"160px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.open")}),(0,R.jsx)(B.Z,{variant:"contained",color:"error",onClick:()=>{h({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:n("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!u.exists&&(0,R.jsx)(B.Z,{variant:"contained",disabled:u.isConnectOpen,onClick:P,sx:{width:"180px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.".concat(u.shouldReconnect?"reconnect":"verify"))})]}),u.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:j,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:u.connectData.action,checkFn:r.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(a),onSuccess:C,extraParams:u.connectData.extraParams,messages:u.connectMessages,onClose:()=>{h({isConnectOpen:!1})}}),u.isConfirmOpen&&(0,R.jsx)(Pe.Z,{color:"error",title:n("blocklet.restoreBlocklet.overwrite.title"),description:n("blocklet.restoreBlocklet.overwrite.description"),confirm:n("common.confirm"),onCancel:()=>{h({isConfirmOpen:!1})},onConfirm:()=>{h({isConfirmOpen:!1,isOverwrite:!0}),P(!0)}})]})};var Qe,Ue=n(55309);const Oe=(0,h.Z)(Ue.Z)(Qe||(Qe=(0,a.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"])));var Ge,Ie,Je,ze=n(35266),He=n(77277),Xe=n(77429),Ke=n(75506),Ye=n.n(Ke),We=n(50482),_e=n.n(We),Ve=n(11397),qe=n.n(Ve),$e=n(11476),et=n(34937),tt=n(66436);const nt=qe()("@abtnode/webapp:restore-blocklet:step-install"),ot=(0,h.Z)("div")(Ge||(Ge=(0,a.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),at=h.Z.div(Ie||(Ie=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(e=>e.theme.palette.grey[500])),st={[He.RESTORE_PROGRESS_STATUS.waiting]:0,[He.RESTORE_PROGRESS_STATUS.start]:1,[He.RESTORE_PROGRESS_STATUS.importData]:2,[He.RESTORE_PROGRESS_STATUS.downloading]:3,[He.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[He.RESTORE_PROGRESS_STATUS.installing]:5,[He.RESTORE_PROGRESS_STATUS.completed]:10};const rt=(0,h.Z)(E.Z)(Je||(Je=(0,a.Z)(["\n padding-top: 24px;\n"]))),lt=function(){var e,t,n,o;const a=new URL(window.location.href),r=a.searchParams.get("appDid"),l=a.searchParams.get("launchType"),i=a.searchParams.get("nftId"),c=a.searchParams.get("fromLauncher"),d=a.searchParams.get("from"),p=a.searchParams.get("chainHost"),u=function(e){let{appDid:t}=e;const[n,o]=(0,s.useState)(He.RESTORE_PROGRESS_STATUS.waiting),a=(0,et.ZP)();return a.connect(),(0,s.useEffect)((()=>(a.on(He.BlockletEvents.restoreProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o(e)})),()=>{a.off(He.BlockletEvents.restoreProgress)})),[t,a]),n}({appDid:r}),[h,f]=(0,s.useState)(0),x=(0,s.useRef)(null),{meta:g}=(0,Re.J_)(),{t:v}=(0,m.PE)(),{api:k,info:w}=(0,A.h6)(),[b,j]=(0,Be.Z)({nextAccessUrl:"",installError:null}),E=(0,$e.Z)(r),{status:S,eventName:C}=E,P=()=>{f(12),x.current&&(clearTimeout(x.current),x.current=null),x.current=setTimeout((()=>{k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{e.blocklet&&M(e.blocklet)}))}),500)},T=()=>{var e,t;null!==E&&void 0!==E&&null!==(e=E.runtimeBlocklet)&&void 0!==e&&null!==(t=e.settings)&&void 0!==t&&t.initialized?f(11):P()},D=[v("blocklet.restoreFromSpaces.progress.waiting"),v("blocklet.restoreFromSpaces.progress.restoring"),v("blocklet.restoreFromSpaces.progress.importData"),v("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===u||void 0===u||null===(t=u.data)||void 0===t?void 0:t.completed)&&void 0!==e?e:100,"/").concat(null!==(n=null===u||void 0===u||null===(o=u.data)||void 0===o?void 0:o.total)&&void 0!==n?n:100)}),v("blocklet.restoreFromSpaces.progress.importSuccess"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.verifying"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.extracting"),v("upgrading"===S?"common.upgrading":"launchBlocklet.waiting.installing"),v("launchBlocklet.waiting.installed"),v("launchBlocklet.waiting.starting"),v("launchBlocklet.waiting.done")];(0,s.useEffect)((()=>{if(u.status===He.RESTORE_PROGRESS_STATUS.error){const e={message:u.message,name:"restoreFailed",action:"retryRestore"};return _e()(e,b.installError)||V.Z.error($()(e)),void j({installError:e})}f(st[u.status]||0)}),[u.status]),(0,s.useEffect)((()=>{if("serverless"!==l||C!==He.BlockletEvents.nftConsumed)switch(S){case"waiting":f(6);break;case"downloading":f(7);break;case"installing":case"upgrading":f(8);break;case"installed":if("serverless"===l&&!(0,Me.MZ)(E))break;T();break;case"starting":f(11);break;case"running":f(12),P();break;case"stopped":P();break;case"corrupted":case"error":{var e;null===E||void 0===E||E.stopPolling();const t={message:null===E||void 0===E||null===(e=E.error)||void 0===e?void 0:e.message,name:null===E||void 0===E?void 0:E.eventName,action:"retryRestore"},n=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!_e()(t,b.installError)&&null!==E&&void 0!==E&&null!==(e=E.error)&&void 0!==e&&e.message&&V.Z.error($()(E.error)),j({installError:t,...n})};k.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{var o;let{blocklet:a}=e;null!==a&&void 0!==a&&null!==(o=a.settings)&&void 0!==o&&o.initialized&&(t.action="retryStart"),n()})).catch((()=>{n()}))}}else T()}),[S,C,E]);const M=async e=>{const t=await(0,Me.DB)(e);if(Ye()(t))return;const n=new URL(t);n.searchParams.set("serverUrl",(0,y.RU)(w)),"running"!==e.status&&n.searchParams.set("__start__","1"),c&&n.searchParams.set("fromLauncher",c),d&&n.searchParams.set("from",d),l&&n.searchParams.set("launchType",l),i&&n.searchParams.set("nftId",i),p&&n.searchParams.set("chainHost",p),null===E||void 0===E||E.stopPolling(),j({nextAccessUrl:n.href,status:e.status,resultMessage:"running"===e.status?{variant:"success",title:v("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:v("common.open")}:{variant:"info",title:v("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:v("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:v("common.configuration")}})};if(b.installError){const e={retryRestore:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:je.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:v("common.retry")}),retryStart:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>(async()=>{j({installError:null,nextAccessUrl:""}),await k.startBlocklet({input:{did:r}}),null===E||void 0===E||E.startPolling()})(),children:v("common.retry")})},t=b.installError.name?b.installError.name.replace("blocklet.",""):"installFailed";return(0,R.jsx)(Oe,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,R.jsxs)(at,{children:[(0,R.jsx)("div",{children:v("launchBlocklet.error.".concat(t))}),b.installError.message&&(0,R.jsx)("div",{className:"error-desc",children:v("common.errorMessage")+b.installError.message})]}),footer:(0,R.jsxs)(rt,{children:[e[b.installError.action],"serverless"===l&&(0,R.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:v("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}const L=!!b.nextAccessUrl;return nt("render",{status:S,eventName:C,launchType:l,runtimeBlockletState:E,state:b}),(0,R.jsxs)(ot,{children:[!L&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z.Z,{title:v("blocklet.restoreBlocklet.restore.title"),subTitle:v("blocklet.restoreFromSpaces.restore.subTitle")}),(0,R.jsxs)(tt.Z,{children:[(0,R.jsx)(ze.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,R.jsx)(Xe.Z,{steps:D,stepIndex:h,autoGrowth:10===h?1e3:4e3})}),[5,7,8].includes(h)&&(0,R.jsx)(De.Z,{appDid:r})]})]}),L&&(0,R.jsx)(Oe,{variant:b.resultMessage.variant,title:b.resultMessage.title,subTitle:b.resultMessage.subTitle,footer:(0,R.jsx)(rt,{children:(0,R.jsx)(B.Z,{variant:"contained",style:{width:"200px"},component:Se.Z,href:b.nextAccessUrl,children:b.resultMessage.footer})})})]})};const it=function(){return(0,R.jsx)(lt,{})};var ct,dt,pt,ut=n(23484);function ht(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),a=(0,ut.Z)(),{meta:r}=(0,Re.J_)(),c=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),h=(0,b.yP)(o),Z=d()((0,b.Y5)(),"/blocklets/restore"),E=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(Z,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:d()(Z,"restore-blocklet")}];let S=[];S="launcher"===l()(a.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...E]:[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:d()(Z,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")},...E];const C=(0,R.jsx)(xt,{className:"".concat(c?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{c&&window.open(c)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:S,children:(0,R.jsx)(f.Z,{blockletMeta:r,locale:n,useOfSkeleton:!1,navLogo:C,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:h,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===r||void 0===r?void 0:r.logo,children:(0,R.jsxs)(ft,{children:[(0,R.jsx)(p.Global,{styles:mt}),(0,R.jsxs)(i.Routes,{children:[(0,R.jsx)(i.Route,{path:"connect-space",element:(0,R.jsx)(ye,{})}),(0,R.jsx)(i.Route,{path:"verify-ownership",element:(0,R.jsx)(Fe,{})}),(0,R.jsx)(i.Route,{path:"restore-blocklet",element:(0,R.jsx)(it,{})}),(0,R.jsx)(i.Route,{path:"*",element:(0,R.jsx)(i.Navigate,{to:"connect-space",replace:!0})})]})]})})})}const mt=(0,p.css)(ct||(ct=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),ft=h.Z.div(dt||(dt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),xt=h.Z.div(pt||(pt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));var gt,vt,kt,wt=n(83294),yt=n(72333),bt=n(25710);function jt(e){let{onSelect:t}=e;const{api:n}=(0,A.h6)(),{t:o,locale:a}=(0,m.PE)(),[r,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)([]),[p,u]=(0,s.useState)(""),[h,f]=(0,s.useState)(null),x=(0,i.useNavigate)();(0,s.useEffect)((()=>{(async()=>{try{l(!0),f(!1);const{getBlocklets:{blocklets:e},getBlockletsFromBackup:{backups:t}}=await n.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});d((t||[]).filter((t=>!(e||[]).some((e=>{var n;return t.appPid===(null===(n=e.meta)||void 0===n?void 0:n.did)})))).sort(((e,t)=>t.createdAt-e.createdAt)).slice(0,200)),l(!1)}catch(e){l(!1),f(e.message)}})()}),[]);let g=null;return g=h?(0,R.jsx)(he.Z,{type:"error",style:{width:"100%",marginTop:8},children:h}):r?(0,R.jsx)(de.Z,{size:16}):c.length?(0,R.jsx)(Zt,{children:c.map((e=>(0,R.jsxs)(Et,{className:"middle-font-size space ".concat(p===e.appDid?"selected":""),onClick:()=>(e=>{u(e.appDid)})(e),children:[(0,R.jsxs)("div",{className:"left",children:[(0,R.jsx)("div",{className:"header",children:(0,R.jsx)(E.Z,{sx:{width:40,height:40},children:(0,R.jsx)(yt.Z,{did:e.appDid,size:40})})}),(0,R.jsxs)("div",{className:"body",children:[(0,R.jsx)(z.Z,{className:"text",children:e.name}),(0,R.jsx)(z.Z,{className:"text middle-font-size",children:(0,R.jsx)(Ee.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,R.jsxs)(E.Z,{color:"text.secondary",className:"footer small-font-size",children:[o("blocklet.restoreFromServer.backupIn")," ",(0,b.B2)(e.createdAt,a)]})]}),(0,R.jsx)("div",{className:"right",children:(0,R.jsx)("div",{className:"more",children:(0,R.jsx)(K.Z,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:(0,R.jsx)(wt.Z,{color:"disabled"})})})}),(0,R.jsx)("div",{className:"selected-container",children:(0,R.jsx)(T.default,{className:"selected-icon"})})]},e.appDid)))}):(0,R.jsx)(bt.Z,{children:o("common.empty")}),(0,R.jsxs)(At,{style:{width:"100%"},children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreFromServer.selectTitle"),subTitle:o("blocklet.restoreFromServer.description")}),(0,R.jsx)(E.Z,{mt:4,mx:3,className:"main-body",children:g}),(0,R.jsx)(E.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,R.jsx)(B.Z,{sx:{width:"180px",height:"100%"},onClick:e=>{e.stopPropagation(),(()=>{const e=c.find((e=>e.appDid===p));t({did:e.appDid,name:e.appDid,title:e.name});const n=new URL(window.location.href);n.searchParams.set("appDid",e.appDid),n.searchParams.set("appName",e.name),x("/blocklets/restore/verify-ownership".concat(n.search))})()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:r||h||!p,children:o("common.restore")})})]})}jt.defaultProps={onSelect:()=>{}};const At=(0,h.Z)(E.Z)(gt||(gt=(0,a.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md"))),Zt=(0,h.Z)(E.Z)(vt||(vt=(0,a.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),Et=(0,h.Z)("div")(kt||(kt=(0,a.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var St,Ct=n(95712);const Pt=(0,h.Z)("div")(St||(St=(0,a.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Bt="verify-app-ownership-disk";const Tt=function(){const e=new URL(window.location.href),t=e.searchParams.get("appDid"),n=e.searchParams.get("appName"),{t:o}=(0,m.PE)(),{api:a,info:r}=(0,A.h6)(),{session:l,api:i}=(0,Ae.T)(),c=(0,s.useMemo)((()=>r?(0,y.RU)(r):""),[r]),[p,u]=(0,Be.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),h=()=>{u({connectData:{isConnectOpen:!1}}),setTimeout((()=>{const e=new URL(d()(c,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)},f=async()=>{if(l.user)await(async()=>{if((await a.getBlocklet({input:{did:t}})).blocklet)return V.Z.error("Blocklet ".concat(n,"(").concat(t,") already exists")),void u({shouldReconnect:!0});u({connectData:{isConnectOpen:!0,action:Bt,extraParams:{appDid:t,restoreFrom:"disk"}}})})();else{var e,o,s;const n=new URL(window.location.href);n.pathname=d()(null!==(e=null===(o=window)||void 0===o||null===(s=o.env)||void 0===s?void 0:s.apiPrefix)&&void 0!==e?e:"/","/api/did/".concat(Bt,"/token")),n.searchParams.set("appDid",t),n.searchParams.set("restoreFrom","disk");const{data:a}=await i.get(n.href);l.login(h,{nw:a.url,openMode:"popup"})}};return(0,s.useEffect)((()=>{f()}),[]),(0,R.jsxs)(Pt,{children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreBlocklet.verify.title"),subTitle:o("blocklet.restoreBlocklet.verify.subTitle")}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Ct.Z,{did:t,size:128}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(z.Z,{variant:"body2",children:n}),(0,R.jsx)(Ee.Z,{did:t})]}),(0,R.jsx)(B.Z,{variant:"contained",disabled:p.connectData.isConnectOpen,onClick:f,sx:{width:"180px",height:"100%"},children:o("blocklet.restoreBlocklet.verify.".concat(p.shouldReconnect?"reconnect":"verify"))})]}),p.connectData.isConnectOpen&&(0,R.jsx)(De.Z,{appDid:t,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:p.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:p.connectData.action,checkFn:i.get,checkTimeout:3e5,webWalletUrl:(0,se.yP)(r),onSuccess:h,extraParams:p.connectData.extraParams,messages:{title:o("blocklet.restoreBlocklet.verify.title"),scan:o("blocklet.restoreBlocklet.verify.scan"),confirm:o("blocklet.restoreBlocklet.verify.confirm"),success:o("blocklet.restoreBlocklet.verify.success")},onClose:()=>{u({connectData:{isConnectOpen:!1}})}})]})};var Dt,Rt,Mt;function Lt(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),{meta:a,setMeta:r}=(0,s.useState)({}),l=(0,s.useMemo)((()=>o?(0,y.RU)(o):""),[o]),c=(0,b.yP)(o),h=d()((0,b.Y5)(),"/blocklets/restore"),Z=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:d()(h,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(h,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:d()(h,"restore-blocklet")}],E=(0,R.jsx)(Qt,{className:"".concat(l?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{l&&window.open(l)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(k.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:Z,children:(0,R.jsx)(f.Z,{blockletMeta:{...a,registryUrl:""},locale:n,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:c,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===a||void 0===a?void 0:a.logo,children:(0,R.jsxs)(Ft,{children:[(0,R.jsx)(p.Global,{styles:Nt}),(0,R.jsxs)(i.Routes,{children:[(0,R.jsx)(i.Route,{path:"select",element:(0,R.jsx)(jt,{onSelect:r})}),(0,R.jsx)(i.Route,{path:"verify-ownership",element:(0,R.jsx)(Tt,{})}),(0,R.jsx)(i.Route,{path:"restore-blocklet",element:(0,R.jsx)(it,{})}),(0,R.jsx)(i.Route,{path:"*",element:(0,R.jsx)(i.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}const Nt=(0,p.css)(Dt||(Dt=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Ft=h.Z.div(Rt||(Rt=(0,a.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),Qt=h.Z.div(Mt||(Mt=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Ut(){const{search:e}=window.location;return e.includes("restoreFrom=server")?(0,R.jsx)(Lt,{}):(0,R.jsx)(ht,{})}},99641:(e,t,n)=>{n.d(t,{Z:()=>d});var o,a,s=n(71171),r=n(55898),l=n.n(r),i=n(33518),c=n(96266);function d(e){let{logo:t,name:n,subname:o,previousData:a,...s}=e,r=(0,c.jsx)(p,{logo:t}),l=n,i=o;return a.logo&&(r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{logo:t,className:"left-fade-in-ele"}),(0,c.jsx)(p,{logo:a.logo,className:"postion-abs left-fade-out-ele"})]})),a.name&&a.name!==n&&(l=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:n}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.name})]})),a.subname&&a.subname!==o&&(i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:o}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:a.subname})]})),(0,c.jsx)(h,{...s,children:(0,c.jsxs)("div",{className:"logo-inner",children:[(0,c.jsx)("div",{className:"logo-img-content",children:r}),(0,c.jsxs)("div",{className:"logo-info ".concat(n||o?"":"zero-left"),children:[(0,c.jsx)("div",{className:"logo-name",children:l}),(0,c.jsx)("div",{className:"logo-subname",children:i})]})]})})}function p(e){let{logo:t,...n}=e;return(0,c.jsx)(u,{...n,children:t})}d.propTypes={logo:l().element.isRequired,name:l().string,subname:l().string,previousData:l().object},d.defaultProps={name:"",subname:"",previousData:{logo:"",name:"",subname:""}};const u=i.Z.div(o||(o=(0,s.Z)(["\n display: block;\n > * {\n display: block;\n }\n"]))),h=i.Z.div(a||(a=(0,s.Z)(["\n position: relative;\n display: block;\n\n .logo-inner {\n display: flex;\n align-items: center;\n height: 100%;\n .logo-img-content {\n position: relative;\n display: block;\n }\n .logo-info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 10px;\n letter-spacing: 0.1px;\n &.zero-left {\n margin-left: 0%;\n }\n .logo-name {\n position: relative;\n line-height: 16px;\n font-size: 16px;\n color: #121319;\n }\n .logo-subname {\n position: relative;\n line-height: 13px;\n font-size: 13px;\n color: #7d8085;\n }\n }\n }\n\n .postion-abs {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n }\n\n .right-fade-out-ele {\n animation: right-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .right-fade-in-ele {\n animation: right-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes right-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n }\n\n @keyframes right-fade-in {\n 0% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n\n .left-fade-out-ele {\n animation: left-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .left-fade-in-ele {\n animation: left-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes left-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n }\n\n @keyframes left-fade-in {\n 0% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n"])))},60344:(e,t,n)=>{n.d(t,{hi:()=>s,od:()=>a.a});var o=n(10458),a=n.n(o);a().defaults.timeout=1e4;const s=a().create()},84584:(e,t,n)=>{n.d(t,{EJ:()=>v,Jf:()=>g,LQ:()=>p,Nb:()=>u,UV:()=>k,Xv:()=>c,Z3:()=>w,ag:()=>m,mo:()=>h,nD:()=>d,nU:()=>x,w2:()=>f});var o=n(82434),a=n.n(o),s=n(77277),r=n(65873),l=n(2842),i=n(60344);function c(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),o=n.at(-4),a=n.at(-2);return(0,l.xn)(t,"space",o,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,l.xn)(t,"space",n)}function p(e){return e.replace(/\/$/,"").split("/").at(-4)}async function u(e){try{if(!a()(e))return!1;const{headers:t}=await i.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function h(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function m(e){const t=new URL(e);return(0,l.xn)(t.origin,t.pathname)}async function f(e){try{if(!a()(e))return!1;const t=m(e),n=(0,l.xn)(t,"space/api/did/one-click-authorization/token"),{status:o,data:s}=await i.hi.get(n,{timeout:5e3});return 200===o&&(0,r.isObject)(s)}catch(t){return console.error(t),!1}}async function x(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!a()(e))return"";const{headers:n}=await i.hi.head(e,{timeout:t}),o=n["x-space-name"];return o?decodeURIComponent(o):""}catch(n){return console.error(n),""}}function g(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,l.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const v=e=>{var t,n;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(n=t.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null};async function k(e){const t={};return t.did=p(e),t.name=await x(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function w(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,r.isString)(e))throw new Error("url(".concat(e,") must be a string"));const o=e.startsWith("http")?e:"https://".concat(e),a=new URL(o),{data:s}=await i.hi.get((0,l.xn)(a.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),c=null===(t=s.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!c)throw new Error("MountPoint(".concat(c,") not found"));const d=(0,l.xn)(a.origin,c);return n.withSearchParams&&a.searchParams.get("spaceDid")?(0,l.xn)(d,"?spaceDid=".concat(a.searchParams.get("spaceDid"))):d}}}]);