@abtnode/blocklet-services 1.16.40-beta-20250305-022942-dea362e4 → 1.16.40-beta-20250305-115031-9569f29a
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/index.js +5 -4
- package/dist/assets/{Add-Cip-Q3Dt.js → Add-hDPhgcb8.js} +1 -1
- package/dist/assets/{ArrowDropDown-_ravVKaf.js → ArrowDropDown-S78kvSgg.js} +1 -1
- package/dist/assets/{CheckCircle-CFF65I7d.js → CheckCircle-KfKBnFRW.js} +1 -1
- package/dist/assets/{ChevronLeft-DyVK0SyV.js → ChevronLeft-CbtVFRMC.js} +1 -1
- package/dist/assets/{ChevronRight-CMCOlQoz.js → ChevronRight-WXIi0AqM.js} +1 -1
- package/dist/assets/{DeleteOutline-f6Nb7LK2.js → DeleteOutline-CDgHO4-2.js} +1 -1
- package/dist/assets/{Done-DcyOV4wB.js → Done-Ck5ymNM-.js} +1 -1
- package/dist/assets/{Download-BcZsjfbS.js → Download-BCt5_Xtj.js} +1 -1
- package/dist/assets/{Error-tDg6ei77.js → Error-DunMaBzN.js} +1 -1
- package/dist/assets/{ExpandLess-RenWdANb.js → ExpandLess-JQZdwBbU.js} +1 -1
- package/dist/assets/{Google-1jzD6KC8.js → Google-Bdmd8THj.js} +1 -1
- package/dist/assets/{InfoOutlined-B6WkOk1K.js → InfoOutlined-C4DBI2hZ.js} +1 -1
- package/dist/assets/{Launch-COjc0xnX.js → Launch-C-Inbjf1.js} +1 -1
- package/dist/assets/{LaunchOutlined-DnsoPOkc.js → LaunchOutlined-CMeuETnG.js} +1 -1
- package/dist/assets/{MoreHoriz-CdM4YEUS.js → MoreHoriz-SXaWAchr.js} +1 -1
- package/dist/assets/{PlayArrow-BtE24rss.js → PlayArrow-Drngi6DM.js} +1 -1
- package/dist/assets/{ViewList-BZ5ZAyNP.js → ViewList-CIudz6A1.js} +1 -1
- package/dist/assets/{access-control-DPAjPJrm.js → access-control-f3_Azppj.js} +1 -1
- package/dist/assets/{actions-B1PhmGqt.js → actions-BLxaYaFH.js} +1 -1
- package/dist/assets/{add-component-core-s08ciPf7.js → add-component-core-B7Gu6G9O.js} +1 -1
- package/dist/assets/{add-resource-CVe7ZKgt.js → add-resource-Dod13n0P.js} +1 -1
- package/dist/assets/{addon-DQmVM60-.js → addon-D0oJMRF-.js} +1 -1
- package/dist/assets/{analytics-BqkTOyTA.js → analytics-CgyKfOXs.js} +1 -1
- package/dist/assets/{audit-logs-YnCvzLMF.js → audit-logs-D3uqnYW7.js} +1 -1
- package/dist/assets/{base32-BaFZoAVl.js → base32-BkXUMliK.js} +1 -1
- package/dist/assets/{branding-DufH4YY9.js → branding-DNZx02j9.js} +2 -2
- package/dist/assets/{bundle-avatar-DS4sS4Ug.js → bundle-avatar-CPxLfXrI.js} +1 -1
- package/dist/assets/{button-CtIW722z.js → button-B6x_cuep.js} +1 -1
- package/dist/assets/{click-to-copy-_PxhgXLr.js → click-to-copy-CGY-KfC1.js} +1 -1
- package/dist/assets/{complete-BrjCxDOq.js → complete-D578HSm9.js} +1 -1
- package/dist/assets/{component-zxGl4zf8.js → component-DCe18oJu.js} +1 -1
- package/dist/assets/{config-Ds5GJ36d.js → config-AUN0KmC2.js} +1 -1
- package/dist/assets/{config-CVwG5ii_.js → config-BUwSAf4L.js} +1 -1
- package/dist/assets/{config-navigation-ChjaLlA9.js → config-navigation-CaYhfgdu.js} +3 -3
- package/dist/assets/{config-space-DHtv33di.js → config-space-CYs5vTpU.js} +1 -1
- package/dist/assets/{confirm-Di8Vvymn.js → confirm-DysGsWlb.js} +1 -1
- package/dist/assets/{connect-CykhV8jX.js → connect-CGmwjDQl.js} +1 -1
- package/dist/assets/{connect-DpYoQ3xM.js → connect-CswAw6jx.js} +1 -1
- package/dist/assets/{connect-to-DGbSWMus.js → connect-to-BQCKg6lB.js} +1 -1
- package/dist/assets/{dashboard-DdkKjU2L.js → dashboard-BYP0lFc1.js} +3 -3
- package/dist/assets/{delete-confirm-B40CCTo2.js → delete-confirm-CxJ_xq3P.js} +1 -1
- package/dist/assets/{did-address-nBrtfdFs.js → did-address-Bf8qM4uR.js} +1 -1
- package/dist/assets/{domain-D37Iq-fb.js → domain-DziiMtvO.js} +1 -1
- package/dist/assets/{domain-action-card-B6iFs8uG.js → domain-action-card-BhI9_vPO.js} +1 -1
- package/dist/assets/domains-DQHyaAeW.js +1 -0
- package/dist/assets/{email-CnCbt9wS.js → email-KAJlxYPo.js} +1 -1
- package/dist/assets/{exchange-passport-BM0Ne4St.js → exchange-passport-C3AhVaU1.js} +1 -1
- package/dist/assets/{form-text-input-Bdb4wXRt.js → form-text-input-DGrWoQps.js} +1 -1
- package/dist/assets/{fuel-B1DzM8DW.js → fuel-DerZDNtI.js} +1 -1
- package/dist/assets/{fullpage-BcQv9PGo.js → fullpage-DasvZmzb.js} +1 -1
- package/dist/assets/{get-safe-url-COD6BqDE.js → get-safe-url-Cjj-SJ8P.js} +1 -1
- package/dist/assets/{get-safe-url-DnoVfY5w.js → get-safe-url-D4LuJrKT.js} +1 -1
- package/dist/assets/{home-D5ywxuTl.js → home-JWShj3xG.js} +1 -1
- package/dist/assets/{iframe-BW5fhB2Q.js → iframe-CaPZffPT.js} +1 -1
- package/dist/assets/index--xsUDxoE.js +138 -0
- package/dist/assets/{index-Wl7uu5xS.js → index-3unD3ckH.js} +1 -1
- package/dist/assets/{index-mso5VXSP.js → index-BLXh-rLN.js} +1 -1
- package/dist/assets/{index-8Xn_gix_.js → index-BVEhbxkj.js} +1 -1
- package/dist/assets/{index-CB8LRAXR.js → index-BhSRK58N.js} +3 -3
- package/dist/assets/{index-DPFaqs63.js → index-Brx6-WRV.js} +1 -1
- package/dist/assets/{index-CENj2fOq.js → index-CQoDmhBj.js} +1 -1
- package/dist/assets/{index-B9xDkTYZ.js → index-CikqCCcV.js} +4 -4
- package/dist/assets/{index-DqR_pNmL.js → index-CxSfbL8C.js} +1 -1
- package/dist/assets/{index-DaVeYoNQ.js → index-D-_kJXEQ.js} +1 -1
- package/dist/assets/index-DBdIGGHk.js +5 -0
- package/dist/assets/{index-0m-J-ZAX.js → index-DoNZBHNi.js} +3 -3
- package/dist/assets/{index-CNtFrfyH.js → index-Doq3Vtou.js} +1 -1
- package/dist/assets/{index-Deh5N0Ca.js → index-KQ6M4B59.js} +1 -1
- package/dist/assets/{index-BnIYxbxY.js → index-dmAbWYEg.js} +1 -1
- package/dist/assets/{index-B7_ziUTF.js → index-javzz5zL.js} +1 -1
- package/dist/assets/{invitation-nR3cIkjy.js → invitation-C7DIKmu_.js} +1 -1
- package/dist/assets/{invite-D6h2Kml0.js → invite-BL1KzmsJ.js} +1 -1
- package/dist/assets/{issue-passport-CA5yDYxP.js → issue-passport-00ieW7dP.js} +1 -1
- package/dist/assets/{item-Bhfjro40.js → item-CZ7lE3uJ.js} +1 -1
- package/dist/assets/{layout-ZMeaWGok.js → layout-C5Uy45Tb.js} +1 -1
- package/dist/assets/{list-ChtSD939.js → list-DS7ThX70.js} +1 -1
- package/dist/assets/{list-header-ZN_SAqiN.js → list-header-CIWer9RC.js} +1 -1
- package/dist/assets/localization-BqlHRVPq.js +1 -0
- package/dist/assets/{log-MCKmey1M.js → log-5sot6gUJ.js} +1 -1
- package/dist/assets/{login-Bq2_5-hJ.js → login-CGLjmpPa.js} +1 -1
- package/dist/assets/{login-oauth-callback-C0RSY-FN.js → login-oauth-callback-2BZORM7d.js} +1 -1
- package/dist/assets/{logo-uploader-DeZeIw8p.js → logo-uploader-BUbZey33.js} +3 -3
- package/dist/assets/{lost-passport-C9PbOpKs.js → lost-passport-CsnG9qDe.js} +1 -1
- package/dist/assets/{open-window-DFyxvWDW.js → open-window-OGNFGaoa.js} +1 -1
- package/dist/assets/overview-DMYIOaJ3.js +12 -0
- package/dist/assets/{page-header-Bqi4eBBo.js → page-header-BxFwzzsQ.js} +1 -1
- package/dist/assets/{permission-DfwAG69G.js → permission-CFzf76RO.js} +1 -1
- package/dist/assets/{preferences-CgrDODoo.js → preferences-BcS_Bi9F.js} +1 -1
- package/dist/assets/{publish-resource-Bu34onY2.js → publish-resource-PsYRscNX.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Drgsy606.js → react-beautiful-dnd.esm-iBp-yx3f.js} +1 -1
- package/dist/assets/{relative-time-Gzr-RzyU.js → relative-time-DKp6opcA.js} +1 -1
- package/dist/assets/sdk-cfSPGhz-.js +1 -0
- package/dist/assets/{session-BqpWYLN3.js → session-OA-ygaPp.js} +1 -1
- package/dist/assets/{setup-DwT-eZo_.js → setup-58gBrv4L.js} +3 -3
- package/dist/assets/{start-BMPOdLHY.js → start-A6ay_10_.js} +1 -1
- package/dist/assets/{status-DiWFAPO1.js → status-Ds_eN-NY.js} +1 -1
- package/dist/assets/{step-actions-D1-msdeY.js → step-actions-DTx1d1Sw.js} +1 -1
- package/dist/assets/{studio-CMXW7rb0.js → studio-DfQNKV55.js} +1 -1
- package/dist/assets/{switch-control-DdM1x1I2.js → switch-control-BBeZvEAE.js} +1 -1
- package/dist/assets/{traffic-s8iVlNpL.js → traffic-Gc0h4-UU.js} +1 -1
- package/dist/assets/{transfer-DOtiND1w.js → transfer-DQE_fCzw.js} +1 -1
- package/dist/assets/{unsubscribe-DlO-9_z9.js → unsubscribe-CdrwBtFq.js} +1 -1
- package/dist/assets/{useAsync-HJBQVHgn.js → useAsync-DG6gLBRZ.js} +1 -1
- package/dist/assets/{useAsyncRetry-ru9OmM2c.js → useAsyncRetry-DGf8Nzkx.js} +1 -1
- package/dist/assets/{useLocalStorage-Cd_KRSFh.js → useLocalStorage-D_fQAujG.js} +1 -1
- package/dist/assets/{user-center-BEC_SYzS.js → user-center-BDUUKdSj.js} +1 -1
- package/dist/assets/{util-iyBXvLTc.js → util-Ca9j-VTa.js} +1 -1
- package/dist/assets/{util-b7UGzXHn.js → util-x3peBGqE.js} +1 -1
- package/dist/assets/{vendor-arcblock-Bv04Mkff.js → vendor-arcblock-o7bY298v.js} +103 -101
- package/dist/assets/{vendor-hooks-DlxYXMPL.js → vendor-hooks-Bxo1qD_4.js} +1 -1
- package/dist/assets/{wrap-locale-BtIDW28I.js → wrap-locale-DOh7YZzw.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +40 -40
- package/dist/assets/domains-Bn5zR8JS.js +0 -1
- package/dist/assets/index-FDeY8Od4.js +0 -138
- package/dist/assets/index-Fv88MhEb.js +0 -5
- package/dist/assets/localization-CP5Fgk5j.js +0 -1
- package/dist/assets/overview-DNIuos67.js +0 -12
- package/dist/assets/sdk-BAIH7jDs.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as u,bm as h,a3 as o,E as r}from"./vendor-mui-core-Dh3XBxY7.js";import{au as j,D as v,ah as a}from"./vendor-arcblock-
|
|
1
|
+
import{j as e,T as u,bm as h,a3 as o,E as r}from"./vendor-mui-core-Dh3XBxY7.js";import{au as j,D as v,ah as a}from"./vendor-arcblock-o7bY298v.js";function w({linkProps:t,...d}){return e.jsxs(u,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...t,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...t,children:"Blocklet Technology"}),", the decentralized web engine."]})}const y="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function k({did:t,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var b,f,p,m;if(!t)return d;let s;try{s=j(t)}catch{console.warn("Invalid did:",t)}const x=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=x.appName),c===void 0&&(c=x.appDescription),n===void 0&&(n=((b=globalThis==null?void 0:globalThis.blocklet)==null?void 0:b.appLogoRect)||((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(o,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n,alt:`${l}'s logo`}):n=e.jsx(v,{size:g,did:t,src:n,variant:"rounded"})),typeof i=="string"&&(i=((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(m=globalThis==null?void 0:globalThis.env)==null?void 0:m.baseUrl)),e.jsxs(o,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(o,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(o,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${y}), lightgray 50% / cover no-repeat`:`url(${y}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(o,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(o,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(u,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(u,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(w,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(o,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}k.propTypes={did:r.string.isRequired,children:r.any.isRequired,title:r.any,description:r.any,logo:r.any,logoSize:r.number,appUrl:r.string};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{k as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e,j as o}from"./vendor-arcblock-
|
|
1
|
+
import{at as e,j as o}from"./vendor-arcblock-o7bY298v.js";function i(...t){try{return e(...t)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e,j as o}from"./vendor-arcblock-
|
|
1
|
+
import{at as e,j as o}from"./vendor-arcblock-o7bY298v.js";function i(...t){try{return e(...t)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,ae as n}from"./vendor-mui-core-Dh3XBxY7.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{a3 as i,b as t}from"./vendor-arcblock-
|
|
1
|
+
import{j as o,ae as n}from"./vendor-mui-core-Dh3XBxY7.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{a3 as i,b as t}from"./vendor-arcblock-o7bY298v.js";import{S as e}from"./studio-DfQNKV55.js";import"./vendor-utils-oUOK1Lc7.js";import"./vendor-hooks-Bxo1qD_4.js";function p(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./vendor-react-DoD83n6N.js";import{ay as E}from"./vendor-arcblock-
|
|
1
|
+
import{b as x}from"./vendor-react-DoD83n6N.js";import{ay as E}from"./vendor-arcblock-o7bY298v.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=E({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import{e as A,aZ as me,j as $,by as N,aw as be,aY as fe,bl as ge}from"./vendor-arcblock-o7bY298v.js";import{x as je,m as de,k as ye}from"./vendor-hooks-Bxo1qD_4.js";import{r as E,b as J}from"./vendor-react-DoD83n6N.js";import{d as V}from"./InfoOutlined-C4DBI2hZ.js";import{z as B,C as we,G as ke}from"./index-DoNZBHNi.js";import{u as H}from"./dashboard-BYP0lFc1.js";import{E as o,j as e,D as ve,ac as Ee,r as Ce,a3 as g,M as ie,T as S,a2 as F,ad as Q,y as Te,x as q,aI as ae,bM as U,a4 as W,L as Y,z as G,aG as Se,A as z,I as Z,C as Re,bO as Me,ae as I,cF as Ie,am as Pe,aC as _,bH as De,bi as $e,cG as We,cH as ze,bj as Oe,ag as Ae,bR as qe,s as ce,t as Le,cI as Be,cJ as He,cK as Fe,cL as Ne,cM as Ue}from"./vendor-mui-core-Dh3XBxY7.js";import{u as _e,C as K}from"./index.esm-CWepf7I_.js";import{d as Ke}from"./ExpandLess-JQZdwBbU.js";import{y as pe}from"./vendor-utils-oUOK1Lc7.js";import{C as Ye}from"./confirm-DysGsWlb.js";import{A as Ge}from"./actions-BLxaYaFH.js";import"./useLocalStorage-D_fQAujG.js";import"./PlayArrow-Drngi6DM.js";import"./get-safe-url-D4LuJrKT.js";import"./format-error-LAoTjvJe.js";import"./index-BVEhbxkj.js";import"./session-OA-ygaPp.js";import"./useAsyncRetry-DGf8Nzkx.js";import"./useAsync-DG6gLBRZ.js";import"./useSetState-BL3ktMon.js";import"./MoreHoriz-SXaWAchr.js";const Je=t=>{var x,T;const[l,c]=E.useState(null),[a,m]=E.useState(!t),[R,r]=E.useState(null),{blocklet:d}=we(),i=(T=(x=d==null?void 0:d.site)==null?void 0:x.domainAliases[0])==null?void 0:T.value,v=E.useMemo(()=>{const h={};return l&&(l.sources.forEach(n=>{h[n.did]={source:n,events:[],count:0}}),l.events.forEach(n=>{h[n.source]&&(h[n.source].events.push(n),h[n.source].count+=1)})),h},[l]),C=async()=>{try{if(m(!0),!i)return;const n=await(await fetch(`https://${i}/.well-known/service/openevent.json`)).json();c(n),r(null)}catch(h){r(h instanceof Error?h:new Error(String(h)))}finally{m(!1)}};return E.useEffect(()=>{C()},[i]),{openEvent:l,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:C}};function X({eventsBySource:t,selectedEvents:l,setSelectedEvents:c,error:a}){const{t:m}=A(),[R,r]=E.useState({}),d=E.useMemo(()=>{const n={};return Object.entries(t).forEach(([y,{events:p}])=>{const k=p.filter(j=>l[`${j.type}-${j.source}`]).length;n[y]=k}),n},[t,l]),i=E.useMemo(()=>Object.values(d).reduce((n,y)=>n+y,0),[d]),v=E.useMemo(()=>Object.values(t).reduce((n,{events:y})=>n+y.length,0),[t]),C=(n,y)=>{y.stopPropagation(),r({...R,[n]:!R[n]})},x=n=>{const y=`${n.type}-${n.source}`;c(p=>({...p,[y]:!p[y]}))},T=(n,y)=>{const p={};n.forEach(k=>{const j=`${k.type}-${k.source}`;p[j]=!y}),c(k=>({...k,...p}))},h=n=>{const y={};Object.values(t).forEach(({events:p})=>{p.forEach(k=>{const j=`${k.type}-${k.source}`;y[j]=n.target.checked})}),c(y)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ae,{control:e.jsx(U,{onChange:h,checked:i>0&&i===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[m("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:m("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(V,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),i>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:m("webhookEndpoint.selectedEventsCount",{count:i})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Y,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([n,{source:y,events:p,count:k}],j)=>{const D=d[n]>0,u=d[n]===p.length&&p.length>0,b=R[n];return e.jsxs(J.Fragment,{children:[e.jsx(G,{sx:{borderBottom:j<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||C(n,s)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:p.length>0&&e.jsx(ae,{control:e.jsx(U,{checked:u,indeterminate:D&&!u,onChange:s=>{s.stopPropagation(),T(p,u)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[y.logo&&e.jsx(Se,{src:y.logo,sx:{width:24,height:24}}),e.jsx(g,{children:y.title||n}),D&&e.jsx(z,{label:m("webhookEndpoint.selectedCount",{count:d[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:m("webhookEndpoint.eventsCount",{count:k})}),p.length>0&&e.jsx(Z,{size:"small",edge:"end",children:b?e.jsx(Ke,{}):e.jsx(me,{})})]})]})}),p.length>0&&e.jsx(Re,{in:b,timeout:"auto",unmountOnExit:!0,children:e.jsx(Y,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:p.map(s=>{const f=`${s.type}-${s.source}`,w=!!l[f];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>x(s),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(U,{checked:w,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},f)})})})]},n)})})}),a&&e.jsx(Me,{error:!0,sx:{mt:1},children:a})]})}X.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};X.defaultProps={error:null};function ee({id:t,url:l,description:c,enabledEvents:a,onSubmit:m,onClose:R}){var s;const{t:r}=A(),[d,i]=E.useState({}),{teamDid:v}=H(),{api:C}=B(),{loading:x,error:T,eventsBySource:h}=Je(),{control:n,handleSubmit:y,formState:{errors:p},reset:k,setValue:j,trigger:D}=_e({defaultValues:{url:"",description:""}});E.useEffect(()=>{const f=Object.values(d).some(w=>w);j("selectedEvents",f?"valid":""),D("selectedEvents")},[d,j,D]);const u=()=>{i({}),k(),R()},b=async f=>{const w=Object.keys(d).filter(M=>d[M]),O={url:f.url,description:f.description,enabledEvents:w.map(M=>{const[se,re]=M.split("-");return!se||!re?null:{type:se,source:re}}).filter(Boolean)};try{if(t){const M=await C.updateWebhookEndpoint({input:{teamDid:v,id:t,data:O}});$.success(`${r("webhookEndpoint.updateWebhook")} ${r("webhookEndpoint.success")}`),m(M)}else{const M=await C.createWebhookEndpoint({input:{teamDid:v,input:O}});$.success(`${r("webhookEndpoint.createWebhook")} ${r("webhookEndpoint.success")}`),m(M)}}catch(M){$.error(M==null?void 0:M.message)}u()};return E.useEffect(()=>{k({url:l,description:c}),i(a.reduce((f,w)=>(f[`${w.type}-${w.source}`]=!0,f),{}))},[k,i,l,c,a]),e.jsx(ve,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:y(b),children:[e.jsx(Ee,{children:r(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ce,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:n,rules:{required:r("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:r("webhookEndpoint.validation.urlInvalid")}},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.url.label"),fullWidth:!0,error:!!p.url,helperText:(w=p.url)==null?void 0:w.message})}}),e.jsx(K,{name:"description",control:n,rules:{required:r("webhookEndpoint.validation.descriptionRequired")},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!p.description,helperText:(w=p.description)==null?void 0:w.message})}}),e.jsx(K,{name:"selectedEvents",control:n,rules:{required:r("webhookEndpoint.validation.eventRequired")},render:({field:f})=>e.jsx("input",{type:"hidden",...f})}),!x&&h&&Object.keys(h).length>0&&e.jsx(X,{eventsBySource:h,selectedEvents:d,setSelectedEvents:i,error:(s=p.selectedEvents)==null?void 0:s.message}),!x&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:r("webhookEndpoint.noAvailableEvents")}),x&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),T&&e.jsx(Q,{severity:"error",children:r("webhookEndpoint.loadingError",{message:T==null?void 0:T.message})})]})}),e.jsxs(Te,{sx:{p:"8px 24px 24px"},children:[e.jsx(q,{onClick:u,children:r("common.cancel")}),e.jsx(q,{type:"submit",variant:"contained",color:"primary",children:r(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}ee.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};ee.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function ue(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ve=(t="en")=>t==="tw"?"zh":t;function L(t,l="YYYY-MM-DD HH:mm:ss",c="en"){return t?ke(t).locale(Ve(c)).format(l):"-"}function Qe(t){return typeof t=="number"?!1:pe(t)}function Ze(t){return t>=200&&t<300}function P(t){const l=Qe(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(Ie,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:l?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:l?"-":t.value})]}),t.divider&&e.jsx(Pe,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};P.defaultProps={tip:"",divider:!1};function te(t){return e.jsxs(I,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}te.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};te.defaultProps={children:null,mb:1.5,mt:1.5};const Xe=t=>{const l={};return t.forEach(c=>{var m;const a=new Date(c.createdAt).toLocaleDateString();l[a]||(l[a]=[]),(m=l[a])==null||m.push(c)}),l};function oe({eventId:t,webhookEndpointId:l,event:c}){const{api:a}=B(),{t:m}=A(),{teamDid:R}=H(),{data:r,loadMore:d,loadingMore:i,loading:v}=je(p=>{const j=p?Math.ceil(p.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:l},paging:{page:j,pageSize:15}}})},{reloadDeps:[t,l]}),C=(r==null?void 0:r.list)||[],[x,T]=E.useState(null),h=Xe(C);E.useEffect(()=>{!x&&(r!=null&&r.list.length)&&T(r.list[0])},[r==null?void 0:r.list.length,x]);const n=p=>{T(p)};if(v)return e.jsx(F,{});const y=r&&r.list.length<r.paging.total;return e.jsxs(_,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(_,{item:!0,xs:12,md:4,height:1,children:pe(Object.keys(h))?e.jsx(S,{color:"text.secondary",children:m("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{sx:{maxHeight:"100%",py:0,overflowY:"auto"},children:Object.entries(h).map(([p,k])=>e.jsxs(J.Fragment,{children:[e.jsx(De,{children:p}),k.map(j=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>n(j),selected:x===j,secondaryAction:e.jsx(S,{color:"text.secondary",children:L(j.createdAt,"HH:mm:ss")}),children:[e.jsx($e,{sx:{minWidth:0,mr:1.5},children:Ze(j.responseStatus)===!1?e.jsx(We,{color:"error"}):e.jsx(ze,{color:"success"})}),e.jsx(Oe,{primary:e.jsx(S,{color:"text.primary",children:j.event.type})})]},j.id))]},p))}),y&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(q,{variant:"text",type:"button",color:"inherit",onClick:d,disabled:i,sx:{color:p=>p.palette.text.disabled},children:m(i?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(_,{item:!0,xs:12,md:8,height:1,children:[x&&e.jsxs(I,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsx(S,{variant:"h6",children:t?x.endpoint.url:x.event.type}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[m("webhookEndpoint.response")," (",x.responseStatus,")"]}),e.jsx(N,{language:"json",children:JSON.stringify(x.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.request")})}),e.jsx(N,{language:"json",sx:{margin:0},children:JSON.stringify(x.event,null,2)})]})]}),(r==null?void 0:r.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.eventData")})}),e.jsx(N,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}oe.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};oe.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:l}){var v,C,x,T;const{t:c}=A(),{api:a}=B(),{teamDid:m}=H(),{loading:R,error:r,data:d}=de(()=>a.getWebhookEndpoint({input:{teamDid:m,id:t}})),i=d==null?void 0:d.data;return r?e.jsx(Q,{severity:"error",children:r.message}):R||!i?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(F,{})}):e.jsxs(et,{direction:"column",sx:{height:1},children:[e.jsxs(g,{children:[e.jsxs(I,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(I,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:i.description}),e.jsx(W,{title:i.url,children:e.jsx(V,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(I,{direction:"row",alignItems:"center",children:e.jsx(Z,{edge:"end",color:"inherit",onClick:l,children:e.jsx(qe,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(I,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(P,{label:c("common.status"),value:e.jsx(z,{size:"small",variant:"filled",label:i.status,color:ue(i.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:i.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(z,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:i.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.version"),value:i.apiVersion,divider:!0}),e.jsx(P,{label:c("common.createdAt"),value:L(i.createdAt),divider:!0}),e.jsx(P,{label:c("common.updatedAt"),value:L(i.updatedAt),divider:!0}),e.jsx(P,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=i.createUser)==null?void 0:v.did,children:e.jsx(z,{size:"small",variant:"filled",label:(C=i.createUser)==null?void 0:C.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(x=i.updateUser)==null?void 0:x.did,children:e.jsx(z,{size:"small",variant:"filled",label:(T=i.updateUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(I,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(te,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(I,{height:0,flex:1,overflow:"hidden",children:e.jsx(oe,{webhookEndpointId:i.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const et=ce(I)``;function he({open:t,onClose:l,id:c}){return e.jsx(Ae,{anchor:"right",open:t,onClose:l,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:l})})})}he.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function le(){return null}const ne=J.memo(({options:t,columns:l,toolbar:c=!0,footer:a=!0,hasRowLink:m=!1,emptyNodeText:R="",...r})=>{const{locale:d}=A(),i=Le(x=>x.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:i?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},C={};return c||(C.TableToolbar=le),a||(C.TableFooter=le),e.jsx(tt,{locale:d,options:{...v,...t},columns:(l||[]).map(x=>(x.options=x.options||{},x.options.filter=x.options.filter||!1,x.options.sort=x.options.sort||!1,x)),emptyNode:e.jsx(be,{children:R}),...r,components:C,hasRowLink:m,isMobile:i})});ne.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};ne.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const tt=ce(fe)`
|
|
2
|
+
.MuiPaper-root {
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
}
|
|
6
|
+
table.MuiTable-root {
|
|
7
|
+
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
8
|
+
border-radius: var(--radius-m, 8px);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
[class*='MUIDataTable-responsiveBase'] {
|
|
12
|
+
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
13
|
+
border-radius: var(--radius-m, 8px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
th.MuiTableCell-head {
|
|
17
|
+
padding: 8px 16px 8px 16px;
|
|
18
|
+
text-transform: inherit;
|
|
19
|
+
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
20
|
+
border-bottom: none;
|
|
21
|
+
&:first-of-type {
|
|
22
|
+
border-top-left-radius: 8px;
|
|
23
|
+
padding-left: 20px;
|
|
24
|
+
}
|
|
25
|
+
&:last-of-type {
|
|
26
|
+
border-top-right-radius: 8px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
tr.MuiTableRow-root:not(.MuiTableRow-footer):hover {
|
|
31
|
+
background: var(--backgrounds-bg-highlight, #eff6ff);
|
|
32
|
+
}
|
|
33
|
+
tr.MuiTableRow-root:last-of-type td:first-of-type {
|
|
34
|
+
border-bottom-left-radius: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
tr.MuiTableRow-root:last-of-type td:last-of-type {
|
|
38
|
+
border-bottom-right-radius: 8px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
tr.MuiTableRow-root:nth-of-type(even) {
|
|
42
|
+
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
43
|
+
}
|
|
44
|
+
td.MuiTableCell-root {
|
|
45
|
+
border-bottom: none;
|
|
46
|
+
padding-top: 12px;
|
|
47
|
+
padding-bottom: 12px;
|
|
48
|
+
padding-left: 16px;
|
|
49
|
+
padding-right: 16px;
|
|
50
|
+
&:first-of-type {
|
|
51
|
+
padding-left: 20px;
|
|
52
|
+
}
|
|
53
|
+
&.MuiTableCell-footer {
|
|
54
|
+
border: none;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.datatable-footer {
|
|
59
|
+
.MuiTableRow-root.MuiTableRow-footer {
|
|
60
|
+
border: none;
|
|
61
|
+
}
|
|
62
|
+
table.MuiTable-root {
|
|
63
|
+
outline: none;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
.MuiTablePagination-input {
|
|
67
|
+
background: none;
|
|
68
|
+
}
|
|
69
|
+
div.MuiSelect-select {
|
|
70
|
+
padding: 0 24px 0 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
th a,
|
|
75
|
+
td a {
|
|
76
|
+
text-decoration: none;
|
|
77
|
+
display: block;
|
|
78
|
+
color: inherit;
|
|
79
|
+
&:first-of-type {
|
|
80
|
+
padding-left: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
> div {
|
|
85
|
+
overflow: auto;
|
|
86
|
+
}
|
|
87
|
+
.custom-toobar-title-inner {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
@media (max-width: ${({theme:t})=>t.breakpoints.values.md}px) {
|
|
92
|
+
th a,
|
|
93
|
+
td a {
|
|
94
|
+
text-decoration: none;
|
|
95
|
+
display: block;
|
|
96
|
+
color: inherit;
|
|
97
|
+
padding-top: 0;
|
|
98
|
+
padding-bottom: 0;
|
|
99
|
+
padding-right: 0;
|
|
100
|
+
}
|
|
101
|
+
tr.MuiTableRow-root {
|
|
102
|
+
border: none;
|
|
103
|
+
padding: 20px;
|
|
104
|
+
display: block;
|
|
105
|
+
}
|
|
106
|
+
td.MuiTableCell-root:first-of-type {
|
|
107
|
+
padding-left: 0;
|
|
108
|
+
margin-top: 0;
|
|
109
|
+
}
|
|
110
|
+
td.MuiTableCell-root {
|
|
111
|
+
margin: 0;
|
|
112
|
+
margin-top: 8px;
|
|
113
|
+
align-items: center;
|
|
114
|
+
padding: 0;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
|
+
flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
|
|
117
|
+
align-items: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"center"};
|
|
118
|
+
justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"space-between"};
|
|
119
|
+
}
|
|
120
|
+
td.MuiTableCell-root > div {
|
|
121
|
+
margin-bottom: 4px;
|
|
122
|
+
}
|
|
123
|
+
.MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
|
|
126
|
+
align-items: flex-start;
|
|
127
|
+
justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"space-between":"flex-start"};
|
|
128
|
+
flex-wrap: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"nowrap":"wrap"};
|
|
129
|
+
word-break: break-all;
|
|
130
|
+
&.datatables-noprint {
|
|
131
|
+
justify-content: center;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
[class*='MUIDataTable-responsiveBase'] tr:not([class*='responsiveSimple']) td.MuiTableCell-body > div {
|
|
135
|
+
width: inherit;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`,ot=ne;function Ct(){const{teamDid:t}=H(),l=`webhook-endpoints-${t}`,c=ge(l),{t:a}=A(),{api:m}=B(),[R,r]=E.useState(""),[d,i]=E.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[v,C]=ye(l,{defaultValue:{pageSize:c.rowsPerPage||20,page:c.page?c.page+1:1}}),{loading:x,error:T,data:h,refresh:n}=de(()=>m.getWebhookEndpoints({input:{teamDid:t,paging:{page:v.page,pageSize:v.pageSize}}}));E.useEffect(()=>{n()},[v,n]);const y=E.useCallback(async(u,b)=>{try{await m.updateWebhookEndpoint({input:{teamDid:t,id:u.id,data:{status:b?"disabled":"enabled"}}}),n(),$.success(`${a(b?"webhookEndpoint.disable":"webhookEndpoint.enable")}${a("webhookEndpoint.success")}`)}catch(s){$.error(s==null?void 0:s.message)}},[m,t,n,a]),p=E.useCallback(async u=>{try{await m.deleteWebhookEndpoint({input:{teamDid:t,id:u}}),n(),i(b=>({...b,deleteConfirm:null})),$.success(`${a("common.delete")}${a("webhookEndpoint.success")}`)}catch(b){$.error(b==null?void 0:b.message)}},[m,t,n,a]),k=(u,b)=>{let s=u.page+1;const f=u.searchText||"";if(f!==R){r(f);return}if(b==="changePage"||b==="changeRowsPerPage"){b!=="changePage"&&(s=1);const w={page:s,pageSize:u.rowsPerPage};r(""),C(w)}};if(T)return e.jsx(Q,{severity:"error",children:T.message});if(x||!h)return e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500,children:e.jsx(F,{})});const j=((h==null?void 0:h.list)||[]).filter(u=>{if(!R)return!0;const b=R.toLowerCase();return u.description.toLowerCase().includes(b)||u.url.toLowerCase().includes(b)}),D=[{label:"URL",name:"url",options:{customBodyRenderLite:(u,b)=>{const s=j[b];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(S,{variant:"body2",children:s.description}),e.jsx(g,{sx:{display:"flex"},onClick:f=>{f.stopPropagation()},children:e.jsx(W,{title:s.url,children:e.jsx(V,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(u,b)=>{const s=j[b];return e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:s.enabledEvents.map(f=>e.jsx(z,{size:"small",variant:"filled",label:f.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${s.source}-${f.type}`))})}}},{label:a("common.status"),name:"status",options:{customBodyRenderLite:(u,b)=>{const s=j[b];return e.jsx(z,{size:"small",variant:"filled",label:a(`webhookEndpoint.${s==null?void 0:s.status}`),color:ue(s==null?void 0:s.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${s.status}`)}}},{label:a("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:u=>L(u)}},{label:a("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(u,b)=>{const s=j[b],f=(s==null?void 0:s.status)==="enabled";return e.jsx(Ge,{actions:[{icon:f?e.jsx(Be,{}):e.jsx(He,{}),text:a(f?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:w=>{w.stopPropagation(),y(s,f)}},{icon:e.jsx(Fe,{}),text:a("common.edit"),onClick:w=>{w.stopPropagation(),i(O=>({...O,createEdit:{open:!0,id:s.id,url:s.url,description:s.description,enabledEvents:s.enabledEvents}}))}},{icon:e.jsx(Ne,{}),text:a("common.delete"),onClick:w=>{w.stopPropagation(),i(O=>({...O,deleteConfirm:{title:a("webhookEndpoint.deleteWebhook.title"),description:a("webhookEndpoint.deleteWebhook.description"),confirm:a("common.confirm"),cancel:a("common.cancel"),onConfirm:()=>p(s.id),onCancel:()=>i(M=>({...M,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(e.Fragment,{children:[e.jsx(ot,{durable:l,durableKeys:["page","rowsPerPage"],data:j,columns:D,options:{count:h.count,page:v.page-1,rowsPerPage:v.pageSize,customToolbar:()=>e.jsx(Z,{onClick:()=>i(u=>({...u,createEdit:{...u.createEdit,open:!0}})),children:e.jsx(Ue,{})},"add"),onRowClick:(u,{dataIndex:b})=>{const s=h.list[b];i(f=>({...f,webhookDetail:{open:!0,id:s.id}}))}},loading:x,onChange:k,title:e.jsx(S,{variant:"h6",children:a("webhookEndpoint.title")}),emptyNodeText:e.jsxs(I,{gap:1,children:[a("webhookEndpoint.noWebhooksAdded"),e.jsx(q,{variant:"contained",color:"primary",onClick:()=>i(u=>({...u,createEdit:{...u.createEdit,open:!0}})),children:a("webhookEndpoint.createWebhook")})]})}),d.webhookDetail.open&&e.jsx(he,{open:!0,onClose:()=>i(u=>({...u,webhookDetail:{open:!1,id:null}})),id:d.webhookDetail.id}),d.createEdit.open&&e.jsx(ee,{onSubmit:n,...d.createEdit,onClose:()=>i(u=>({...u,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),d.deleteConfirm&&e.jsx(Ye,{title:d.deleteConfirm.title,description:d.deleteConfirm.description,confirm:d.deleteConfirm.confirm,cancel:d.deleteConfirm.cancel,params:d.deleteConfirm.params,onConfirm:d.deleteConfirm.onConfirm,onCancel:d.deleteConfirm.onCancel})]})}export{Ct as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as w}from"./vendor-react-DoD83n6N.js";import{af as b}from"./index-
|
|
1
|
+
import{g as w}from"./vendor-react-DoD83n6N.js";import{af as b}from"./index-DoNZBHNi.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=b,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
|
|
2
2
|
`).filter(e=>{const r=e.match(E);if(r===null||!r[1])return!0;const a=r[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!$.test(a)}).filter(e=>e.trim()!=="").map(e=>t.pretty?e.replace(E,(r,a)=>r.replace(a,a.replace(j,"~"))):e).join(`
|
|
3
3
|
`));const A=x,S=v,I=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let k=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let e=t.map(r=>typeof r.stack=="string"?I(S(r.stack)):String(r)).join(`
|
|
4
4
|
`);e=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a3 as g,bh as G,M as H,I as O,a2 as U,bS as Y,aa as J}from"./vendor-mui-core-Dh3XBxY7.js";import{a2 as Q,x as Z,ag as v}from"./vendor-arcblock-
|
|
1
|
+
import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a3 as g,bh as G,M as H,I as O,a2 as U,bS as Y,aa as J}from"./vendor-mui-core-Dh3XBxY7.js";import{a2 as Q,x as Z,ag as v}from"./vendor-arcblock-o7bY298v.js";import{d as ee}from"./Done-Ck5ymNM-.js";import{C as te}from"./Google-Bdmd8THj.js";import{ab as ne,f as re}from"./index-DoNZBHNi.js";import{R as oe,F as se,L as ie}from"./logo-uploader-BUbZey33.js";const N={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function _({editing:r,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return r&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[r]);const b=s=>{p.current=s,a(s)},k=()=>{u(!1),a(p.current)},C=n.jsx(g,{className:"form-item-input slot",px:1,children:n.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:k,children:[n.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),n.jsx(G,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:o,onChange:s=>b(s.hex)})})]});return r?f:C}_.propTypes=N;function D({editing:r,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,b=d.useRef(a),{t:k}=d.useContext(Q),C=s=>{s.key==="Enter"&&c(b.current,"confirm")},f=s=>{b.current=s,c(s)};return r?n.jsx(H,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:C,...m}):n.jsx(g,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:k("common.requiredInputPlaceholder",{name:o||p})})})}D.propTypes=N;D.defaultProps={componentProps:{}};function T({editing:r,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?Z.getPassportColorFromDid(m.appDid):o;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ne({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),n.jsx(_,{...u,editing:r,value:r?p:o,onChange:a,componentProps:c})]})}T.propTypes={...N,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};T.defaultProps={};const ae=Y`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as T,j as K,aG as J}from"./vendor-mui-core-Dh3XBxY7.js";import{x as O}from"./vendor-utils-oUOK1Lc7.js";import{z as ee,h as _,T as te,Q as ne,U as se,E as re,V as oe}from"./index-0m-J-ZAX.js";import{g as W,r as ae}from"./vendor-react-DoD83n6N.js";import{n as ie}from"./vendor-arcblock-Bv04Mkff.js";const S=(e,t)=>{var n;let s="?v=";return t?s+=te(t):s+=`${(n=e==null?void 0:e.meta)==null?void 0:n.version}${ne(e==null?void 0:e.status)?"~":""}`,s};function ce({blocklet:e}){var L,x,N,C,B,F,j;const{inService:t}=ee(),s=(L=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:L.value,n=(x=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:x.value,r=(N=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:N.value,o=(C=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:C.value,i=(B=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:B.value,a=(F=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:F.value,c=((j=window.env)==null?void 0:j.apiPrefix)||"/",d=`${O(c,`/blocklet/logo/${t?"":e.meta.did}`)}${S(e,s)}`,l=`${O(c,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${S(e,n??s)}`,f=`${O(c,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${S(e,r??s)}`,p=`${O(c,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${S(e,o)}`,h=`${O(c,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${S(e,i)}`,u=`${O(c,`/blocklet/og-image/${t?"":e.meta.did}`)}${S(e,a)}`;return{logoUrl:d,rectLogoUrl:l,faviconUrl:f,splashPortraitUrl:p,splashLandscapeUrl:h,ogImageUrl:u}}function V({blocklet:e,style:t,size:s,...n}){const{logoUrl:r}=ce({blocklet:e}),{variant:o}=n;return K.jsx(J,{variant:o||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:K.jsx("img",{src:r,alt:"",style:{width:s}})})}V.propTypes={blocklet:T.object.isRequired,style:T.object,size:T.oneOfType([T.number,T.string])};V.defaultProps={style:{},size:40};var le=ae;function de(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var w=de(le);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},M.apply(this,arguments)}function ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A(e,t)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},A(e,t)}function fe(e,t){if(e==null)return{};var s={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(s[r]=e[r]);return s}var G={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},pe=["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 me(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(s[n]=e[n])}),s}var he=["component","className","unsafeHTML"];function Y(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(a){s.appendChild(ge(a))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var r=[].slice.call(e.childNodes),o=r.length,i=0;i<o;i++)Y(r[i],t)}function ge(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 q(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);q(e.parentNode,t)}}function Le(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 k={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ee=Object.keys(k),Q=function(e){ue(t,e);function t(n){var r;return r=e.call(this,n)||this,r.state={html:n.unsafeHTML,clamped:!1},r.canvas=null,r.maxLine=0,r.nlUnits=[],r}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(r){r.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==r&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(r,o){return typeof r.clamped<"u"&&(this.clamped=r.clamped),e.prototype.setState.call(this,r,o)},s.initCanvas=function(){if(!this.canvas){var r=this.canvas=document.createElement("div");r.className="LinesEllipsis-canvas "+this.props.className,r.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(G).forEach(function(o){r.style[o]=G[o]}),document.body.appendChild(r)}},s.copyStyleToCanvas=function(){var r=this,o=window.getComputedStyle(this.target);pe.forEach(function(i){r.canvas.style[i]=o[i]})},s.reflow=function(r){this.maxLine=+r.maxLine||1,this.canvas.innerHTML=r.unsafeHTML;var o=r.basedOn||(/^[\x00-\x7F]+$/.test(r.unsafeHTML)?"words":"letters");Y(this.canvas,o);var i=this.putEllipsis(this.calcIndexes()),a={clamped:i,html:this.canvas.innerHTML};this.setState(a,r.onReflow.bind(this,a))},s.calcIndexes=function(){var r=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),i=o.length;if(!o.length)return r;var a=o.find(b);if(!a)return r;for(var c=1,d=a.offsetTop,l=1;l<i&&!(b(o[l])&&o[l].offsetTop-d>1&&(c++,r.push(l),d=o[l].offsetTop,c>this.maxLine));l++);return r},s.putEllipsis=function(r){if(r.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,r[this.maxLine]);var o=this.nlUnits.pop(),i=this.makeEllipsisSpan();do q(o,this.canvas),Le(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},s.makeEllipsisSpan=function(){var r=this.props,o=r.ellipsisHTML,i=r.ellipsis,a=document.createElement("span");a.appendChild(document.createElement("wbr"));var c=document.createElement("span");return c.className="LinesEllipsis-ellipsis",o?c.innerHTML=o:c.textContent=i,a.appendChild(c),a},s.isClamped=function(){return this.clamped},s.render=function(){var r=this,o=this.state,i=o.html,a=o.clamped,c=this.props,d=c.component,l=c.className,f=c.unsafeHTML,p=fe(c,he);return w.default.createElement(d,M({className:"LinesEllipsis "+(a?"LinesEllipsis--clamped":"")+" "+l,ref:function(u){return r.target=u}},me(p,Ee)),w.default.createElement("div",{dangerouslySetInnerHTML:{__html:a?i:f}}))},t}(w.default.Component);Q.defaultProps=k;var ve=Q;const qe=W(ve),{joinURL:g,withQuery:E}=se,{toTypeInfo:ye}=ie,{isEVMChain:xe,getExplorerUrl:Oe}=re,{arcChainConfig:_e}=oe,Se={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},v="https://explorer.abtnetwork.io/explorer/";var Ce=function({hash:t,asset:s,rollup:n,address:r,token:o,stake:i,chainId:a=""}){if(xe(a)){const f=Oe(a);return t?g(f,`tx/${t}`):s?g(f,`token/${s}`):g(f,`address/${r}`)}const c=_e[a],d=c==null?void 0:c.defaultRPC,l=d?`${d}`:void 0;return n&&ye(n).role===Se.ROLE_ROLLUP?t?E(g(v,`rollups/${n}/moves/${t}`),{host:l}):E(g(v,`rollups/${n}`),{host:l}):s?E(g(v,`assets/${s}`),{host:l}):t?E(g(v,`txs/${t}`),{host:l}):o?E(g(v,`tokens/${o}/tx`),{host:l}):i?E(g(v,`stakes/${i}`),{host:l}):E(g(v,`accounts/${r}`),{host:l})},Te={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const $=Ce,{isSameAddr:y}=Te;class U{constructor({type:t,did:s,chainId:n,text:r}){this.text=r,this.did=s,this.type=t,this.chainId=n}}const D=e=>{const t=[];try{let s=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,r=e.matchAll(n);for(const o of r){const i=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,a=o[0],c=o.index||s,d=c+a.length;if([...a.matchAll(i)].length>1)return[e];let f="";const p=i.exec(a);let h="";if(p){const C=p[0];f=a.replace(C,"").replace(/^</,"").replace(/(>)$/,""),h=C.replace(/\)$/,"").replace(/^\(/,"")}else h=a;const u=h.split(":"),L=(u[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),x=(u[1]||"").replace(/>$/,"").replace(/\)$/,""),N=(u[u.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,c)),t.push(new U({type:L,chainId:x,did:N,text:f||L})),s=d}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},H=e=>{let t;const{type:s,chainId:n,did:r}=e;return y(s,"link")?t=`${n}:${r}`:y(s,"tx")?t=$({hash:r,chainId:n}):y(s,"stake")?t=$({stake:r,chainId:n}):y(s,"nft")?t=$({asset:r,chainId:n}):y(s,"token")?t=$({token:r,chainId:n}):y(s,"did")&&(t=$({address:r,chainId:n})),t},$e=(e,t=!0)=>D(e).map(n=>{if(n instanceof U){if(t){const r=H(n),{type:o,chainId:i,did:a}=n;return y(o,"dapp")?`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`:r?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${r}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`}return n.text}return n}).join(""),Re=e=>D(e).map(s=>s instanceof U?`<${H(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var ke={toClickableSpan:$e,toTextList:D,toSlackLink:Re,Link:U,getLink:H};const Ne=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ue=e=>{try{return new URL(e).host}catch{return e}};var Qe={getChainHost:Ne,getUrlHost:Ue},Xe={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}},we={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"}},be={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 P=new Map,Me=(e,t)=>{P.set(e,t)},Ae=(e="en_US")=>P.get(e)||P.get("en_US");var X={registerLang:Me,getLang:Ae},Pe=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 De=Pe,{getLang:R}=X,He=(e,t)=>t===1?e:`${e}s`,Ie=1e-7;var Be=(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 s=R(t.locale),n=[],r=(a,c)=>{const d=Math.floor(a*10**c+Ie);return(Math.round(d)/10**c).toFixed(c)},o=(a,c,d)=>{if((n.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:l}=s[c]||R("en_US")[c],{short:f}=s[c]||R("en_US")[c];let p=(d||a||"0").toString(),h,u;if(t.colonNotation){h=n.length>0?":":"",u="";const L=p.includes(".")?p.split(".")[0].length:p.length,x=n.length>0?2:1;p="0".repeat(Math.max(0,x-L))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(L=>L>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?u=l:u=f:i.minutes?u=l:u=f:u=t.verbose?` ${He(l,a)}`:f;n.push(h+p+u)},i=De(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 a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,d=a>=1?Math.round(a):Math.ceil(a),l=c?a.toFixed(c):d;o(Number.parseFloat(l,10),"millisecond",l)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=r(a,c),l=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(l,10),"second",l)}if(n.length===0){const a=(s.millisecond||R("en_US").millisecond).long,c=(s.millisecond||R("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return n[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?n.join(""):n.join(" ")};const Fe=we,je=be,{registerLang:I}=X,Z=Be;I("en_US",Fe);I("zh_CN",je);Z.registerLang=I;var Ke=Z;const Ze=W(Ke);export{V as B,qe as H,Qe as c,Te as f,ke as h,Ze as p,Xe as s,ce as u};
|
|
1
|
+
import{E as T,j as K,aG as J}from"./vendor-mui-core-Dh3XBxY7.js";import{x as O}from"./vendor-utils-oUOK1Lc7.js";import{z as ee,h as _,T as te,Q as ne,U as se,E as re,V as oe}from"./index-DoNZBHNi.js";import{g as W,r as ae}from"./vendor-react-DoD83n6N.js";import{n as ie}from"./vendor-arcblock-o7bY298v.js";const S=(e,t)=>{var n;let s="?v=";return t?s+=te(t):s+=`${(n=e==null?void 0:e.meta)==null?void 0:n.version}${ne(e==null?void 0:e.status)?"~":""}`,s};function ce({blocklet:e}){var L,x,N,C,B,F,j;const{inService:t}=ee(),s=(L=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:L.value,n=(x=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:x.value,r=(N=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:N.value,o=(C=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:C.value,i=(B=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:B.value,a=(F=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:F.value,c=((j=window.env)==null?void 0:j.apiPrefix)||"/",d=`${O(c,`/blocklet/logo/${t?"":e.meta.did}`)}${S(e,s)}`,l=`${O(c,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${S(e,n??s)}`,f=`${O(c,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${S(e,r??s)}`,p=`${O(c,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${S(e,o)}`,h=`${O(c,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${S(e,i)}`,u=`${O(c,`/blocklet/og-image/${t?"":e.meta.did}`)}${S(e,a)}`;return{logoUrl:d,rectLogoUrl:l,faviconUrl:f,splashPortraitUrl:p,splashLandscapeUrl:h,ogImageUrl:u}}function V({blocklet:e,style:t,size:s,...n}){const{logoUrl:r}=ce({blocklet:e}),{variant:o}=n;return K.jsx(J,{variant:o||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:K.jsx("img",{src:r,alt:"",style:{width:s}})})}V.propTypes={blocklet:T.object.isRequired,style:T.object,size:T.oneOfType([T.number,T.string])};V.defaultProps={style:{},size:40};var le=ae;function de(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var w=de(le);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},M.apply(this,arguments)}function ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A(e,t)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},A(e,t)}function fe(e,t){if(e==null)return{};var s={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(s[r]=e[r]);return s}var G={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},pe=["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 me(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(s[n]=e[n])}),s}var he=["component","className","unsafeHTML"];function Y(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(a){s.appendChild(ge(a))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var r=[].slice.call(e.childNodes),o=r.length,i=0;i<o;i++)Y(r[i],t)}function ge(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 q(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);q(e.parentNode,t)}}function Le(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 k={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ee=Object.keys(k),Q=function(e){ue(t,e);function t(n){var r;return r=e.call(this,n)||this,r.state={html:n.unsafeHTML,clamped:!1},r.canvas=null,r.maxLine=0,r.nlUnits=[],r}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(r){r.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==r&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(r,o){return typeof r.clamped<"u"&&(this.clamped=r.clamped),e.prototype.setState.call(this,r,o)},s.initCanvas=function(){if(!this.canvas){var r=this.canvas=document.createElement("div");r.className="LinesEllipsis-canvas "+this.props.className,r.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(G).forEach(function(o){r.style[o]=G[o]}),document.body.appendChild(r)}},s.copyStyleToCanvas=function(){var r=this,o=window.getComputedStyle(this.target);pe.forEach(function(i){r.canvas.style[i]=o[i]})},s.reflow=function(r){this.maxLine=+r.maxLine||1,this.canvas.innerHTML=r.unsafeHTML;var o=r.basedOn||(/^[\x00-\x7F]+$/.test(r.unsafeHTML)?"words":"letters");Y(this.canvas,o);var i=this.putEllipsis(this.calcIndexes()),a={clamped:i,html:this.canvas.innerHTML};this.setState(a,r.onReflow.bind(this,a))},s.calcIndexes=function(){var r=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),i=o.length;if(!o.length)return r;var a=o.find(b);if(!a)return r;for(var c=1,d=a.offsetTop,l=1;l<i&&!(b(o[l])&&o[l].offsetTop-d>1&&(c++,r.push(l),d=o[l].offsetTop,c>this.maxLine));l++);return r},s.putEllipsis=function(r){if(r.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,r[this.maxLine]);var o=this.nlUnits.pop(),i=this.makeEllipsisSpan();do q(o,this.canvas),Le(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},s.makeEllipsisSpan=function(){var r=this.props,o=r.ellipsisHTML,i=r.ellipsis,a=document.createElement("span");a.appendChild(document.createElement("wbr"));var c=document.createElement("span");return c.className="LinesEllipsis-ellipsis",o?c.innerHTML=o:c.textContent=i,a.appendChild(c),a},s.isClamped=function(){return this.clamped},s.render=function(){var r=this,o=this.state,i=o.html,a=o.clamped,c=this.props,d=c.component,l=c.className,f=c.unsafeHTML,p=fe(c,he);return w.default.createElement(d,M({className:"LinesEllipsis "+(a?"LinesEllipsis--clamped":"")+" "+l,ref:function(u){return r.target=u}},me(p,Ee)),w.default.createElement("div",{dangerouslySetInnerHTML:{__html:a?i:f}}))},t}(w.default.Component);Q.defaultProps=k;var ve=Q;const qe=W(ve),{joinURL:g,withQuery:E}=se,{toTypeInfo:ye}=ie,{isEVMChain:xe,getExplorerUrl:Oe}=re,{arcChainConfig:_e}=oe,Se={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},v="https://explorer.abtnetwork.io/explorer/";var Ce=function({hash:t,asset:s,rollup:n,address:r,token:o,stake:i,chainId:a=""}){if(xe(a)){const f=Oe(a);return t?g(f,`tx/${t}`):s?g(f,`token/${s}`):g(f,`address/${r}`)}const c=_e[a],d=c==null?void 0:c.defaultRPC,l=d?`${d}`:void 0;return n&&ye(n).role===Se.ROLE_ROLLUP?t?E(g(v,`rollups/${n}/moves/${t}`),{host:l}):E(g(v,`rollups/${n}`),{host:l}):s?E(g(v,`assets/${s}`),{host:l}):t?E(g(v,`txs/${t}`),{host:l}):o?E(g(v,`tokens/${o}/tx`),{host:l}):i?E(g(v,`stakes/${i}`),{host:l}):E(g(v,`accounts/${r}`),{host:l})},Te={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const $=Ce,{isSameAddr:y}=Te;class U{constructor({type:t,did:s,chainId:n,text:r}){this.text=r,this.did=s,this.type=t,this.chainId=n}}const D=e=>{const t=[];try{let s=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,r=e.matchAll(n);for(const o of r){const i=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,a=o[0],c=o.index||s,d=c+a.length;if([...a.matchAll(i)].length>1)return[e];let f="";const p=i.exec(a);let h="";if(p){const C=p[0];f=a.replace(C,"").replace(/^</,"").replace(/(>)$/,""),h=C.replace(/\)$/,"").replace(/^\(/,"")}else h=a;const u=h.split(":"),L=(u[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),x=(u[1]||"").replace(/>$/,"").replace(/\)$/,""),N=(u[u.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,c)),t.push(new U({type:L,chainId:x,did:N,text:f||L})),s=d}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},H=e=>{let t;const{type:s,chainId:n,did:r}=e;return y(s,"link")?t=`${n}:${r}`:y(s,"tx")?t=$({hash:r,chainId:n}):y(s,"stake")?t=$({stake:r,chainId:n}):y(s,"nft")?t=$({asset:r,chainId:n}):y(s,"token")?t=$({token:r,chainId:n}):y(s,"did")&&(t=$({address:r,chainId:n})),t},$e=(e,t=!0)=>D(e).map(n=>{if(n instanceof U){if(t){const r=H(n),{type:o,chainId:i,did:a}=n;return y(o,"dapp")?`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`:r?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${r}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`}return n.text}return n}).join(""),Re=e=>D(e).map(s=>s instanceof U?`<${H(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var ke={toClickableSpan:$e,toTextList:D,toSlackLink:Re,Link:U,getLink:H};const Ne=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ue=e=>{try{return new URL(e).host}catch{return e}};var Qe={getChainHost:Ne,getUrlHost:Ue},Xe={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}},we={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"}},be={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 P=new Map,Me=(e,t)=>{P.set(e,t)},Ae=(e="en_US")=>P.get(e)||P.get("en_US");var X={registerLang:Me,getLang:Ae},Pe=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 De=Pe,{getLang:R}=X,He=(e,t)=>t===1?e:`${e}s`,Ie=1e-7;var Be=(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 s=R(t.locale),n=[],r=(a,c)=>{const d=Math.floor(a*10**c+Ie);return(Math.round(d)/10**c).toFixed(c)},o=(a,c,d)=>{if((n.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:l}=s[c]||R("en_US")[c],{short:f}=s[c]||R("en_US")[c];let p=(d||a||"0").toString(),h,u;if(t.colonNotation){h=n.length>0?":":"",u="";const L=p.includes(".")?p.split(".")[0].length:p.length,x=n.length>0?2:1;p="0".repeat(Math.max(0,x-L))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(L=>L>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?u=l:u=f:i.minutes?u=l:u=f:u=t.verbose?` ${He(l,a)}`:f;n.push(h+p+u)},i=De(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 a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,d=a>=1?Math.round(a):Math.ceil(a),l=c?a.toFixed(c):d;o(Number.parseFloat(l,10),"millisecond",l)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=r(a,c),l=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(l,10),"second",l)}if(n.length===0){const a=(s.millisecond||R("en_US").millisecond).long,c=(s.millisecond||R("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return n[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?n.join(""):n.join(" ")};const Fe=we,je=be,{registerLang:I}=X,Z=Be;I("en_US",Fe);I("zh_CN",je);Z.registerLang=I;var Ke=Z;const Ze=W(Ke);export{V as B,qe as H,Qe as c,Te as f,ke as h,Ze as p,Xe as s,ce as u};
|