@abtnode/blocklet-services 1.16.43-beta-20250429-130236-269254ff → 1.16.43-beta-20250430-225854-7914dfe4
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/api/libs/connect/session.js +4 -2
- package/api/middlewares/ensure-blocklet.js +1 -1
- package/api/routes/user-session.js +4 -2
- package/api/services/auth/session.js +13 -8
- package/dist/assets/{AdapterDayjs-D5LoqHiU.js → AdapterDayjs-BWhMsmQP.js} +1 -1
- package/dist/assets/{ArrowDropDown-BCCa5uRn.js → ArrowDropDown-DUCtp8oo.js} +1 -1
- package/dist/assets/{CheckCircle-Bxk_pKUt.js → CheckCircle-yKW43XdV.js} +1 -1
- package/dist/assets/{ChevronLeft-DgTQnUwX.js → ChevronLeft-6AvuBihM.js} +1 -1
- package/dist/assets/{ChevronRight-C-lajCDc.js → ChevronRight-BsdsjNxw.js} +1 -1
- package/dist/assets/{DeleteOutline-Csdx_lih.js → DeleteOutline-D_I07sPe.js} +1 -1
- package/dist/assets/{Done-DjB4uf97.js → Done-DLTvHdZB.js} +1 -1
- package/dist/assets/{Download-CF6ZhZfD.js → Download-DKz_gZX5.js} +1 -1
- package/dist/assets/{Edit-C-zkyYSj.js → Edit-odNPT5GK.js} +1 -1
- package/dist/assets/{Error-DnzvDd2d.js → Error-js7ePZ5o.js} +1 -1
- package/dist/assets/{ExpandLess-DBN4huDO.js → ExpandLess-TUium4RQ.js} +1 -1
- package/dist/assets/{Google-VfyWFLKO.js → Google-C7d25Q5r.js} +1 -1
- package/dist/assets/{InfoOutlined-BMb9Zu84.js → InfoOutlined-BjII93aR.js} +1 -1
- package/dist/assets/{Launch-CVPYIHzD.js → Launch-ryL3I8d9.js} +1 -1
- package/dist/assets/{LaunchOutlined-faHvtBle.js → LaunchOutlined-D21Xchdf.js} +1 -1
- package/dist/assets/{MoreHoriz-CT231fLS.js → MoreHoriz-DHyMdwpT.js} +1 -1
- package/dist/assets/{PlayArrow-CVHX5RbU.js → PlayArrow-zDVVYX6u.js} +1 -1
- package/dist/assets/{TuneOutlined-DcBuSd1o.js → TuneOutlined-Bv7cSbWT.js} +1 -1
- package/dist/assets/{ViewList-rVo7d5VV.js → ViewList-Ca1IEB31.js} +1 -1
- package/dist/assets/{access-control-Cum8iIaB.js → access-control-CwSjARsN.js} +1 -1
- package/dist/assets/{actions-D-Helr6n.js → actions-BW0Vx00_.js} +1 -1
- package/dist/assets/{add-component-core-kWUUw0fB.js → add-component-core-DXp_ntZ3.js} +1 -1
- package/dist/assets/{add-resource-DEesv1LC.js → add-resource-CmPIp37F.js} +1 -1
- package/dist/assets/{addon-B5zwPHe5.js → addon-FArG2oUy.js} +1 -1
- package/dist/assets/{advanced-CjSPlkxp.js → advanced-mJXTlRFz.js} +2 -2
- package/dist/assets/api-Bf1onQOz.js +1 -0
- package/dist/assets/{appearance-rlMOco_Q.js → appearance-D9WrcbPF.js} +1 -1
- package/dist/assets/{audit-logs-BpacJ0mq.js → audit-logs-CVUuBgdy.js} +1 -1
- package/dist/assets/{authorize-Dup4yiJg.js → authorize-Bk0sIDAH.js} +1 -1
- package/dist/assets/{base32-yUUlhgnG.js → base32-C_EKY5vU.js} +1 -1
- package/dist/assets/{branding-BB4z7dex.js → branding-BoSHL25b.js} +2 -2
- package/dist/assets/{branding-3E94pu9e.js → branding-Cywl-fod.js} +4 -4
- package/dist/assets/{bundle-avatar-njRzpG6o.js → bundle-avatar-BXQsJw7m.js} +1 -1
- package/dist/assets/{button-DRqMfYjF.js → button-h00yLUET.js} +1 -1
- package/dist/assets/{click-to-copy-CSwBjJDI.js → click-to-copy-0s0a7Ak5.js} +1 -1
- package/dist/assets/{cloneDeep-Cg0h_FaY.js → cloneDeep-WT_kDeVd.js} +1 -1
- package/dist/assets/{complete-lhAOowgH.js → complete--raviZZ4.js} +1 -1
- package/dist/assets/{component-DG-t6Jac.js → component-C3maTG8x.js} +72 -69
- package/dist/assets/{config-Ct2icT-j.js → config-Die5cVWR.js} +1 -1
- package/dist/assets/{config-BWuaMoux.js → config-e3P85n7z.js} +1 -1
- package/dist/assets/{config-navigation-BZ3T8tYK.js → config-navigation-DhvlW96p.js} +6 -6
- package/dist/assets/{config-space-CKx83vmi.js → config-space-CHI2AzS5.js} +1 -1
- package/dist/assets/{confirm-Bj4L0Vn8.js → confirm-BqrhdaU7.js} +1 -1
- package/dist/assets/connect-DGOqnhoS.js +5 -0
- package/dist/assets/{connect-v2Zx9JEk.js → connect-cpTXz6hq.js} +1 -1
- package/dist/assets/{connect-to-lcfZI_0b.js → connect-to-C1xSYa-8.js} +1 -1
- package/dist/assets/dashboard-CvJ8cVy-.js +280 -0
- package/dist/assets/{delete-confirm-kpan5KFX.js → delete-confirm-CmXluMcs.js} +1 -1
- package/dist/assets/{did-address-CJZtrzhT.js → did-address-C6ni99I7.js} +1 -1
- package/dist/assets/{domain-C8nJlURa.js → domain-B7m2mZGp.js} +1 -1
- package/dist/assets/{domain-action-card-BZ3CFKs5.js → domain-action-card-DIGUxqW7.js} +1 -1
- package/dist/assets/domains-DV-Gl3-a.js +1 -0
- package/dist/assets/{dot-CaKxEi_0.js → dot-WAAJ-O65.js} +1 -1
- package/dist/assets/{email-BjCEb0WI.js → email-CxndZMem.js} +2 -2
- package/dist/assets/{exchange-passport-B_b6xNH8.js → exchange-passport-JjK-mItt.js} +1 -1
- package/dist/assets/{fuel-Dtvd1fJW.js → fuel-bktBZZhG.js} +1 -1
- package/dist/assets/{gen-access-key-DsGgHUvi.js → gen-access-key-CPCwDcVa.js} +1 -1
- package/dist/assets/{get-safe-url-BTmcSfZP.js → get-safe-url-C-CJKtkC.js} +1 -1
- package/dist/assets/{get-safe-url-BYr2jgRv.js → get-safe-url-cyoeQ7Mw.js} +1 -1
- package/dist/assets/{home-ClwQWk4f.js → home-BclSkhw2.js} +1 -1
- package/dist/assets/{iframe-B7H87IMw.js → iframe-DZlnwo40.js} +1 -1
- package/dist/assets/{index-C-rP7qS0.js → index--MMFwLMX.js} +1 -1
- package/dist/assets/{index-D9eW5l3E.js → index-17ov_POl.js} +1 -1
- package/dist/assets/index-BAstW3VS.js +137 -0
- package/dist/assets/{index-C1UHqpp3.js → index-Bdi900W2.js} +3 -3
- package/dist/assets/{index-CEmSUlto.js → index-BhX4Vx5B.js} +3 -3
- package/dist/assets/{index-2eL6Ndgh.js → index-BugTfB-J.js} +1 -1
- package/dist/assets/index-C-rU1lEd.js +10 -0
- package/dist/assets/{index-CVKN_Jn1.js → index-C0x4zVBW.js} +2 -2
- package/dist/assets/index-C4pzdyRW.js +1 -0
- package/dist/assets/{index-B9lBWxnt.js → index-C8EYAWok.js} +2 -2
- package/dist/assets/index-CLD6I2fv.js +6 -0
- package/dist/assets/{index-a0ZdM5aG.js → index-COTyGW2s.js} +1 -1
- package/dist/assets/{index-BDaAwySV.js → index-CiIQJxvH.js} +1 -1
- package/dist/assets/{index-Cb1OPKJL.js → index-CksPySYI.js} +86 -93
- package/dist/assets/{index-DHIWtN6I.js → index-DJeuTVoT.js} +7 -7
- package/dist/assets/{index-DyKjKMmu.js → index-DODYa3Im.js} +1 -1
- package/dist/assets/{index-B1ljmpu4.css → index-DOq-_YXu.css} +1 -1
- package/dist/assets/{index-i5c4XeO-.js → index-D_z5kVUS.js} +1 -1
- package/dist/assets/{index-Cx-tuAMi.js → index-DdLPuFP7.js} +1 -1
- package/dist/assets/{index-BUrD6xiH.js → index-DxR1P6Lh.js} +4 -4
- package/dist/assets/{index-BOvzhuNp.js → index-htPha6tP.js} +2 -2
- package/dist/assets/{invitation-DGRUoRzD.js → invitation-sucipANy.js} +8 -8
- package/dist/assets/{invite-uoA9amq7.js → invite-Bkpf8YcY.js} +1 -1
- package/dist/assets/{issue-passport-2LsCG1Ym.js → issue-passport-Dm4XKvqR.js} +1 -1
- package/dist/assets/{item-taL0aTyr.js → item-CCsztPdL.js} +2 -2
- package/dist/assets/landing-page-BJMRDSCP.js +1 -0
- package/dist/assets/{layout-DAempiIX.js → layout-DV03YuuA.js} +1 -1
- package/dist/assets/list-BgP6u-5j.js +236 -0
- package/dist/assets/localization-CTzQFuMS.js +1 -0
- package/dist/assets/{log-CL673QLU.js → log-B4LRFTNR.js} +1 -1
- package/dist/assets/{logger-OMyVyA8K.js → logger-8RyN9oiF.js} +1 -1
- package/dist/assets/{login-CsMJeMSS.js → login-B6TE3gqj.js} +1 -1
- package/dist/assets/{login-oauth-callback-Bh6TJ59S.js → login-oauth-callback-CPP0UVME.js} +1 -1
- package/dist/assets/{logo-uploader-DFGj09Gp.js → logo-uploader-DMxsEq63.js} +3 -4
- package/dist/assets/{lost-passport-D00cnWl_.js → lost-passport-ekwdQ24A.js} +1 -1
- package/dist/assets/{omit-1zyydTZL.js → omit-DNeUY6_X.js} +1 -1
- package/dist/assets/{open-window-xLNOSl03.js → open-window-BjXpEOv2.js} +1 -1
- package/dist/assets/{overview-Ds0WiSnv.js → overview-CJRHh92f.js} +1 -1
- package/dist/assets/{page-header-BXC_EZqA.js → page-header-MKUHlyAT.js} +1 -1
- package/dist/assets/{passport-item-Dpr4rKdD.js → passport-item-jrknj0MQ.js} +1 -1
- package/dist/assets/{permission-DDLyDuSn.js → permission-PNXSTeNL.js} +1 -1
- package/dist/assets/{preferences-DXw1rfcr.js → preferences-9BJlt30G.js} +1 -1
- package/dist/assets/{profile-embed-co2rsGfl.js → profile-embed-CIWdUuC6.js} +1 -1
- package/dist/assets/publish-resource-BQg2Vwb0.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CeODMcuS.js → react-beautiful-dnd.esm-C1Wt0pHO.js} +1 -1
- package/dist/assets/{relative-time-DlN06RKr.js → relative-time-cijkMMnc.js} +1 -1
- package/dist/assets/runtime-71FSw-R0.js +1 -0
- package/dist/assets/sdk-BXECCi1q.js +1 -0
- package/dist/assets/{security-CHs7ENbZ.js → security-Y5seZEn6.js} +1 -1
- package/dist/assets/{session-j-9KoWbs.js → session-DLQ0rbYE.js} +1 -1
- package/dist/assets/{setup-CGwOCqjv.js → setup-4hj9RPfM.js} +12 -7
- package/dist/assets/{spaces-CZHg-rr5.js → spaces-CP1iyRKS.js} +1 -1
- package/dist/assets/{start-Chlvxw3J.js → start-Bt5Vo3K8.js} +1 -1
- package/dist/assets/{starting-progress-DpqgCEFM.js → starting-progress-yIv14mT6.js} +1 -1
- package/dist/assets/{status-XLk6MkKv.js → status-BKlS-OSq.js} +1 -1
- package/dist/assets/{step-actions-hjC-pbPT.js → step-actions-DMwF4axn.js} +1 -1
- package/dist/assets/{studio-DrYhFxCD.js → studio-BR3c6nt5.js} +1 -1
- package/dist/assets/{switch-control-CqfXXgvP.js → switch-control-yJOWKqcv.js} +1 -1
- package/dist/assets/{traffic-Dbf1L1c0.js → traffic-BzRbyLJ-.js} +1 -1
- package/dist/assets/{transfer-GcIVZcyL.js → transfer-Ds9NQ12A.js} +1 -1
- package/dist/assets/{unsubscribe-D2dQlJJM.js → unsubscribe-hfXD8-ea.js} +1 -1
- package/dist/assets/use-blocklet-logo-BOYeM9RY.js +1 -0
- package/dist/assets/{useAsync-DXeWUWXr.js → useAsync-GjVghrwi.js} +1 -1
- package/dist/assets/{useLocalStorage-Cb6R1F6v.js → useLocalStorage-CXDkfohf.js} +1 -1
- package/dist/assets/{user-center-D7lo6m0u.js → user-center-CBh-mxjZ.js} +1 -1
- package/dist/assets/{util-BcFfyz6S.js → util-D-LnEy9h.js} +1 -1
- package/dist/assets/{util-BYQQqvk1.js → util-DJFgW-07.js} +1 -1
- package/dist/assets/{vendor-arcblock-CX-5Ex_f.js → vendor-arcblock-Dkhgjlzn.js} +81 -81
- package/dist/assets/{vendor-hooks-DpLLpTSZ.js → vendor-hooks-DXGUREV9.js} +1 -1
- package/dist/assets/{vendor-utils-BUwfcN20.js → vendor-utils-CjMBJT5V.js} +17 -17
- package/dist/assets/vendor-ux-did-connect-D4-ZeZHm.js +2292 -0
- package/dist/assets/{wrap-locale-CzSOEkvO.js → wrap-locale-Dob_mf2V.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/service-worker.js +2 -2
- package/package.json +43 -43
- package/dist/assets/api-BkKTvlm_.js +0 -1
- package/dist/assets/connect-BoejDqj-.js +0 -5
- package/dist/assets/dashboard-0TEl6bJJ.js +0 -280
- package/dist/assets/domains-Cn_DfzNS.js +0 -1
- package/dist/assets/index-Bco7nZ5q.js +0 -6
- package/dist/assets/index-CjZLIV87.js +0 -10
- package/dist/assets/index-DAer_mWn.js +0 -137
- package/dist/assets/index-M6peJL7s.js +0 -1
- package/dist/assets/landing-page-EY5bGAu7.js +0 -1
- package/dist/assets/list-B1E5dxgu.js +0 -236
- package/dist/assets/localization-Di0I0VVv.js +0 -1
- package/dist/assets/publish-resource-CBR18Gc3.js +0 -1
- package/dist/assets/runtime-nJVx0iKJ.js +0 -1
- package/dist/assets/sdk-DICk2ZHP.js +0 -1
- package/dist/assets/use-blocklet-logo-DryhoHen.js +0 -1
- package/dist/assets/vendor-ux-did-connect-DVrP2LNw.js +0 -2295
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import{r as u}from"./vendor-react-DEoibe3W.js";import{H as i,j as t,be as K,ap as se,aa as p,ah as D,T as $,v as q,X as ne,bL as ke,ad as Qe,bM as Xe,ar as Ke,ai as Ye,e as Y,a9 as Ce,m as Ze,bZ as Je,y as et,s as tt,I as rt}from"./vendor-mui-core-B6POpIBB.js";import{f as L,u as te}from"./vendor-hooks-DpLLpTSZ.js";import{a0 as ie,b6 as oe,ba as W,u as Re,r as Te,I as Se,n as st,bl as nt}from"./vendor-ux-did-connect-DVrP2LNw.js";import{S as it}from"./index-DIe9psLc.js";import{B as ot}from"./bundle-avatar-njRzpG6o.js";import{a as at,c as B,s as V,g as ae,H as lt,u as $e,M as Ie,b as G,d as ct,m as dt,i as ut}from"./use-blocklet-logo-DryhoHen.js";import{R as Me}from"./relative-time-DlN06RKr.js";import{A as Z,af as pt,b as _,$ as ht,z as mt}from"./vendor-utils-BUwfcN20.js";import{u as Pe,p as ft,h as Q,f as ze,w as xt}from"./vendor-arcblock-CX-5Ex_f.js";import{d as gt}from"./InfoOutlined-BMb9Zu84.js";import{b as yt}from"./sdk-DICk2ZHP.js";import{d as vt}from"./CheckCircle-Bxk_pKUt.js";import{U as jt,C as bt,I as wt}from"./index-CjZLIV87.js";import{p as kt}from"./util-BcFfyz6S.js";import{z as Ct}from"./index-Cb1OPKJL.js";function le({blocklet:e,style:r,size:s,...n}){const o=at({blocklet:e,square:!0}),{variant:l}=n;return t.jsx(K,{variant:l||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...n,children:t.jsx("img",{src:o,alt:"",style:{width:s}})})}le.propTypes={blocklet:i.object.isRequired,style:i.object,size:i.oneOfType([i.number,i.string])};le.defaultProps={style:{},size:40};function Ne({attachment:e}){const{data:r}=e;let s="";try{s=new URL(r.url).host}catch{s=r.url}return t.jsxs(se,{target:"_blank",rel:"noopener noreferrer",href:r.url,className:"link",style:{wordBreak:"break-all"},onClick:n=>{n.customPreventRedirect=!0},children:[!!s&&t.jsx("span",{className:"url",children:s}),!!r.title&&t.jsx(p,{className:"title",style:{whiteSpace:"unset"},children:r.title}),!!r.description&&t.jsx(p,{className:"description",style:{whiteSpace:"unset",color:"rgba(75, 85, 99, 1)"},children:r.description}),!!r.image&&t.jsx("img",{src:Pe.getImagePath(r.image),alt:r.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}Ne.propTypes={attachment:i.object.isRequired};function Ae({attachment:e}){const{data:r}=e;return t.jsx("img",{src:Pe.getImagePath(r.url),alt:r.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}Ae.propTypes={attachment:i.object.isRequired};function Le({attachment:e,...r}){var c;const{data:s}=e,n=((c=s.color)==null?void 0:c.toLowerCase())||r.color,o=s.size||r.size,l=s.fontWeight||r.fontWeight||400;let a="14px";return o==="small"?a="12px":o==="normal"?a="14px":o==="big"?a="16px":o==="large"&&(a="18px"),t.jsx(Rt,{className:"title",style:{fontSize:a,color:n,whiteSpace:"unset",fontWeight:l},children:s.text})}Le.propTypes={attachment:i.object.isRequired};const Rt=D.span`
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: -webkit-box;
|
|
4
|
-
-webkit-box-orient: vertical;
|
|
5
|
-
-webkit-line-clamp: 2;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
text-overflow: ellipsis;
|
|
8
|
-
white-space: normal;
|
|
9
|
-
word-break: break-word;
|
|
10
|
-
`;ce.propTypes={locale:i.string,data:i.object.isRequired};ce.defaultProps={locale:"en"};function ce({locale:e="en",data:r}){const s={zh:"来自",en:"from"}[e]||"from",n={zh:"接收",en:"Received"}[e]||"Received",l=`https://${B.getUrlHost(r.chainHost)||B.getChainHost(r.chainId)}/explorer/tokens/${r.address}/tx`;let a=r.amount;r.decimal&&(a=r.amount/10**r.decimal);const c=L(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return t.jsx("a",{href:l,target:"_blank",rel:"noreferrer",onClick:m=>{m.customPreventRedirect=!0},children:t.jsxs(p,{display:"flex",flexDirection:"column",children:[t.jsxs(p,{sx:c,children:[t.jsx($,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:n}),t.jsxs($,{component:"div",align:"right",style:V.summaryStyle,flex:1,children:["+",a," ",r.symbol]})]}),t.jsxs(p,{sx:c,children:[t.jsx($,{component:"div",style:{...V.remarkStyle,fontSize:14},children:s}),t.jsx(p,{maxWidth:260,fontSize:14,children:t.jsx(ie,{did:r.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}de.propTypes={locale:i.string,data:i.object.isRequired};de.defaultProps={locale:"en"};function de({locale:e,data:r}){var m,j;const s={zh:"接收",en:"Received"}[e]||"Received",n={zh:"来自",en:"from"}[e]||"from",o=B.getUrlHost(r.chainHost)||B.getChainHost(r.chainId),l=r.did||((j=(m=r==null?void 0:r.credential)==null?void 0:m.issuer)==null?void 0:j.id)||"",a=`https://${o}/explorer/assets/${l}`,c=L(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return t.jsx(p,{sx:{pr:1},children:t.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},onClick:y=>{y.customPreventRedirect=!0},rel:"noreferrer",children:t.jsxs(p,{display:"flex",flexDirection:"column",children:[t.jsxs(p,{sx:c,children:[t.jsx($,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:s}),t.jsx($,{component:"div",align:"right",style:V.summaryStyle,children:"+1 Asset"})]}),l?t.jsxs(p,{sx:c,children:[t.jsx($,{component:"div",style:{...V.remarkStyle,fontSize:14},children:n}),t.jsx(p,{maxWidth:260,fontSize:14,children:t.jsx(ie,{did:l,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}De.propTypes={data:i.object.isRequired,locale:i.string};function De({data:e,locale:r="en"}){return t.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},onClick:s=>{s.customPreventRedirect=!0},rel:"noreferrer",children:[t.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),t.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[t.jsx("div",{style:{marginBottom:"6px"},children:e.title}),t.jsx(p,{maxWidth:260,fontSize:10,style:{color:"#a5a5a5"},children:t.jsx(ie,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:r})})]})]})}ue.propTypes={locale:i.string,data:i.object.isRequired};ue.defaultProps={locale:"en"};function ue({locale:e,data:r}){const s=B.getChainHost(r.chainId),n=`https://${s}/explorer/txs/${r.hash}`,o={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",l={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash";return t.jsxs("a",{href:n,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block",fontSize:14},onClick:a=>{a.customPreventRedirect=!0},rel:"noreferrer",children:[t.jsx("h6",{style:{color:"#a5a5a5",margin:0},children:s}),t.jsx("p",{style:{color:"#4598fa",margin:0},children:o}),t.jsxs("div",{style:{wordBreak:"break-all"},children:[l,": ",r.hash]})]})}function _e({attachment:e,...r}){const{local:s}=u.useContext(oe),n=q(o=>o.breakpoints.down("md"));return t.jsxs(Tt,{...r,isMd:n,children:[e.type==="link"&&t.jsx(Ne,{attachment:e,...r,isMd:n}),e.type==="image"&&t.jsx(Ae,{attachment:e,isMd:n}),e.type==="text"&&t.jsx(Le,{attachment:e,isMd:n}),e.type==="token"&&t.jsx(ce,{data:e.data,local:s,isMd:n}),e.type==="asset"||e.type==="vc"?t.jsx(de,{data:e.data,local:s,isMd:n}):null,e.type==="dapp"&&t.jsx(De,{data:e.data,local:s,isMd:n}),e.type==="transaction"&&t.jsx(ue,{data:e.data,local:s,...r,isMd:n}),e.type==="divider"&&t.jsx(ne,{sx:{mb:1,mt:1},style:{color:W.dividerColor}})]})}const Tt=D.div`
|
|
11
|
-
display: ${({sx:e={}})=>e.display||"flex"};
|
|
12
|
-
flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
|
|
13
|
-
gap: ${({sx:e={}})=>e.gap||1};
|
|
14
|
-
width: ${({isMd:e=!1})=>e?"100%":"auto"};
|
|
15
|
-
&:last-child {
|
|
16
|
-
margin-bottom: 0;
|
|
17
|
-
}
|
|
18
|
-
`;_e.propTypes={attachment:i.object.isRequired};function Ee({data:e,...r}){const{items:s}=e;return t.jsx(St,{...r,children:s.map(n=>t.jsxs(ke,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:1,children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,style:{width:16,height:16}}):null,t.jsxs(p,{className:"metric-name",display:"flex",alignItems:"center",children:[n.title,n.subtitle?t.jsx(Qe,{title:n.subtitle,arrow:!0,placement:"top",children:t.jsx(gt,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),t.jsxs(p,{className:"metric-number",sx:{color:n.content_color||"rgba(3, 7, 18, 1)"},children:[n.content,n.sub_content?t.jsxs("span",{className:"sub-content",style:{color:n.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",n.sub_content,")"]}):null]})]},n.title))})}const St=D(p)`
|
|
19
|
-
display: flex;
|
|
20
|
-
justify-content: flex-start;
|
|
21
|
-
flex-wrap: wrap;
|
|
22
|
-
gap: 16px;
|
|
23
|
-
.metric-number {
|
|
24
|
-
font-size: 18px;
|
|
25
|
-
font-weight: 600;
|
|
26
|
-
.sub-content {
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
margin-left: 4px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
.metric-name {
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
color: rgba(156, 163, 175, 1);
|
|
35
|
-
}
|
|
36
|
-
`;Ee.propTypes={data:i.object.isRequired};function qe({data:e}){const{items:r}=e,s=q(a=>a.breakpoints.down("sm")),n=q(a=>a.breakpoints.down("md")),o=q(a=>a.breakpoints.down("lg")),l=()=>s?1:n?3:o?4:6;return t.jsx(Xe,{variant:"quilted",cols:l(),gap:8,rowHeight:128,sx:{margin:0},children:r.map(a=>{const c=a.cover||a.display;return c?t.jsx("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:t.jsx(Ke,{children:t.jsx("img",{src:c,alt:a.title||"",style:{borderRadius:"8px"}})})},c):null})})}qe.propTypes={data:i.object.isRequired};function pe({data:e,feedType:r,...s}){return t.jsxs($t,{...s,children:[r==="data-tracker"&&e.type==="table"&&t.jsx(Ee,{data:e}),(r==="graphic"||r==="gallery")&&t.jsx(qe,{data:e})]})}const $t=D.div`
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
width: 100%;
|
|
40
|
-
margin-bottom: 4px;
|
|
41
|
-
&:last-child {
|
|
42
|
-
margin-bottom: 0;
|
|
43
|
-
}
|
|
44
|
-
`;pe.propTypes={data:i.object.isRequired,feedType:i.string};pe.defaultProps={feedType:"data-tracker"};const It=e=>{let r="rgba(0, 0, 0, 0.12)";return e==="warning"?r="#DE9E37":e==="error"?r="#F16E6E":r="rgba(0, 0, 0, 0.12)",r},Mt=e=>e.every(r=>r.type==="text"),Pt=e=>e.every(r=>r.type==="image"),zt=e=>pt(e,2).map(r=>({type:"combined",items:r})).filter(r=>(r.items||[]).every(s=>{var n,o,l;return(l=(o=(n=s==null?void 0:s.data)==null?void 0:n.text)==null?void 0:o.trim)==null?void 0:l.call(o)})),Nt=e=>{if(!e.length||e.length<=1)return!1;const r=e[0].type;return e.every(s=>s.type===r)},At=async(e,r)=>{const s=yt.user;if(s)try{return await s.getUserPublicInfo({did:e})?await s.getProfileUrl({did:e,locale:r}):void 0}catch(n){console.error(n);return}},Lt=(e,r)=>{var n;const s=(n=r==null?void 0:r.componentMountPoints)==null?void 0:n.find(o=>o.did===e);return s==null?void 0:s.mountPoint},Dt=(e,r)=>{var o,l,a;if(!e)return null;if(((o=e.actions)==null?void 0:o.length)===1)return e.actions[0].link||null;const s=ae(e.activity),n=(s==null?void 0:s.metaLink)||(s==null?void 0:s.targetLink);if(n)return Z(r,n);if(((l=e.attachments)==null?void 0:l.length)===1){const c=e.attachments[0];if(c.type==="link")return((a=c.data)==null?void 0:a.url)||null}return null},_t=e=>{const{receivers:r=[]}=e;return r.length?r.every(s=>s.read):!0};O.propTypes={data:i.array.isRequired,style:i.object};function O({data:e,style:r={}}){return t.jsx($,{style:{color:e.color||"initial",margin:0,whiteSpace:"pre-line!important",...r},children:e.text})}function He({data:e}){const r=[];for(let s=0;s<(e==null?void 0:e.length);s+=2){const n=e[s],o=e[s+1];n&&o?r.push(t.jsxs(je,{children:[t.jsx("td",{className:"label-col",children:t.jsx(O,{data:n.data,style:{whiteSpace:"nowrap"}})}),t.jsx("td",{className:"value-col",children:t.jsx(O,{data:o.data,style:{wordBreak:"break-all"}})})]},s)):n&&r.push(t.jsx(je,{children:t.jsx("td",{className:"label-col",children:t.jsx(O,{data:n.data})})},s))}return t.jsx("table",{style:{width:"100%"},children:t.jsx("tbody",{children:r})})}He.propTypes={data:i.array.isRequired};const je=D.tr`
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: row;
|
|
47
|
-
justify-content: flex-start;
|
|
48
|
-
align-items: center;
|
|
49
|
-
gap: ${({theme:e})=>e.spacing(1)};
|
|
50
|
-
.label-col {
|
|
51
|
-
min-width: 130px;
|
|
52
|
-
flex-shrink: 0;
|
|
53
|
-
}
|
|
54
|
-
.value-col {
|
|
55
|
-
flex: 1;
|
|
56
|
-
}
|
|
57
|
-
`;function he({notification:e,severity:r,showSke:s=!0}){const{attachments:n,data:o,...l}=e,a=q(y=>y.breakpoints.down("md"));if((!n||!n.length)&&_(o))return null;const c=It(r),m=(y,R=!1)=>{if(!y&&!Array.isArray(y))return null;let v=y,w={},k="horizontal";R&&Mt(y)&&(v=zt(y),k="vertical",w={display:"flex",gap:8,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%",width:a||v.length===1?"100%":"28%"});const d=Nt(v);return t.jsx(p,{sx:{width:"100%",display:"flex",gap:1,flexDirection:R?"row":"column",justifyContent:"flex-start",alignItems:R?"center":"unset",flexWrap:"wrap"},children:v.map((x,h)=>x.type==="section"?t.jsx(He,{data:x.fields},h):t.jsxs(u.Fragment,{children:[t.jsx(_e,{attachment:x,style:w,...l}),!(a&&k==="vertical")&&d&&v.length>1&&h!==v.length-1?t.jsx(ne,{orientation:k,style:{color:W.dividerColor},sx:k==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},h))})},j=Pt(n);return t.jsx(Et,{children:t.jsxs("div",{className:"message-in-list",children:[n.length>0&&t.jsx("div",{className:"message-container",style:a?{width:"100%"}:{},children:j?m(n):t.jsx(ke,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128,borderColor:c},children:m(n)})}),!_(o)&&t.jsx("div",{className:"message-container",children:t.jsx("div",{className:"data-container",children:t.jsx(pe,{data:o,feedType:e.feedType})})}),n.length===0&&_(o)&&s&&t.jsx(Ye,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const Et=D.div`
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
.message-in-list {
|
|
61
|
-
padding: 8px 8px 8px 0;
|
|
62
|
-
display: flex;
|
|
63
|
-
border-radius: 8px;
|
|
64
|
-
}
|
|
65
|
-
.message-title {
|
|
66
|
-
color: #25292f;
|
|
67
|
-
font-size: 18px;
|
|
68
|
-
font-weight: bold;
|
|
69
|
-
word-break: break-all;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.attach-ske {
|
|
73
|
-
position: relative;
|
|
74
|
-
margin-left: 10px;
|
|
75
|
-
&::after {
|
|
76
|
-
content: '';
|
|
77
|
-
position: absolute;
|
|
78
|
-
left: -10px;
|
|
79
|
-
top: 0;
|
|
80
|
-
height: 100%;
|
|
81
|
-
width: 4px;
|
|
82
|
-
background-color: ${e=>e.leftLineColor};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.message-body {
|
|
87
|
-
color: #25292f;
|
|
88
|
-
font-size: 16px;
|
|
89
|
-
word-break: break-all;
|
|
90
|
-
white-space: pre-line;
|
|
91
|
-
}
|
|
92
|
-
.message-container {
|
|
93
|
-
display: flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
justify-content: flex-start;
|
|
96
|
-
.data-container,
|
|
97
|
-
.attachment-container {
|
|
98
|
-
display: flex;
|
|
99
|
-
flex-direction: column;
|
|
100
|
-
width: 100%;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
.actions-container {
|
|
104
|
-
margin-top: 10px;
|
|
105
|
-
.actions-item {
|
|
106
|
-
margin-right: 8px;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
`;he.propTypes={severity:i.string.isRequired,notification:i.object.isRequired,showSke:i.bool};he.defaultProps={showSke:!0};const ee=e=>ft.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),qt=async(e,r)=>{const{type:s,did:n}=e;return ze.isSameAddr(s,"did")?await At(n,r)||Q.getLink(e):Q.getLink(e)},Ht=async(e,r,s=!0)=>{const n=Q.toTextList(e);return await Promise.all(n.map(async l=>{if(l instanceof Q.Link){if(s){const a=await qt(l,r),{type:c,chainId:m,did:j}=l;return ze.isSameAddr(c,"dapp")?`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${m}" data-did="${j}">${l.text}</em>`:a?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${a}">${l.text}</a>`:`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${m}" data-did="${j}">${l.text}</em>`}return l.text}return l})).then(l=>l.join(""))};We.propTypes={notification:i.object,rows:i.number,minimal:i.bool};function We({notification:e,rows:r=2,minimal:s=!1}){const[n,o]=u.useState(!1),[l,a]=u.useState(""),{t:c,locale:m}=Re(),{palette:j}=Y(),y=u.useMemo(()=>{const{attachments:h}=e||{};if(!h)return!1;try{return h.length>0}catch{return!1}},[e]),R=u.useMemo(()=>{const{blocks:h}=e||{};if(!h)return!1;try{return h.length>0}catch{return!1}},[e]),v=u.useMemo(()=>{const{description:h}=e||{};return!!h},[e]),w=u.useMemo(()=>{const{data:h}=e||{};return!_(h)},[e]),k=u.useMemo(()=>y||R||v||w,[y,R,v,w]);if(u.useEffect(()=>{Ht((e==null?void 0:e.description)??"",m).then(h=>{a(h)})},[e==null?void 0:e.description,m]),!k)return null;const d=()=>r===0?"":n?`<span class='toggle-btn' data-name='toggle-expanded'>${c("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${c("common.expand")}</span>`,x=h=>{const{target:I}=h;I.getAttribute("data-name")==="toggle-expanded"&&(o(!n),h.customPreventRedirect=!0)};return t.jsxs(Wt,{color:s?j.primary.contrastText:"",children:[t.jsx(p,{className:"text-container",component:"div",onClick:x,children:l&&(!n&&r>0?t.jsx(lt,{basedOn:"letters",unsafeHTML:ee(l),maxLine:r,ellipsisHTML:ee(d())}):t.jsx($,{component:"div",className:`content ${r===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important"},dangerouslySetInnerHTML:{__html:ee(`${l}${d()}`)}}))}),!s&&(y||w)?t.jsx(he,{severity:e.severity,notification:e}):null]})}const Wt=D(p)`
|
|
110
|
-
width: 100%;
|
|
111
|
-
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
112
|
-
.text-container {
|
|
113
|
-
word-wrap: break-word;
|
|
114
|
-
word-break: break-all;
|
|
115
|
-
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
116
|
-
.toggle-btn {
|
|
117
|
-
display: inline-block;
|
|
118
|
-
white-space: nowrap;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
margin-left: 4px;
|
|
121
|
-
color: ${e=>e.theme.palette.secondary.main};
|
|
122
|
-
}
|
|
123
|
-
.content.ellipsis {
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
word-break: break-all;
|
|
127
|
-
display: block;
|
|
128
|
-
display: -webkit-box;
|
|
129
|
-
-webkit-box-orient: vertical;
|
|
130
|
-
-webkit-line-clamp: 2;
|
|
131
|
-
line-height: 1.25;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
`,Bt=u.memo(We);var me={},Ut=Ce;Object.defineProperty(me,"__esModule",{value:!0});var Be=me.default=void 0,Ot=Ut(Te()),Ft=t;Be=me.default=(0,Ot.default)((0,Ft.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var fe={},Vt=Ce;Object.defineProperty(fe,"__esModule",{value:!0});var Ue=fe.default=void 0,Gt=Vt(Te()),Qt=t;Ue=fe.default=(0,Gt.default)((0,Qt.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");const Xt={error:Be,warning:Ue,info:xt,success:vt};xe.propTypes={severity:i.oneOf(["error","warning","info","success"]).isRequired,size:i.number};xe.defaultProps={size:32};function xe({severity:e="info",size:r=32}){const s=Y(),o=L(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],l=Xt[e],a=Ze(o,.1);return t.jsx(K,{sx:{width:r,height:r,bgcolor:a,color:o},children:t.jsx(l,{fontSize:"small"})})}const Kt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},Yt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},Zt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},Jt={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},er={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},be={comment:{icon:Kt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:Yt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:Zt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:Jt,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:er,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};ge.propTypes={activity:i.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:i.number};ge.defaultProps={size:32};function ge({activity:e,size:r=32}){const s=be[e]||be.comment,n=s.icon;return t.jsx(K,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:n}):t.jsx(Se,{icon:n})})}const re={avatar:i.string,fullName:i.string,did:i.string};function X({actor:e,size:r,teamDid:s,inService:n,showName:o}){const l=L(()=>({...e,avatar:e!=null&&e.avatar?kt(e.avatar,s,n):null}),[e,s,n]),a=c=>{e&&(c.stopPropagation(),window.open(mt(Z(st.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),c.customPreventRedirect=!0)};return t.jsxs(p,{display:"flex",alignItems:"center",gap:1,onClick:a,role:"button",style:{cursor:"pointer"},title:(e==null?void 0:e.fullName)||"",children:[l.avatar?t.jsx(jt,{user:l,showDid:!0,cardType:bt.AvatarOnly,infoType:wt.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(K,{sx:{width:r,height:r}}),o&&t.jsx("span",{children:e==null?void 0:e.fullName})]})}X.propTypes={actor:i.shape(re).isRequired,size:i.number.isRequired,teamDid:i.string,inService:i.bool,showName:i.bool};X.defaultProps={teamDid:"",inService:!1,showName:!1};J.propTypes={actors:i.oneOfType([i.shape(re),i.arrayOf(i.shape(re))]).isRequired,size:i.number,maxDisplay:i.number,teamDid:i.string,inService:i.bool,showName:i.bool,avatarFallback:i.node};J.defaultProps={size:32,maxDisplay:9,teamDid:"",inService:!0,showName:!1,avatarFallback:null};function J({actors:e,size:r=32,maxDisplay:s=9,teamDid:n="",inService:o=!0,showName:l=!1,avatarFallback:a=null}){const c=L(()=>{const m=Array.isArray(e)?e:[e];return ht(m,"did").filter(Boolean)},[e]);return c.length===1||!c.length?t.jsx(X,{actor:c[0],size:r,teamDid:n,inService:o,showName:l}):t.jsx(Je,{total:c.length,renderSurplus:m=>m<100?t.jsxs("span",{children:["+",m]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:c.map((m,j)=>m!=null&&m.avatar?t.jsx(X,{actor:m,size:r,teamDid:n,inService:o},(m==null?void 0:m.did)||j):a)})}const we=3;Ve.propTypes={notification:i.object.isRequired,isMultiple:i.bool,blocklet:i.object,mountPoint:i.string,avatarFallback:i.node};Oe.propTypes={notification:i.object.isRequired,mountPoint:i.string};Fe.propTypes={items:i.array.isRequired,activity:i.object.isRequired,blocklet:i.object,mountPoint:i.string,viewMoreLink:i.string,avatarFallback:i.node};function Oe({notification:e,mountPoint:r=""}){var a;const{activity:s}=e,{type:n,meta:o={}}=s||{},l=$e({activity:s,users:[e==null?void 0:e.actorInfo],actors:[(a=e==null?void 0:e.activity)==null?void 0:a.actor],mountPoint:r});return _(s)||!s.type||!s.actor||_(s.target)?null:t.jsxs(p,{children:[t.jsx($,{variant:"body1",color:W.textBase,sx:{mb:.5},children:l}),t.jsx(Ie,{meta:o,type:n})]})}function Fe({items:e,activity:r,blocklet:s,mountPoint:n="",viewMoreLink:o="",avatarFallback:l=null}){const a=Y(),c=L(()=>{var d;return(s==null?void 0:s.did)||((d=s==null?void 0:s.meta)==null?void 0:d.did)||""},[s]),{locale:m}=u.useContext(oe),j=L(()=>!_(r.meta)&&Object.values(r.meta).some(d=>d!=null),[r]),y=$e({activity:r,users:e.map(d=>d==null?void 0:d.actorInfo),actors:e.map(d=>{var x;return(x=d==null?void 0:d.activity)==null?void 0:x.actor}),mountPoint:n}),R=te(d=>{if(!d.activity)return null;const x=ae(d.activity);return x!=null&&x.metaLink?Z(n,x.metaLink):null}),v=te((d,x)=>{if(d.stopPropagation(),!x)return;const h=R(x);h&&(window.open(h,"_blank"),d.customPreventRedirect=!0)}),w=e.length>we,k=e.slice(0,we);return t.jsxs(p,{sx:{width:"100%"},children:[t.jsx($,{variant:"body1",color:W.textBase,sx:{mb:3},children:y}),j?t.jsxs(p,{className:"sub-content",display:"flex",flexDirection:"column",gap:3,children:[k.map(d=>{var x;return t.jsxs(p,{display:"flex",flexDirection:"column",gap:1,onClick:h=>v(h,d),children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:1,children:[G(d)?t.jsx(J,{actors:d.actorInfo,size:32,teamDid:c}):l,t.jsx($,{variant:"subtitle1",color:W.textBase,children:G(d)?(x=d==null?void 0:d.actorInfo)==null?void 0:x.fullName:"System"})," ","·",t.jsx(Me,{value:d.createdAt,locale:m,shouldUpdate:!0,style:{color:a.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),t.jsx(p,{pl:5,children:t.jsx(Ie,{meta:d.activity.meta,type:d.activity.type})})]},d.id)}),w&&o?t.jsx(p,{mt:1,display:"flex",justifyContent:"center",children:t.jsxs(et,{size:"large",variant:"text",component:se,href:o,target:"_blank",rel:"noopener noreferrer",onClick:d=>{d.customPreventRedirect=!0},children:["View More ",t.jsx(Se,{icon:ct,style:{marginLeft:4}})]})}):null]}):null]})}function Ve({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:n="",avatarFallback:o}){const l=L(()=>{if(!e.activity)return null;const a=ae(e.activity);return a!=null&&a.targetLink?Z(n,a.targetLink):null},[e.activity,n]);return r?t.jsx(Fe,{items:e.items,activity:e.activity,blocklet:s,mountPoint:n,viewMoreLink:l,avatarFallback:o}):t.jsx(Oe,{notification:e,mountPoint:n})}const tr=tt(p)`
|
|
135
|
-
display: flex;
|
|
136
|
-
justify-content: center;
|
|
137
|
-
align-items: center;
|
|
138
|
-
flex-direction: column;
|
|
139
|
-
height: 100%;
|
|
140
|
-
min-height: 100px;
|
|
141
|
-
color: #999;
|
|
142
|
-
.empty-icon {
|
|
143
|
-
margin: 10px 0;
|
|
144
|
-
}
|
|
145
|
-
`;function ye({color:e,children:r,...s}){const n=Ct();return t.jsxs(tr,{...s,children:[t.jsx("img",{src:`${n.imgPrefix}/all-done.png`,alt:"All Done",width:200,height:200,style:{maxHeight:"100%",maxWidth:"100%"},onError:o=>{o.target.style.display="none"}}),t.jsx(p,{className:"empty-content",children:r})]})}ye.propTypes={color:i.string,children:i.any};ye.defaultProps={color:"inherit",children:null};rr.propTypes={data:i.array,blockletMap:i.object,onReadNotification:i.func,onReadBatch:i.func,inDialog:i.bool,highlightId:i.string,highlight:i.bool,type:i.oneOf(["server","service"])};Ge.propTypes={notification:i.object,blocklet:i.object,onReadNotification:i.func,inDialog:i.bool,highlight:i.bool};F.propTypes={blocklet:i.object,size:i.number,showName:i.bool,hideDot:i.bool};function F({blocklet:e,size:r=40,showName:s=!1,hideDot:n=!1}){var a,c;const o=(e==null?void 0:e.did)||((a=e==null?void 0:e.meta)==null?void 0:a.did)||"",l=((e==null?void 0:e.alsoKnownAs)||[]).concat((e==null?void 0:e.appId)||(e==null?void 0:e.appDid)||(e==null?void 0:e.appPid)||"");return t.jsxs(p,{className:"component-avatar",display:"flex",alignItems:"center",sx:{gap:n?"8px":"4px"},children:[!n&&t.jsx("span",{className:"dot"}),e?t.jsx(p,{children:l.includes(o)?t.jsx(le,{blocklet:e,size:r,style:{borderRadius:8}}):t.jsx(ot,{blocklet:e,ancestors:e.ancestors??[],size:r,style:{borderRadius:8}})}):t.jsx(it,{width:r,height:r}),s&&t.jsx("span",{className:"component-name",children:(c=e==null?void 0:e.meta)==null?void 0:c.title})]})}function Ge({notification:e,blocklet:r,onReadNotification:s=()=>{},inDialog:n=!1,highlight:o}){const{locale:l}=u.useContext(oe),a=Y(),c=q(g=>g.breakpoints.down("md")),m=u.useRef(null),j=u.useMemo(()=>_t(e),[e]),y=u.useMemo(()=>ut(e),[e]),R=u.useMemo(()=>G(e),[e]),v=u.useMemo(()=>{const{actions:g,action:C}=e;let T=g??[];return!T.length&&C&&(T=[{name:"Visit",link:C}]),T},[e]),w=u.useMemo(()=>e.items||[],[e]),k=u.useMemo(()=>w.length>0,[w]),d=u.useMemo(()=>y?k?w.map(g=>{var C;return G(g)?g.actorInfo:{did:(C=g.activity)==null?void 0:C.actor}}).filter(Boolean):e.actorInfo??[]:[],[w,e.actorInfo,k,y]),x=u.useMemo(()=>{var g;return(r==null?void 0:r.did)||((g=r==null?void 0:r.meta)==null?void 0:g.did)||""},[r]),h=u.useMemo(()=>Lt(x,window.blocklet),[x]),I=te((g,C)=>{if(j||s(g),C&&!C.customPreventRedirect){const T=Dt(g,h);T&&typeof T=="string"&&window.open(T,"_blank","noopener,noreferrer")}});return t.jsxs(sr,{ref:m,className:"notification-row",id:e.id,isRead:j,inDialog:n,highlight:o,isMd:c,onClick:g=>I(e,g),children:[y?t.jsx(ge,{activity:e.activity.type,size:c?24:32}):t.jsx(xe,{severity:e.severity,size:c?24:32}),t.jsxs(p,{className:"notification",display:"flex",flexDirection:"column",alignItems:"start",children:[t.jsxs(p,{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,className:"header",mb:1.5,children:[y&&R?t.jsx(J,{actors:d,teamDid:x,size:c?24:32,avatarFallback:t.jsx(F,{blocklet:r,hideDot:!0,size:c?24:32})}):t.jsx(F,{blocklet:r,hideDot:!0,size:c?24:32}),t.jsx(Me,{value:e.createdAt,locale:l,shouldUpdate:!0,style:{color:a.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),y?t.jsx(Ve,{notification:e,isMultiple:k,blocklet:r,mountPoint:h,avatarFallback:t.jsx(F,{blocklet:r,hideDot:!0,size:c?24:32})}):t.jsxs(t.Fragment,{children:[t.jsx($,{variant:"body1",className:"title",color:"rgba(24, 24, 27, 1)",style:{marginTop:0},sx:{mb:.5},children:e.title}),t.jsx(Bt,{notification:e,rows:n?0:2})]}),v.length>0?t.jsx(p,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,mt:1.5,children:v.map((g,C)=>t.jsxs(u.Fragment,{children:[t.jsx(se,{href:g.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:T=>{T.customPreventRedirect=!0},children:g.name},g.link),C<v.length-1?t.jsx(ne,{orientation:"vertical",sx:{ml:1,mr:1,height:12,borderWidth:"1px"}}):null]},g.link))}):null]}),(e==null?void 0:e.description)&&e.severity==="error"&&t.jsx(p,{className:"copy-button",children:t.jsx(rt,{size:"small",children:t.jsx(nt,{sx:{fontSize:22},content:(e==null?void 0:e.description)||""})})})]})}function rr({data:e,blockletMap:r,onReadNotification:s=()=>{},onReadBatch:n=()=>{},inDialog:o=!1,highlightId:l,highlight:a=!1,type:c="service"}){const{t:m}=Re(),j=u.useRef(null),[y,R]=u.useState(!1),[v,w]=u.useState(!0),[k,d]=u.useState(!1),x=u.useRef(new Set),h=u.useRef(new Set),I=u.useRef(null),g=u.useRef(null),C=u.useRef(!1),T=u.useMemo(()=>o?e==null?void 0:e.slice(0,5):e,[o,e]),P=u.useMemo(()=>dt(T),[T]),H=u.useMemo(()=>{const f=new Map;return P&&P.length&&P.forEach(b=>{f.set(b.id,b)}),f},[P]);u.useEffect(()=>{const f=()=>{w(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",f),()=>{document.removeEventListener("visibilitychange",f)}},[]);const U=u.useCallback(()=>{if(!o&&x.current.size>0){const f=[];x.current.forEach(b=>{if(h.current.has(b))return;const M=H.get(b);if(M){const{receivers:N=[],items:A=[]}=M;if(N.length&&!N[0].read&&(f.push(b),h.current.add(b),A.length>0&&A.forEach(S=>{const z=S.id;z&&!h.current.has(z)&&(f.push(z),h.current.add(z))}),g.current)){const S=document.getElementById(b);S&&g.current.unobserve(S)}}}),f.length>0&&(n(f),setTimeout(()=>{R(!1)},300)),x.current.clear()}},[o,H,n]),E=u.useCallback(()=>{if(o||!j.current||!v)return;g.current&&g.current.disconnect();const f={root:null,rootMargin:"0px",threshold:.5},b=new IntersectionObserver(N=>{y&&N.forEach(A=>{const S=A.target.id;if(h.current.has(S))return;const z=H.get(S);if(z){const{receivers:ve=[]}=z;ve.length&&!ve[0].read&&(A.isIntersecting?(x.current.add(S),k||U()):x.current.delete(S))}})},f);g.current=b,Array.from(j.current.querySelectorAll(".notification-row")).filter(N=>{const A=N.id;if(h.current.has(A))return!1;const S=H.get(A);if(S){const{receivers:z=[]}=S;return z.length&&!z[0].read}return!1}).forEach(N=>{b.observe(N)}),C.current=!1},[y,o,k,v,H,U]);return u.useEffect(()=>{o||(C.current=!0,g.current&&v&&y&&setTimeout(()=>{E()},0))},[T,y,v,E,o]),u.useEffect(()=>{if(o||!j.current||!v)return;let f=window;if(c==="server"&&(f=document.getElementById("arc__dashboard-main")),!f){const M=document.getElementsByClassName("dashboard-main")[0];M&&(f=M)}if(!f)return;const b=M=>{M.isTrusted&&(y||R(!0),d(!0),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{d(!1),U(),C.current&&E()},300))};return f.addEventListener("scroll",b,{passive:!0}),()=>{f.removeEventListener("scroll",b),I.current&&clearTimeout(I.current)}},[o,y,v,U,E,c]),u.useEffect(()=>(o||E(),()=>{g.current&&g.current.disconnect()}),[E,o]),P!=null&&P.length?t.jsx(p,{ref:j,display:"flex",flexDirection:"column",sx:{...o?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:P==null?void 0:P.map(f=>{var M;const b=f.source==="system"?r.get(f.entityId||f.sender):r.get(f.componentDid||f.sender);return((M=f==null?void 0:f.type)==null?void 0:M.toLowerCase())==="passthrough"?null:t.jsx(Ge,{highlight:a&&l===f.id,inDialog:o,notification:f,blocklet:b,onReadNotification:()=>s(f)},f.id)})}):t.jsx(ye,{children:m("notification.allDone")})}const sr=D("div")`
|
|
146
|
-
@keyframes flash-bg {
|
|
147
|
-
0% {
|
|
148
|
-
background-color: ${e=>e.theme.palette.warning.light};
|
|
149
|
-
}
|
|
150
|
-
100% {
|
|
151
|
-
background-color: unset;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
position: relative;
|
|
155
|
-
display: flex;
|
|
156
|
-
align-items: flex-start;
|
|
157
|
-
gap: ${e=>e.isMd?e.theme.spacing(1):e.theme.spacing(1.5)};
|
|
158
|
-
padding: ${e=>e.isMd?`${e.theme.spacing(2)} 0`:e.theme.spacing(3)};
|
|
159
|
-
cursor: pointer;
|
|
160
|
-
animation: ${e=>e.highlight?"flash-bg 3s ease-out 0s 1 normal none running":"none"};
|
|
161
|
-
background-color: ${e=>e.isRead?"transparent":e.theme.palette.grey[100]};
|
|
162
|
-
border-bottom: 1px solid;
|
|
163
|
-
border-color: ${({theme:e})=>e.palette.grey[200]};
|
|
164
|
-
&:last-child {
|
|
165
|
-
border-bottom: none;
|
|
166
|
-
}
|
|
167
|
-
&:hover {
|
|
168
|
-
background-color: ${e=>e.theme.palette.action.hover};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.copy-button {
|
|
172
|
-
position: absolute;
|
|
173
|
-
right: ${e=>e.inDialog?e.theme.spacing(2):"0"};
|
|
174
|
-
top: ${e=>e.inDialog?e.theme.spacing(5):e.theme.spacing(4)};
|
|
175
|
-
display: none;
|
|
176
|
-
background: ${e=>e.theme.palette.action.disabledBackground};
|
|
177
|
-
border-radius: 50%;
|
|
178
|
-
svg {
|
|
179
|
-
width: ${e=>e.theme.spacing(2.25)};
|
|
180
|
-
height: ${e=>e.theme.spacing(2.25)};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
&:hover {
|
|
184
|
-
.copy-button {
|
|
185
|
-
display: block;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.component-avatar {
|
|
190
|
-
.dot {
|
|
191
|
-
width: ${e=>e.theme.spacing(1)};
|
|
192
|
-
height: ${e=>e.theme.spacing(1)};
|
|
193
|
-
border-radius: 50%;
|
|
194
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
195
|
-
visibility: ${e=>e.isRead?"hidden":"visible"};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.notification {
|
|
200
|
-
width: calc(100% - ${e=>e.theme.spacing(6.25)});
|
|
201
|
-
|
|
202
|
-
> .header {
|
|
203
|
-
width: 100%;
|
|
204
|
-
@media (min-width: 900px) {
|
|
205
|
-
.title {
|
|
206
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(50)});
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
@media (min-width: 1200px) {
|
|
210
|
-
.title {
|
|
211
|
-
max-width: ${e=>e.theme.spacing(102.5)};
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
@media (max-width: 900px) {
|
|
215
|
-
.title {
|
|
216
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(25)});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.title {
|
|
222
|
-
min-width: 0;
|
|
223
|
-
max-width: 100%;
|
|
224
|
-
overflow: hidden;
|
|
225
|
-
text-overflow: ellipsis;
|
|
226
|
-
white-space: nowrap;
|
|
227
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
228
|
-
font-size: ${e=>e.theme.typography.fontSize*1.15}px;
|
|
229
|
-
}
|
|
230
|
-
.link {
|
|
231
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
232
|
-
font-size: ${e=>e.theme.typography.fontSize}px;
|
|
233
|
-
text-decoration: none;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
`;export{J as A,le as B,rr as N,F as S,Ve as a,Bt as b,_t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-B6POpIBB.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-DrYhFxCD.js";import"./vendor-ux-did-connect-DVrP2LNw.js";import"./vendor-utils-BUwfcN20.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CX-5Ex_f.js";import"./TuneOutlined-DcBuSd1o.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as n,j as i,aa as l}from"./vendor-mui-core-B6POpIBB.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{u,ar as h}from"./vendor-ux-did-connect-DVrP2LNw.js";import g from"./index-BUrD6xiH.js";import"./vendor-utils-BUwfcN20.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";import"./index-Cb1OPKJL.js";import"./vendor-arcblock-CX-5Ex_f.js";import"./Error-DnzvDd2d.js";import"./confirm-Bj4L0Vn8.js";import"./format-error-BrmqJs5a.js";import"./session-j-9KoWbs.js";import"./did-address-CJZtrzhT.js";import"./empty-spinner-BYUFR95o.js";import"./bundle-avatar-njRzpG6o.js";import"./shorten-label-SbKUBkvs.js";import"./list-header-8k1_C0K0.js";import"./Download-CF6ZhZfD.js";import"./click-to-copy-CSwBjJDI.js";import"./QuestionMarkCircle-DpFFQWud.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./index-DIe9psLc.js";import"./api-BkKTvlm_.js";import"./ChevronRight-C-lajCDc.js";import"./vendor-mui-x-CATHW1QL.js";import"./DeleteOutline-Csdx_lih.js";import"./react-beautiful-dnd.esm-CeODMcuS.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-taL0aTyr.js";import"./Launch-CVPYIHzD.js";import"./Done-DjB4uf97.js";import"./delete-confirm-kpan5KFX.js";import"./get-safe-url-BYr2jgRv.js";import"./ArrowDropDown-BCCa5uRn.js";import"./index-CMFOn8T3.js";import"./index-Bt7GP-dU.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as x}from"./vendor-react-DEoibe3W.js";import{e as G,m as C,j as s,bL as q,T as k,aa as w,H as l,bd as R,ah as F,ad as S,cp as Z,cq as H}from"./vendor-mui-core-B6POpIBB.js";import{p as v}from"./use-blocklet-logo-DryhoHen.js";import{u as P,a4 as ee,I as te,ab as ae}from"./vendor-ux-did-connect-DVrP2LNw.js";import{as as O,ax as _,z as se,C as J,f as U,aF as ne}from"./index-Cb1OPKJL.js";import{b as A,aL as ie}from"./vendor-utils-BUwfcN20.js";import{a6 as D}from"./vendor-arcblock-CX-5Ex_f.js";import{R as K}from"./index-C-rP7qS0.js";import{B as re}from"./bundle-avatar-njRzpG6o.js";import{B as oe}from"./dashboard-0TEl6bJJ.js";import"./vendor-hooks-DpLLpTSZ.js";import"./session-j-9KoWbs.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cb6R1F6v.js";import"./confirm-Bj4L0Vn8.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-CVHX5RbU.js";import"./get-safe-url-BYr2jgRv.js";import"./InfoOutlined-BMb9Zu84.js";import"./dot-CaKxEi_0.js";import"./useAsync-DXeWUWXr.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";const Q=n=>{const g=new Date(Math.min(...n)),r=(new Date(Math.max(...n))-g)/(1e3*60);return u=>{if(r<=10){const t=(n.length-n.length%r)/r;return u%t===0}const o=(n.length-n.length%6)/6;return u%o===0}},B=n=>`${n}%`;function N({title:n,cpus:g,currentLoad:c,history:d,empty:r,onHover:u,hoverIndex:i}){const{t:o,locale:b}=P(),t=G(),e=x.useRef(null),a=A(d)?[]:d.map(p=>O(p.date,"HH:mm",b)),j=`${n||o("common.cpu")} (${Math.floor(c||0)}%)`,L=x.useCallback(()=>{u==null||u(null)},[u]);if(x.useEffect(()=>{if(!e.current||(i==null?void 0:i.ref)===e)return;const p=e.current.getEchartsInstance(),E=i==null?void 0:i.seriesIndex,T=a.findIndex(y=>y===(i==null?void 0:i.dataValue));i&&T!==-1?p.dispatchAction({type:"showTip",seriesIndex:E,dataIndex:T}):(p.dispatchAction({type:"hideTip"}),p.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[i]),!A(d)){const T={tooltip:{trigger:"axis",formatter(y){const $=y[0].data,{seriesIndex:f,dataIndex:h}=y[0];return u==null||u({seriesIndex:f,dataIndex:h,dataValue:a[h],ref:(i==null?void 0:i.ref)||e}),`${y[0].name}: <b>${B($)}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:a,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:Q(d.map(y=>new Date(y.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:100,interval:Math.ceil(50),axisLabel:{formatter:B}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:80,color:C(t.palette.primary.main,t.palette.mode==="dark"?.15:.08)},{min:80,max:100,color:C(t.palette.warning.main,t.palette.mode==="dark"?.18:.12)},{min:100,color:C(t.palette.error.main,t.palette.mode==="dark"?.25:.18)}]},series:[{name:"CPU Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:t.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:d.map(y=>y.value),markLine:{silent:!0,symbol:["none","none"],lineStyle:{color:t.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${B(100)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2},data:[{yAxis:100},{yAxis:80,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${B(80)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}}]}}]};return s.jsxs(q,{sx:{p:1,position:"relative"},onMouseLeave:L,children:[s.jsx(k,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:j}),s.jsx(K,{ref:e,option:T,style:{width:"100%",height:"200px"},onEvents:{globalout:L}}),s.jsxs(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:[`${o("system.cores")}: ${(g==null?void 0:g.length)||0}`," "]})]})}return r}N.propTypes={title:l.string,cpus:l.array,currentLoad:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};N.defaultProps={title:"",cpus:[],currentLoad:0,history:[],empty:null,onHover:()=>{},hoverIndex:null};function V({instanceCount:n,title:g,total:c,used:d,history:r,empty:u,onHover:i,hoverIndex:o}){const{t:b,locale:t}=P(),e=G(),a=!!c,j=c-d,L=a?`(${_(d)}, ${Math.floor(d/c*100)}%)`:"",p=x.useRef(null),E=`${g||b("common.memory")} ${L}`,T=A(r)?[]:r.map(f=>O(f.date,"HH:mm",t));x.useEffect(()=>{if(!p.current||(o==null?void 0:o.ref)===p)return;const f=p.current.getEchartsInstance(),h=o==null?void 0:o.seriesIndex,M=T.findIndex(m=>m===(o==null?void 0:o.dataValue));o&&M!==-1?f.dispatchAction({type:"showTip",seriesIndex:h,dataIndex:M}):(f.dispatchAction({type:"hideTip"}),f.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[o==null?void 0:o.dataIndex]);const y=x.useCallback(()=>{i==null||i(null)},[i]);x.useEffect(()=>{if(p.current){const f=p.current.getEchartsInstance(),h=f.getDom(),M=m=>{y(m)};return h.addEventListener("mouseleave",M),()=>{h&&h.removeEventListener("mouseleave",M),f&&f.dispose()}}},[y]);const $=[];if(n&&$.push({title:b("system.instances"),metric:n}),a&&$.push({title:b("system.free"),metric:D(j,{short:!0,iec:!0})}),!A(r)){const f=Math.max(...r.map(m=>m.value),c,0),h=Math.ceil(c*.8),M={tooltip:{trigger:"axis",formatter(m){const z=m[0].data,X=D(z,{short:!0,iec:!0}),{seriesIndex:Y,dataIndex:W}=m[0];return i==null||i({seriesIndex:Y,dataIndex:W,dataValue:T[W],ref:(o==null?void 0:o.ref)||p}),`${m[0].name}: <b>${X}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:T,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:Q(r.map(m=>new Date(m.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:f,interval:Math.ceil(f/2),axisLabel:{formatter:m=>D(m,{short:!0,iec:!0}),padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:h,color:C(e.palette.primary.main,e.palette.mode==="dark"?.15:.08)},{min:h,max:c,color:C(e.palette.warning.main,e.palette.mode==="dark"?.18:.12)},{min:c,color:C(e.palette.error.main,e.palette.mode==="dark"?.25:.18)}]},series:[{name:"Memory Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:e.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:r.map(m=>m.value),markLine:{silent:!0,symbol:["none","none"],data:[{yAxis:c,lineStyle:{color:e.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${D(c,{short:!0,iec:!0})}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:h,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${D(h,{short:!0,iec:!0})}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}}]}}]};return s.jsxs(q,{sx:{p:1,position:"relative"},onMouseLeave:y,children:[s.jsx(k,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:E}),s.jsx(K,{ref:p,option:M,style:{width:"100%",height:"200px"}}),s.jsx(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:$.map((m,z)=>s.jsxs(w,{sx:{marginLeft:z===0?0:1,display:"inline-flex"},children:[m.title,": ",m.metric]},m.title))})]})}return u}V.propTypes={title:l.string,instanceCount:l.number,total:l.number,used:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};V.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[],empty:null,onHover:()=>{},hoverIndex:null};function I({blocklet:n,...g}){const{t:c}=P(),{info:d}=se(),{runtimeHistory:r}=J(),[u,i]=x.useState(null),o=x.useCallback(t=>n.status!=="running"?s.jsx(k,{children:c("blocklet.runtimeInfo.noRunning")}):t.length?null:s.jsx(ee,{children:c("common.empty")}),[n.status,c]),b=x.useCallback(t=>{i(t)},[]);return r.length===0?s.jsx(k,{children:c("blocklet.runtimeInfo.noRunning")}):s.jsxs(le,{component:"div",...g,children:[s.jsxs(R,{className:"page-metrics",container:!0,spacing:5,children:[s.jsx(R,{item:!0,xs:12,sx:{pt:"16px !important"},children:s.jsx(k,{fontSize:"16px",fontWeight:"bold",children:"CPU"})}),r==null?void 0:r.map(t=>{var e,a;return s.jsx(R,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:s.jsx(N,{title:`${t.name} CPU`,empty:o(t.cpu),currentLoad:((e=t.appRuntimeInfo)==null?void 0:e.cpuUsage)||0,cpus:((a=t.appRuntimeInfo)==null?void 0:a.cpus)||[],history:t.cpu,onHover:b,hoverIndex:u,style:{height:150}})},`${t.key}-cpu`)})]}),s.jsxs(R,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[s.jsx(R,{item:!0,xs:12,sx:{pt:"16px !important"},children:s.jsx(k,{fontSize:"16px",fontWeight:"bold",children:"Memory"})}),r==null?void 0:r.map(t=>{var e,a,j;return s.jsx(R,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:s.jsx(V,{title:`${t.name} Memory`,empty:o(t.memory),total:(e=d.runtimeConfig)!=null&&e.blockletMaxMemoryLimit?D.parseSize(`${d.runtimeConfig.blockletMaxMemoryLimit*(t.key===((a=n==null?void 0:n.meta)==null?void 0:a.did)?r.length-1:1)}MiB`):0,used:((j=t.appRuntimeInfo)==null?void 0:j.memoryUsage)||0,history:t.memory,onHover:b,hoverIndex:u,style:{height:150}})},`${t.key}-memory`)})]})]})}I.propTypes={blocklet:l.object.isRequired,cpuHistory:l.arrayOf(l.shape({date:l.number,value:l.number})),memoryHistory:l.arrayOf(l.shape({date:l.number,value:l.number}))};I.defaultProps={cpuHistory:[],memoryHistory:[]};const le=F(k)``;function ce(){const{t:n,locale:g}=P(),[c,d]=x.useState(6),{blocklet:r,actions:{refreshBlocklet:u}}=J(),i=x.useMemo(()=>{const t=[];return U.forEachBlockletSync(r,(e,{ancestors:a,id:j,level:L})=>{var p;(p=e==null?void 0:e.meta)!=null&&p.did&&e.meta.did!==r.meta.did&&t.push({type:"blocklet",groupId:r.meta.did,groupName:U.getDisplayName(r),id:j,name:U.getDisplayName(e,!0),blocklet:r,component:e,level:L-1>=0?L-1:0,runtimeInfo:e.runtimeInfo,ancestors:a})}),t},[r]);x.useEffect(()=>{u({hours:c});const t=setInterval(()=>{u({hours:c})},1e3*10);return()=>{clearInterval(t)}},[c]);const o=t=>v(Number(t||0),{locale:ne(g)}),b=[{label:n("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:e,component:a,level:j,ancestors:L}=i[t];return s.jsxs(w,{display:"flex",alignItems:"center",pl:j*2,children:[s.jsx(re,{size:20,blocklet:a,ancestors:L}),s.jsx(w,{ml:1,children:e}),s.jsx(oe,{variant:"pin",style:{marginLeft:8},status:a.status,source:a.source,progress:a.progress})]})}}},{label:n("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=i[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):o(e==null?void 0:e.uptime)}}},{label:n("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=i[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):_((e==null?void 0:e.memoryUsage)||0)}}},{label:n("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=i[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):`${((e==null?void 0:e.cpuUsage)||0).toFixed(1)}%`}}},{label:n("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(t){const{runtimeInfo:e}=i[t];return e!=null&&e.uptime?s.jsxs(w,{display:"flex",alignItems:"center",children:[s.jsx(te,{icon:e!=null&&e.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),s.jsx(w,{ml:1,children:e!=null&&e.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:n("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=i[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):e==null?void 0:e.pid}}},{label:n("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=i[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):e==null?void 0:e.port}}}];return s.jsxs(me,{component:"div",children:[s.jsxs(w,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[s.jsx(k,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:n("analytics.trend")}),s.jsx(Z,{size:"small",exclusive:!0,value:c,onChange:(t,e)=>{ie(e)&&d(e)},children:[1,3,6,12,24].map(t=>s.jsxs(H,{value:t,children:[t,"H"]},t))})]}),s.jsx(w,{children:s.jsx(I,{blocklet:r})}),s.jsx(w,{mt:3,children:s.jsx(ae,{title:n("analytics.detail"),className:"monitor-table",locale:g,data:i,columns:b,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}ce.propTypes={};const me=F(k)``;export{ce as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a$ as o}from"./vendor-ux-did-connect-DVrP2LNw.js";const e=o();export{e as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as H,b as le,g as J}from"./vendor-react-DEoibe3W.js";import{H as E,j as a,ap as ee,s as K,w as de,aa as G,T as F,y as ue}from"./vendor-mui-core-B6POpIBB.js";import{f as j,u as Q}from"./vendor-hooks-DpLLpTSZ.js";import{n as pe,ba as C,I as me}from"./vendor-ux-did-connect-DVrP2LNw.js";import{b as W,z as fe,A as x}from"./vendor-utils-BUwfcN20.js";import{u as he}from"./session-j-9KoWbs.js";import{c as T,t as ge}from"./vendor-arcblock-CX-5Ex_f.js";import{z as ye,X as ve,V as Le}from"./index-Cb1OPKJL.js";const at=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var m,h,L,S;if(!n.activity||!n.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),n.activity&&n.activity.type?(r=n,s=[n]):(t.push(n),r=null,s=[]);return}const o=s[0].activity,i=o.type,c=(m=o.target)==null?void 0:m.type,l=(h=o.target)==null?void 0:h.id,p=n.activity.type,d=(L=n.activity.target)==null?void 0:L.type,v=(S=n.activity.target)==null?void 0:S.id;if(i&&p&&i===p&&(!o.target&&!n.activity.target||o.target&&n.activity.target&&c===d&&l===v))s.push(n);else{if(s.length===1)t.push(s[0]);else{const w=Object.assign({},r,{items:s});t.push(w)}r=n,s=[n]}}),r)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},r,{items:s});t.push(n)}return t},xe=e=>!W(e.activity)&&!!e.activity.type&&!!e.activity.actor,ct=e=>xe(e)&&!!e.actorInfo&&!!e.actorInfo.did,Ee=e=>{if(!e)return null;const{meta:t,target:r}=e;return{metaLink:t==null?void 0:t.id,targetLink:r==null?void 0:r.id}},N={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign",UN_ASSIGN:"un_assign"},Se={[N.COMMENT]:(e,t,r)=>t>1?a.jsxs(a.Fragment,{children:["left ",t," comments on ",r?"your":"the"," ",e]}):a.jsxs(a.Fragment,{children:["commented on ",r?"your":"the"," ",e]}),[N.LIKE]:(e,t)=>a.jsxs(a.Fragment,{children:["liked ",t?"your":"the"," ",e]}),[N.FOLLOW]:()=>a.jsx(a.Fragment,{children:"followed you"}),[N.TIPS]:(e,t)=>a.jsxs(a.Fragment,{children:["gave tips to ",t?"your":"the"," ",e]}),[N.MENTION]:(e,t)=>a.jsxs(a.Fragment,{children:["mentioned you in ",t?"your":"the"," ",e]}),[N.ASSIGN]:()=>a.jsx(a.Fragment,{children:"assigned you a task"}),[N.UN_ASSIGN]:()=>a.jsx(a.Fragment,{children:"revoked your assignment of the task"})},O=H.memo(function({user:t,color:r=C.textBase}){const s=fe(x(pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return a.jsx(ee,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});O.propTypes={user:E.shape({did:E.string.isRequired,fullName:E.string.isRequired}).isRequired,color:E.string};O.displayName="UserLink";function lt({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{session:o}=he()||{},{type:i,target:c}=e||{},{type:l,author:p}=c||{},{linkColor:d=C.textBase}=s||{},v=j(()=>{var f;return p?(((f=o==null?void 0:o.user)==null?void 0:f.did)||(s==null?void 0:s.userDid))===p:!0},[o,p]),y=j(()=>{if(!Array.isArray(t))return new Map;const u=new Map;return t.forEach(f=>{f!=null&&f.did&&!u.has(f.did)&&u.set(f.did,f)}),u},[t]),m=j(()=>Array.isArray(r)?r.map(u=>u?y.get(u)||{did:u,fullName:"System"}:null):[],[r,y]),h=Q(()=>{if(!Array.isArray(m)||m.length===0)return null;if(m.length===1)return a.jsx(O,{user:m[0],color:d});const u=m.slice(0,-1),f=m[m.length-1];if(m.length===2)return a.jsxs(a.Fragment,{children:[a.jsx(O,{user:u[0],color:d})," and ",a.jsx(O,{user:f,color:d})]});const M=m.length>3,U=M?m.slice(0,2):u;return a.jsxs(a.Fragment,{children:[U.map((A,D)=>a.jsxs(le.Fragment,{children:[a.jsx(O,{user:A,color:d}),D<U.length-1?", ":""]},A.did)),M?`, and ${m.length-2} others`:a.jsxs(a.Fragment,{children:[", and ",a.jsx(O,{user:f,color:d})]})]})}),L=Q(()=>{const u=Se[i];return u?u(l,t.length,v):null}),S=j(()=>{const u=h(),f=L();return!u||!f?null:a.jsxs(a.Fragment,{children:[u," ",f]})},[i,l,m,h,L]),w=j(()=>{if(!e)return null;const u=Ee(e);return u!=null&&u.targetLink?x(n,u.targetLink):null},[e,n]);return!i||W(c)?null:a.jsxs(a.Fragment,{children:[S," ",a.jsx(ee,{href:w,color:C.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:u=>{u.customPreventRedirect=!0},children:c.name})]})}const Te={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};te.propTypes={meta:E.object.isRequired};const _e=K(de)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${C.dividerColor}`,boxShadow:"none"})),Ce=K(G)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ne=K(G)({display:"flex",justifyContent:"space-between",alignItems:"center"});function te({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return a.jsxs(_e,{children:[a.jsxs(Ce,{children:[a.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),a.jsx(F,{variant:"h5",color:C.textBase,children:"ArcBlock"})]}),a.jsxs(Ne,{children:[a.jsxs(G,{display:"flex",alignItems:"baseline",gap:1,children:[a.jsxs(F,{component:"span",variant:"h5",color:C.textBase,fontWeight:"bold",children:["+ ",t]}),a.jsx(F,{component:"span",variant:"subtitle2",color:C.textSubtitle,children:r})]}),a.jsx(ue,{variant:"outlined",size:"small",color:"secondary",endIcon:a.jsx(me,{icon:Te}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}ne.propTypes={meta:E.object.isRequired,type:E.string.isRequired,hideTips:E.bool,sx:E.object};ne.defaultProps={hideTips:!1,sx:{}};function ne({meta:e,type:t,hideTips:r=!1,sx:s}){return W(e)?null:t==="tips"&&!r?a.jsx(te,{meta:e}):a.jsx(F,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:C.textSubtitle,children:e.content})}var Oe=H;function we(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var R=we(Oe);function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},P.apply(this,arguments)}function Me(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},$(e,t)}function Ue(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,o;for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var X={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Ae=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function je(e,t){if(!e||typeof e!="object")return e;var r={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(r[s]=e[s])}),r}var Ie=["component","className","unsafeHTML"];function se(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var r=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(c){r.appendChild(De(c))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),o=n.length,i=0;i<o;i++)se(n[i],t)}function De(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function Z(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function re(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);re(e.parentNode,t)}}function Fe(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function B(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var oe={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Re=Object.keys(oe),ie=function(e){Me(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var r=t.prototype;return r.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},r.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},r.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},r.setState=function(n,o){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,o)},r.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(X).forEach(function(o){n.style[o]=X[o]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,o=window.getComputedStyle(this.target);Ae.forEach(function(i){n.canvas.style[i]=o[i]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var o=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");se(this.canvas,o);var i=this.putEllipsis(this.calcIndexes()),c={clamped:i,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},r.calcIndexes=function(){var n=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),i=o.length;if(!o.length)return n;var c=o.find(B);if(!c)return n;for(var l=1,p=c.offsetTop,d=1;d<i&&!(B(o[d])&&o[d].offsetTop-p>1&&(l++,n.push(d),p=o[d].offsetTop,l>this.maxLine));d++);return n},r.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var o=this.nlUnits.pop(),i=this.makeEllipsisSpan();do re(o,this.canvas),Fe(o).appendChild(i),o=this.nlUnits.pop();while(o&&(!B(o)||i.offsetHeight>o.offsetHeight||i.offsetTop>o.offsetTop));return o&&Z(o),this.nlUnits.forEach(Z),!0},r.makeEllipsisSpan=function(){var n=this.props,o=n.ellipsisHTML,i=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var l=document.createElement("span");return l.className="LinesEllipsis-ellipsis",o?l.innerHTML=o:l.textContent=i,c.appendChild(l),c},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,o=this.state,i=o.html,c=o.clamped,l=this.props,p=l.component,d=l.className,v=l.unsafeHTML,y=Ue(l,Ie);return R.default.createElement(p,P({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(h){return n.target=h}},je(y,Re)),R.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?i:v}}))},t}(R.default.Component);ie.defaultProps=oe;var Be=ie;const dt=J(Be),Pe=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},$e=e=>{try{return new URL(e).host}catch{return e}};var ut={getChainHost:Pe,getUrlHost:$e},pt={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},be={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"}},He={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 b=new Map,Ke=(e,t)=>{b.set(e,t)},Ge=(e="en_US")=>b.get(e)||b.get("en_US");var ae={registerLang:Ke,getLang:Ge},We=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 ze=We,{getLang:I}=ae,ke=(e,t)=>t===1?e:`${e}s`,qe=1e-7;var Ye=(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 r=I(t.locale),s=[],n=(c,l)=>{const p=Math.floor(c*10**l+qe);return(Math.round(p)/10**l).toFixed(l)},o=(c,l,p)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&l==="minute"))return;const{long:d}=r[l]||I("en_US")[l],{short:v}=r[l]||I("en_US")[l];let y=(p||c||"0").toString(),m,h;if(t.colonNotation){m=s.length>0?":":"",h="";const L=y.includes(".")?y.split(".")[0].length:y.length,S=s.length>0?2:1;y="0".repeat(Math.max(0,S-L))+y}else m="",t.locale==="zh_CN"?Object.values(i).filter(L=>L>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?h=d:h=v:i.minutes?h=d:h=v:h=t.verbose?` ${ke(d,c)}`:v;s.push(m+y+h)},i=ze(e);if(o(Math.trunc(i.days/365),"year"),o(i.days%365,"day"),o(i.hours,"hour"),o(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(o(i.seconds,"second"),t.formatSubMilliseconds)o(i.milliseconds,"millisecond"),o(i.microseconds,"microsecond"),o(i.nanoseconds,"nanosecond");else{const c=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,l=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,p=c>=1?Math.round(c):Math.ceil(c),d=l?c.toFixed(l):p;o(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,p=n(c,l),d=t.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");o(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(r.millisecond||I("en_US").millisecond).long,l=(r.millisecond||I("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:l}`:`0${t.verbose?` ${c}s`:l}`}if(t.compact)return s[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return s.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?s.join(""):s.join(" ")};const Ve=be,Qe=He,{registerLang:z}=ae,ce=Ye;z("en_US",Ve);z("zh_CN",Qe);ce.registerLang=z;var Xe=ce;const mt=J(Xe),_=(e,t)=>{var s;let r="?v=";return t?r+=ve(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${Le(e==null?void 0:e.status)?"~":""}`,r};function Ze({blocklet:e}){var f,M,U,A,D,k,q,Y,V;const{inService:t}=ye(),r=(f=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:f.value,s=(M=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE_DARK))==null?void 0:M.value,n=(U=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:U.value,o=(A=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT_DARK))==null?void 0:A.value,i=(D=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:D.value,c=(k=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:k.value,l=(q=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:q.value,p=(Y=((e==null?void 0:e.environments)||[]).find(g=>g.key===T.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:Y.value,d=((V=window.env)==null?void 0:V.apiPrefix)||"/",v=`${x(d,`/blocklet/logo/${t?"":e.meta.did}`)}${_(e,r)}`,y=`${x(d,`/blocklet/logo-dark/${t?"":e.meta.did}`)}${_(e,s)}`,m=`${x(d,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${_(e,n??r)}`,h=`${x(d,`/blocklet/logo-rect-dark/${t?"":e.meta.did}`)}${_(e,o??s)}`,L=`${x(d,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${_(e,i??r)}`,S=`${x(d,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${_(e,c)}`,w=`${x(d,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${_(e,l)}`,u=`${x(d,`/blocklet/og-image/${t?"":e.meta.did}`)}${_(e,p)}`;return{logoUrl:v,logoDarkUrl:y,rectLogoUrl:m,rectLogoDarkUrl:h,faviconUrl:L,splashPortraitUrl:S,splashLandscapeUrl:w,ogImageUrl:u}}function ft({blocklet:e,square:t}={}){const{logoUrl:r,logoDarkUrl:s,rectLogoUrl:n,rectLogoDarkUrl:o}=Ze({blocklet:e}),i=H.useMemo(()=>({appLogo:r,appLogoDark:s,appLogoRect:n,appLogoRectDark:o}),[r,s,n,o]);return ge({meta:i,square:t})}export{dt as H,ne as M,ft as a,ct as b,ut as c,Te as d,Ze as e,Ee as g,xe as i,at as m,mt as p,pt as s,lt as u};
|