@abtnode/blocklet-services 1.16.22 → 1.16.23-beta-f85576a6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Add-fjbSIcnc.js → Add-WOKsiMJk.js} +1 -1
- package/dist/assets/{Alert-nav821gk.js → Alert-sYFXq3Al.js} +1 -1
- package/dist/assets/{ArrowDropDown-HzxvBXz1.js → ArrowDropDown-H7oIyp0F.js} +1 -1
- package/dist/assets/{Autocomplete-FZ1Hog9u.js → Autocomplete-vDgjSkCK.js} +1 -1
- package/dist/assets/{Avatar-4W2iSGC-.js → Avatar-sPQLj-7K.js} +1 -1
- package/dist/assets/{ButtonGroup-qjjm6C6u.js → ButtonGroup-T2tPvlgZ.js} +1 -1
- package/dist/assets/{CardContent-hsa9cKyn.js → CardContent-hFzeKFHi.js} +1 -1
- package/dist/assets/{CheckCircle-htlybHjr.js → CheckCircle-ttstfmEU.js} +1 -1
- package/dist/assets/{ChevronRight-7cKIhy5z.js → ChevronRight-43UHN-z-.js} +1 -1
- package/dist/assets/{DeleteOutline-QxqDOFWu.js → DeleteOutline-e9e8OEcE.js} +1 -1
- package/dist/assets/{Done-ApQZxhfW.js → Done-E-Gh1lkh.js} +1 -1
- package/dist/assets/{Download-eudDXSjG.js → Download-ayiRETlJ.js} +1 -1
- package/dist/assets/{Edit-4h5n3zVg.js → Edit-lj_ebVEl.js} +1 -1
- package/dist/assets/{EditIcon-CEHYlrp-.js → EditIcon-vBYCcMT4.js} +1 -1
- package/dist/assets/{ExpandMore-JmnmUnd8.js → ExpandMore-205fwIPh.js} +1 -1
- package/dist/assets/{FilterList-rU96K2al.js → FilterList-kWJ_p-Xk.js} +2 -2
- package/dist/assets/{FormControl-U_6qW76h.js → FormControl-9fKakpMh.js} +1 -1
- package/dist/assets/FormControlLabel-EmYIE4Ks.js +1 -0
- package/dist/assets/{FormGroup-6byJTUh5.js → FormGroup-lOaPA6kB.js} +1 -1
- package/dist/assets/{Google-0MAQRWrd.js → Google-ik5OMx5W.js} +1 -1
- package/dist/assets/{Hidden-SKwxA9k1.js → Hidden-3SNT7G6f.js} +1 -1
- package/dist/assets/{Icon-9CFlKIHS.js → Icon-42MXOEvW.js} +1 -1
- package/dist/assets/{InfoOutlined-0GqWWO-f.js → InfoOutlined-fvTeaIHi.js} +1 -1
- package/dist/assets/{InputAdornment-iwL7P_Vm.js → InputAdornment-DhK5XGEl.js} +1 -1
- package/dist/assets/{InputLabel-qtx_TKpe.js → InputLabel-wK2bWpSD.js} +1 -1
- package/dist/assets/{LastPage-pHa4HGK_.js → LastPage-VBH3ZNA2.js} +1 -1
- package/dist/assets/{Launch-gJCQmpyL.js → Launch-Xygdj5kt.js} +1 -1
- package/dist/assets/{LaunchOutlined-WAN0Led7.js → LaunchOutlined-3Jpkcyko.js} +1 -1
- package/dist/assets/{ListItem-kYIyq9wN.js → ListItem-Mc-6Sx7a.js} +1 -1
- package/dist/assets/{LockIcon-e6UtCqfh.js → LockIcon-R_R57epV.js} +1 -1
- package/dist/assets/{Loop-PXldOGkJ.js → Loop-aSwEwGmw.js} +1 -1
- package/dist/assets/{MoreHoriz-1QS3N81v.js → MoreHoriz-3Yd91mwt.js} +1 -1
- package/dist/assets/{MoreVert-b_wUncc4.js → MoreVert-4y42cx0s.js} +1 -1
- package/dist/assets/{OpenInNew-cyQNIeON.js → OpenInNew-tmusoGGX.js} +1 -1
- package/dist/assets/{Pagination-yeBOKJgc.js → Pagination-AapFkNsX.js} +1 -1
- package/dist/assets/{PlayArrow-DsCR1WAD.js → PlayArrow-NomOs4fE.js} +1 -1
- package/dist/assets/{RadioGroup-MeoNWf5B.js → RadioGroup-ds0DRyXx.js} +1 -1
- package/dist/assets/{Search-pq50dDMP.js → Search-JFjur7RV.js} +1 -1
- package/dist/assets/{Select-1vnu6Wod.js → Select-gum5gwN9.js} +1 -1
- package/dist/assets/{ServerLogo-RRmp6mc-.js → ServerLogo-6ooEEYN8.js} +1 -1
- package/dist/assets/{Skeleton-bmmJmS0u.js → Skeleton-d1ARVMzl.js} +1 -1
- package/dist/assets/{Stepper-V9gE9w3-.js → Stepper-kfcuXM-6.js} +1 -1
- package/dist/assets/{TableRow-7b-DLFKT.js → TableRow-OmKn0_uE.js} +1 -1
- package/dist/assets/{TextField-HfFRez76.js → TextField-SIkk5GBD.js} +1 -1
- package/dist/assets/{Toolbar-z-FYIGbv.js → Toolbar-NMQzSDZI.js} +1 -1
- package/dist/assets/access-control-Azg2skw_.js +13 -0
- package/dist/assets/{actions-c_BF9d9e.js → actions-c-PXZIk7.js} +1 -1
- package/dist/assets/{add-component-core-cwUA8ONY.js → add-component-core-0mqZzfNI.js} +4 -4
- package/dist/assets/add-resource-UgWhIHuw.js +1 -0
- package/dist/assets/{addon-7yjXaIX_.js → addon-jPojDgo_.js} +1 -1
- package/dist/assets/{analytics-b1UCJ6Cn.js → analytics-HAGGLVM8.js} +8 -8
- package/dist/assets/api-vzG5R7gz.js +1 -0
- package/dist/assets/{audit-logs-poKE0OY8.js → audit-logs-CZDNePJG.js} +3 -3
- package/dist/assets/{button-lOeSUgmq.js → button-9FEeAZF5.js} +1 -1
- package/dist/assets/{click-to-copy-H2O9ZAs8.js → click-to-copy-z0bRySrb.js} +1 -1
- package/dist/assets/{complete--aJHmuMX.js → complete-5wmNK-Kr.js} +1 -1
- package/dist/assets/{component-O_4jZEKT.js → component-noCyoaJE.js} +16 -16
- package/dist/assets/{config-_s2-tqfS.js → config-3kWa06jg.js} +1 -1
- package/dist/assets/{config-Fxb0qTJ0.js → config-L7IY53NO.js} +1 -1
- package/dist/assets/{config-navigation-YoH5FRo8.js → config-navigation-l2UUL5GX.js} +11 -11
- package/dist/assets/confirm-VPAExB8S.js +7 -0
- package/dist/assets/{confirm-yusCbmM9.js → confirm-aWG4liTX.js} +1 -1
- package/dist/assets/{connect-91kkXTrG.js → connect-3nZsP0Y7.js} +1 -1
- package/dist/assets/{connect-tamQdAs3.js → connect-Ut_qUKGn.js} +1 -1
- package/dist/assets/{content-layout-P9P08qyU.js → content-layout-NQeupjc8.js} +1 -1
- package/dist/assets/{dashboard-wLNTNF45.js → dashboard-IqdH25X5.js} +8 -8
- package/dist/assets/{did-address-fR8IBME6.js → did-address-0zsr9FGE.js} +1 -1
- package/dist/assets/{did-utils-LIvwQDYN.js → did-utils-2mzsdPOz.js} +1 -1
- package/dist/assets/domain-LGO9FXxu.js +9 -0
- package/dist/assets/domain-list-o5CVt5cn.js +12 -0
- package/dist/assets/{exchange-passport-T-h-OnRN.js → exchange-passport-8-3A99qv.js} +1 -1
- package/dist/assets/{fallback-wCdaTD2t.js → fallback-eXgiG5Pr.js} +1 -1
- package/dist/assets/{format-error-iCYgDtF5.js → format-error-lyZJ-vR8.js} +1 -1
- package/dist/assets/{fuel-KNzdaW-g.js → fuel-MWRKFgDm.js} +1 -1
- package/dist/assets/{fullpage-JCH-m3GS.js → fullpage-HBGx7AXk.js} +1 -1
- package/dist/assets/{home-Po2ga9wZ.js → home-ZOyRqxG6.js} +1 -1
- package/dist/assets/{iframe-5bCtjLAp.js → iframe-UeX3-BnF.js} +1 -1
- package/dist/assets/{index-nNJj_XhL.js → index--pe7TOaI.js} +1 -1
- package/dist/assets/{index-2HiYYWCO.js → index-1UDTrmOX.js} +1 -1
- package/dist/assets/{index-R3dXtQXo.js → index-2z2N5UaY.js} +1 -1
- package/dist/assets/index-3pcwx4gz.js +57 -0
- package/dist/assets/{index-4MBFFo4b.js → index-4KpCdTmK.js} +1 -1
- package/dist/assets/{index-NURviigq.js → index-7CKFrXrK.js} +1 -1
- package/dist/assets/{index-3kUoZ2Ef.js → index-DxSli22q.js} +1 -1
- package/dist/assets/{index-KswRO1Cx.js → index-HFGXBlAK.js} +1 -1
- package/dist/assets/{index-ax5KBcO9.js → index-JDaNxIsV.js} +59 -8
- package/dist/assets/{index-FMCeh-OO.js → index-JaoLJlQo.js} +1 -1
- package/dist/assets/{index-C7hr4YV8.js → index-NIuSKnAA.js} +1 -1
- package/dist/assets/index-NKi4Ykg5.js +1 -0
- package/dist/assets/{index-nXJuMgJq.js → index-OinRqSU-.js} +1 -1
- package/dist/assets/index-Rx4AmqwM.js +37 -0
- package/dist/assets/index-YS2sbIaj.js +203 -0
- package/dist/assets/{index-hnUD7mNC.js → index-arjlRv-U.js} +1 -1
- package/dist/assets/{index-3S1MajfA.js → index-dGMkSc6M.js} +3 -3
- package/dist/assets/index-ensthqSY.js +262 -0
- package/dist/assets/{index-7N0uMPlx.js → index-etPzRhyP.js} +1 -1
- package/dist/assets/index-h9Qzr9Ij.js +54 -0
- package/dist/assets/{index-q4YuEk6Y.js → index-hGEyozRl.js} +1 -1
- package/dist/assets/{index-lnLE9M77.js → index-jFRsVOWf.js} +1 -1
- package/dist/assets/{index-dQP0j7rR.js → index-jkuqfE6z.js} +1 -1
- package/dist/assets/{index-uIKkPDx2.js → index-mBoNVAkF.js} +41 -41
- package/dist/assets/{index-FT9kP6qN.js → index-p7HYJjf1.js} +1 -1
- package/dist/assets/{index-GsSFMKbP.js → index-vQOHKZcI.js} +1 -1
- package/dist/assets/{index-GG6_BZrf.js → index-zzHjRlUr.js} +1 -1
- package/dist/assets/{index.es-vxViMQsn.js → index.es-SmEqR8v0.js} +1 -1
- package/dist/assets/{index.esm-xVa55Zup.js → index.esm-Fk-GXIgo.js} +1 -1
- package/dist/assets/{invite-EUhwRkSk.js → invite-wSBdWHDI.js} +1 -1
- package/dist/assets/{issue-passport-Z7ofkA6K.js → issue-passport-vHldGpRg.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-NWykbogG.js → jss-plugin-props-sort.esm-egoHvTKv.js} +1 -1
- package/dist/assets/{launch-result-message-E79l1MGN.js → launch-result-message-iDsonzeo.js} +1 -1
- package/dist/assets/{layout-ZhSAbpLd.js → layout-zzysI8Bj.js} +1 -1
- package/dist/assets/{list-header-OJgTzNF1.js → list-header-4FSJXt5l.js} +1 -1
- package/dist/assets/localization-JHpBkuFr.js +1 -0
- package/dist/assets/{log-4VclxlhZ.js → log-IHBBDSFp.js} +1 -1
- package/dist/assets/{login-7XksV0rI.js → login-qQGlXI6G.js} +1 -1
- package/dist/assets/{logo-uploader-enkwnhCD.js → logo-uploader-hR6FFn-4.js} +4 -4
- package/dist/assets/{lost-passport-cJF6p-67.js → lost-passport-CLoK127V.js} +4 -4
- package/dist/assets/{lottie-2uuZhpDU.js → lottie-X29n5HYo.js} +1 -1
- package/dist/assets/{memoize-one.esm-Y0hnttfr.js → memoize-one.esm-LD5HLm_4.js} +1 -1
- package/dist/assets/{nav-menu-2LU_iiMs.js → nav-menu-1ENXh9G_.js} +1 -1
- package/dist/assets/notifications-dFwaKILc.js +62 -0
- package/dist/assets/overview-KFyYnpN3.js +12 -0
- package/dist/assets/{page-header-CBzxlYad.js → page-header-8tWFobCu.js} +1 -1
- package/dist/assets/{permission-K-J3su8S.js → permission-oSc67tVg.js} +1 -1
- package/dist/assets/preferences-4qWEpSzN.js +1 -0
- package/dist/assets/publish-resource-ZwETSLtn.js +1 -0
- package/dist/assets/react-cBGiULoP.js +160 -0
- package/dist/assets/{redux-XOuz_cVf.js → redux-OxlCLGwT.js} +1 -1
- package/dist/assets/{selector-ykYLL3HG.js → selector-DDVRP6ux.js} +1 -1
- package/dist/assets/session-p0WamCWG.js +1 -0
- package/dist/assets/setup-vvvXA-tK.js +19 -0
- package/dist/assets/{slicedToArray-ttVd16Np.js → slicedToArray-o0-7iTky.js} +1 -1
- package/dist/assets/{spaces-ciJpOZGt.js → spaces--f1ECR1p.js} +1 -1
- package/dist/assets/{start-uztJSUel.js → start-hbohyu1u.js} +1 -1
- package/dist/assets/{step-actions-DJIhDuRf.js → step-actions-yuXDfRYd.js} +1 -1
- package/dist/assets/{studio--sQ-x80O.js → studio-sH4ftY9Y.js} +1 -1
- package/dist/assets/{switch-control-HdRcPAzs.js → switch-control-Q8hGL7Dp.js} +1 -1
- package/dist/assets/toPropertyKey-x0vRpJ6G.js +1 -0
- package/dist/assets/{transfer-3Gc3ycMl.js → transfer-25pDMv7-.js} +1 -1
- package/dist/assets/{uniqBy-k-IuKA35.js → uniqBy-ee2n6S1k.js} +1 -1
- package/dist/assets/{unsubscribe-XLKaVY1Y.js → unsubscribe-dD_FM5MN.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-3Ylh35kg.js → use-blocklet-info-for-connect-did-spaces-U7E-FAZZ.js} +1 -1
- package/dist/assets/{useAsync-eueWQMQv.js → useAsync-B1gkUbWE.js} +1 -1
- package/dist/assets/{useFormControl-egCRc-oY.js → useFormControl-MFcUIOcD.js} +1 -1
- package/dist/assets/{useLocalStorage--e-ZnzAS.js → useLocalStorage-P7Xfe7vr.js} +1 -1
- package/dist/assets/{useSetState-FhUMbwgE.js → useSetState-aTBeha54.js} +1 -1
- package/dist/assets/user-oCYYn8TG.js +22 -0
- package/dist/assets/{util-ScgYi65n.js → util-piM_BAzR.js} +1 -1
- package/dist/assets/{wallet-hidden-topbar-4xE3Zmur.js → wallet-hidden-topbar-mQy-B-PP.js} +4 -4
- package/dist/assets/{wrap-locale-eKtYETDv.js → wrap-locale-gKjEjXie.js} +2 -2
- package/dist/assets/{zh-ZEZ2eHqG.js → zh-lWXip989.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +18 -18
- package/dist/assets/Checkbox-iS0aPWS5.js +0 -1
- package/dist/assets/DialogContentText-2StByoPg.js +0 -1
- package/dist/assets/FormControlLabel-Yzi0VkLB.js +0 -1
- package/dist/assets/Grid-G2b-U3nu.js +0 -1
- package/dist/assets/Slider-24UR9uuQ.js +0 -1
- package/dist/assets/access-control-140xtlbD.js +0 -13
- package/dist/assets/add-resource-iCbxZ67X.js +0 -1
- package/dist/assets/api-Rgr2QdHb.js +0 -1
- package/dist/assets/confirm-Q5y49s7X.js +0 -7
- package/dist/assets/domain-list-lVne43El.js +0 -12
- package/dist/assets/domain-zuaklUGn.js +0 -9
- package/dist/assets/index-8qpwDSzw.js +0 -203
- package/dist/assets/index-SVSv1xqW.js +0 -54
- package/dist/assets/index-_typwRVC.js +0 -37
- package/dist/assets/index-auhYXn_h.js +0 -262
- package/dist/assets/index-nBzqT-lu.js +0 -1
- package/dist/assets/index-p4r1RVIJ.js +0 -57
- package/dist/assets/localization-cO5MmVsH.js +0 -1
- package/dist/assets/notifications-Y8Uw-nJi.js +0 -62
- package/dist/assets/overview-9xOIDQ82.js +0 -12
- package/dist/assets/preferences-d-eWeFvi.js +0 -1
- package/dist/assets/publish-resource-4G2Mwb1d.js +0 -1
- package/dist/assets/react-QMgqj51s.js +0 -87
- package/dist/assets/session-4pK31v9z.js +0 -1
- package/dist/assets/setup-vcogg-M1.js +0 -19
- package/dist/assets/toPropertyKey-NzAT2yhV.js +0 -1
- package/dist/assets/user-waJ6JIkq.js +0 -22
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{aA as L,T as C,r as c,aC as j,aD as w,cq as H,j as a,aE as d,aG as S,aH as P,cr as O,aI as E,cs as Q,ct as M,cu as J,cv as K,U,u as V,bl as X,cw as Y,cx as Z,F as _,S as ss,P as r,G as os,cy as ts}from"./index-mBoNVAkF.js";import{D as es}from"./index-Rx4AmqwM.js";import{A as as}from"./Alert-sYFXq3Al.js";import{f as ns}from"./format-error-lyZJ-vR8.js";const rs=["className","id"],is=o=>{const{classes:s}=o;return P({root:["root"]},O,s)},cs=L(C,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(o,s)=>s.root})({padding:"16px 24px",flex:"0 0 auto"}),ls=c.forwardRef(function(s,t){const e=j({props:s,name:"MuiDialogTitle"}),{className:l,id:n}=e,i=w(e,rs),m=e,u=is(m),{titleId:y=n}=c.useContext(H);return a.jsx(cs,d({component:"h2",className:S(u.root,l),ownerState:m,ref:t,variant:"h6",id:n??y},i))}),ms=ls,ps=["className"],ds=o=>{const{alignItems:s,classes:t}=o;return P({root:["root",s==="flex-start"&&"alignItemsFlexStart"]},Q,t)},us=L("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:t}=o;return[s.root,t.alignItems==="flex-start"&&s.alignItemsFlexStart]}})(({theme:o,ownerState:s})=>d({minWidth:56,color:(o.vars||o).palette.action.active,flexShrink:0,display:"inline-flex"},s.alignItems==="flex-start"&&{marginTop:8})),ys=c.forwardRef(function(s,t){const e=j({props:s,name:"MuiListItemIcon"}),{className:l}=e,n=w(e,ps),i=c.useContext(E),m=d({},e,{alignItems:i.alignItems}),u=ds(m);return a.jsx(us,d({className:S(u.root,l),ownerState:m,ref:t},n))}),js=ys,fs=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],xs=o=>{const{classes:s,inset:t,primary:e,secondary:l,dense:n}=o;return P({root:["root",t&&"inset",n&&"dense",e&&l&&"multiline"],primary:["primary"],secondary:["secondary"]},J,s)},gs=L("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:t}=o;return[{[`& .${M.primary}`]:s.primary},{[`& .${M.secondary}`]:s.secondary},s.root,t.inset&&s.inset,t.primary&&t.secondary&&s.multiline,t.dense&&s.dense]}})(({ownerState:o})=>d({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},o.primary&&o.secondary&&{marginTop:6,marginBottom:6},o.inset&&{paddingLeft:56})),hs=c.forwardRef(function(s,t){const e=j({props:s,name:"MuiListItemText"}),{children:l,className:n,disableTypography:i=!1,inset:m=!1,primary:u,primaryTypographyProps:y,secondary:b,secondaryTypographyProps:v}=e,h=w(e,fs),{dense:I}=c.useContext(E);let f=u??l,p=b;const T=d({},e,{disableTypography:i,inset:m,primary:!!f,secondary:!!p,dense:I}),g=xs(T);return f!=null&&f.type!==C&&!i&&(f=a.jsx(C,d({variant:I?"body2":"body1",className:g.primary,component:y!=null&&y.variant?void 0:"span",display:"block"},y,{children:f}))),p!=null&&p.type!==C&&!i&&(p=a.jsx(C,d({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},v,{children:p}))),a.jsxs(gs,d({className:S(g.root,n),ownerState:T,ref:t},h,{children:[f,p]}))}),ws=hs;function Ts(){var o;const s=K();return(o=s==null?void 0:s.$$material)!=null?o:s}function Cs(){const o=Ts();return{minWidth:U(o.breakpoints.down("md"))?300:o.breakpoints.values.sm}}function W({title:o,description:s,showCancel:t,cancel:e,confirm:l,color:n,params:i,onCancel:m,onConfirm:u,loading:y,displayError:b,...v}){const[h,I]=c.useState(i),[f,p]=c.useState(!0),[T,g]=c.useState(!1),[R,$]=c.useState(""),{t:B}=V(),q=X(),k=async x=>{if(typeof x=="function"){g(!0);try{if(await x(h)===!1)return;p(!1)}catch(D){$(ns(D)),console.error(D)}finally{g(!1)}}else p(!1)},A=typeof o=="function"?o():o,F=typeof s=="function"?s(h,I,$):s,G=U(q.breakpoints.down("md")),z=x=>{x.stopPropagation()},{minWidth:N}=Cs();return a.jsxs(Is,{onClick:z,fullScreen:G,open:f,style:{minWidth:N},...v,children:[a.jsx(ms,{children:A}),a.jsxs(Y,{style:{minWidth:N},children:[a.jsx(es,{component:"div",children:F}),!!R&&b&&a.jsx(as,{severity:"error",style:{width:"100%",marginTop:8},children:R})]}),a.jsxs(Z,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[t&&a.jsx(_,{onClick:x=>{x.stopPropagation(),k(m)},color:"inherit","data-cy":"cancel-confirm-dialog",children:e||B("common.cancel")}),a.jsxs(_,{onClick:x=>{x.stopPropagation(),k(u)},color:n,disabled:h.__disableConfirm||T||y,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(T||y)&&a.jsx(ss,{size:16,sx:{mr:1}}),l]})]})]})}W.propTypes={title:r.any.isRequired,description:r.any.isRequired,showCancel:r.bool,cancel:r.string,color:r.string,confirm:r.string,params:r.object,onCancel:r.func,onConfirm:r.func.isRequired,loading:r.bool,displayError:r.bool};W.defaultProps={onCancel:()=>{},showCancel:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1,displayError:!0};const Is=os(ts)`
|
|
2
|
+
.delete-actions .Mui-disabled {
|
|
3
|
+
color: rgba(0, 0, 0, 0.26) !important;
|
|
4
|
+
box-shadow: none;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.12) !important;
|
|
6
|
+
}
|
|
7
|
+
`;export{W as C,ms as D,js as L,ws as a,Ts as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,f as e,j as m,E as p,N as d,bC as c,cW as x}from"./index-
|
|
1
|
+
import{r as a,f as e,j as m,E as p,N as d,bC as c,cW as x}from"./index-mBoNVAkF.js";const g=a.forwardRef((r,f)=>{const{t:i}=a.useContext(p),n=d({show:!1,title:"",content:"",onConfirm:c,onCancel:c,loading:!1}),t=e((l={})=>{n.show=!0,n.title=l.title,n.content=l.content,n.onConfirm=l.onConfirm||c,n.onCancel=l.onCancel||c,n.loading=!1}),o=e(()=>{n.title="",n.content="",n.onConfirm=c,n.onCancel=c}),s=e(()=>{n.show=!1,setTimeout(()=>{o()},300)}),u=e(()=>{s(),n==null||n.onCancel()}),C=e(async()=>{n.loading=!0;try{await(n==null?void 0:n.onConfirm(s))}finally{n.loading=!1}});return a.useImperativeHandle(f,()=>({open:t,close:s}),[t,s]),m.jsx(x,{open:n.show,title:n.title,onConfirm:C,onCancel:u,confirmButton:{text:i("common.confirm"),props:{variant:"contained",color:"primary",loading:n.loading}},cancelButton:{text:i("common.cancel"),props:{variant:"outlined",color:"primary"}},children:n.content instanceof Function?n.content():n.content})});function h(){const r=a.useRef(null),f=e((...t)=>{var o;(o=r.current)==null||o.open(...t)}),i=e((...t)=>{var o;(o=r.current)==null||o.close(...t)}),n={open:f,close:i};return{confirmHolder:m.jsx(g,{ref:r}),confirmApi:n}}export{h as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as y,d as x,eR as h,c as m,j as t,C as i,S as g,T as w,y as C,s as T,n as j,P as k,G as S,x as v}from"./index-
|
|
1
|
+
import{u as y,d as x,eR as h,c as m,j as t,C as i,S as g,T as w,y as C,s as T,n as j,P as k,G as S,x as v}from"./index-mBoNVAkF.js";import{_ as P}from"./useAsync-B1gkUbWE.js";function U({children:p}){const{t:r,locale:u}=y(),{api:c,session:a}=x(),{encryptKey:l,decrypt:d}=h(),n=P(async()=>{var s;const e=new URL(window.location.href);e.pathname=m(((s=window==null?void 0:window.env)==null?void 0:s.apiPrefix)??"/","/api/did/setup/token"),e.searchParams.set("_ek_",l);const{data:o}=await c.get(e.href);return o}),f=async e=>{const o=Array.isArray(e)?e.find(s=>s.sessionToken):e;T(d(o.sessionToken));try{await a.refresh()}catch(s){j.error(s.message)}};return!n.value||n.loading||a.loading?t.jsx(i,{relative:"parent",children:t.jsx(g,{})}):a.user?p:n.error?t.jsx(i,{relative:"parent",children:t.jsx(w,{children:n.error.message})}):t.jsx(R,{popup:!0,open:!0,hideCloseButton:!0,action:"pre-setup",checkFn:c.get,checkTimeout:10*60*1e3,webWalletUrl:C(),onSuccess:f,locale:u,messages:{title:r("setup.connect.title"),scan:r("setup.connect.scan"),confirm:r("setup.connect.confirm"),success:r("setup.connect.success")},extraParams:{setup:!0,nw:n.value.url}})}U.propTypes={children:k.any.isRequired};const R=S(v)`
|
|
2
2
|
.action-info-desc {
|
|
3
3
|
padding: 0 72px;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as w,d as M,u as $,e as F,q as N,t as A,v as W,j as n,B as u,a as b,L as y,w as x,h as O,C as z,S as B,n as D}from"./index-
|
|
1
|
+
import{r as w,d as M,u as $,e as F,q as N,t as A,v as W,j as n,B as u,a as b,L as y,w as x,h as O,C as z,S as B,n as D}from"./index-mBoNVAkF.js";import{i as I}from"./index-HFGXBlAK.js";import{u as H}from"./use-passport-id-pXgWCnyq.js";import{F as K}from"./fullpage-HBGx7AXk.js";const P="authorization_response";function Q(){var g;const p=w.useRef(null),{getPassportId:T}=H(),{session:k,connectApi:C}=M(),{t,locale:v}=$(),R=F(),[l]=N();let f={};try{f=JSON.parse(decodeURIComponent(atob(l.get("params"))))}catch{console.warn("parse connect params failed")}const{action:i="login",extraParams:m={},messages:E,...d}=f,r=l.get("redirect");m.passportId=T(),i==="login"&&A(d.forceConnected)&&(d.forceConnected=!1);const h=w.useMemo(()=>r||!window.opener?"redirect":"popup",[r]),S=({encrypted:o=!0,...e},a)=>{o&&(e.sessionToken&&(e.sessionToken=a(e.sessionToken)),e.refreshToken&&(e.refreshToken=a(e.refreshToken)),e.visitorId&&(e.visitorId=a(e.visitorId))),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const U={type:P,response:e};({redirect:()=>{setTimeout(()=>{if(r){const c=decodeURIComponent(r);let s;I(c)?s=new URL(c):s=new URL(c,window.location.origin),e.sessionToken&&s.searchParams.set("sessionToken",e.sessionToken),e.refreshToken&&s.searchParams.set("refreshToken",e.refreshToken),e.visitorId&&s.searchParams.set("visitorId",e.visitorId),I(c)?window.location.href=s.href:R(`${s.pathname}${s.search}`,{replace:!0})}else window.location.href=window.env.pathPrefix||"/"},50)},popup:()=>{window.opener.postMessage(U,"*")}})[h]()},_=o=>{const e={type:P,error:o.message,errorDescription:o.message};({redirect:()=>{D.error(o.message)},popup:()=>{window.opener.postMessage(e,"*")}})[h]()},j=`${x.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport?redirect=${encodeURIComponent(`${window.location.pathname}${window.location.search}`)}`,L=W(()=>{if(i!=="login")return null;const o=window.blocklet.trustedFactories||[];return n.jsx(u,{textAlign:"center",fontSize:14,children:o.length>0&&n.jsx(b,{title:t("exchangePassport.tooltip",{collections:o.map(e=>e.factoryAddress)}),placement:"top-end",enterTouchDelay:0,children:n.jsx(y,{to:`${x.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport?redirect=${encodeURIComponent(r||"/")}`,style:{color:"#4598FA"},children:t("exchangePassport.title")},"exchange-passport")})})},[i]);return O(()=>{p.current&&setTimeout(()=>{C.open({locale:v,action:i,extraParams:m,...d,containerEl:p.current,className:"connect",popup:!1,messages:E||{title:t("login.dialog.title"),scan:t("login.dialog.scan"),confirm:t("login.dialog.confirm"),success:t("login.dialog.success")},extraContent:L,lostPassportUrl:j,onSuccess:S,onError:_})})}),k.loading?n.jsx(z,{children:n.jsx(B,{})}):n.jsx(K,{did:(g=window.blocklet)==null?void 0:g.appPid,children:n.jsx(u,{sx:{width:"560px",maxWidth:"100%",height:"100%"},ref:p})})}export{Q as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as n,G as i,j as o}from"./index-
|
|
1
|
+
import{P as n,G as i,j as o}from"./index-mBoNVAkF.js";function p({children:e,...t}){return o.jsx(d,{...t,children:e})}p.propTypes={children:n.any.isRequired};const d=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as g,ay as Qn,az as Yn,aA as Vt,aB as F,aC as Xn,aD as Zn,aE as ye,aF as Rn,aG as St,j as l,aH as Jn,aI as ur,aJ as dr,aK as fr,aL as pr,aM as hr,aN as mr,aO as gr,aP as vr,aQ as yr,aR as br,aS as eo,aT as xr,aU as wr,aV as jr,P as y,E as qt,aW as Ot,a as Et,S as se,K as H,M as K,G as rt,e as st,a9 as W,aX as ce,$,aY as _r,aZ as to,a_ as me,aw as Ht,a$ as Cr,L as no,b0 as Pt,b1 as Sr,F as be,Y as $e,T as Z,b2 as Or,n as T,b3 as Er,b4 as Pr,c as pt,b5 as Rr,b6 as Rt,A as Ar,u as G,w as k,B as L,x as Ir,b7 as Dr,b8 as Lr,ac as Kt,aa as it,a8 as at,b9 as Qe,X as Ke,ba as oo,bb as ro,bc as so,H as Tr,bd as Br,U as io,W as kr,be as Nr,bf as ht,bg as $r,bh as We,bi as ao,bj as Mr,bk as An,bl as Ur,bm as Fr,bn as zr,bo as Vr,a7 as qr,bp as Hr,bq as Kr,br as Wr,av as Gr,C as Je,bs as Qr,bt as Yr,bu as Xr,Q as M,bv as Zr,ah as Jr,R as In}from"./index-uIKkPDx2.js";import{T as es}from"./index-FT9kP6qN.js";import{D as ts,_ as ns,P as os}from"./permission-K-J3su8S.js";import{T as co,d as rs}from"./MoreVert-b_wUncc4.js";import{_ as ss}from"./useLocalStorage--e-ZnzAS.js";import{L as is,a as lo,C as Dn}from"./confirm-Q5y49s7X.js";import{d as as,_ as cs}from"./useSetState-FhUMbwgE.js";import{d as ls}from"./PlayArrow-DsCR1WAD.js";import{A as us}from"./Alert-nav821gk.js";import{B as ds}from"./ButtonGroup-qjjm6C6u.js";import{R as fs,a as Ln}from"./RadioGroup-MeoNWf5B.js";import{F as At}from"./FormControlLabel-Yzi0VkLB.js";import{f as Me}from"./format-error-iCYgDtF5.js";import{A as uo}from"./Avatar-4W2iSGC-.js";import{A as ps}from"./index-_typwRVC.js";import{u as hs}from"./session-4pK31v9z.js";import{b as ms,c as gs}from"./spaces-ciJpOZGt.js";import{E as vs}from"./fallback-wCdaTD2t.js";import{b as ys,s as bs,u as xs,f as ws,g as js,a as _s,m as Cs,c as Ss,d as Os,p as et,H as Es,L as Ps}from"./wallet-hidden-topbar-4xE3Zmur.js";import{D as Rs,u as As}from"./index-nXJuMgJq.js";import{C as Is}from"./Checkbox-iS0aPWS5.js";const fo=e=>{const t=g.useRef({});return g.useEffect(()=>{t.current=e}),t.current};function Ds(e){const{badgeContent:t,invisible:n=!1,max:o=99,showZero:r=!1}=e,s=fo({badgeContent:t,max:o});let i=n;n===!1&&t===0&&!r&&(i=!0);const{badgeContent:a,max:c=o}=i?s:e,u=a&&Number(a)>c?`${c}+`:a;return{badgeContent:a,invisible:i,max:c,displayValue:u}}function Ls(e){return Yn("MuiBadge",e)}const Ts=Qn("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),ne=Ts,Bs=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],mt=10,gt=4,ks=e=>{const{color:t,anchorOrigin:n,invisible:o,overlap:r,variant:s,classes:i={}}=e,a={root:["root"],badge:["badge",s,o&&"invisible",`anchorOrigin${F(n.vertical)}${F(n.horizontal)}`,`anchorOrigin${F(n.vertical)}${F(n.horizontal)}${F(r)}`,`overlap${F(r)}`,t!=="default"&&`color${F(t)}`]};return Jn(a,Ls,i)},Ns=Vt("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),$s=Vt("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${F(n.anchorOrigin.vertical)}${F(n.anchorOrigin.horizontal)}${F(n.overlap)}`],n.color!=="default"&&t[`color${F(n.color)}`],n.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:mt*2,lineHeight:1,padding:"0 6px",height:mt*2,borderRadius:mt,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(n=>{var o,r;return((o=e.vars)!=null?o:e).palette[n].main&&((r=e.vars)!=null?r:e).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:gt,height:gt*2,minWidth:gt*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),Ms=g.forwardRef(function(t,n){var o,r,s,i,a,c;const u=Xn({props:t,name:"MuiBadge"}),{anchorOrigin:d={vertical:"top",horizontal:"right"},className:f,component:p,components:h={},componentsProps:x={},children:v,overlap:P="rectangular",color:m="default",invisible:R=!1,max:A=99,badgeContent:w,slots:b,slotProps:_,showZero:E=!1,variant:S="standard"}=u,C=Zn(u,Bs),{badgeContent:I,invisible:Ce,max:Se,displayValue:le}=Ds({max:A,invisible:R,badgeContent:w,showZero:E}),Oe=fo({anchorOrigin:d,color:m,overlap:P,variant:S,badgeContent:w}),ue=Ce||I==null&&S!=="dot",{color:Ee=m,overlap:de=P,anchorOrigin:O=d,variant:J=S}=ue?Oe:u,Pe=J!=="dot"?le:void 0,fe=ye({},u,{badgeContent:I,invisible:ue,max:Se,displayValue:Pe,showZero:E,anchorOrigin:O,color:Ee,overlap:de,variant:J}),j=ks(fe),N=(o=(r=b==null?void 0:b.root)!=null?r:h.Root)!=null?o:Ns,ee=(s=(i=b==null?void 0:b.badge)!=null?i:h.Badge)!=null?s:$s,Y=(a=_==null?void 0:_.root)!=null?a:x.root,te=(c=_==null?void 0:_.badge)!=null?c:x.badge,pe=Rn({elementType:N,externalSlotProps:Y,externalForwardedProps:C,additionalProps:{ref:n,as:p},ownerState:fe,className:St(Y==null?void 0:Y.className,j.root,f)}),ft=Rn({elementType:ee,externalSlotProps:te,ownerState:fe,className:St(j.badge,te==null?void 0:te.className)});return l.jsxs(N,ye({},pe,{children:[v,l.jsx(ee,ye({},ft,{children:Pe}))]}))}),po=Ms;function Us(e){return Yn("MuiListItemAvatar",e)}Qn("MuiListItemAvatar",["root","alignItemsFlexStart"]);const Fs=["className"],zs=e=>{const{alignItems:t,classes:n}=e;return Jn({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},Us,n)},Vs=Vt("div",{name:"MuiListItemAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({ownerState:e})=>ye({minWidth:56,flexShrink:0},e.alignItems==="flex-start"&&{marginTop:8})),qs=g.forwardRef(function(t,n){const o=Xn({props:t,name:"MuiListItemAvatar"}),{className:r}=o,s=Zn(o,Fs),i=g.useContext(ur),a=ye({},o,{alignItems:i.alignItems}),c=zs(a);return l.jsx(Vs,ye({className:St(c.root,r),ownerState:a,ref:n},s))}),Hs=qs;var Ks=dr,Ws=hr,Gs=mr,Qs=fr,Ys=pr,Xs=gr,Zs=200;function Js(e,t,n,o){var r=-1,s=Ws,i=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Qs(t,Ys(n))),o?(s=Gs,i=!1):t.length>=Zs&&(s=Xs,i=!1,t=new Ks(t));e:for(;++r<a;){var d=e[r],f=n==null?d:n(d);if(d=o||d!==0?d:0,i&&f===f){for(var p=u;p--;)if(t[p]===f)continue e;c.push(d)}else s(t,f,o)||c.push(d)}return c}var ei=Js,ti=ei,ni=vr,Tn=yr;function oi(e,t,n){var o=e.length;if(o<2)return o?Tn(e[0]):[];for(var r=-1,s=Array(o);++r<o;)for(var i=e[r],a=-1;++a<o;)a!=r&&(s[r]=ti(s[r]||i,e[a],t,n));return Tn(ni(s,1),t,n)}var ri=oi,si=xr,ii=br,ai=ri,ci=jr,li=wr,ui=ii(function(e){var t=li(e);return t=typeof t=="function"?t:void 0,ai(si(e,ci),void 0,t)}),di=ui;const fi=eo(di),ho=g.createContext({});function Wt({children:e,type:t}){const[n,o]=g.useState([]),r=g.useRef([]),s=c=>{if(!r.current.includes(c)){const u=[...r.current,c];o(u),r.current=u}},i=c=>{if(r.current.includes(c)){const u=r.current.filter(d=>d!==c);o(u),r.current=u}},a=c=>{const u=n.filter(f=>c.find(p=>p===f));fi(u,n).forEach(f=>i(f))};return l.jsx(ho.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:i,matchDeletingDid:a},children:e})}Wt.propTypes={type:y.string,children:y.node.isRequired};Wt.defaultProps={type:"blocklets"};function Sl(){return g.useContext(ho)}function Gt({children:e,style:t,...n}){return l.jsx(co,{style:t,...n,children:e})}Gt.propTypes={children:y.any.isRequired,style:y.object};Gt.defaultProps={style:{}};const B={yellow:"#FFCF71",grey:"#888888"};function Qt({status:e,variant:t,source:n,progress:o,...r}){const{t:s}=g.useContext(qt),i={added:"primary",waiting:"warning",downloading:"warning",extracting:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"},a={added:B.grey,waiting:B.yellow,downloading:B.yellow,extracting:B.yellow,downloaded:B.grey,installing:B.yellow,installed:B.grey,starting:B.yellow,running:"success",stopping:B.yellow,stopped:B.grey,error:"error",upgrading:B.yellow,restarting:B.yellow,corrupted:"error",deleting:B.yellow},c=Ot(e),u=s(`blocklet.status.${e}`);return t==="dot"?l.jsx(Et,{title:s("blocklet.statusTip",{status:u}),children:l.jsx(ts,{color:a[e],...r})}):l.jsxs(Gt,{type:i[e],...r,children:[c&&l.jsx(se,{size:12,color:"inherit",style:{marginRight:5}}),u,e==="downloading"&&o?l.jsx("div",{style:{marginLeft:5},children:`${o} %`}):null]})}Qt.propTypes={status:y.string.isRequired,variant:y.oneOf(["dot","tag"]),source:y.string,progress:y.number};Qt.defaultProps={variant:"tag",source:"",progress:0};var Yt={},pi=K;Object.defineProperty(Yt,"__esModule",{value:!0});var mo=Yt.default=void 0,hi=pi(H()),mi=l;mo=Yt.default=(0,hi.default)((0,mi.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Xt={},gi=K;Object.defineProperty(Xt,"__esModule",{value:!0});var go=Xt.default=void 0,vi=gi(H()),yi=l;go=Xt.default=(0,vi.default)((0,yi.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Zt={},bi=K;Object.defineProperty(Zt,"__esModule",{value:!0});var vo=Zt.default=void 0,xi=bi(H()),wi=l;vo=Zt.default=(0,xi.default)((0,wi.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Jt={},ji=K;Object.defineProperty(Jt,"__esModule",{value:!0});var yo=Jt.default=void 0,_i=ji(H()),Ci=l;yo=Jt.default=(0,_i.default)((0,Ci.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var en={},Si=K;Object.defineProperty(en,"__esModule",{value:!0});var bo=en.default=void 0,Oi=Si(H()),Ei=l;bo=en.default=(0,Oi.default)((0,Ei.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var tn={},Pi=K;Object.defineProperty(tn,"__esModule",{value:!0});var xo=tn.default=void 0,Ri=Pi(H()),Ai=l;xo=tn.default=(0,Ri.default)((0,Ai.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");const X={Start:ls,Stop:mo,Restart:go,Reload:vo,Remove:as,Config:yo,Log:bo,Group:xo};function nn({blocklet:e,onStart:t,onComplete:n,variant:o,hasPermission:r,useBlockletUrlEvaluation:s,...i}){var O,J,Pe,fe;const a=st(),c=W(),[u,d]=g.useState(null),[f,p]=g.useState(null),[h,x]=g.useState(!1),[v,P]=g.useState(null),{t:m}=g.useContext(qt),[R]=ss("skip-blocklet-setup",!1),{loading:A,recommendedUrl:w}=s(e),{nftState:b}=ce(),_=Ot(e.status);let E=((J=(O=e==null?void 0:e.controller)==null?void 0:O.status)==null?void 0:J.value)===$.BLOCKLET_CONTROLLER_STATUS.suspended;!(b!=null&&b.expired)&&((fe=(Pe=e==null?void 0:e.controller)==null?void 0:Pe.status)==null?void 0:fe.reason)===$.SUSPENDED_REASON.expired&&(E=!1);const{inService:S}=c,C=(j,N,ee=!1)=>async()=>{const Y=async Ve=>{var He;t({action:j,blocklet:e}),x(!0),p(j);let qe=!1;try{if(j==="remove")await N(Ve);else if(j==="start"){if(!Or(e)){T.error(m("blocklet.noComponent"));return}if(!S&&!R&&!((He=e.settings)!=null&&He.initialized)&&e.mode!==$.BLOCKLET_MODES.DEVELOPMENT){const z=Er(c.info),Pn=new URL(w);Pn.searchParams.set("serverUrl",z),window.open(Pn.href),n({action:j,blocklet:e});return}const ie=e.children.filter(z=>!Ot(z.status)&&z.status!=="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await N({input:he})}else if(["stop","restart","reload"].includes(j)){const ie=e.children.filter(z=>z.status==="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await N({input:he})}else{const ie={did:e.meta.did};await N({input:ie})}j==="remove"?qe=!0:await Pr(1e3),j==="reload"&&T.success(m("blocklet.reloadSuccess")),P(null),n({action:j,blocklet:e})}catch(ie){const he=`Blocklet ${j} failed: ${Me(ie)}`;throw n({action:j,blocklet:e,error:new Error(he)}),new Error(he)}finally{qe||x(!1)}},te=()=>{x(!1),P(null)},pe=$e(e,!0),ft=e.mode===$.BLOCKLET_MODES.DEVELOPMENT?{description:()=>l.jsx(Z,{component:"div",children:l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ve,qe)=>l.jsxs(Z,{component:"div",children:[l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),l.jsxs(fs,{name:"removeType",value:Ve.removeType,onChange:He=>qe({...Ve,removeType:He.target.value}),children:[l.jsx(At,{value:"backup",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),l.jsx(At,{value:"complete",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},lr={stop:{title:`${m("common.stop")} ${pe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},restart:{title:`${m("common.restart")} ${pe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},remove:{title:`${m("common.remove")} ${pe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te,...ft},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:pe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te}};ee?P(lr[j]):await Y()},I=!!u,Ce=j=>{try{j.stopPropagation(),j.preventDefault()}catch{}d(j.currentTarget)},Se=j=>{try{j.stopPropagation(),j.preventDefault()}catch{}d(null)},le=async(j,N)=>{try{N.stopPropagation(),N.preventDefault()}catch{}if(typeof j.handler=="function")try{x(!0),p(j.action),await j.handler()}catch(ee){console.error(`Blocklet ${j.name} failed: `,ee)}finally{x(!1),d(null)}else d(null)},Oe=!S&&_r(e)?{action:"remove",icon:X.Remove,name:m("common.remove"),handler:C("remove",async({removeType:j})=>{j==="backup"&&await c.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await c.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:_}:null,ue={action:"remove",icon:X.Remove,name:m("common.cancel"),handler:C("cancelDownload",c.api.cancelDownloadBlocklet,!0)},Ee=to(e),de=[{action:"start",icon:X.Start,name:m("common.start"),handler:C("start",c.api.startBlocklet),disabled:E||e.children.every(j=>j.status==="running")||me(e.status)||A||_},{action:"stop",icon:X.Stop,name:m("common.stop"),handler:C("stop",c.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",icon:X.Restart,name:m("common.restart"),handler:C("restart",c.api.restartBlocklet,!0),disabled:E||e.status!=="running"},{action:"reload",icon:X.Reload,name:m("common.reload"),handler:C("reload",c.api.reloadBlocklet),disabled:E||e.status!=="running"},me(e.status)?ue:Oe,{separator:!0},{onlyInMenu:!0,action:"config",icon:X.Config,name:m("common.config"),handler:()=>{a(`/blocklets/${e.meta.did}/configuration`)},disabled:me(e.status)},{onlyInMenu:!0,action:"team",icon:X.Group,name:m("common.manageTeam"),handler:()=>{a(`/blocklets/${e.meta.did}/members`)},disabled:me(e.status)},{onlyInMenu:!0,action:"log",icon:X.Log,name:m("common.log"),handler:()=>{a(`/logs/blocklet-${e.meta.did}`)},disabled:me(e.status)}].filter(Boolean);return o==="menu"?l.jsxs(Bn,{"data-cy":"blocklet-actions",children:[l.jsx(Ht,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:Ce,size:"small",disabled:!r||!me(e.status)&&h,children:l.jsx(rs,{})}),l.jsxs(Cr,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:I,onClose:Se,PaperProps:{},children:[Ee.length>0&&l.jsxs(us,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),l.jsx("br",{}),l.jsx(no,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),de.map((j,N)=>j.separator?l.jsx(Pt,{},`separator-${N}`):l.jsxs(Sr,{dense:!0,onClick:ee=>le(j,ee),disabled:h||j.disabled,"data-cy":`${j.action}-blocklet`,children:[l.jsx(is,{style:{minWidth:24},children:f===j.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(j.icon,{fontSize:"small"})}),l.jsx(lo,{primary:j.name})]},j.name))]}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):l.jsxs(Bn,{"data-cy":"blocklet-actions",...i,children:[l.jsx(ds,{children:de.filter(j=>!j.separator&&!j.onlyInMenu).map(j=>l.jsxs(be,{title:j.name,"data-cy":`${j.action}-blocklet`,onClick:()=>le(j),disabled:!!j.disabled||h,children:[f===j.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(j.icon,{}),l.jsx("span",{className:"blocklet-action-text",children:j.name})]},j.name))}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}nn.propTypes={blocklet:y.object.isRequired,onStart:y.func.isRequired,onComplete:y.func.isRequired,variant:y.oneOf(["menu","group"]),hasPermission:y.bool,useBlockletUrlEvaluation:y.func};nn.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const Bn=rt.div`
|
|
1
|
+
import{r as g,ay as Qn,az as Yn,aA as Vt,aB as F,aC as Xn,aD as Zn,aE as ye,aF as Rn,aG as St,j as l,aH as Jn,aI as ur,aJ as dr,aK as fr,aL as pr,aM as hr,aN as mr,aO as gr,aP as vr,aQ as yr,aR as br,aS as eo,aT as xr,aU as wr,aV as jr,P as y,E as qt,aW as Ot,a as Et,S as se,K as H,M as K,G as rt,e as st,a9 as W,aX as ce,$,aY as _r,aZ as to,a_ as me,aw as Ht,a$ as Cr,L as no,b0 as Pt,b1 as Sr,F as be,Y as $e,T as Z,b2 as Or,n as T,b3 as Er,b4 as Pr,c as pt,b5 as Rr,b6 as Rt,A as Ar,u as G,w as k,B as L,x as Ir,b7 as Dr,b8 as Lr,ac as Kt,aa as it,a8 as at,b9 as Qe,X as Ke,ba as oo,bb as ro,bc as so,H as Tr,bd as Br,U as io,W as kr,be as Nr,bf as ht,bg as $r,bh as We,bi as ao,bj as Mr,bk as An,bl as Ur,bm as Fr,bn as zr,bo as Vr,a7 as qr,bp as Hr,bq as Kr,br as Wr,av as Gr,C as Je,bs as Qr,bt as Yr,bu as Xr,Q as M,bv as Zr,ah as Jr,R as In}from"./index-mBoNVAkF.js";import{T as es}from"./index-p7HYJjf1.js";import{D as ts,_ as ns,P as os}from"./permission-oSc67tVg.js";import{T as co,d as rs}from"./MoreVert-4y42cx0s.js";import{_ as ss}from"./useLocalStorage-P7Xfe7vr.js";import{L as is,a as lo,C as Dn}from"./confirm-VPAExB8S.js";import{d as as,_ as cs}from"./useSetState-aTBeha54.js";import{d as ls}from"./PlayArrow-NomOs4fE.js";import{A as us}from"./Alert-sYFXq3Al.js";import{B as ds}from"./ButtonGroup-T2tPvlgZ.js";import{R as fs,a as Ln}from"./RadioGroup-ds0DRyXx.js";import{F as At,C as ps}from"./FormControlLabel-EmYIE4Ks.js";import{f as Me}from"./format-error-lyZJ-vR8.js";import{A as uo}from"./Avatar-sPQLj-7K.js";import{A as hs}from"./index-Rx4AmqwM.js";import{u as ms}from"./session-p0WamCWG.js";import{b as gs,c as vs}from"./spaces--f1ECR1p.js";import{E as ys}from"./fallback-eXgiG5Pr.js";import{b as bs,s as xs,u as ws,f as js,g as _s,a as Cs,m as Ss,c as Os,d as Es,p as et,H as Ps,L as Rs}from"./wallet-hidden-topbar-mQy-B-PP.js";import{D as As,u as Is}from"./index-OinRqSU-.js";const fo=e=>{const t=g.useRef({});return g.useEffect(()=>{t.current=e}),t.current};function Ds(e){const{badgeContent:t,invisible:n=!1,max:o=99,showZero:r=!1}=e,s=fo({badgeContent:t,max:o});let i=n;n===!1&&t===0&&!r&&(i=!0);const{badgeContent:a,max:c=o}=i?s:e,u=a&&Number(a)>c?`${c}+`:a;return{badgeContent:a,invisible:i,max:c,displayValue:u}}function Ls(e){return Yn("MuiBadge",e)}const Ts=Qn("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),ne=Ts,Bs=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],mt=10,gt=4,ks=e=>{const{color:t,anchorOrigin:n,invisible:o,overlap:r,variant:s,classes:i={}}=e,a={root:["root"],badge:["badge",s,o&&"invisible",`anchorOrigin${F(n.vertical)}${F(n.horizontal)}`,`anchorOrigin${F(n.vertical)}${F(n.horizontal)}${F(r)}`,`overlap${F(r)}`,t!=="default"&&`color${F(t)}`]};return Jn(a,Ls,i)},Ns=Vt("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),$s=Vt("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${F(n.anchorOrigin.vertical)}${F(n.anchorOrigin.horizontal)}${F(n.overlap)}`],n.color!=="default"&&t[`color${F(n.color)}`],n.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:mt*2,lineHeight:1,padding:"0 6px",height:mt*2,borderRadius:mt,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(n=>{var o,r;return((o=e.vars)!=null?o:e).palette[n].main&&((r=e.vars)!=null?r:e).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:gt,height:gt*2,minWidth:gt*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ne.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),Ms=g.forwardRef(function(t,n){var o,r,s,i,a,c;const u=Xn({props:t,name:"MuiBadge"}),{anchorOrigin:d={vertical:"top",horizontal:"right"},className:f,component:p,components:h={},componentsProps:x={},children:v,overlap:P="rectangular",color:m="default",invisible:R=!1,max:A=99,badgeContent:w,slots:b,slotProps:_,showZero:E=!1,variant:S="standard"}=u,C=Zn(u,Bs),{badgeContent:I,invisible:Ce,max:Se,displayValue:le}=Ds({max:A,invisible:R,badgeContent:w,showZero:E}),Oe=fo({anchorOrigin:d,color:m,overlap:P,variant:S,badgeContent:w}),ue=Ce||I==null&&S!=="dot",{color:Ee=m,overlap:de=P,anchorOrigin:O=d,variant:J=S}=ue?Oe:u,Pe=J!=="dot"?le:void 0,fe=ye({},u,{badgeContent:I,invisible:ue,max:Se,displayValue:Pe,showZero:E,anchorOrigin:O,color:Ee,overlap:de,variant:J}),j=ks(fe),N=(o=(r=b==null?void 0:b.root)!=null?r:h.Root)!=null?o:Ns,ee=(s=(i=b==null?void 0:b.badge)!=null?i:h.Badge)!=null?s:$s,Y=(a=_==null?void 0:_.root)!=null?a:x.root,te=(c=_==null?void 0:_.badge)!=null?c:x.badge,pe=Rn({elementType:N,externalSlotProps:Y,externalForwardedProps:C,additionalProps:{ref:n,as:p},ownerState:fe,className:St(Y==null?void 0:Y.className,j.root,f)}),ft=Rn({elementType:ee,externalSlotProps:te,ownerState:fe,className:St(j.badge,te==null?void 0:te.className)});return l.jsxs(N,ye({},pe,{children:[v,l.jsx(ee,ye({},ft,{children:Pe}))]}))}),po=Ms;function Us(e){return Yn("MuiListItemAvatar",e)}Qn("MuiListItemAvatar",["root","alignItemsFlexStart"]);const Fs=["className"],zs=e=>{const{alignItems:t,classes:n}=e;return Jn({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},Us,n)},Vs=Vt("div",{name:"MuiListItemAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({ownerState:e})=>ye({minWidth:56,flexShrink:0},e.alignItems==="flex-start"&&{marginTop:8})),qs=g.forwardRef(function(t,n){const o=Xn({props:t,name:"MuiListItemAvatar"}),{className:r}=o,s=Zn(o,Fs),i=g.useContext(ur),a=ye({},o,{alignItems:i.alignItems}),c=zs(a);return l.jsx(Vs,ye({className:St(c.root,r),ownerState:a,ref:n},s))}),Hs=qs;var Ks=dr,Ws=hr,Gs=mr,Qs=fr,Ys=pr,Xs=gr,Zs=200;function Js(e,t,n,o){var r=-1,s=Ws,i=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Qs(t,Ys(n))),o?(s=Gs,i=!1):t.length>=Zs&&(s=Xs,i=!1,t=new Ks(t));e:for(;++r<a;){var d=e[r],f=n==null?d:n(d);if(d=o||d!==0?d:0,i&&f===f){for(var p=u;p--;)if(t[p]===f)continue e;c.push(d)}else s(t,f,o)||c.push(d)}return c}var ei=Js,ti=ei,ni=vr,Tn=yr;function oi(e,t,n){var o=e.length;if(o<2)return o?Tn(e[0]):[];for(var r=-1,s=Array(o);++r<o;)for(var i=e[r],a=-1;++a<o;)a!=r&&(s[r]=ti(s[r]||i,e[a],t,n));return Tn(ni(s,1),t,n)}var ri=oi,si=xr,ii=br,ai=ri,ci=jr,li=wr,ui=ii(function(e){var t=li(e);return t=typeof t=="function"?t:void 0,ai(si(e,ci),void 0,t)}),di=ui;const fi=eo(di),ho=g.createContext({});function Wt({children:e,type:t}){const[n,o]=g.useState([]),r=g.useRef([]),s=c=>{if(!r.current.includes(c)){const u=[...r.current,c];o(u),r.current=u}},i=c=>{if(r.current.includes(c)){const u=r.current.filter(d=>d!==c);o(u),r.current=u}},a=c=>{const u=n.filter(f=>c.find(p=>p===f));fi(u,n).forEach(f=>i(f))};return l.jsx(ho.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:i,matchDeletingDid:a},children:e})}Wt.propTypes={type:y.string,children:y.node.isRequired};Wt.defaultProps={type:"blocklets"};function Cl(){return g.useContext(ho)}function Gt({children:e,style:t,...n}){return l.jsx(co,{style:t,...n,children:e})}Gt.propTypes={children:y.any.isRequired,style:y.object};Gt.defaultProps={style:{}};const B={yellow:"#FFCF71",grey:"#888888"};function Qt({status:e,variant:t,source:n,progress:o,...r}){const{t:s}=g.useContext(qt),i={added:"primary",waiting:"warning",downloading:"warning",extracting:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"},a={added:B.grey,waiting:B.yellow,downloading:B.yellow,extracting:B.yellow,downloaded:B.grey,installing:B.yellow,installed:B.grey,starting:B.yellow,running:"success",stopping:B.yellow,stopped:B.grey,error:"error",upgrading:B.yellow,restarting:B.yellow,corrupted:"error",deleting:B.yellow},c=Ot(e),u=s(`blocklet.status.${e}`);return t==="dot"?l.jsx(Et,{title:s("blocklet.statusTip",{status:u}),children:l.jsx(ts,{color:a[e],...r})}):l.jsxs(Gt,{type:i[e],...r,children:[c&&l.jsx(se,{size:12,color:"inherit",style:{marginRight:5}}),u,e==="downloading"&&o?l.jsx("div",{style:{marginLeft:5},children:`${o} %`}):null]})}Qt.propTypes={status:y.string.isRequired,variant:y.oneOf(["dot","tag"]),source:y.string,progress:y.number};Qt.defaultProps={variant:"tag",source:"",progress:0};var Yt={},pi=K;Object.defineProperty(Yt,"__esModule",{value:!0});var mo=Yt.default=void 0,hi=pi(H()),mi=l;mo=Yt.default=(0,hi.default)((0,mi.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Xt={},gi=K;Object.defineProperty(Xt,"__esModule",{value:!0});var go=Xt.default=void 0,vi=gi(H()),yi=l;go=Xt.default=(0,vi.default)((0,yi.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Zt={},bi=K;Object.defineProperty(Zt,"__esModule",{value:!0});var vo=Zt.default=void 0,xi=bi(H()),wi=l;vo=Zt.default=(0,xi.default)((0,wi.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Jt={},ji=K;Object.defineProperty(Jt,"__esModule",{value:!0});var yo=Jt.default=void 0,_i=ji(H()),Ci=l;yo=Jt.default=(0,_i.default)((0,Ci.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var en={},Si=K;Object.defineProperty(en,"__esModule",{value:!0});var bo=en.default=void 0,Oi=Si(H()),Ei=l;bo=en.default=(0,Oi.default)((0,Ei.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var tn={},Pi=K;Object.defineProperty(tn,"__esModule",{value:!0});var xo=tn.default=void 0,Ri=Pi(H()),Ai=l;xo=tn.default=(0,Ri.default)((0,Ai.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");const X={Start:ls,Stop:mo,Restart:go,Reload:vo,Remove:as,Config:yo,Log:bo,Group:xo};function nn({blocklet:e,onStart:t,onComplete:n,variant:o,hasPermission:r,useBlockletUrlEvaluation:s,...i}){var O,J,Pe,fe;const a=st(),c=W(),[u,d]=g.useState(null),[f,p]=g.useState(null),[h,x]=g.useState(!1),[v,P]=g.useState(null),{t:m}=g.useContext(qt),[R]=ss("skip-blocklet-setup",!1),{loading:A,recommendedUrl:w}=s(e),{nftState:b}=ce(),_=Ot(e.status);let E=((J=(O=e==null?void 0:e.controller)==null?void 0:O.status)==null?void 0:J.value)===$.BLOCKLET_CONTROLLER_STATUS.suspended;!(b!=null&&b.expired)&&((fe=(Pe=e==null?void 0:e.controller)==null?void 0:Pe.status)==null?void 0:fe.reason)===$.SUSPENDED_REASON.expired&&(E=!1);const{inService:S}=c,C=(j,N,ee=!1)=>async()=>{const Y=async Ve=>{var He;t({action:j,blocklet:e}),x(!0),p(j);let qe=!1;try{if(j==="remove")await N(Ve);else if(j==="start"){if(!Or(e)){T.error(m("blocklet.noComponent"));return}if(!S&&!R&&!((He=e.settings)!=null&&He.initialized)&&e.mode!==$.BLOCKLET_MODES.DEVELOPMENT){const z=Er(c.info),Pn=new URL(w);Pn.searchParams.set("serverUrl",z),window.open(Pn.href),n({action:j,blocklet:e});return}const ie=e.children.filter(z=>!Ot(z.status)&&z.status!=="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await N({input:he})}else if(["stop","restart","reload"].includes(j)){const ie=e.children.filter(z=>z.status==="running").map(z=>z.meta.did),he={did:e.meta.did,componentDids:ie};await N({input:he})}else{const ie={did:e.meta.did};await N({input:ie})}j==="remove"?qe=!0:await Pr(1e3),j==="reload"&&T.success(m("blocklet.reloadSuccess")),P(null),n({action:j,blocklet:e})}catch(ie){const he=`Blocklet ${j} failed: ${Me(ie)}`;throw n({action:j,blocklet:e,error:new Error(he)}),new Error(he)}finally{qe||x(!1)}},te=()=>{x(!1),P(null)},pe=$e(e,!0),ft=e.mode===$.BLOCKLET_MODES.DEVELOPMENT?{description:()=>l.jsx(Z,{component:"div",children:l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ve,qe)=>l.jsxs(Z,{component:"div",children:[l.jsx(Z,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),l.jsxs(fs,{name:"removeType",value:Ve.removeType,onChange:He=>qe({...Ve,removeType:He.target.value}),children:[l.jsx(At,{value:"backup",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),l.jsx(At,{value:"complete",control:l.jsx(Ln,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},lr={stop:{title:`${m("common.stop")} ${pe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},restart:{title:`${m("common.restart")} ${pe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te},remove:{title:`${m("common.remove")} ${pe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te,...ft},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:pe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:Y,onCancel:te}};ee?P(lr[j]):await Y()},I=!!u,Ce=j=>{try{j.stopPropagation(),j.preventDefault()}catch{}d(j.currentTarget)},Se=j=>{try{j.stopPropagation(),j.preventDefault()}catch{}d(null)},le=async(j,N)=>{try{N.stopPropagation(),N.preventDefault()}catch{}if(typeof j.handler=="function")try{x(!0),p(j.action),await j.handler()}catch(ee){console.error(`Blocklet ${j.name} failed: `,ee)}finally{x(!1),d(null)}else d(null)},Oe=!S&&_r(e)?{action:"remove",icon:X.Remove,name:m("common.remove"),handler:C("remove",async({removeType:j})=>{j==="backup"&&await c.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await c.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:_}:null,ue={action:"remove",icon:X.Remove,name:m("common.cancel"),handler:C("cancelDownload",c.api.cancelDownloadBlocklet,!0)},Ee=to(e),de=[{action:"start",icon:X.Start,name:m("common.start"),handler:C("start",c.api.startBlocklet),disabled:E||e.children.every(j=>j.status==="running")||me(e.status)||A||_},{action:"stop",icon:X.Stop,name:m("common.stop"),handler:C("stop",c.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",icon:X.Restart,name:m("common.restart"),handler:C("restart",c.api.restartBlocklet,!0),disabled:E||e.status!=="running"},{action:"reload",icon:X.Reload,name:m("common.reload"),handler:C("reload",c.api.reloadBlocklet),disabled:E||e.status!=="running"},me(e.status)?ue:Oe,{separator:!0},{onlyInMenu:!0,action:"config",icon:X.Config,name:m("common.config"),handler:()=>{a(`/blocklets/${e.meta.did}/configuration`)},disabled:me(e.status)},{onlyInMenu:!0,action:"team",icon:X.Group,name:m("common.manageTeam"),handler:()=>{a(`/blocklets/${e.meta.did}/members`)},disabled:me(e.status)},{onlyInMenu:!0,action:"log",icon:X.Log,name:m("common.log"),handler:()=>{a(`/logs/blocklet-${e.meta.did}`)},disabled:me(e.status)}].filter(Boolean);return o==="menu"?l.jsxs(Bn,{"data-cy":"blocklet-actions",children:[l.jsx(Ht,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:Ce,size:"small",disabled:!r||!me(e.status)&&h,children:l.jsx(rs,{})}),l.jsxs(Cr,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:I,onClose:Se,PaperProps:{},children:[Ee.length>0&&l.jsxs(us,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),l.jsx("br",{}),l.jsx(no,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),de.map((j,N)=>j.separator?l.jsx(Pt,{},`separator-${N}`):l.jsxs(Sr,{dense:!0,onClick:ee=>le(j,ee),disabled:h||j.disabled,"data-cy":`${j.action}-blocklet`,children:[l.jsx(is,{style:{minWidth:24},children:f===j.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(j.icon,{fontSize:"small"})}),l.jsx(lo,{primary:j.name})]},j.name))]}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):l.jsxs(Bn,{"data-cy":"blocklet-actions",...i,children:[l.jsx(ds,{children:de.filter(j=>!j.separator&&!j.onlyInMenu).map(j=>l.jsxs(be,{title:j.name,"data-cy":`${j.action}-blocklet`,onClick:()=>le(j),disabled:!!j.disabled||h,children:[f===j.action&&h?l.jsx(se,{size:16,sx:{marginRight:1}}):l.jsx(j.icon,{}),l.jsx("span",{className:"blocklet-action-text",children:j.name})]},j.name))}),v&&l.jsx(Dn,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}nn.propTypes={blocklet:y.object.isRequired,onStart:y.func.isRequired,onComplete:y.func.isRequired,variant:y.oneOf(["menu","group"]),hasPermission:y.bool,useBlockletUrlEvaluation:y.func};nn.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const Bn=rt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ import{r as g,ay as Qn,az as Yn,aA as Vt,aB as F,aC as Xn,aD as Zn,aE as ye,aF a
|
|
|
8
8
|
font-size: 10px;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,vt=(e,t)=>{var o;let n="?v=";return t?n+=Rr(t):n+=`${(o=e==null?void 0:e.meta)==null?void 0:o.version}${Rt(e==null?void 0:e.status)?"~":""}`,n};function Ii({blocklet:e}){var u,d,f,p;const{inService:t}=W(),n=(u=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:u.value,o=(d=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:d.value,r=(f=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:f.value,s=((p=window.env)==null?void 0:p.apiPrefix)||"/",i=pt(s,`/blocklet/logo/${t?"":e.meta.did}`,vt(e,n)),a=pt(s,`/blocklet/logo-rect/${t?"":e.meta.did}`,vt(e,o)),c=pt(s,`/blocklet/logo-favicon/${t?"":e.meta.did}`,vt(e,r));return{logoUrl:i,rectLogoUrl:a,faviconUrl:c}}function on({blocklet:e,style:t,size:n,...o}){var a;const{logoUrl:r}=Ii({blocklet:e}),{variant:s}=o;let i=l.jsx("img",{src:r,alt:"",style:{width:n}});return e.meta.logo||(a=(e.configs||[]).find(u=>u.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))!=null&&a.value||(i=l.jsx(Ar,{did:e.meta.did||"",responsive:!0})),l.jsx(uo,{variant:s||"square",style:Object.assign({backgroundColor:"transparent",width:n,height:n,borderRadius:10},t),...o,children:i})}on.propTypes={blocklet:y.object.isRequired,style:y.object,size:y.oneOfType([y.number,y.string])};on.defaultProps={style:{},size:40};const Di=e=>{const t={};let n=null;return Lr(e,o=>{t[o.meta.bundleDid]?n=$e(o,!0):o.meta.bundleDid&&(t[o.meta.bundleDid]=!0)}),n},Li=(e,t,n)=>{var s;const{hostname:o,href:r}=e;if(!t)return r;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(o);if(!a)return r;const c=a[0],d=((((s=t.site)==null?void 0:s.domainAliases)||[]).map(f=>f.value).filter(Boolean).find(f=>f.endsWith(k.DEFAULT_DID_DOMAIN))||"").replace(`.${k.DEFAULT_DID_DOMAIN}`,"");return d?r.replace(o,`${d}-${c}.${k.DEFAULT_IP_DOMAIN_SUFFIX}`):r}return r.replace(t.meta.bundleDid,t.appPid)};function wo(){const{t:e}=G(),{api:t}=
|
|
11
|
+
`,vt=(e,t)=>{var o;let n="?v=";return t?n+=Rr(t):n+=`${(o=e==null?void 0:e.meta)==null?void 0:o.version}${Rt(e==null?void 0:e.status)?"~":""}`,n};function Ii({blocklet:e}){var u,d,f,p;const{inService:t}=W(),n=(u=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:u.value,o=(d=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:d.value,r=(f=((e==null?void 0:e.environments)||[]).find(h=>h.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:f.value,s=((p=window.env)==null?void 0:p.apiPrefix)||"/",i=pt(s,`/blocklet/logo/${t?"":e.meta.did}`,vt(e,n)),a=pt(s,`/blocklet/logo-rect/${t?"":e.meta.did}`,vt(e,o)),c=pt(s,`/blocklet/logo-favicon/${t?"":e.meta.did}`,vt(e,r));return{logoUrl:i,rectLogoUrl:a,faviconUrl:c}}function on({blocklet:e,style:t,size:n,...o}){var a;const{logoUrl:r}=Ii({blocklet:e}),{variant:s}=o;let i=l.jsx("img",{src:r,alt:"",style:{width:n}});return e.meta.logo||(a=(e.configs||[]).find(u=>u.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))!=null&&a.value||(i=l.jsx(Ar,{did:e.meta.did||"",responsive:!0})),l.jsx(uo,{variant:s||"square",style:Object.assign({backgroundColor:"transparent",width:n,height:n,borderRadius:10},t),...o,children:i})}on.propTypes={blocklet:y.object.isRequired,style:y.object,size:y.oneOfType([y.number,y.string])};on.defaultProps={style:{},size:40};const Di=e=>{const t={};let n=null;return Lr(e,o=>{t[o.meta.bundleDid]?n=$e(o,!0):o.meta.bundleDid&&(t[o.meta.bundleDid]=!0)}),n},Li=(e,t,n)=>{var s;const{hostname:o,href:r}=e;if(!t)return r;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(o);if(!a)return r;const c=a[0],d=((((s=t.site)==null?void 0:s.domainAliases)||[]).map(f=>f.value).filter(Boolean).find(f=>f.endsWith(k.DEFAULT_DID_DOMAIN))||"").replace(`.${k.DEFAULT_DID_DOMAIN}`,"");return d?r.replace(o,`${d}-${c}.${k.DEFAULT_IP_DOMAIN_SUFFIX}`):r}return r.replace(t.meta.bundleDid,t.appPid)};function wo(){const{t:e}=G(),{api:t}=ms(),{blocklet:n}=ce(),{inService:o}=W(),[r,s]=g.useState(!1),[i,a]=g.useState(5),c=n&&n.structVersion!==k.APP_STRUCT_VERSION,u=()=>{try{if(n.status==="running"){T.error(e("blocklet.migrate.tip.running"));return}const p=Di(n);if(p){T.error(e("blocklet.migrate.tip.duplicate",{name:p}));return}s(!0)}catch(p){T.error(Me(p))}},d=()=>{const p=Li(window.location,n,o);setTimeout(()=>{window.location.href=p},5e3),a(5),setInterval(()=>{a(h=>h-1)},1e3)},f=()=>s(!1);return[c&&l.jsxs(hs,{type:"warning",style:{margin:"12px 0"},children:[l.jsxs(L,{display:"flex",alignItems:"center",children:[l.jsx(be,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),l.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(p=>l.jsx(L,{display:"flex",alignItems:"center",children:e(`blocklet.migrate.intro.${p}`)},p))]},"alert"),n&&l.jsx(Ir,{popup:!0,open:r,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:Dr(n,!0),title:$e(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:i>=0?e("blocklet.migrate.success",{sec:i}):"Redirecting..."},onClose:f},"connect")]}wo.propTypes={};async function Ti({blockletDid:e,nodeApi:t,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async s=>{let{name:i}=s;const a=await gs(s.endpoint);return!Kt.isEmpty(a)&&a!==i&&(i=a,o=!0),{...s,name:i}}));return o&&await Promise.all(r.filter(s=>s.did).map(s=>t.updateBlockletSpaceGateway({input:{did:e,where:{did:s.did},spaceGateway:{...s}}}))),r}function Bi({setLoading:e,refresh:t}={}){var c;const{blocklet:n,actions:{refreshBlocklet:o}}=ce(),r=(c=n==null?void 0:n.meta)==null?void 0:c.did,[s,i]=g.useState([]),{api:a}=W();return it(async()=>{try{if(!r){i([]);return}e==null||e(!0);const{spaceGateways:u}=await a.getBlockletSpaceGateways({input:{did:r}}),d=await Ti({blockletDid:r,nodeApi:a,spaceGateways:u});i(d??[])}catch(u){console.error(u),T.error(Me(u))}finally{e==null||e(!1)}},[r,o,t]),{spaceGateways:s}}function jo({deps:e,setLoading:t}={deps:[],setLoading:()=>{}}){var a;const{blocklet:n}=ce(),[o,r]=g.useState([]),{api:s}=W(),i=Kt.debounce(async()=>{try{if(t(!0),!n){r([]);return}const{backups:c}=await s.getBlockletBackups({input:{did:n.meta.did}});r(c??[])}catch(c){console.error(c),T.error(Me(c))}finally{t(!1)}},2e3);return it(async()=>{i()},[(a=n==null?void 0:n.meta)==null?void 0:a.did].concat(e)),{backups:o}}function ki({appDid:e}){const{backups:t}=jo(),[n,o]=g.useState({message:"",progress:0,completed:!1}),r=W(),{ws:{useSubscription:s}}=r;return s($.BlockletEvents.backupProgress,i=>{e===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[e]),g.useEffect(()=>{var i;if(t!=null&&t.length&&Kt.isNull((i=t[0])==null?void 0:i.status)){const[a]=t;o(()=>({message:a.message,progress:a.progress,completed:a.progress>=100}))}},[t]),n}function Ni({deps:e}={deps:[]}){var s;const{blocklet:t}=ce(),{api:n}=W(),[o,r]=g.useState(null);return it(async()=>{var i;if((i=t==null?void 0:t.meta)!=null&&i.did){const{autoBackup:a}=await n.getAutoBackup({input:{did:t.meta.did}});r(a)}},[(s=t==null?void 0:t.meta)==null?void 0:s.did].concat(e)),o}function $i({deps:e}={deps:[]}){var s;const{blocklet:t}=ce(),{api:n}=W(),[o,r]=g.useState(null);return it(async()=>{var i;if((i=t==null?void 0:t.meta)!=null&&i.did){const{autoCheckUpdate:a}=await n.getAutoCheckUpdate({input:{did:t.meta.did}});r(a)}},[(s=t==null?void 0:t.meta)==null?void 0:s.did].concat(e)),o}const _o=g.createContext({}),{Provider:Mi,Consumer:Sl}=_o;function rn({children:e}){const{t}=G(),{api:n}=W(),{blocklet:o}=ce(),[r,s]=g.useState(!1),[i,a]=g.useState(!1),{spaceGateways:c}=Bi({refresh:i,setLoading:s}),u=ki({appDid:o==null?void 0:o.appDid}),[d,f]=g.useState(!1),p=g.useMemo(()=>vs(o==null?void 0:o.environments),[o,i,d]),[h,x]=g.useState(!1),{backups:v}=jo({deps:[u],setLoading:x}),[P,m]=g.useState(c==null?void 0:c.find(O=>O.endpoint===p)),[R,A]=g.useState(!1),w=Ni({deps:[R]}),[b,_]=g.useState(!1),E=$i({deps:[b]}),S=()=>{a(O=>!O)},C=()=>{f(O=>!O)},I=()=>{A(O=>!O)},Ce=()=>{_(O=>!O)},Se=async(O,J)=>{c.push({...O,loading:!0}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:O}}),p!==J&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:J}]}}),S(),m(O)},le=async O=>{if(O){if(O.endpoint===p){T.warning(t("storage.spaces.gateway.delete.failedForConnected"));return}await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:O==null?void 0:O.did}}),S(),m(O)}},Oe=async O=>{await n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:O.did},spaceGateway:O}}),p!==O.endpoint&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:O.endpoint}]}}),T.success(t("storage.spaces.connectedWithName",{name:(O==null?void 0:O.name)??"DID Spaces"})),S()},ue=O=>(O==null?void 0:O.endpoint)===p,Ee=async O=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:O}}),I()},de=async O=>{await n.updateAutoCheckUpdate({input:{did:o.meta.did,autoCheckUpdate:O}}),Ce()};return l.jsx(Mi,{value:{spaceGateways:c,selectedSpaceGateway:P,addSpaceGateway:Se,deleteSpaceGateway:le,updateSpaceGateway:Oe,refreshSpaceGateways:S,spaceGatewaysLoading:r,spaceGatewayIsSelected:ue,updateAutoBackup:Ee,updateAutoCheckUpdate:de,autoCheckUpdate:E,backupEndpoint:p,backupProgress:u,backups:v,backupsLoading:h,refreshBackupEndpoint:C,autoBackup:w},children:e})}rn.propTypes={children:y.any.isRequired};rn.defaultProps={};function Ol(){return g.useContext(_o)}const Co=g.createContext({});function El(){return g.useContext(Co)}const{Provider:Ui,Consumer:Pl}=Co,{did:U,appId:Fi}=window.env;function zi({children:e}){var _,E;const{t,locale:n}=G(),{blocklet:o}=at(),[r,s]=g.useState([]),[i,a]=g.useState([]),[c,u]=g.useState([]),d=$e(o),f=((_=((o==null?void 0:o.environments)||[]).find(S=>S.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:_.value)||"auto",p=(o==null?void 0:o.trustedPassports)||[],h=(o==null?void 0:o.trustedFactories)||[],x=(o==null?void 0:o.enablePassportIssuance)!==!1,v=async()=>{try{const S=await Ke.doBatchQuery({getRoles:{input:{teamDid:U}},getPermissions:{input:{teamDid:U}},getInvitations:{input:{teamDid:U}}});a((S.getRoles.roles||[]).filter(C=>!k.RBAC_CONFIG.roles.some(I=>I.name===C.name&&(!I.passport||I.ci))).map(C=>(C.hasDescription=!!C.description,C.hasDescription||(C.description=t("team.passport.description",{teamName:d,title:C.title})),C))),u(S.getPermissions.permissions||[]),s(S.getInvitations.invitations||[])}catch(S){T.error(S.message)}},P=({did:S}={})=>{const C={teamDid:U,user:{did:S}};return Ke.getUser({input:C})},m=({query:S,paging:C}={})=>{const I={teamDid:U};return C&&(I.paging=C),S&&(I.query=S),I.sort={lastLoginAt:-1},Ke.getUsers({input:I})},R=()=>Ke.getUsersCountPerRole({input:{teamDid:U}}),A=()=>v();g.useEffect(()=>{var S;(S=o==null?void 0:o.meta)!=null&&S.did&&v()},[(E=o==null?void 0:o.meta)==null?void 0:E.did]),g.useEffect(()=>{a(S=>S.map(C=>(C.hasDescription||(C.description=t("team.passport.description",{teamName:d,title:C.title})),{...C})))},[t,n]);const w=S=>{S.teamDid===U&&v()};Qe(k.EVENTS.USER_ADDED,w,[U]),Qe(k.EVENTS.USER_REMOVED,w,[U]),Qe(k.EVENTS.USER_UPDATED,w,[U]);const b={teamDid:U,teamIssuerDid:Fi,teamName:d,invitations:r,roles:i,permissions:c,trustedPassports:p,trustedFactories:h,isNodeTeam:!1,enablePassportIssuance:x,refresh:A,passportColor:f,endpoint:window.location.origin,blocklet:o,api:{getUser:P,getUsers:m,getUsersCountPerRole:R}};return l.jsx(Ui,{value:b,children:e})}function D(e,t,n){return oo.call(t,"css")?l.jsx(ro,so(e,t),n):l.jsx(e,t,n)}function yt(e,t,n){return oo.call(t,"css")?l.jsxs(ro,so(e,t),n):l.jsxs(e,t,n)}/**
|
|
12
12
|
* (c) Iconify
|
|
13
13
|
*
|
|
14
14
|
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
@@ -30,7 +30,7 @@ Document Details
|
|
|
30
30
|
${n}
|
|
31
31
|
* Page: ${window.location.href}
|
|
32
32
|
-->
|
|
33
|
-
`),D(L,{sx:{mx:{xs:0,md:2}},children:D(Tr,{sx:{color:"text.primary"},target:"_blank",href:o.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}vn.propTypes={infos:y.arrayOf(y.shape({label:y.string,value:y.string}))};vn.defaultProps={infos:[]};function yn({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:o,sessionManagerProps:r,links:s,...i}){var w;xs();const a=g.useContext(Br),c=(w=a==null?void 0:a.session)==null?void 0:w.user,u=c==null?void 0:c.role,{locale:d}=G()||{},f=g.useMemo(()=>{const b=Object.assign({},window.blocklet,e);try{return ws(b)}catch(_){return console.error("Failed to format blocklet info",_,b),b}},[e]),{localizedNav:p,flattened:h,matchedIndex:x}=g.useMemo(()=>{var S;let b=js((S=f==null?void 0:f.navigation)==null?void 0:S.dashboard,d)||[];b=_s(b,u),b=Cs(b,C=>({title:C.title,url:C.link,icon:C.icon?l.jsx("iconify-icon",{icon:C.icon}):null,external:!0,children:C.items}),"items");const _=Ss(b).filter(C=>!!C.url),E=Os(_.map(C=>C.url));return E!==-1&&(_[E].active=!0),{localizedNav:b,flattened:_,matchedIndex:E}},[f,d,u]),v=typeof s=="function"?s(p):[...p,...s];if(g.useLayoutEffect(()=>{c&&!(h!=null&&h.length)&&t&&(window.location.href=t)},[t]),g.useLayoutEffect(()=>{var b;c&&(h!=null&&h.length)&&x===-1&&(n?n():window.location.href=((b=h[0])==null?void 0:b.url)||et)},[n,h,x]),!f.appName)return null;const{appLogo:P,appLogoRect:m,appName:R}=f,A=l.jsx(Es,{formattedBlocklet:f,addons:o,sessionManagerProps:r});return l.jsx(Rs,{title:R,fullWidth:!0,sidebarWidth:128,legacy:!1,links:v,...i,headerProps:{homeLink:et,logo:l.jsx("img",{src:m||P,alt:"logo"}),addons:A,...i.headerProps}})}yn.propTypes={meta:ys,fallbackUrl:y.string,invalidPathFallback:y.func,headerAddons:y.oneOfType([y.func,y.node]),sessionManagerProps:bs,links:y.oneOfType([y.array,y.func])};yn.defaultProps={meta:{},fallbackUrl:et,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=et}},links:[]};var bn={},gc=K;Object.defineProperty(bn,"__esModule",{value:!0});var sr=bn.default=void 0,vc=gc(H()),Hn=l;sr=bn.default=(0,vc.default)([(0,Hn.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,Hn.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");var yc={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},bc={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const Ut=new Map,xc=(e,t)=>{Ut.set(e,t)},wc=(e="en_US")=>Ut.get(e)||Ut.get("en_US");var ir={registerLang:xc,getLang:wc},jc=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const _c=jc,{getLang:Ie}=ir,Cc=(e,t)=>t===1?e:`${e}s`,Sc=1e-7;var Oc=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=Ie(t.locale),o=[],r=(a,c)=>{const u=Math.floor(a*10**c+Sc);return(Math.round(u)/10**c).toFixed(c)},s=(a,c,u)=>{if((o.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:d}=n[c]||Ie("en_US")[c],{short:f}=n[c]||Ie("en_US")[c];let p=(u||a||"0").toString(),h,x;if(t.colonNotation){h=o.length>0?":":"",x="";const v=p.includes(".")?p.split(".")[0].length:p.length,P=o.length>0?2:1;p="0".repeat(Math.max(0,P-v))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(v=>v>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?x=d:x=f:i.minutes?x=d:x=f:x=t.verbose?` ${Cc(d,a)}`:f;o.push(h+p+x)},i=_c(e);if(s(Math.trunc(i.days/365),"year"),s(i.days%365,"day"),s(i.hours,"hour"),s(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(s(i.seconds,"second"),t.formatSubMilliseconds)s(i.milliseconds,"millisecond"),s(i.microseconds,"microsecond"),s(i.nanoseconds,"nanosecond");else{const a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=a>=1?Math.round(a):Math.ceil(a),d=c?a.toFixed(c):u;s(Number.parseFloat(d,10),"millisecond",d)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=r(a,c),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");s(Number.parseFloat(d,10),"second",d)}if(o.length===0){const a=(n.millisecond||Ie("en_US").millisecond).long,c=(n.millisecond||Ie("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return o[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return o.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?o.join(""):o.join(" ")};const Ec=yc,Pc=bc,{registerLang:xn}=ir,ar=Oc;xn("en_US",Ec);xn("zh_CN",Pc);ar.registerLang=xn;var Rc=ar;const Ft=eo(Rc),Ac=30*24*60*60*1e3,Ic="https://launcher.arcblock.io/";function Ct({children:e}){return l.jsxs(L,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(sr,{fontSize:"small"}),e]})}function ot({launcherUrl:e,chainHost:t,nftId:n,retention:o,...r}){var b,_;const{t:s,locale:i}=G(),[a,c]=cs({safeIframeRef:null,popoverAnchorEl:null}),u=g.useRef(null),d=io(E=>E.breakpoints.down("md")),{sx:f={},...p}=r,h=d?"mobile":"desktop",x=ns(async()=>{const[E,S]=await Promise.all([kr(t,n),Nr({launcherUrl:e||Ic,nftId:n,locale:i})]);return{asset:E,subscriptionURL:S}},[i]);if(x.loading)return l.jsx(ht,{label:l.jsxs(Ct,{children:[!d&&s("expiration.desktop.loading"),l.jsx(se,{size:16})]}),variant:"success",sx:{cursor:"pointer",...f},...p});if(x.error)return console.error(x.error),l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...f},...p,onClick:()=>x.retry()});const v=$r((b=x.value)==null?void 0:b.asset),P=We(v).isBefore(We()),m=We(v).diff(We(),"ms");let R="success";m<=Ac&&(R="warning"),P&&(R="error");const A=E=>{c({popoverAnchorEl:E.currentTarget})},w=()=>{c({popoverAnchorEl:null})};return l.jsxs(l.Fragment,{children:[l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.tips.${R}`,{validity:Ft(m,{locale:ao(i),compact:!0,verbose:!0})})}),color:R,variant:R!=="success"?"contained":"outlined",sx:{cursor:"pointer",...f},...p,onClick:A}),l.jsx(Mr,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:l.jsx("iframe",{ref:u,title:s("common.subscription"),width:"360px",height:"600px",style:{border:0},src:(_=x.value)==null?void 0:_.subscriptionURL})})]})}ot.propTypes={chainHost:y.string.isRequired,nftId:y.string.isRequired,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};ot.defaultProps={sx:{},retention:0};var wn={};Object.defineProperty(wn,"__esModule",{value:!0});var zt=wn.default=void 0;Dc(g);var Kn=l;function Dc(e){return e&&e.__esModule?e:{default:e}}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(o){Lc(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lc(e,t,n){return t=Tc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tc(e){var t=Bc(e,"string");return typeof t=="symbol"?t:String(t)}function Bc(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jn=function(t){return(0,Kn.jsx)("svg",Gn(Gn({},t),{},{children:(0,Kn.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.251 2.5c-2.576-.006-4.747 2.1-4.766 4.506v5.784c0 .793-.084 1.778-.58 2.71h12.19c-.496-.932-.58-1.917-.58-2.711V7.01c-.035-2.403-2.21-4.502-4.797-4.508L9.25 2.5zM17.015 7v5.789c0 .79.1 1.562.53 2.219l.287.438c.436.664-.033 1.554-.817 1.554H2.985c-.785 0-1.255-.89-.818-1.554l.287-.438c.43-.657.53-1.428.53-2.218V7c.024-3.291 2.927-6.008 6.27-6l1.467.003c3.344.008 6.254 2.706 6.294 5.998zM11.06 18.06A1.5 1.5 0 0 0 11.5 17H13a3 3 0 0 1-6 0h1.5a1.5 1.5 0 0 0 2.56 1.06z",fill:"currentColor"})}))};jn.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};jn.displayName="notification";var kc=jn;zt=wn.default=kc;function cr({status:e,...t}){const n={warning:"warning",error:"error",info:"primary"};return!e||e==="info"||e==="success"?null:l.jsx(co,{type:n[e],style:{borderRadius:5,border:"1px solid #ccc"},...t,children:e})}cr.propTypes={status:y.string.isRequired};function _n({value:e,...t}){const{t:n,locale:o}=G();if(!e)return"-";const r={locale:ao(o),compact:!0},s=new Date(e).getTime(),i=Date.now();if(s>i){const c=Ft(s-i,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.afterTime",{time:c})})})}const a=Ft(i-s,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.timeAgo",{time:a})})})}_n.propTypes={value:y.any};_n.defaultProps={value:""};function Nc(e,t){const n=g.useRef(t);g.useEffect(()=>{const o=r=>n.current(r.detail);return window.addEventListener(e,o),()=>window.removeEventListener(e,o)},[e])}function $c(){window.dispatchEvent(new CustomEvent("checkUpdate"))}function Al(e){const t=st(),{t:n}=G(),o=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),t(r.toString()),e(),T.success(n("notification.checkingForUpdates")))};g.useEffect(o,[]),Nc("checkUpdate",o)}function Cn({onHide:e,api:t,notifications:n,updateNotifications:o,viewAllUrl:r,teamDid:s}){const{inService:i}=W(),{t:a,locale:c}=g.useContext(qt),[u,d]=g.useState(!0),[f,p]=g.useState(!1),h=st(),x=Ur();let v=u?n:n.filter(w=>w.read===!1);v=v.slice(0,5);const P=n.filter(w=>w.read===!1).length>0,m=async()=>{p(!0);const w=n.filter(b=>b.read===!1).map(b=>b.id).join(",");i?await t.readBlockletNotifications({input:{id:w,teamDid:s}}):await t.readNotifications({input:{id:w}}),o(),p(!1)},R=(w,b)=>{b.read||(i?t.readBlockletNotifications({input:{id:b.id,teamDid:s}}).then(()=>o()):t.readNotifications({input:{id:b.id}}).then(()=>o())),e(w),h(r)},A=(w,b)=>{w.preventDefault(),w.stopPropagation(),h(b),$c()};return l.jsxs(Mc,{children:[l.jsxs(Z,{component:"h3",variant:"h6",className:"notification-header",children:[a("notification.title"),l.jsx(be,{component:no,to:r,"data-cy":"view-all-notifications-btn",onClick:e,children:a("notification.viewAll")})]}),l.jsx(Pt,{}),l.jsxs(Fr,{className:"notification-list",style:{maxHeight:"calc(100vh - 200px)",overflow:"auto"},children:[v.length===0&&l.jsx(Z,{component:"p",variant:"body1",className:"notification-tip",children:a("notification.empty")}),v.length>0&&v.map(w=>l.jsxs(Ps,{alignItems:"flex-start",disabled:w.read,onClick:b=>R(b,w),children:[l.jsx(Hs,{className:"list-item-avatar",children:l.jsxs(l.Fragment,{children:[l.jsx(uo,{children:w.entityType.substr(0,1).toUpperCase()}),l.jsx(cr,{className:"notification-tag",status:w.severity})]})}),l.jsx(lo,{primary:w.title,secondary:l.jsxs(L,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[l.jsx(Z,{component:"span",sx:{overflow:"hidden","-webkit-line-clamp":"3","-webkit-box-orient":"vertical",display:"-webkit-box","text-overflow":"ellipsis"},children:w.description}),l.jsxs(L,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[l.jsx(_n,{value:w.createdAt,locale:c,style:{color:x.palette.text.secondary,fontSize:"0.875rem",marginTop:"4px"}}),w.action&&!w.read?l.jsx(be,{color:"primary",variant:"outlined",onPointerDown:b=>{b.stopPropagation(),b.preventDefault()},onClick:b=>A(b,w.action),"data-cy":"check-for-updates",children:a("notification.proceed")}):null]})]})})]},w.id))]}),l.jsx(Pt,{}),l.jsxs(Z,{component:"div",className:"notification-footer",children:[l.jsx(At,{control:l.jsx(Is,{checked:u,onChange:()=>d(!u),name:"showRead",color:"primary"}),label:a("notification.showRead")}),l.jsx(os,{permission:i?"":"mutate_notification",role:i?zr:[],children:P&&l.jsxs(be,{disabled:f,onClick:m,className:"",children:[f&&l.jsx(se,{size:16,style:{marginRight:"1em"}}),a("notification.markAllAsRead")]})})]})]})}const Mc=rt.div`
|
|
33
|
+
`),D(L,{sx:{mx:{xs:0,md:2}},children:D(Tr,{sx:{color:"text.primary"},target:"_blank",href:o.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}vn.propTypes={infos:y.arrayOf(y.shape({label:y.string,value:y.string}))};vn.defaultProps={infos:[]};function yn({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:o,sessionManagerProps:r,links:s,...i}){var w;ws();const a=g.useContext(Br),c=(w=a==null?void 0:a.session)==null?void 0:w.user,u=c==null?void 0:c.role,{locale:d}=G()||{},f=g.useMemo(()=>{const b=Object.assign({},window.blocklet,e);try{return js(b)}catch(_){return console.error("Failed to format blocklet info",_,b),b}},[e]),{localizedNav:p,flattened:h,matchedIndex:x}=g.useMemo(()=>{var S;let b=_s((S=f==null?void 0:f.navigation)==null?void 0:S.dashboard,d)||[];b=Cs(b,u),b=Ss(b,C=>({title:C.title,url:C.link,icon:C.icon?l.jsx("iconify-icon",{icon:C.icon}):null,external:!0,children:C.items}),"items");const _=Os(b).filter(C=>!!C.url),E=Es(_.map(C=>C.url));return E!==-1&&(_[E].active=!0),{localizedNav:b,flattened:_,matchedIndex:E}},[f,d,u]),v=typeof s=="function"?s(p):[...p,...s];if(g.useLayoutEffect(()=>{c&&!(h!=null&&h.length)&&t&&(window.location.href=t)},[t]),g.useLayoutEffect(()=>{var b;c&&(h!=null&&h.length)&&x===-1&&(n?n():window.location.href=((b=h[0])==null?void 0:b.url)||et)},[n,h,x]),!f.appName)return null;const{appLogo:P,appLogoRect:m,appName:R}=f,A=l.jsx(Ps,{formattedBlocklet:f,addons:o,sessionManagerProps:r});return l.jsx(As,{title:R,fullWidth:!0,sidebarWidth:128,legacy:!1,links:v,...i,headerProps:{homeLink:et,logo:l.jsx("img",{src:m||P,alt:"logo"}),addons:A,...i.headerProps}})}yn.propTypes={meta:bs,fallbackUrl:y.string,invalidPathFallback:y.func,headerAddons:y.oneOfType([y.func,y.node]),sessionManagerProps:xs,links:y.oneOfType([y.array,y.func])};yn.defaultProps={meta:{},fallbackUrl:et,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=et}},links:[]};var bn={},gc=K;Object.defineProperty(bn,"__esModule",{value:!0});var sr=bn.default=void 0,vc=gc(H()),Hn=l;sr=bn.default=(0,vc.default)([(0,Hn.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,Hn.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");var yc={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},bc={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const Ut=new Map,xc=(e,t)=>{Ut.set(e,t)},wc=(e="en_US")=>Ut.get(e)||Ut.get("en_US");var ir={registerLang:xc,getLang:wc},jc=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const _c=jc,{getLang:Ie}=ir,Cc=(e,t)=>t===1?e:`${e}s`,Sc=1e-7;var Oc=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=Ie(t.locale),o=[],r=(a,c)=>{const u=Math.floor(a*10**c+Sc);return(Math.round(u)/10**c).toFixed(c)},s=(a,c,u)=>{if((o.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:d}=n[c]||Ie("en_US")[c],{short:f}=n[c]||Ie("en_US")[c];let p=(u||a||"0").toString(),h,x;if(t.colonNotation){h=o.length>0?":":"",x="";const v=p.includes(".")?p.split(".")[0].length:p.length,P=o.length>0?2:1;p="0".repeat(Math.max(0,P-v))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(v=>v>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?x=d:x=f:i.minutes?x=d:x=f:x=t.verbose?` ${Cc(d,a)}`:f;o.push(h+p+x)},i=_c(e);if(s(Math.trunc(i.days/365),"year"),s(i.days%365,"day"),s(i.hours,"hour"),s(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(s(i.seconds,"second"),t.formatSubMilliseconds)s(i.milliseconds,"millisecond"),s(i.microseconds,"microsecond"),s(i.nanoseconds,"nanosecond");else{const a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=a>=1?Math.round(a):Math.ceil(a),d=c?a.toFixed(c):u;s(Number.parseFloat(d,10),"millisecond",d)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=r(a,c),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");s(Number.parseFloat(d,10),"second",d)}if(o.length===0){const a=(n.millisecond||Ie("en_US").millisecond).long,c=(n.millisecond||Ie("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return o[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return o.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?o.join(""):o.join(" ")};const Ec=yc,Pc=bc,{registerLang:xn}=ir,ar=Oc;xn("en_US",Ec);xn("zh_CN",Pc);ar.registerLang=xn;var Rc=ar;const Ft=eo(Rc),Ac=30*24*60*60*1e3,Ic="https://launcher.arcblock.io/";function Ct({children:e}){return l.jsxs(L,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(sr,{fontSize:"small"}),e]})}function ot({launcherUrl:e,chainHost:t,nftId:n,retention:o,...r}){var b,_;const{t:s,locale:i}=G(),[a,c]=cs({safeIframeRef:null,popoverAnchorEl:null}),u=g.useRef(null),d=io(E=>E.breakpoints.down("md")),{sx:f={},...p}=r,h=d?"mobile":"desktop",x=ns(async()=>{const[E,S]=await Promise.all([kr(t,n),Nr({launcherUrl:e||Ic,nftId:n,locale:i})]);return{asset:E,subscriptionURL:S}},[i]);if(x.loading)return l.jsx(ht,{label:l.jsxs(Ct,{children:[!d&&s("expiration.desktop.loading"),l.jsx(se,{size:16})]}),variant:"success",sx:{cursor:"pointer",...f},...p});if(x.error)return console.error(x.error),l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...f},...p,onClick:()=>x.retry()});const v=$r((b=x.value)==null?void 0:b.asset),P=We(v).isBefore(We()),m=We(v).diff(We(),"ms");let R="success";m<=Ac&&(R="warning"),P&&(R="error");const A=E=>{c({popoverAnchorEl:E.currentTarget})},w=()=>{c({popoverAnchorEl:null})};return l.jsxs(l.Fragment,{children:[l.jsx(ht,{label:l.jsx(Ct,{children:s(`expiration.${h}.tips.${R}`,{validity:Ft(m,{locale:ao(i),compact:!0,verbose:!0})})}),color:R,variant:R!=="success"?"contained":"outlined",sx:{cursor:"pointer",...f},...p,onClick:A}),l.jsx(Mr,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:l.jsx("iframe",{ref:u,title:s("common.subscription"),width:"360px",height:"600px",style:{border:0},src:(_=x.value)==null?void 0:_.subscriptionURL})})]})}ot.propTypes={chainHost:y.string.isRequired,nftId:y.string.isRequired,sx:y.object,retention:y.number,launcherUrl:y.string.isRequired};ot.defaultProps={sx:{},retention:0};var wn={};Object.defineProperty(wn,"__esModule",{value:!0});var zt=wn.default=void 0;Dc(g);var Kn=l;function Dc(e){return e&&e.__esModule?e:{default:e}}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(o){Lc(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lc(e,t,n){return t=Tc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tc(e){var t=Bc(e,"string");return typeof t=="symbol"?t:String(t)}function Bc(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jn=function(t){return(0,Kn.jsx)("svg",Gn(Gn({},t),{},{children:(0,Kn.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.251 2.5c-2.576-.006-4.747 2.1-4.766 4.506v5.784c0 .793-.084 1.778-.58 2.71h12.19c-.496-.932-.58-1.917-.58-2.711V7.01c-.035-2.403-2.21-4.502-4.797-4.508L9.25 2.5zM17.015 7v5.789c0 .79.1 1.562.53 2.219l.287.438c.436.664-.033 1.554-.817 1.554H2.985c-.785 0-1.255-.89-.818-1.554l.287-.438c.43-.657.53-1.428.53-2.218V7c.024-3.291 2.927-6.008 6.27-6l1.467.003c3.344.008 6.254 2.706 6.294 5.998zM11.06 18.06A1.5 1.5 0 0 0 11.5 17H13a3 3 0 0 1-6 0h1.5a1.5 1.5 0 0 0 2.56 1.06z",fill:"currentColor"})}))};jn.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};jn.displayName="notification";var kc=jn;zt=wn.default=kc;function cr({status:e,...t}){const n={warning:"warning",error:"error",info:"primary"};return!e||e==="info"||e==="success"?null:l.jsx(co,{type:n[e],style:{borderRadius:5,border:"1px solid #ccc"},...t,children:e})}cr.propTypes={status:y.string.isRequired};function _n({value:e,...t}){const{t:n,locale:o}=G();if(!e)return"-";const r={locale:ao(o),compact:!0},s=new Date(e).getTime(),i=Date.now();if(s>i){const c=Ft(s-i,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.afterTime",{time:c})})})}const a=Ft(i-s,r);return l.jsx(Et,{title:An(e,o),placement:"top-end",enterTouchDelay:0,children:l.jsx("span",{...t,children:n("common.timeAgo",{time:a})})})}_n.propTypes={value:y.any};_n.defaultProps={value:""};function Nc(e,t){const n=g.useRef(t);g.useEffect(()=>{const o=r=>n.current(r.detail);return window.addEventListener(e,o),()=>window.removeEventListener(e,o)},[e])}function $c(){window.dispatchEvent(new CustomEvent("checkUpdate"))}function Rl(e){const t=st(),{t:n}=G(),o=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),t(r.toString()),e(),T.success(n("notification.checkingForUpdates")))};g.useEffect(o,[]),Nc("checkUpdate",o)}function Cn({onHide:e,api:t,notifications:n,updateNotifications:o,viewAllUrl:r,teamDid:s}){const{inService:i}=W(),{t:a,locale:c}=g.useContext(qt),[u,d]=g.useState(!0),[f,p]=g.useState(!1),h=st(),x=Ur();let v=u?n:n.filter(w=>w.read===!1);v=v.slice(0,5);const P=n.filter(w=>w.read===!1).length>0,m=async()=>{p(!0);const w=n.filter(b=>b.read===!1).map(b=>b.id).join(",");i?await t.readBlockletNotifications({input:{id:w,teamDid:s}}):await t.readNotifications({input:{id:w}}),o(),p(!1)},R=(w,b)=>{b.read||(i?t.readBlockletNotifications({input:{id:b.id,teamDid:s}}).then(()=>o()):t.readNotifications({input:{id:b.id}}).then(()=>o())),e(w),h(r)},A=(w,b)=>{w.preventDefault(),w.stopPropagation(),h(b),$c()};return l.jsxs(Mc,{children:[l.jsxs(Z,{component:"h3",variant:"h6",className:"notification-header",children:[a("notification.title"),l.jsx(be,{component:no,to:r,"data-cy":"view-all-notifications-btn",onClick:e,children:a("notification.viewAll")})]}),l.jsx(Pt,{}),l.jsxs(Fr,{className:"notification-list",style:{maxHeight:"calc(100vh - 200px)",overflow:"auto"},children:[v.length===0&&l.jsx(Z,{component:"p",variant:"body1",className:"notification-tip",children:a("notification.empty")}),v.length>0&&v.map(w=>l.jsxs(Rs,{alignItems:"flex-start",disabled:w.read,onClick:b=>R(b,w),children:[l.jsx(Hs,{className:"list-item-avatar",children:l.jsxs(l.Fragment,{children:[l.jsx(uo,{children:w.entityType.substr(0,1).toUpperCase()}),l.jsx(cr,{className:"notification-tag",status:w.severity})]})}),l.jsx(lo,{primary:w.title,secondary:l.jsxs(L,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[l.jsx(Z,{component:"span",sx:{overflow:"hidden","-webkit-line-clamp":"3","-webkit-box-orient":"vertical",display:"-webkit-box","text-overflow":"ellipsis"},children:w.description}),l.jsxs(L,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[l.jsx(_n,{value:w.createdAt,locale:c,style:{color:x.palette.text.secondary,fontSize:"0.875rem",marginTop:"4px"}}),w.action&&!w.read?l.jsx(be,{color:"primary",variant:"outlined",onPointerDown:b=>{b.stopPropagation(),b.preventDefault()},onClick:b=>A(b,w.action),"data-cy":"check-for-updates",children:a("notification.proceed")}):null]})]})})]},w.id))]}),l.jsx(Pt,{}),l.jsxs(Z,{component:"div",className:"notification-footer",children:[l.jsx(At,{control:l.jsx(ps,{checked:u,onChange:()=>d(!u),name:"showRead",color:"primary"}),label:a("notification.showRead")}),l.jsx(os,{permission:i?"":"mutate_notification",role:i?zr:[],children:P&&l.jsxs(be,{disabled:f,onClick:m,className:"",children:[f&&l.jsx(se,{size:16,style:{marginRight:"1em"}}),a("notification.markAllAsRead")]})})]})]})}const Mc=rt.div`
|
|
34
34
|
width: 420px;
|
|
35
35
|
|
|
36
36
|
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
@@ -73,7 +73,7 @@ ${n}
|
|
|
73
73
|
background: ${e=>e.theme.palette.primary.light};
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
`;Cn.propTypes={onHide:y.func,api:y.shape({readNotifications:y.func.isRequired,readBlockletNotifications:y.func.isRequired}).isRequired,notifications:y.arrayOf(y.shape({id:y.string,read:y.bool,entityType:y.string,title:y.string,createdAt:y.string,description:y.string}).isRequired).isRequired,updateNotifications:y.func.isRequired,viewAllUrl:y.string.isRequired,teamDid:y.string};Cn.defaultProps={onHide:()=>{},teamDid:""};function Sn({api:e,notifications:t,updateNotifications:n,viewAllUrl:o,teamDid:r}){const[s,i]=g.useState(!1),a=g.useRef(null),c=()=>{i(f=>!f)},u=f=>{a.current&&a.current.contains(f.target)||i(!1)},d=t.filter(f=>f.read===!1).length;return l.jsxs("div",{className:"notification-addon",children:[l.jsx(Ht,{ref:a,"aria-controls":"notify-list-grow","aria-haspopup":"true","data-cy":"toggle-notification-btn",onClick:c,children:d>0?l.jsx(po,{badgeContent:d,max:99,color:"primary",children:l.jsx(zt,{style:{width:"auto",height:24}})}):l.jsx(zt,{style:{width:"auto",height:24}})}),s&&l.jsx(Vr,{open:!0,anchorEl:a.current,disablePortal:!0,placement:"bottom-end",children:l.jsx(qr,{id:"notify-list-grow",children:l.jsx(Hr,{onClickAway:u,children:l.jsx("div",{children:l.jsx(Cn,{notifications:t,updateNotifications:n,api:e,viewAllUrl:o,onHide:u,teamDid:r})})})})})]})}Sn.propTypes={notifications:y.arrayOf(y.object),viewAllUrl:y.string.isRequired,api:y.object.isRequired,updateNotifications:y.func.isRequired,teamDid:y.string};Sn.defaultProps={notifications:[],teamDid:""};const Uc=`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/notifications`;function On(){const{did:e}=window.env,{api:t,data:n,refresh:o}=Kr();return l.jsx(Sn,{api:t,viewAllUrl:Uc,notifications:n||[],updateNotifications:o,teamDid:e})}On.propTypes={};On.defaultProps={};function Fc(){const{inFullPage:e,toggleFullPage:t}=
|
|
76
|
+
`;Cn.propTypes={onHide:y.func,api:y.shape({readNotifications:y.func.isRequired,readBlockletNotifications:y.func.isRequired}).isRequired,notifications:y.arrayOf(y.shape({id:y.string,read:y.bool,entityType:y.string,title:y.string,createdAt:y.string,description:y.string}).isRequired).isRequired,updateNotifications:y.func.isRequired,viewAllUrl:y.string.isRequired,teamDid:y.string};Cn.defaultProps={onHide:()=>{},teamDid:""};function Sn({api:e,notifications:t,updateNotifications:n,viewAllUrl:o,teamDid:r}){const[s,i]=g.useState(!1),a=g.useRef(null),c=()=>{i(f=>!f)},u=f=>{a.current&&a.current.contains(f.target)||i(!1)},d=t.filter(f=>f.read===!1).length;return l.jsxs("div",{className:"notification-addon",children:[l.jsx(Ht,{ref:a,"aria-controls":"notify-list-grow","aria-haspopup":"true","data-cy":"toggle-notification-btn",onClick:c,children:d>0?l.jsx(po,{badgeContent:d,max:99,color:"primary",children:l.jsx(zt,{style:{width:"auto",height:24}})}):l.jsx(zt,{style:{width:"auto",height:24}})}),s&&l.jsx(Vr,{open:!0,anchorEl:a.current,disablePortal:!0,placement:"bottom-end",children:l.jsx(qr,{id:"notify-list-grow",children:l.jsx(Hr,{onClickAway:u,children:l.jsx("div",{children:l.jsx(Cn,{notifications:t,updateNotifications:n,api:e,viewAllUrl:o,onHide:u,teamDid:r})})})})})]})}Sn.propTypes={notifications:y.arrayOf(y.object),viewAllUrl:y.string.isRequired,api:y.object.isRequired,updateNotifications:y.func.isRequired,teamDid:y.string};Sn.defaultProps={notifications:[],teamDid:""};const Uc=`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/notifications`;function On(){const{did:e}=window.env,{api:t,data:n,refresh:o}=Kr();return l.jsx(Sn,{api:t,viewAllUrl:Uc,notifications:n||[],updateNotifications:o,teamDid:e})}On.propTypes={};On.defaultProps={};function Fc(){const{inFullPage:e,toggleFullPage:t}=Is();return D(Ht,{onClick:t,children:e?D(rr,{sx:{transform:"scale(1.3)"}}):D(or,{sx:{transform:"scale(1.3)"}})})}function En({children:e}){var v;const{t}=G(),{loading:n,error:o,actions:{refreshBlocklet:r},env:s,blocklet:i}=at(),{info:a}=Wr(),c=Gr(),u=io(P=>P.breakpoints.down("md")),{appId:d,version:f}=s,p=[{label:"App ID",value:d},{label:"App Version",value:f},{label:"App Bundle Name",value:(v=i==null?void 0:i.meta)==null?void 0:v.bundleName},{label:"Server Id",value:a.did},{label:"Server Version",value:a.version}],h=P=>{var R,A,w;const m=Array.isArray(P)?P:[P];if(m.unshift(D(On,{})),m.unshift(D(Fc,{})),i){const b={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Yr(i)?m.unshift(D(ot,{chainHost:(R=i==null?void 0:i.controller)==null?void 0:R.chainHost,nftId:(A=i==null?void 0:i.controller)==null?void 0:A.nftId,launcherUrl:(w=i==null?void 0:i.controller)==null?void 0:w.launcherUrl,retention:k.EXPIRED_BLOCKLET_DATA_RETENTION_DAYS,sx:b})):a.ownerNft&&a.launcher&&m.unshift(D(ot,{chainHost:a.launcher.chainHost,nftId:a.ownerNft.did,launcherUrl:a.launcher.url,sx:b}))}return m},x={};return u&&(x.logo=null),yt(zc,{legacy:!1,fullWidth:!0,headerAddons:h,headerProps:x,isMobile:u,footerProps:{addon:D(vn,{infos:p})},children:[!i&&n&&D(Je,{relative:"parent",children:D(se,{})}),!i&&o&&yt(Je,{relative:"parent",children:[yt(L,{display:"flex",alignItems:"center",children:[D(nr,{color:"error",sx:{marginRight:1}}),Me(o)]}),D(be,{onClick:()=>r(),children:D("span",{style:{textDecoration:"underline"},children:t("common.retry")})})]}),!!i&&D(L,{flex:1,padding:u?2:3,display:"flex",flexDirection:"column",children:D(Qr,{FallbackComponent:ys,resetKeys:[c.pathname],children:e})})]})}En.propTypes={children:y.any};En.defaultProps={children:null};const zc=rt(yn)`
|
|
77
77
|
div.dashboard-content {
|
|
78
78
|
padding: 0;
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ ${n}
|
|
|
81
81
|
max-height: 400px;
|
|
82
82
|
overflow-y: auto;
|
|
83
83
|
}
|
|
84
|
-
`,Vc=g.lazy(()=>M(()=>import("./overview-
|
|
84
|
+
`,Vc=g.lazy(()=>M(()=>import("./overview-KFyYnpN3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]))),qc=g.lazy(()=>M(()=>import("./index-1UDTrmOX.js"),__vite__mapDeps([48,1,2,49,4,50,51,52,21,22,23,24,25,53,54,55,35,36,12,11,13,14,30,56,46,57,58,59,15,29,7,8,9,10,60,19,61,37,26,27,31,32,33,34,38,39,18,40,41,42,43,44,45,5,47]))),Hc=g.lazy(()=>M(()=>import("./index-dGMkSc6M.js"),__vite__mapDeps([62,1,2,4,63,5,33,64,6,51,52,21,22,23,24,25,8,9,10,12,11,13,14,35,65,7,29,15,66,30,31,32,34,36,37,38,39,18,40,41,42,43,44,45,27,46,47]))),Kc=g.lazy(()=>M(()=>import("./index-ensthqSY.js"),__vite__mapDeps([67,1,2,68,44,45,27,5,46,47,69,70,71,49,64,72,33,21,22,23,24,25,73,37,30,50,74,13,75,8,9,10,12,11,14,15,60,35,76,77,78,79,80,53,54,55,36,56,57,58,59,52,29,19,81,39,31,32,34,38,18,40,41,42,43,82]))),Wc=g.lazy(()=>M(()=>import("./audit-logs-CZDNePJG.js"),__vite__mapDeps([83,1,2,84,29,31,22,23,24,25,85,56,30,8,9,10,12,11,13,14,15,32,33,34,35,36,37,38,39,18,40,41,42,43,44,45,27,5,46,47,86]))),Gc=g.lazy(()=>M(()=>import("./log-IHBBDSFp.js"),__vite__mapDeps([87,1,2,31,33,88,22,23,25,89]))),Qc=g.lazy(()=>M(()=>import("./index-YS2sbIaj.js"),__vite__mapDeps([90,1,2,15,53,54,55,35,23,22,36,24,12,11,13,14,25,21,30,56,46,57,58,59,52,29,7,73,37,31,10,66,88,91,49,39,5,17,18]))),Yc=g.lazy(()=>M(()=>import("./config-navigation-l2UUL5GX.js"),__vite__mapDeps([92,1,2,57,58,59,93,94,77,95,38,39,18,22,23,24,25,12,11,13,14,21,30,66,74,96,40,45,27,5,41,42,43,37,97,33,46,8,9,10,29,31,15,32,34,35,36,44,47]))),Xc=g.lazy(()=>M(()=>import("./index-h9Qzr9Ij.js"),__vite__mapDeps([98,1,2,63,5,33,11,18,99,38,39,21,22,23,24,25,14,19,7,76,35,29,91,12,13,75,53,54,55,36,30,56,46,57,58,59,52,15,100,8,9,10,31,32,34,37,40,41,42,43,44,45,27,47]))),Zc=g.lazy(()=>M(()=>import("./component-noCyoaJE.js"),__vite__mapDeps([101,1,2,4,69,70,71,49,64,72,33,21,22,23,24,25,16,79,15,19,7,102,29,12,11,13,14,8,9,10,76,35,73,37,30,54,55,36,56,46,58,59,52,100,103,91,93,94,97,66,60,34,32,104,105,106,107,47,108,109,110,65,18,42,20,84,111,31,40,112,113,99,38,39,63,5,114,6,26,27,41,43,44,45]))),Jc=g.lazy(()=>M(()=>import("./analytics-HAGGLVM8.js"),__vite__mapDeps([115,1,2,30,8,9,10,68,44,45,27,5,46,47,116,103,59,73,37,42,12,11,13,14,22,23,25,28,21,24,66,53,54,55,35,36,56,57,58,52,15,29,31,32,33,34,38,39,18,40,41,43]))),el=g.lazy(()=>M(()=>import("./notifications-dFwaKILc.js"),__vite__mapDeps([117,1,2,8,9,10,35,23,42,37,12,11,13,14,85,56,30,29,31,15,32,33,34,36,38,39,18,40,41,43,44,45,27,5,46,47])));function tl(){var v,P;const e=st(),{tab:t="overview"}=Zr(),{blocklet:n,actions:{refreshBlocklet:o}}=at(),{t:r}=G(),s=(v=n==null?void 0:n.meta)==null?void 0:v.did,i=m=>{e(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${m}`)},a=()=>{o()},c=!n||Rt(n.status)?[]:to(n),u=[{label:r("common.overview"),value:"overview"},{label:l.jsx(po,{color:"error",variant:"dot",invisible:!c.length,children:r("common.components")}),value:"components"}];Rt(n==null?void 0:n.status)||u.push({label:r("common.configuration"),value:"configuration"}),u.push({label:r("common.auditLogs"),value:"audit-logs"}),n&&((P=n.children)!=null&&P.length)&&n.structVersion===k.APP_STRUCT_VERSION&&u.push({label:r("common.logs"),value:"logs"}),u.push({label:r("common.configNavigation"),value:"navigation"}),u.push({label:r("common.storage"),value:"storage"}),u.push({label:r("common.publish"),value:"publish"});const d=l.jsx(Wc,{scope:s,categories:["blocklet","team","security","certificates","gateway"]});Qe(k.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{const{severity:R,title:A,description:w}=m||{};R==="error"?T.error(w||A):T.success(w||A)});const f={overview:l.jsx(Vc,{}),members:l.jsx(L,{mt:-5,children:l.jsx(qc,{type:"blocklet",createPassportSvg:In})}),passports:l.jsx(L,{mt:-4.5,children:l.jsx(Hc,{createPassportSvg:In})}),components:Zc,configuration:l.jsx(Kc,{blocklet:n,onUpdate:a}),"audit-logs":d,logs:Gc,navigation:Yc,storage:l.jsx(Xc,{}),analytics:l.jsx(L,{mt:-5,children:l.jsx(Jc,{})}),publish:l.jsx(Qc,{}),notifications:l.jsx(el,{})},p=f[t]||f.overview,h=!["members","passports","analytics","notifications"].includes(t),x=n?l.jsxs(Wt,{type:"components",children:[h&&l.jsx(L,{pt:3,children:l.jsx(es,{tabs:u,current:t,onChange:i,scrollButtons:"auto"})}),l.jsx("div",{className:"page-content",children:l.jsx(g.Suspense,{fallback:l.jsx(Je,{relative:"parent",children:l.jsx(se,{})}),children:g.isValidElement(p)?p:l.jsx(p,{blocklet:n})})})]}):l.jsx(Je,{relative:"parent",children:l.jsx(se,{})});return l.jsx(Jr,{children:l.jsx(zi,{children:l.jsx(En,{children:l.jsx(rn,{children:l.jsxs(ol,{children:[h&&l.jsxs(L,{component:"div",className:"page-header",children:[l.jsxs(Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[n?l.jsx(on,{blocklet:n,style:{marginRight:16}}):null,n?l.jsxs(L,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[l.jsx(L,{children:$e(n)}),(n==null?void 0:n.status)!=="unknown"&&l.jsx(Qt,{size:"12px",status:n.status,source:n.source,progress:n.progress})]}):`${r("common.blocklet")} ${r("common.detail")}`]}),n?l.jsx(nn,{className:"page-actions",hasPermission:!0,blocklet:n,onStart:()=>{},onComplete:({error:m}={})=>{m&&T.error(m.message)},variant:"group"}):null]}),l.jsx(wo,{}),x]})})})})})}function nl(){var n;const{blocklet:e}=at(),t=(n=e==null?void 0:e.meta)==null?void 0:n.did;return g.useEffect(()=>{const o=Xr();return t&&o.connect(),()=>{t&&o.isConnected()&&o.disconnect()}},[t]),l.jsx(tl,{})}const ol=rt.main`
|
|
85
85
|
.page-header {
|
|
86
86
|
display: flex;
|
|
87
87
|
justify-content: space-between;
|
|
@@ -127,10 +127,10 @@ ${n}
|
|
|
127
127
|
margin-bottom: 15px;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
`,
|
|
130
|
+
`,Al=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"}));export{Qt as B,yn as D,Hs as L,cr as N,_n as R,Gt as W,ei as _,Ii as a,xo as b,on as c,nr as d,fo as e,Ol as f,Xt as g,X as h,mo as i,Cl as j,Rl as k,go as l,vo as m,po as n,Al as o,Ft as p,El as u};
|
|
131
131
|
function __vite__mapDeps(indexes) {
|
|
132
132
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
133
|
-
__vite__mapDeps.viteFileDeps = ["assets/overview-
|
|
133
|
+
__vite__mapDeps.viteFileDeps = ["assets/overview-KFyYnpN3.js","assets/index-mBoNVAkF.js","assets/index-Fay2ci-b.css","assets/domain-list-o5CVt5cn.js","assets/Add-WOKsiMJk.js","assets/ExpandMore-205fwIPh.js","assets/LockIcon-R_R57epV.js","assets/did-address-0zsr9FGE.js","assets/permission-oSc67tVg.js","assets/useAsync-B1gkUbWE.js","assets/session-p0WamCWG.js","assets/index-Rx4AmqwM.js","assets/confirm-VPAExB8S.js","assets/Alert-sYFXq3Al.js","assets/format-error-lyZJ-vR8.js","assets/useSetState-aTBeha54.js","assets/InfoOutlined-fvTeaIHi.js","assets/OpenInNew-tmusoGGX.js","assets/api-vzG5R7gz.js","assets/index-vQOHKZcI.js","assets/util-piM_BAzR.js","assets/TextField-SIkk5GBD.js","assets/FormControl-9fKakpMh.js","assets/useFormControl-MFcUIOcD.js","assets/InputLabel-wK2bWpSD.js","assets/Select-gum5gwN9.js","assets/actions-c-PXZIk7.js","assets/MoreHoriz-3Yd91mwt.js","assets/CardContent-hFzeKFHi.js","assets/MoreVert-4y42cx0s.js","assets/index-p7HYJjf1.js","assets/useLocalStorage-P7Xfe7vr.js","assets/PlayArrow-NomOs4fE.js","assets/ButtonGroup-T2tPvlgZ.js","assets/RadioGroup-ds0DRyXx.js","assets/FormControlLabel-EmYIE4Ks.js","assets/FormGroup-lOaPA6kB.js","assets/Avatar-sPQLj-7K.js","assets/spaces--f1ECR1p.js","assets/index-HFGXBlAK.js","assets/fallback-eXgiG5Pr.js","assets/wallet-hidden-topbar-mQy-B-PP.js","assets/ListItem-Mc-6Sx7a.js","assets/selector-DDVRP6ux.js","assets/index-OinRqSU-.js","assets/nav-menu-1ENXh9G_.js","assets/Toolbar-NMQzSDZI.js","assets/Hidden-3SNT7G6f.js","assets/index-1UDTrmOX.js","assets/index-7CKFrXrK.js","assets/Loop-aSwEwGmw.js","assets/list-header-4FSJXt5l.js","assets/Search-JFjur7RV.js","assets/index-arjlRv-U.js","assets/FilterList-kWJ_p-Xk.js","assets/TableRow-OmKn0_uE.js","assets/LastPage-VBH3ZNA2.js","assets/index-DxSli22q.js","assets/redux-OxlCLGwT.js","assets/toPropertyKey-x0vRpJ6G.js","assets/click-to-copy-z0bRySrb.js","assets/did-utils-2mzsdPOz.js","assets/index-dGMkSc6M.js","assets/index-hGEyozRl.js","assets/EditIcon-vBYCcMT4.js","assets/Google-ik5OMx5W.js","assets/InputAdornment-DhK5XGEl.js","assets/index-ensthqSY.js","assets/iframe-UeX3-BnF.js","assets/Edit-lj_ebVEl.js","assets/Done-E-Gh1lkh.js","assets/logo-uploader-hR6FFn-4.js","assets/ArrowDropDown-H7oIyp0F.js","assets/ChevronRight-43UHN-z-.js","assets/Autocomplete-vDgjSkCK.js","assets/mode-Ip8p6ZjP.js","assets/switch-control-Q8hGL7Dp.js","assets/index.esm-Fk-GXIgo.js","assets/confirm-aWG4liTX.js","assets/Launch-Xygdj5kt.js","assets/config-L7IY53NO.js","assets/index-zzHjRlUr.js","assets/index-1NyTkR9G.css","assets/audit-logs-CZDNePJG.js","assets/index-2z2N5UaY.js","assets/Pagination-AapFkNsX.js","assets/audit-logs-QseNTS8s.css","assets/log-IHBBDSFp.js","assets/Download-ayiRETlJ.js","assets/log-993Rbbf_.css","assets/index-YS2sbIaj.js","assets/DeleteOutline-e9e8OEcE.js","assets/config-navigation-l2UUL5GX.js","assets/slicedToArray-o0-7iTky.js","assets/jss-plugin-props-sort.esm-egoHvTKv.js","assets/index-jFRsVOWf.js","assets/index-NIuSKnAA.js","assets/Skeleton-d1ARVMzl.js","assets/index-h9Qzr9Ij.js","assets/use-blocklet-info-for-connect-did-spaces-U7E-FAZZ.js","assets/Icon-42MXOEvW.js","assets/component-noCyoaJE.js","assets/memoize-one.esm-LD5HLm_4.js","assets/index-etPzRhyP.js","assets/add-component-core-0mqZzfNI.js","assets/uniqBy-ee2n6S1k.js","assets/page-header-8tWFobCu.js","assets/index--pe7TOaI.js","assets/lottie-X29n5HYo.js","assets/launch-result-message-iDsonzeo.js","assets/index-NKi4Ykg5.js","assets/Stepper-kfcuXM-6.js","assets/preact.module-yJdvQMHZ.js","assets/content-layout-NQeupjc8.js","assets/add-component-core-wegghUnI.css","assets/analytics-HAGGLVM8.js","assets/LaunchOutlined-3Jpkcyko.js","assets/notifications-dFwaKILc.js"]
|
|
134
134
|
}
|
|
135
135
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
136
|
-
}
|
|
136
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,D as p,H as d,L as l,P as r}from"./index-
|
|
1
|
+
import{j as s,D as p,H as d,L as l,P as r}from"./index-mBoNVAkF.js";function a({did:n,href:e,external:o,avatarProps:x,...i}){const t=s.jsx(p,{did:n,...i});return e?o?s.jsx(d,{target:"_blank",href:e,underline:"hover",children:t}):s.jsx(l,{to:e,children:t}):t}a.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};a.defaultProps={to:"",href:"",avatarProps:{},external:!1};export{a as W};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,P as c,r as O,u as D,B as a,cU as A,G as _,$ as R}from"./index-
|
|
1
|
+
import{j as o,P as c,r as O,u as D,B as a,cU as A,G as _,$ as R}from"./index-mBoNVAkF.js";import{I as S}from"./index-vQOHKZcI.js";import{W as I}from"./did-address-0zsr9FGE.js";function g({user:e}){return(e.connectedAccounts||[]).map(n=>o.jsx(S,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:n.provider,children:o.jsx(I,{did:n.did})},n.did))}g.propTypes={user:c.object.isRequired};g.defaultProps={};var l={};Object.defineProperty(l,"__esModule",{value:!0});var v=l.default=void 0;C(O);var f=o;function C(e){return e&&e.__esModule?e:{default:e}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(r){W(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W(e,t,n){return t=L(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=N(e,"string");return typeof t=="symbol"?t:String(t)}function N(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var u=function(t){return(0,f.jsx)("svg",m(m({},t),{},{children:(0,f.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10a6.75 6.75 0 1 1 13.5 0 6.75 6.75 0 0 1-13.5 0zM10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5zM8.03 6.97a.75.75 0 0 0-1.06 1.06l5 5a.75.75 0 1 0 1.06-1.06l-5-5z"})}))};u.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};u.displayName="revoke";var E=u;v=l.default=E;function P({passport:e,user:t,color:n,width:r,icon:s,children:h,createPassportSvg:b,...w}){const{t:j}=D();return o.jsxs(M,{display:"flex",alignItems:"center",...w,children:[o.jsx("div",{dangerouslySetInnerHTML:{__html:b({title:e.title||e.name,issuer:e.issuer&&e.issuer.name,issuerDid:e.issuer&&e.issuer.id,ownerName:t.fullName,ownerDid:t.did,ownerAvatarUrl:t.avatar,revoked:e.revoked,preferredColor:n,width:r})}}),o.jsxs("div",{className:"body",children:[o.jsxs(a,{className:"title",display:"flex",alignItems:"center",children:[A(e.title),o.jsxs("div",{className:"status-icons",children:[s,e.revoked&&o.jsx(v,{})]})]}),e.expirationDate&&o.jsx(a,{className:"title",display:"flex",alignItems:"center",children:j("team.passport.validUntil",{date:e.expirationDate})}),h]})]})}P.propTypes={passport:c.any.isRequired,user:c.any.isRequired,color:c.string.isRequired,createPassportSvg:c.func.isRequired,icon:c.any,children:c.any,width:c.number};P.defaultProps={icon:null,children:null,width:150};const M=_(a)`
|
|
2
2
|
.body {
|
|
3
3
|
padding: 0;
|
|
4
4
|
margin-left: 24px;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{aS as O,j as e,r as f,E as V,a8 as Y,eU as q,eV as G,V as N,B as c,P as I,G as M,X as U,n as w}from"./index-mBoNVAkF.js";import{D as X,u as J,a as Q,A as Z}from"./domain-list-o5CVt5cn.js";import{C as tt}from"./confirm-VPAExB8S.js";import{P as rt}from"./page-header-8tWFobCu.js";import{r as et}from"./index-JaoLJlQo.js";import{_ as ot}from"./useSetState-aTBeha54.js";import{S as E}from"./button-9FEeAZF5.js";import{S as it}from"./layout-zzysI8Bj.js";import{S as nt}from"./step-actions-yuXDfRYd.js";import"./Add-WOKsiMJk.js";import"./ExpandMore-205fwIPh.js";import"./LockIcon-R_R57epV.js";import"./did-address-0zsr9FGE.js";import"./permission-oSc67tVg.js";import"./useAsync-B1gkUbWE.js";import"./session-p0WamCWG.js";import"./index-Rx4AmqwM.js";import"./InfoOutlined-fvTeaIHi.js";import"./OpenInNew-tmusoGGX.js";import"./api-vzG5R7gz.js";import"./index-vQOHKZcI.js";import"./util-piM_BAzR.js";import"./TextField-SIkk5GBD.js";import"./FormControl-9fKakpMh.js";import"./useFormControl-MFcUIOcD.js";import"./InputLabel-wK2bWpSD.js";import"./Select-gum5gwN9.js";import"./actions-c-PXZIk7.js";import"./MoreHoriz-3Yd91mwt.js";import"./CardContent-hFzeKFHi.js";import"./Alert-sYFXq3Al.js";import"./format-error-lyZJ-vR8.js";import"./content-layout-NQeupjc8.js";var x={exports:{}};const st=et,at=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class L extends Error{constructor(i){super(),i instanceof Error?(this.originalError=i,{message:i}=i):(this.originalError=new Error(i),this.originalError.stack=this.stack),this.name="AbortError",this.message=i}}const lt=(o,i,r)=>{const n=r.retries-(i-1);return o.attemptNumber=i,o.retriesLeft=n,o},dt=o=>at.includes(o),$=(o,i)=>new Promise((r,n)=>{i={onFailedAttempt:()=>{},retries:10,...i};const a=st.operation(i);a.attempt(async h=>{try{r(await o(h))}catch(s){if(!(s instanceof Error)){n(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof L)a.stop(),n(s.originalError);else if(s instanceof TypeError&&!dt(s.message))a.stop(),n(s);else{lt(s,h,i);try{await i.onFailedAttempt(s)}catch(l){n(l);return}a.retry(s)||n(a.mainError())}}})});x.exports=$;x.exports.default=$;x.exports.AbortError=L;var mt=x.exports;const ct=O(mt);function S({onNext:o,onPrevious:i}){var T,A;const{t:r}=f.useContext(V),[n,a]=f.useState(""),[h,s]=f.useState(!1),{blocklet:l}=Y(),[g,F]=f.useState(""),k=J(),W=(((l==null?void 0:l.site)||{}).domainAliases||[]).map(t=>q(t.value,g)),[p,u]=ot({domain:"",invalidDNSDomain:null,type:""}),_=(A=(T=l.environments)==null?void 0:T.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:A.value,z=W.find(t=>G.isDidDomain(t)),j=async(t,d)=>{a(r("setup.domain.addingDomain")),await k.validateDomain(t,d)&&(await U.addDomainAlias({input:{id:l.site.id,domainAlias:t,teamDid:l.meta.did,inBlockletSetup:!0}}).finally(()=>{u(null)}),o())},C=async({domain:t,type:d,nftDid:D,chainHost:P})=>{if(!n)try{if(a(r("setup.domain.checkingResolvable")),!await k.validateDomain(t,d)){a(""),s(r("setup.domain.invalidDomain"));return}let v=30;const y=3e3,K=v*1e3/y,R=setInterval(()=>{if(v<=0){clearInterval(R);return}a(`${r("setup.domain.checkingResolvable")} (${v--}s)`)},1e3),B=await ct(async()=>{const{data:m}=await N.get(`/dns-resolve?hostname=${t}`);if(!m.address)throw new Error("Cannot resolve domain");return m.address},{retries:K,minTimeout:y,maxTimeout:y,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(R),!B){const m=r("setup.domain.cannotResolve",{domain:t});if(d==="nftDomain"){w.error(m),o();return}u({invalidDNSDomain:{domain:t,error:m},domain:t,type:d,nftDid:D,chainHost:P});return}if(B!==g){const m=r("setup.domain.resolvedAddressError",{domain:t,curDomain:window.location.hostname});if(d==="nftDomain"){w.error(m),o();return}u({invalidDNSDomain:{domain:t,error:m},domain:t,type:d,nftDid:D,chainHost:P});return}if(d==="nftDomain"){o();return}await j(t,d)}catch(b){w.error(b.message),a("")}},H=()=>{a(""),u({invalidDNSDomain:null})};return f.useEffect(()=>{N.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{F(t.address||"")}).catch(t=>{console.error(t.message)})},[]),e.jsxs(pt,{children:[e.jsx("div",{className:"header",children:e.jsx(rt,{title:r("setup.domain.title"),subTitle:r("setup.domain.subTitle"),onClickBack:i})}),e.jsxs(c,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[e.jsxs(c,{children:[e.jsxs(c,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:[e.jsx(c,{display:"inline",children:r("setup.domain.skipStart")}),e.jsx(E,{variant:"text",size:"small",disabled:!!n,onClick:()=>o(),style:{paddingTop:0},children:e.jsx("span",{style:{textDecoration:"underline"},children:r("setup.domain.skip")})}),e.jsx(c,{display:"inline",children:r("setup.domain.skipEnd")})]}),e.jsx(c,{sx:{marginTop:"12px"},children:e.jsx(Q,{listOnly:!0,inSetup:!0})})]}),e.jsxs(c,{children:[e.jsx(c,{fontWeight:"fontWeightBold",fontSize:"1.125rem",children:r("setup.domain.addTitle")}),e.jsx(Z,{autoFocus:!1,appPk:_,disabled:!!n,appId:l.appPid,siteId:l.site.id,teamDid:l.meta.did,sx:{marginTop:"12px"},cnameDomain:z,inBlockletSetup:!0,onInputDomain:t=>{u({domain:t.domain,type:t.type}),s(t.error)},onSuccess:async t=>{const d={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};u(d),await C(d)},onError:s})]})]}),p.invalidDNSDomain&&e.jsx(tt,{title:r("common.reminder"),description:r("setup.domain.invalidDNSReminder",{error:p.invalidDNSDomain.error}),color:"primary",confirm:r("setup.domain.continueAdd"),onConfirm:()=>j(p.invalidDNSDomain.domain,p.type),onCancel:H}),e.jsx(nt,{mt:8,disabled:!!n,blocklet:l,onStartNow:()=>o("complete"),children:p.domain?e.jsx(E,{variant:"contained",loading:!!n,disabled:h||!!n||!p.domain,onClick:()=>C(p),children:n||r("setup.next")}):e.jsx(E,{variant:"contained",disabled:!!n,onClick:()=>o(),children:r("setup.skip")})})]})}function Mt(o){return e.jsx(X,{children:e.jsx(S,{...o})})}S.propTypes={onNext:I.func,onPrevious:I.func};S.defaultProps={onNext:()=>{},onPrevious:()=>{}};const pt=M(it)`
|
|
2
|
+
height: 100%;
|
|
3
|
+
overflow-y: hidden;
|
|
4
|
+
.form {
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
word-break: break-all;
|
|
8
|
+
}
|
|
9
|
+
`;export{Mt as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{K as U,M as W,j as e,ce as Ue,eW as We,P as o,eX as Ce,u as w,r as v,a9 as z,aX as Se,$ as xe,a as q,S as M,n as B,eY as He,aS as Ve,eZ as Je,e_ as Ke,e$ as Ge,f0 as Qe,f1 as Xe,f2 as Ze,f3 as Ae,f4 as Ye,f5 as et,B as h,U as Te,bl as H,T,f6 as tt,C as ge,H as nt,F as N,x as it,c0 as st,b4 as ee,bC as je,eV as we,b1 as Re,bj as Ie,bA as ot,f7 as ye,f8 as rt,G as at,bn as lt,bt as ct,f9 as dt,fa as mt,aW as ut,fb as pt,bB as ft,aw as ht}from"./index-mBoNVAkF.js";import{d as xt}from"./Add-WOKsiMJk.js";import{d as gt}from"./ExpandMore-205fwIPh.js";import{d as jt}from"./LockIcon-R_R57epV.js";import{W as yt}from"./did-address-0zsr9FGE.js";import{_ as bt,D as be,w as _e}from"./permission-oSc67tVg.js";import{A as vt}from"./index-Rx4AmqwM.js";import{C as te,L as Dt,a as Ct}from"./confirm-VPAExB8S.js";import{_ as ne,d as Pe}from"./useSetState-aTBeha54.js";import{d as St}from"./InfoOutlined-fvTeaIHi.js";import{d as At}from"./OpenInNew-tmusoGGX.js";import{_ as Tt}from"./useAsync-B1gkUbWE.js";import"./api-vzG5R7gz.js";import{I as wt}from"./index-vQOHKZcI.js";import{p as ke}from"./util-piM_BAzR.js";import{M as Rt}from"./TextField-SIkk5GBD.js";import{A as It}from"./actions-c-PXZIk7.js";import{C as Ee,a as $e}from"./CardContent-hFzeKFHi.js";import{A as _t}from"./Alert-sYFXq3Al.js";var ie={},Pt=W;Object.defineProperty(ie,"__esModule",{value:!0});var G=ie.default=void 0,kt=Pt(U()),Et=e;G=ie.default=(0,kt.default)((0,Et.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");var se={},$t=W;Object.defineProperty(se,"__esModule",{value:!0});var Le=se.default=void 0,Lt=$t(U()),qt=e;Le=se.default=(0,Lt.default)((0,qt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");class zt{constructor(t,i,s){this.name=t,this.prefix=i,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ft{constructor(t,i,s){if(this.name=t,this.prefix=i,i.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return qe(this,t)}}class Mt{constructor(t){this.decoders=t}or(t){return qe(this,t)}decode(t){const i=t[0],s=this.decoders[i];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const qe=(n,t)=>new Mt({...n.decoders||{[n.prefix]:n},...t.decoders||{[t.prefix]:t}});class Nt{constructor(t,i,s,a){this.name=t,this.prefix=i,this.baseEncode=s,this.baseDecode=a,this.encoder=new zt(t,i,s),this.decoder=new Ft(t,i,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ot=({name:n,prefix:t,encode:i,decode:s})=>new Nt(n,t,i,s),Bt=(n,t,i,s)=>{const a={};for(let p=0;p<t.length;++p)a[t[p]]=p;let r=n.length;for(;n[r-1]==="=";)--r;const l=new Uint8Array(r*i/8|0);let c=0,d=0,u=0;for(let p=0;p<r;++p){const y=a[n[p]];if(y===void 0)throw new SyntaxError(`Non-${s} character`);d=d<<i|y,c+=i,c>=8&&(c-=8,l[u++]=255&d>>c)}if(c>=i||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return l},Ut=(n,t,i)=>{const s=t[t.length-1]==="=",a=(1<<i)-1;let r="",l=0,c=0;for(let d=0;d<n.length;++d)for(c=c<<8|n[d],l+=8;l>i;)l-=i,r+=t[a&c>>l];if(l&&(r+=t[a&c<<i-l]),s)for(;r.length*i&7;)r+="=";return r},$=({name:n,prefix:t,bitsPerChar:i,alphabet:s})=>Ot({prefix:t,name:n,encode(a){return Ut(a,s,i)},decode(a){return Bt(a,s,i,n)}}),Wt=$({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ht=$({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vt=$({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jt=$({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Kt=$({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Gt=$({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Qt=$({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xt=$({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zt=$({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Yt=Object.freeze(Object.defineProperty({__proto__:null,base32:Wt,base32hex:Kt,base32hexpad:Qt,base32hexpadupper:Xt,base32hexupper:Gt,base32pad:Vt,base32padupper:Jt,base32upper:Ht,base32z:Zt},Symbol.toStringTag,{value:"Module"})),en=Ue(Yt),{toBuffer:tn,toAddress:nn}=We,{base32:sn}=en,on=n=>{if(!n)return n;const t=tn(nn(n));return sn.encode(t)};var rn={encode:on};const an=n=>["waiting","creating","renewaling"].includes(n);function oe(n){var k,F;const{t}=w(),[i,s]=v.useState(!1),{inService:a}=z(),[r,l]=v.useState(null),{siteId:c,domain:d,onAdd:u,children:p,did:y}=n,[g,S]=v.useState(!1),{api:_,ws:{useSubscription:j}}=z(),{mode:C,actions:{refreshDomainStatus:D}}=Se(),x=bt(async()=>{const{cert:f}=await _.findCertificateByDomain({input:{domain:d,did:y}});return f}),b=(f,I)=>{f.domain===d&&(S(!1),s(!1),a&&C!=="setup"&&(I==="success"?B.success(t("setup.domain.genCertSuccess",{domain:f.domain})):I==="error"&&B.error(t("setup.domain.genCertFailed",{domain:f.domain,message:f.message}))))};if(v.useEffect(()=>{var f;x.loading||S(an((f=x.value)==null?void 0:f.status))},[x.loading,(k=x.value)==null?void 0:k.status]),j(xe.BlockletEvents.certError,f=>b(f,"error")),j(xe.BlockletEvents.certIssued,f=>{x.retry(),D(f.domain),b(f,"success")}),x.loading||((F=x.value)==null?void 0:F.status)==="normal")return"";const P=()=>{s(!1),l(null)},m=async()=>{s(!0);try{await _.issueLetsEncryptCert({input:{siteId:c,domain:d,did:y,inBlockletSetup:C==="setup"}}),u(),S(!0)}catch(f){console.error(f),S(!1)}finally{s(!1),l(null)}},A={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(vt,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:m,onCancel:P},R=f=>{f.stopPropagation(),l(A)};return e.jsxs(e.Fragment,{children:[g?e.jsx(q,{title:t("router.cert.issuing"),children:e.jsx(M,{size:12})}):p({loading:i,open:R}),r&&e.jsx(te,{color:"primary",title:r.title,description:r.description,confirm:r.confirm,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}oe.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any};oe.defaultProps={onAdd:()=>{},children:null};function re(n){const{domain:t,domainStatus:i,...s}=n;return!Ce(t)||i!=null&&i.isHttps?"":e.jsx(oe,{domain:t,...s})}re.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any};re.defaultProps={onAdd:()=>{},children:null};var ae={},ln=W;Object.defineProperty(ae,"__esModule",{value:!0});var ze=ae.default=void 0,cn=ln(U()),dn=e;ze=ae.default=(0,cn.default)((0,dn.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5z"}),"CallMerge");var mn=He;function un(n,t){for(var i=-1,s=n.length;++i<s&&mn(t,n[i],0)>-1;);return i}var pn=un,fn=Je,hn=Ke,xn=Ge,gn=Qe,jn=pn,ve=Xe,yn=Ze;function bn(n,t,i){if(n=yn(n),n&&(i||t===void 0))return hn(n);if(!n||!(t=fn(t)))return n;var s=ve(n),a=ve(t),r=jn(s,a),l=gn(s,a)+1;return xn(s,r,l).join("")}var vn=bn;const Fe=Ve(vn),Me=v.createContext({}),{Provider:Dn,Consumer:Zn}=Me;function Cn({children:n}){const[t,i]=ne({domain:"",error:null}),{locale:s,t:a}=w(),{api:r}=z(),l={error:t.error,domain:t.domain,setError:c=>{i({error:c})},setDomain:c=>{const d=Fe(c),u=Ae(d,s);i({domain:d,error:u})},validateDomain:async(c,d)=>!t.error&&d&&d!=="nftDomain"&&(await r.isDidDomain({input:{domain:c}})).value===!0?(i({error:a("router.domainAlias.add.isDidDomainError")}),!1):!0};return e.jsx(Dn,{value:{value:l},children:n})}function Ne(){const{value:n}=v.useContext(Me);return n}const De=Ye,Sn=et,Oe="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",An=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:i}=await Sn.get(t.toString()),s=(c=i==null?void 0:i.componentMountPoints)==null?void 0:c.find(d=>d.did===Oe),a=new URL(n);a.pathname=s==null?void 0:s.mountPoint;const r=a.toString(),l=De(r,"/api");return{base:r,api:l,domain:De(l,"/domains")}};var Tn={DID_DOMAIN_SERVICE_DID:Oe,getDidDomainServiceURL:An};function le({domain:n,resolvedTarget:t,...i}){const{t:s,locale:a}=w();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...i,children:[e.jsxs(h,{display:"flex",children:[s("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),s("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(Q,{label:s("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(Q,{label:s("router.domain.setup.recordValue"),value:t,locale:a})]})]})}le.propTypes={domain:o.string,resolvedTarget:o.string.isRequired};le.defaultProps={domain:""};function Q({locale:n,label:t,value:i}){const s=Te(r=>r.breakpoints.down("md")),a=H();return e.jsx(wt,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(T,{component:"span",color:"primary.main",overflow:"auto",sx:s?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:i}),e.jsx(tt,{content:i,locale:n,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}Q.propTypes={locale:o.string.isRequired,label:o.string.isRequired,value:o.string.isRequired};function ce({siteId:n,teamDid:t,cnameDomain:i,defaultCustomDomain:s,onInputDomain:a,appId:r,appPk:l,onSuccess:c,disabled:d,autoFocus:u,inBlockletSetup:p,...y}){const{t:g,locale:S}=w(),{api:_,info:j}=z(),C=Ne(),D=H(),[x,b]=ne({domain:s,error:null,type:j!=null&&j.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),P=Tt(()=>Tn.getDidDomainServiceURL(j==null?void 0:j.nftDomainUrl));if(j!=null&&j.nftDomainUrl&&P.loading)return e.jsx(h,{...y,children:e.jsx(ge,{relative:"parent",children:e.jsx(M,{})})});if(P.error)return e.jsx(h,{...y,children:e.jsx(ge,{relative:"parent",children:P.error.message})});const m=async({domain:f,nftDid:I,chainHost:L})=>{try{const E=ke(f);await _.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:E,nftDid:I,chainHost:L,teamDid:t,inBlockletSetup:p}}),await ee(2e3),b({confirmSetting:null,showNFTDomainAuth:!1,type:"nftDomain"}),c({domain:E,type:x.type,nftDid:I,chainHost:L})}catch(E){B.error(E.message)}finally{b({showNFTDomainAuth:!1})}},A=C.error||x.error,R=P.value,k={inputDomain:{name:g("router.domainAlias.inputDomain"),component:e.jsxs(e.Fragment,{children:[e.jsx(Rt,{label:g("router.domainAlias.add.domainDescription"),helperText:x.type==="inputDomain"&&A||g("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:d,value:x.domain,size:"small",variant:"outlined",error:!!A&&x.type==="inputDomain",onChange:f=>{var E;const I=Fe((E=f.target)==null?void 0:E.value);C.setDomain(I);const L=Ae(I,S);b({domain:I,error:L,type:"inputDomain"}),a({domain:I,error:L,type:"inputDomain"})},autoFocus:u,onBlur:()=>{C.domain||(b({error:null}),C.setError(null))}}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",marginTop:"8px",lineHeight:1,color:D.palette.primary.main},onClick:()=>b({showDnsTip:!x.showDnsTip}),children:[e.jsx(St,{fontSize:"1em"}),g("router.domainAlias.showTipHint")]}),x.showDnsTip&&e.jsx(le,{domain:x.domain,resolvedTarget:i,style:{marginTop:"4px"}})]})}};j!=null&&j.nftDomainUrl&&R&&(k.nftDomain={name:g("router.domainAlias.nftDomain"),component:e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{maxWidth:"640px",color:"text.secondary",fontSize:"14px"},children:[e.jsx("div",{children:g("router.domainAlias.addDomainNFT.tips")}),e.jsxs("div",{children:[g("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(nt,{href:R.base,sx:{fontSize:"14px",display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:g("router.domainAlias.addDomainNFT.buy")}),e.jsx(At,{fontSize:"small"})]})]})]}),e.jsx(N,{sx:{marginTop:"8px"},disabled:d,onClick:()=>b({showNFTDomainAuth:!0}),variant:"contained",children:g("router.domainAlias.addDomainNFT.showNFT")}),e.jsx(it,{open:x.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:R.api,checkFn:st.create({baseURL:R.api}).get,extraParams:{delegatee:r,delegateePk:l},onSuccess:m,onClose:()=>b({showNFTDomainAuth:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:g("router.domainAlias.addDomainNFT.connect.title"),scan:g("router.domainAlias.addDomainNFT.connect.scan"),confirm:g("router.domainAlias.addDomainNFT.connect.confirm"),success:g("router.domainAlias.addDomainNFT.connect.success")}})]})});const F=Object.keys(k);return F.sort(f=>f==="inputDomain"?1:-1),e.jsx(h,{...y,children:e.jsx(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:F.map((f,I)=>{var L,E;return e.jsxs(h,{children:[F.length>1&&e.jsx(h,{sx:{fontWeight:700,color:D.palette.text.primary},children:`${g(`optionsOrder.${I+1}`)}: ${(L=k[f])==null?void 0:L.name}`}),e.jsx(h,{sx:{marginTop:"8px"},children:(E=k[f])==null?void 0:E.component})]},f)})})})}ce.propTypes={siteId:o.string.isRequired,teamDid:o.string.isRequired,cnameDomain:o.string.isRequired,defaultCustomDomain:o.string,onInputDomain:o.func,onSuccess:o.func,appId:o.string,appPk:o.string,disabled:o.bool,autoFocus:o.bool,inBlockletSetup:o.bool};ce.defaultProps={defaultCustomDomain:"",onInputDomain:je,onSuccess:je,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1};function de({id:n,children:t,title:i,teamDid:s,systemDomains:a,appId:r,appPk:l}){const{t:c}=w(),{api:d}=z(),[u,p]=ne({loading:!1,confirmSetting:null}),y=a.find(D=>we.isDidDomain(D)),g=Ne(),S=()=>{p({loading:!1,confirmSetting:null})},_=async D=>{if(!u.loading){p({loading:!0});try{const x=ke(D.domain);if(!await g.validateDomain(x,D.type))return!1;await d.addDomainAlias({input:{id:n,domainAlias:x,teamDid:s}}),await ee(2e3),p({confirmSetting:null})}catch(x){return g.setError(x.message),!1}finally{p({loading:!1})}}},j={title:i||c("router.domainAlias.add.title"),description:function(x,b,P){return e.jsx(ce,{siteId:n,teamDid:s,cnameDomain:y,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:m,type:A,error:R})=>{b({...x,domain:m,type:A,__disableConfirm:!!R}),P(R)},appId:r,appPk:l})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onConfirm:_,onCancel:S},C=D=>{D.stopPropagation(),p({confirmSetting:j})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:u.loading,open:C}):e.jsxs(Re,{onClick:C,className:"rule-action","data-cy":"action-add-domain-alias",children:[u.loading?e.jsx(M,{size:16}):e.jsx(ze,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),u.confirmSetting&&e.jsx(te,{title:u.confirmSetting.title,description:u.confirmSetting.description,confirm:u.confirmSetting.confirm,cancel:u.confirmSetting.cancel,params:u.confirmSetting.params,onConfirm:u.confirmSetting.onConfirm,onCancel:u.confirmSetting.onCancel,displayError:!1,color:"primary",loading:u.loading,maxWidth:"lg"})]})}de.propTypes={id:o.string.isRequired,children:o.any,title:o.string,teamDid:o.string,systemDomains:o.arrayOf(o.string).isRequired,appId:o.string,appPk:o.string.isRequired};de.defaultProps={children:null,title:"",teamDid:"",appId:null};function wn(n){return e.jsx(Cn,{children:e.jsx(de,{...n})})}function me(n){const{t}=w(),[i,s]=v.useState(!1),[a,r]=v.useState(null),{id:l,domain:c,children:d,teamDid:u}=n,{api:p}=z(),y=()=>{s(!1),r(null)},g=async()=>{s(!0);try{await p.deleteDomainAlias({input:{id:l,domainAlias:c,teamDid:u}}),await ee(2e3)}catch(j){B.error(j.message)}finally{r(null),s(!1)}},S={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:g,onCancel:y},_=j=>{j.stopPropagation(),r(S)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:i,open:_}):e.jsxs(N,{edge:"end",onClick:_,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[i?e.jsx(M,{size:16}):e.jsx(Pe,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(te,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}me.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string};me.defaultProps={children:null,teamDid:""};function ue({site:n,domain:t,blocklet:i}){const{t:s}=w(),a=t.value===window.location.hostname;return e.jsx(It,{"data-cy":"domain-actions",size:"large",actions:[({close:r})=>{var l;return e.jsx(me,{id:n.id,domain:t.value,teamDid:(l=i==null?void 0:i.meta)==null?void 0:l.did,children:({open:c})=>e.jsx(q,{title:a?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Re,{disabled:t.isProtected||a,dense:!0,onClick:d=>{r(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Dt,{style:{minWidth:24,marginRight:8},children:e.jsx(Pe,{})}),e.jsx(Ct,{primary:s("common.delete")})]},"remove")})})})}]})}ue.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired};ue.defaultProps={};var pe={},Rn=W;Object.defineProperty(pe,"__esModule",{value:!0});var fe=pe.default=void 0,In=Rn(U()),_n=e;fe=pe.default=(0,In.default)((0,_n.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Https");const V=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function he({certificate:n}){const[t,i]=v.useState(null),s=z(),{t:a,locale:r}=w(),l=u=>{i(u.currentTarget)},c=()=>{i(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(fe,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Ie,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(Ee,{children:e.jsxs($e,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${s.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(T,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(T,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(T,{component:"div",children:`${a("common.issuer")}: ${ot(n,"issuer.commonName","")}`}),e.jsx(T,{component:"div",children:`${a("router.cert.issuedOn")}: ${ye(n.validFrom,r)}`}),e.jsx(T,{component:"div",children:`${a("router.cert.expiryOn")}: ${ye(n.validTo,r)}`})]})]})})})]})}he.propTypes={certificate:o.object};he.defaultProps={certificate:{}};function O({domain:n,filters:t}){const{t:i}=w(),{value:s,domainStatus:a}=n;if(!Ce(s))return null;let r=null,l=null;const{isHttps:c,matchedCert:d}=a;if(!rt(s)){const{dns:{resolved:p,ip:y}={}}=a;p||y==="127.0.0.1"?r=e.jsx(q,{title:i("router.domain.verify.ok"),children:e.jsx(be,{color:"success"})}):r=e.jsx(q,{title:i("router.domain.verify.notResolved"),children:e.jsx(be,{color:"error"})})}c?l=e.jsx(he,{certificate:d}):l=e.jsx(q,{title:i("router.domain.https.bad"),children:e.jsx(fe,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const u=t.map(p=>p==="domain"?r:p==="http"?l:null);return v.createElement(v.Fragment,null,...u)}O.propTypes={domain:V.isRequired,filters:o.array};O.defaultProps={filters:["domain","http"]};const Pn=_e(J,"mutate_blocklets"),kn=_e(J,"",lt);function Be(n){const{inService:t}=z(),{blocklet:i,loadingRuntimeInfo:s}=Se();let a=Pn;return t&&(a=kn),e.jsx(a,{...n,blocklet:i,inService:t,loadingRuntimeInfo:s})}Be.propTypes={listOnly:o.bool};Be.defaultProps={listOnly:!1};function J({hasPermission:n,blocklet:t,loadingRuntimeInfo:i,inService:s,listOnly:a}){var D,x,b,P;const{t:r}=w(),[l,c]=v.useState(!1),d=Te(m=>m.breakpoints.down("md")),u=v.useMemo(()=>{let m=n;return ct(t)&&(m=m&&s),m},[n,s,t]),{site:p}=t,y=v.useMemo(()=>{var m;return dt((m=t.site)==null?void 0:m.domainAliases)},[(D=t.site)==null?void 0:D.domainAliases]),g=[],S=[],_=rn.encode(t.appPid),j=(b=(x=t.environments)==null?void 0:x.find(m=>m.key==="BLOCKLET_APP_PK"))==null?void 0:b.value,C=mt(y);return y.forEach(m=>{const A=m.value||"";we.isDidDomain(A)&&!A.startsWith(_)?S.push(m):g.push(m)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:r("common.domain")}),u&&e.jsx(wn,{id:p.id,title:r("router.domain.add.title"),teamDid:(P=t.meta)==null?void 0:P.did,appId:t.appPid,appPk:j,systemDomains:C==null?void 0:C.map(m=>m.value),children:({open:m})=>e.jsxs(N,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:m,disabled:ut(t.status),children:[e.jsx(xt,{style:{fontSize:"1.3em",marginRight:4}}),r("common.add")]})})]}),pt(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(_t,{severity:"warning",children:r("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(l?y:g).map(m=>{var R,k;const A=m.value;return e.jsxs(v.Fragment,{children:[d&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(X,{domain:m,target:"_blank",children:m.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(O,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(Y,{siteId:(R=t.site)==null?void 0:R.id,domain:m,blocklet:t,hasMutatePermission:u})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(Z,{hasMutatePermission:u,site:p,domain:m,blocklet:t})})]})]},A),!d&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(O,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(X,{domain:m,target:"_blank",children:m.value})}),e.jsx(Y,{siteId:(k=t.site)==null?void 0:k.id,domain:m,blocklet:t,hasMutatePermission:u})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(Z,{hasMutatePermission:u,site:p,domain:m,blocklet:t})})]},A)]},A)})}),S.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(N,{endIcon:l?e.jsx(Le,{}):e.jsx(gt,{}),onClick:()=>c(!l),children:r(l?"common.collapseAll":"blocklet.router.showAllDomains")})}),!y.length&&(i?e.jsx(M,{size:16}):e.jsx(ft,{children:r("common.empty")}))]})}J.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,listOnly:o.bool};J.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function X({domain:n,children:t,...i}){const{t:s}=w(),{href:a,accessibility:r}=n;return!r||r.loading?e.jsxs(K,{...i,children:[t,e.jsx(q,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(M,{size:12})})})]}):r.accessible?e.jsx(K,{...i,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(K,{...i,children:e.jsx(q,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}X.propTypes={domain:V.isRequired,children:o.any.isRequired};const K=at.span`
|
|
2
|
+
&,
|
|
3
|
+
& > * {
|
|
4
|
+
color: #222;
|
|
5
|
+
font-size: 18px;
|
|
6
|
+
word-break: break-all;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.status {
|
|
10
|
+
margin-left: 8px;
|
|
11
|
+
}
|
|
12
|
+
`;function Z({hasMutatePermission:n,site:t,domain:i,blocklet:s}){const a=H(),{t:r}=w();return n&&!i.isProtected?e.jsx(ue,{site:t,domain:i,blocklet:s}):e.jsx(q,{title:r("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(ht,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(jt,{style:{fill:a.palette.text.disabled}})})})}Z.propTypes={hasMutatePermission:o.bool.isRequired,site:o.object.isRequired,domain:V.isRequired,blocklet:o.object.isRequired};function Y({siteId:n,domain:t,blocklet:i,hasMutatePermission:s}){const a=H(),{t:r}=w(),[l,c]=v.useState(null),d=p=>{c(p.currentTarget)},u=()=>{c(null)};return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsxs(e.Fragment,{children:[e.jsx(G,{onMouseEnter:d,onMouseLeave:u,style:{cursor:"pointer",fill:a.palette.primary.main}}),e.jsx(Ie,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:!!l,anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:u,disableRestoreFocus:!0,children:e.jsx(Ee,{children:e.jsxs($e,{style:{display:"flex",flexDirection:"column"},children:[e.jsxs(T,{component:"div",style:{display:"flex",alignItems:"center"},children:[e.jsx(G,{style:{fill:a.palette.primary.main}}),e.jsx(T,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:r("router.domainAlias.nftDomain")})]}),e.jsxs(T,{component:"div",style:{display:"flex",marginTop:"12px"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:r("common.domain")}),e.jsx(T,{component:"span",children:t.value})]}),e.jsxs(T,{component:"div",style:{display:"flex"},children:[e.jsx(T,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),e.jsx(yt,{did:t.nftDid})]})]})})})]}),e.jsx(O,{domain:t,filters:["http"]},`${t.value}-http`),s&&e.jsx(re,{siteId:n,domain:t.value,domainStatus:t.domainStatus,did:i.meta.did,children:({open:p})=>e.jsx(N,{sx:{padding:0},size:"small",onClick:y=>p(y),children:r("router.cert.genLetsEncryptCert.title")})})]})}Y.propTypes={siteId:o.string.isRequired,domain:V.isRequired,blocklet:o.object.isRequired,hasMutatePermission:o.bool.isRequired};export{ce as A,Cn as D,Be as a,Le as d,Ne as u};
|