@abtnode/blocklet-services 1.16.42-beta-20250416-010627-a89e72e0 → 1.16.42-beta-20250415-222652-04c5d2fe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-B7fWFwN5.js → AdapterDayjs-BLBXeg9J.js} +1 -1
- package/dist/assets/{ArrowDropDown-DO9H_COV.js → ArrowDropDown--dAaadP8.js} +1 -1
- package/dist/assets/{CheckCircle-B_wWOO2P.js → CheckCircle-Av1UotA-.js} +1 -1
- package/dist/assets/{ChevronLeft-BdrBCIFt.js → ChevronLeft-De8Da-PB.js} +1 -1
- package/dist/assets/{ChevronRight-CO9My6tF.js → ChevronRight-CQOI2CyK.js} +1 -1
- package/dist/assets/{DeleteOutline-7AloJjcV.js → DeleteOutline-Cgoi-K0i.js} +1 -1
- package/dist/assets/{Done-BXISjL2g.js → Done-BYuUlh_s.js} +1 -1
- package/dist/assets/{Download-B0rKRcTB.js → Download-DUKR_Wkm.js} +1 -1
- package/dist/assets/{Edit-C1mcIe4c.js → Edit-D2RQMivt.js} +1 -1
- package/dist/assets/{Error-BnWmSZ5k.js → Error-By0ZMWzh.js} +1 -1
- package/dist/assets/{ExpandLess-DRlih5VO.js → ExpandLess-BNGLjxae.js} +1 -1
- package/dist/assets/{Google-1eG1YH-u.js → Google-tZCjvU7D.js} +1 -1
- package/dist/assets/{InfoOutlined-DO0_Vjz-.js → InfoOutlined-DSoJjRQo.js} +1 -1
- package/dist/assets/{Launch-CIC8rZgo.js → Launch-B161pSEw.js} +1 -1
- package/dist/assets/{LaunchOutlined-CkYWJcA9.js → LaunchOutlined-wehxIahb.js} +1 -1
- package/dist/assets/{MoreHoriz-B8cBSV22.js → MoreHoriz-Bo_R2nuS.js} +1 -1
- package/dist/assets/{PlayArrow-NjIpSDwJ.js → PlayArrow-D38lbyGo.js} +1 -1
- package/dist/assets/{TuneOutlined-Bry0vSC0.js → TuneOutlined-DMMtKa6E.js} +1 -1
- package/dist/assets/{ViewList-BzGRahvc.js → ViewList-CMIoKrN6.js} +1 -1
- package/dist/assets/{access-control-7Ih10vY9.js → access-control-DLD9n3S7.js} +1 -1
- package/dist/assets/{actions-BOikuUJD.js → actions-CMsM02NP.js} +1 -1
- package/dist/assets/{add-component-core-DRJSzr-6.js → add-component-core-FnU4dwXM.js} +1 -1
- package/dist/assets/{add-resource-VgacdokL.js → add-resource-CubCXHBS.js} +1 -1
- package/dist/assets/{addon-F4fsk4Yi.js → addon-5JaI2ctX.js} +1 -1
- package/dist/assets/{advanced-a-1InjKG.js → advanced-D4wfoh0v.js} +1 -1
- package/dist/assets/{appearance-BWtF9DZd.js → appearance-BUsj4DWC.js} +1 -1
- package/dist/assets/{audit-logs-DqFf6jS-.js → audit-logs-rk_iUYcM.js} +1 -1
- package/dist/assets/{authorize-BKpxW7YW.js → authorize-CDJXjmiI.js} +1 -1
- package/dist/assets/{base32-CQfYcymN.js → base32-BhlNgZPk.js} +1 -1
- package/dist/assets/{branding--Qk4aIi4.js → branding-BBbE2Klb.js} +1 -1
- package/dist/assets/{branding-DoPxX3nU.js → branding-JQ1914RB.js} +2 -2
- package/dist/assets/{bundle-avatar-DNxC8z4b.js → bundle-avatar-woUZoGoi.js} +1 -1
- package/dist/assets/{button-leITu2bm.js → button-Rx3uHycr.js} +1 -1
- package/dist/assets/{click-to-copy-Cygm8U3_.js → click-to-copy-BxZJa7n5.js} +1 -1
- package/dist/assets/{complete-Cnzbqj4O.js → complete-KnPBZq-P.js} +1 -1
- package/dist/assets/{component-BBRNk4Tr.js → component-fD-EGTLm.js} +1 -1
- package/dist/assets/{config-Ba-WdcGO.js → config-8xeoVfWN.js} +1 -1
- package/dist/assets/{config-Dko9yBri.js → config-DbqQgRSU.js} +1 -1
- package/dist/assets/{config-navigation-CDw3CW3J.js → config-navigation-DrgPbe5I.js} +3 -3
- package/dist/assets/{config-space-CSSDG-WO.js → config-space-DZ9w_4_9.js} +1 -1
- package/dist/assets/{confirm-BX8_-j-l.js → confirm-_RIb3OmR.js} +1 -1
- package/dist/assets/connect-CJOq1BXE.js +5 -0
- package/dist/assets/{connect-ByA6PdRd.js → connect-CPIImVme.js} +1 -1
- package/dist/assets/{connect-to-yIsMDJbM.js → connect-to-BdhN0BHi.js} +1 -1
- package/dist/assets/{dashboard-oxsbu66O.js → dashboard-vsk4QHJ1.js} +3 -3
- package/dist/assets/{delete-confirm-C0cAQSXq.js → delete-confirm-DaoAi4Gz.js} +1 -1
- package/dist/assets/{did-address-GAxLGeWB.js → did-address-CGHn52xI.js} +1 -1
- package/dist/assets/domain-BJUSWYGQ.js +9 -0
- package/dist/assets/{domain-action-card-BKzC5bbv.js → domain-action-card-9r42-rWK.js} +2 -2
- package/dist/assets/domains-BNDFk-7R.js +1 -0
- package/dist/assets/{email-B9kMynU0.js → email-fp1LVcF6.js} +1 -1
- package/dist/assets/{exchange-passport-CgO3iLVh.js → exchange-passport-DIyhYtFS.js} +1 -1
- package/dist/assets/{fuel-C6fpJHcg.js → fuel-aGwI1uP2.js} +1 -1
- package/dist/assets/{gen-access-key-jNw5st5h.js → gen-access-key-DMS1kzry.js} +1 -1
- package/dist/assets/{get-safe-url-CRmmLBFf.js → get-safe-url-DMordnyN.js} +1 -1
- package/dist/assets/{get-safe-url-ZRaKUVld.js → get-safe-url-DW2Z07ex.js} +1 -1
- package/dist/assets/{home-AJ00GuT0.js → home-B_gUzcjU.js} +1 -1
- package/dist/assets/{iframe-C4N_8Wwh.js → iframe-BEanRyio.js} +1 -1
- package/dist/assets/{index-D6v3bOtJ.js → index-4rY7Xp2W.js} +1 -1
- package/dist/assets/{index-PfRsNX8F.js → index-AhbLOD9c.js} +1 -1
- package/dist/assets/{index-EBUaBME3.js → index-BDNlzmD0.js} +1 -1
- package/dist/assets/{index-tjRN_EVx.js → index-BPa_QtWl.js} +3 -3
- package/dist/assets/{index-8Co4tmLR.js → index-BjN8LAYh.js} +4 -4
- package/dist/assets/{index-CyBxUW5e.js → index-BmexzVQt.js} +1 -1
- package/dist/assets/{index-BSlpaPEE.js → index-C0hr4pkt.js} +1 -1
- package/dist/assets/{index-Cv9H4C1K.js → index-CFJtmMCn.js} +1 -1
- package/dist/assets/{index-DyO7bYXp.js → index-CFkRKsyT.js} +1 -1
- package/dist/assets/{index-CNl-IhR2.js → index-CbW18ndN.js} +1 -1
- package/dist/assets/{index-DKLLCs8G.js → index-CcjD0qiY.js} +1 -1
- package/dist/assets/{index-BRz2myBK.js → index-D22ZWGxu.js} +1 -1
- package/dist/assets/{index-B64a4BbE.js → index-D22lazSG.js} +3 -3
- package/dist/assets/{index-BP62CTBB.js → index-D2EAXstd.js} +1 -1
- package/dist/assets/{index-Dc-Oeqo9.js → index-DBZZ-U66.js} +1 -1
- package/dist/assets/{index-C1H5SEVx.js → index-DUQK_NaI.js} +1 -1
- package/dist/assets/{index-BS5tohCn.js → index-D_gSWW1P.js} +1 -1
- package/dist/assets/{index-B5bNvBjf.js → index-DbpVrp8z.js} +1 -1
- package/dist/assets/{index-DIckhHU5.js → index-xa5W6ExD.js} +1 -1
- package/dist/assets/{invitation-DVbBeS8B.js → invitation-D-l4US6a.js} +1 -1
- package/dist/assets/{invite-t8rB5ZWZ.js → invite-DPswrm4J.js} +1 -1
- package/dist/assets/{issue-passport-CSlA5ioP.js → issue-passport-AJghkFHK.js} +1 -1
- package/dist/assets/{item--dgEgBvz.js → item-zk7clNKz.js} +1 -1
- package/dist/assets/{landing-page-aHOyrHWC.js → landing-page-D13wALfk.js} +1 -1
- package/dist/assets/{layout-B4YOjaNK.js → layout-aS-gjZH3.js} +1 -1
- package/dist/assets/{list-Bny5F0T2.js → list-CJt5nOcn.js} +1 -1
- package/dist/assets/localization-Us9buoy1.js +1 -0
- package/dist/assets/{log-CP1_Zl5R.js → log-DFaz-U9x.js} +1 -1
- package/dist/assets/{logger-B9-TWjbH.js → logger-DXlQ8ejK.js} +1 -1
- package/dist/assets/{login-C8k7kmim.js → login-DKSu0ge6.js} +1 -1
- package/dist/assets/{login-oauth-callback-DqejBHsA.js → login-oauth-callback-CP7cNspN.js} +1 -1
- package/dist/assets/{logo-uploader-zhddoC5p.js → logo-uploader-B7i5QemW.js} +3 -3
- package/dist/assets/{lost-passport-Croi_0xR.js → lost-passport-QRUn4RXe.js} +1 -1
- package/dist/assets/{open-window-plauGxNl.js → open-window-B6LZyZAW.js} +1 -1
- package/dist/assets/{overview-C8MR_9r7.js → overview-B3A_5sHO.js} +1 -1
- package/dist/assets/{page-header-Cu9lHawO.js → page-header-DUh_2MUQ.js} +1 -1
- package/dist/assets/{passport-item-DDktLU4q.js → passport-item-BY6VS7Ot.js} +1 -1
- package/dist/assets/{permission-C5Df-sxb.js → permission-DKFJEWNH.js} +1 -1
- package/dist/assets/{preferences-BUVHMy7R.js → preferences-CA76rfbp.js} +1 -1
- package/dist/assets/{profile-embed-BKX2YBaX.js → profile-embed-DHFHXO1W.js} +1 -1
- package/dist/assets/{publish-resource-tDbEc2CN.js → publish-resource-rxvf6s83.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-BQ3hEDNY.js → react-beautiful-dnd.esm-D0nBCaor.js} +1 -1
- package/dist/assets/{relative-time-DESntOZH.js → relative-time-BK3hjJNN.js} +1 -1
- package/dist/assets/{runtime-8Gq50HDL.js → runtime-D_bXZ0w0.js} +1 -1
- package/dist/assets/sdk-Hg_BMu_u.js +1 -0
- package/dist/assets/{security-CRd92J54.js → security-DEmFjZiu.js} +1 -1
- package/dist/assets/{session-DaQ4KCFD.js → session-DB9Du-lc.js} +1 -1
- package/dist/assets/setup-kkb6SvQ7.js +19 -0
- package/dist/assets/{spaces-D1rqZVaX.js → spaces-25E9GQ6_.js} +1 -1
- package/dist/assets/{start-Df0wvo1-.js → start-DfEUlPuS.js} +1 -1
- package/dist/assets/{status-D7e11K9q.js → status-CUyAteC9.js} +1 -1
- package/dist/assets/{step-actions-BAf7tRyq.js → step-actions-CAgwlOEY.js} +1 -1
- package/dist/assets/{studio-CJpRZ6Af.js → studio-2U2-FOOC.js} +1 -1
- package/dist/assets/{switch-control-DPANzJ8H.js → switch-control-DwTxPESj.js} +1 -1
- package/dist/assets/{traffic-Brsh4OZD.js → traffic-B94bYvtf.js} +1 -1
- package/dist/assets/{transfer-CBAuvpGA.js → transfer-DWjvJtPs.js} +1 -1
- package/dist/assets/{unsubscribe-Cyuj6w2n.js → unsubscribe-CTZlUfqc.js} +1 -1
- package/dist/assets/useAsync-DKE0K0bz.js +1 -0
- package/dist/assets/{useAsyncRetry-k063P8TB.js → useAsyncRetry-BBomZj1z.js} +2 -2
- package/dist/assets/{useLocalStorage-BXnF_60k.js → useLocalStorage-DKl7XFfI.js} +1 -1
- package/dist/assets/{user-center-DOyIfHWq.js → user-center-Du6EtGgy.js} +1 -1
- package/dist/assets/{util-C9b90o5T.js → util-BEvdQ5nP.js} +1 -1
- package/dist/assets/{util-Csa0tyHO.js → util-DkIhTuT7.js} +1 -1
- package/dist/assets/{vendor-arcblock-BtlDhznp.js → vendor-arcblock-ACo-BN0q.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-CiLSrCOH.js → vendor-ux-did-connect-DOjsg91L.js} +1 -1
- package/dist/assets/{wrap-locale--aKPMOdK.js → wrap-locale-DjpRZNtr.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +42 -41
- package/dist/assets/connect-DBfZH_8M.js +0 -5
- package/dist/assets/domain-BB7h2xMD.js +0 -9
- package/dist/assets/domains-CQPZJx98.js +0 -1
- package/dist/assets/localization-DS_PbFVL.js +0 -1
- package/dist/assets/sdk-DRKovxXZ.js +0 -1
- package/dist/assets/setup-DXwqTfxV.js +0 -19
- package/dist/assets/useAsync-BmW5cnbx.js +0 -1
- package/dist/assets/useAsync-DkPaceIy.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,H as f,ag as _e,T as A,a9 as w,cu as _,ac as $,cv as $e,aa as g,ak as J,s as Se,ab as je,ao as et,cw as Le,a8 as ye,q as K,b4 as V,b5 as G,y as tt,ap as st,bg as Oe}from"./vendor-mui-core-DxD1UA4o.js";import{m as nt,i as Me,f as he}from"./vendor-hooks-BwVH-TAd.js";import{r as j,f as ot}from"./vendor-react-DoD83n6N.js";import{c as F,G as rt,Z as at,P as it,$ as ct,q as lt,a0 as pe,F as dt}from"./vendor-arcblock-
|
|
1
|
+
import{j as e,H as f,ag as _e,T as A,a9 as w,cu as _,ac as $,cv as $e,aa as g,ak as J,s as Se,ab as je,ao as et,cw as Le,a8 as ye,q as K,b4 as V,b5 as G,y as tt,ap as st,bg as Oe}from"./vendor-mui-core-DxD1UA4o.js";import{m as nt,i as Me,f as he}from"./vendor-hooks-BwVH-TAd.js";import{r as j,f as ot}from"./vendor-react-DoD83n6N.js";import{c as F,G as rt,Z as at,P as it,$ as ct,q as lt,a0 as pe,F as dt}from"./vendor-arcblock-ACo-BN0q.js";import{Y as k,u as E,a$ as pt,p as T,b3 as W,a5 as ut,r as Ae,bK as mt,B as ue,am as ht,C as Fe,aq as ft}from"./vendor-ux-did-connect-DOjsg91L.js";import{C as O,z,t as v,Z as gt,a9 as xt,as as St}from"./index-BPa_QtWl.js";import{u as jt}from"./use-mobile-BHPd3bDQ.js";import{z as Y,d as ze,aD as yt,H as At,D as Pe,y as fe}from"./vendor-utils-CTIzdAFg.js";import"./api-3sG9at7i.js";import{u as Ne,C as Ct,D as Bt,a as bt}from"./connect-to-BdhN0BHi.js";import{b as kt,c as It,d as vt,i as Et,e as ge,f as Rt,h as Tt,j as Dt}from"./spaces-25E9GQ6_.js";import{f as X}from"./format-error-LAoTjvJe.js";import{I as wt}from"./index-D22ZWGxu.js";import{R as Ot}from"./index-CX4jvZnM.js";import{d as Ut}from"./MoreHoriz-Bo_R2nuS.js";import{e as Lt}from"./dashboard-vsk4QHJ1.js";import{d as Mt}from"./DeleteOutline-Cgoi-K0i.js";import{g as Ue}from"./get-safe-url-DMordnyN.js";import{S as Ft}from"./switch-control-DwTxPESj.js";import{L as xe}from"./list-header-Bm8u_Z_p.js";import{C as zt,u as Pt}from"./config-space-DZ9w_4_9.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-DKl7XFfI.js";import"./confirm-_RIb3OmR.js";import"./PlayArrow-D38lbyGo.js";import"./index-xa5W6ExD.js";import"./session-DB9Du-lc.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./InfoOutlined-DSoJjRQo.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";async function Nt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const i=await Promise.all(n.map(async r=>{let{name:a}=r;const p=await kt(r.endpoint);return!Y(p)&&p!==a&&(a=p,s=!0),{...r,name:a}}));return s&&await Promise.all(i.filter(r=>r.did).map(r=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),i}function Jt({refresh:t}={}){var i;const{blocklet:o}=O(),n=(i=o==null?void 0:o.meta)==null?void 0:i.did,{api:s}=z();return nt(async()=>{if(!n)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:n}});return await Nt({blockletDid:n,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var a;(a=r==null?void 0:r.message)!=null&&a.includes("not logged")?console.warn(r):(console.error(r),k.error(X(r)))}})}function Je({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,r]=j.useState([]),{api:a}=z(),[p,c]=j.useMemo(()=>n?[v(n).startOf("day").toISOString(),v(n).endOf("day").toISOString()]:[v().startOf("year").toISOString(),v().endOf("day").toISOString()],[n]),m=ze(async()=>{try{if(o(!0),!s){r([]);return}const{backups:u}=await a.getBlockletBackups({input:{did:s.meta.did,startTime:p,endTime:c}});r(u??[])}catch(u){console.error(u),k.error(X(u))}finally{o(!1)}},1e3);return Me(async()=>{m()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Zt({appDid:t}){const{backups:o}=Je(),[n,s]=j.useState({message:"",progress:0,completed:!1}),i=z(),{ws:{useSubscription:r}}=i;return r(F.BlockletEvents.backupProgress,a=>{t===(a==null?void 0:a.appDid)&&s(()=>({...a}))},[t]),j.useEffect(()=>{var a;if(o!=null&&o.length&&yt((a=o[0])==null?void 0:a.status)){const[p]=o;s(()=>({message:p.message,progress:p.progress,completed:p.progress>=100}))}},[o]),n}function Qt({deps:t=[],setLoading:o=()=>{}}={}){var p;const{blocklet:n}=O(),[s,i]=j.useState([]),{api:r}=z(),a=j.useCallback(ze(async()=>{var c;if(!r||!((c=n==null?void 0:n.meta)!=null&&c.did)){i([]);return}try{o(!0);const m=v(),x=m.subtract(1,"year"),{summary:u}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:x.toISOString(),endTime:m.toISOString()}});i(Array.isArray(u)?u:[])}catch(m){console.error("Failed to fetch backup summary:",m),k.error(X(m)),i([])}finally{o(!1)}},1e3),[]);return Me(async()=>(await a(),()=>{a.cancel()}),[(p=n==null?void 0:n.meta)==null?void 0:p.did].concat(t)),{backupSummary:s}}const Ze=j.createContext({}),{Provider:Ht,Consumer:Ns}=Ze;function Ce({children:t}){var Q;const{t:o}=E(),{api:n}=z(),{blocklet:s}=O(),[i,r]=j.useState(null),[a,p]=j.useState(!1),{data:c,loading:m,mutate:x}=Jt({refresh:a}),u=At(c),d=Zt({appDid:s==null?void 0:s.appDid}),y=j.useMemo(()=>It(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,B]=j.useState(!1),[S,l]=j.useState(!1),{backups:te}=Je({deps:[S,i],setLoading:B,backupDate:i}),[se,ne]=j.useState(!1),{backupSummary:oe}=Qt({deps:[se]}),[P,L]=j.useState(c==null?void 0:c.find(h=>h.endpoint===y)),R=(Q=s==null?void 0:s.settings)==null?void 0:Q.autoBackup,D=()=>{p(h=>!h)},re=()=>{ne(h=>!h)},ae=()=>{l(h=>!h)},Z=async h=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:h}})},q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(h,N)=>{try{x(I=>{const M=[...I];return M.push({...h,loading:!0}),M}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:h}}),y!==N&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(h),D(),k.success(o("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"}))}catch(I){throw console.error(I),x(M=>[...M].filter(de=>de.did!==h.did)),I}},ce=async h=>{h&&(h.endpoint===y&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),R!=null&&R.enabled&&await Z({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:h==null?void 0:h.did}}),x(N=>{const I=[...N];return I.splice(I.indexOf(h),1),I}),L(h),D())},le=async h=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:h.did},spaceGateway:h}}),y!==h.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:h.endpoint}]}})]),k.success(o("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"})),D()},C=h=>(h==null?void 0:h.endpoint)===y;return e.jsx(Ht,{value:{spaceGateways:c||[],selectedSpaceGateway:P,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:D,spaceGatewaysLoading:m,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:Z,abortBlockletBackup:q,backupEndpoint:y,backupProgress:d,backups:te,backupSummary:oe,refreshBackupSummary:re,refreshBackups:ae,setBackupDate:r,backupsLoading:b,autoBackup:R},children:t})}Ce.propTypes={children:f.any.isRequired};Ce.defaultProps={};function U(){return j.useContext(Ze)}function ee({...t}){const{blocklet:o}=O(),{info:n}=z(),{t:s}=E(),i=Ne({blocklet:o}),r=gt(n),{spaceGateways:a,addSpaceGateway:p}=U(),c={checkFn:Pe.create({baseURL:fe(window.location.origin,xt())}).get,webWalletUrl:r,extraParams:{appPid:o.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:n.did}},m=async({endpoint:u,name:d,did:y})=>{const b=await vt(u);if(!await Et(b)){k.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(a.some(l=>l.endpoint===u)){k.error(s("storage.spaces.gateway.add.duplicate",{name:d}));return}await p({name:d,did:y,url:b,endpoint:u},u)},x=async({spaceGateway:u})=>{try{await m(u)}catch(d){console.error(d),k.error(X(d))}};return e.jsx(rt,{...t,options:c,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Qe({...t}){const{t:o}=j.useContext(pt),{blocklet:n,loadingDiskInfo:s,actions:i}=O();if(j.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(c,m,x)=>e.jsxs(A,{children:[c," ",e.jsx("strong",{children:m?St(m):"empty"})]}),a=n.environments.reduce((c,m)=>(c[m.key]=m.value,c),{}),p=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Kt,{component:"div",...t,children:p.map(c=>e.jsx(wt,{valueComponent:"div",nameWidth:120,name:c.name,children:c.value},c.key))})}return s?e.jsx(w,{}):e.jsx(A,{children:o("blocklet.diskInfo.empty")})}const Kt=_e(A)``;function Be(){const{t}=E(),{setBackupDate:o,backupSummary:n}=U(),s=at({key:"lg"}),i=j.useRef(null),r=j.useCallback(c=>{o(c)},[o]),a=j.useMemo(()=>{const c=v().subtract(1,"year"),m=v().add(1,"day"),x=new Map(n.map(d=>[d.date,{date:d.date,successCount:d.successCount,errorCount:d.errorCount}])),u=[];for(let d=c.clone();v(d).isBefore(m);d=d.add(1,"day")){const y=d.format("YYYY-MM-DD");u.push(x.get(y)||{date:y,successCount:0,errorCount:0})}return u},[n]),p=j.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:10},tooltip:{formatter:d=>{const{date:y,successCount:b,errorCount:B}=a[d.dataIndex]||{date:d.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${y}</div>`,`<div>${t("common.succeeded")}: ${b}</div>`,`<div>${t("common.failed")}: ${B}</div>`].join(`
|
|
2
2
|
`)},borderWidth:0,padding:[8,10],textStyle:{fontSize:14},extraCssText:"border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);"},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:_[600]},{min:-9,max:-6,color:_[500]},{min:-6,max:-3,color:_[400]},{min:-3,max:-1,color:_[300]},{min:0,max:0,color:"#ecedf0"},{min:1,max:3,color:$[300]},{min:3,max:6,color:$[400]},{min:6,max:9,color:$[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:$[600]}],orient:"horizontal",left:"center",bottom:10,itemWidth:12,itemHeight:12,textStyle:{color:"#666",fontSize:12}},calendar:{top:30,left:40,right:5,bottom:20,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:4,borderColor:"#fff",borderRadius:0,color:"#fff"},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:12,fontSize:14,color:"rgb(31, 35, 40)",fontWeight:"400"},monthLabel:{show:!0,nameMap:"cn",align:"left",color:"rgb(31, 35, 40)",fontWeight:"400",fontSize:16,position:"start"},yearLabel:{show:!1},range:[v().subtract(1,"year").format("YYYY-MM-DD"),v().format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:a.map(d=>[d.date,d.errorCount?-d.errorCount:d.successCount]),label:{show:!1},itemStyle:{borderWidth:1.5,borderColor:"#fff",borderRadius:5,color:"#ecedf0"},emphasis:{itemStyle:{borderWidth:2.5,borderColor:$e[200],color:"inherit"}}}}),[a,t]);return j.useEffect(()=>{i.current&&s&&setTimeout(()=>{i.current.scrollLeft=i.current.scrollWidth},100)},[s,a]),e.jsxs(e.Fragment,{children:[e.jsx(g,{ref:i,sx:{overflowX:s?"visible":"hidden",overflowY:"hidden"},children:e.jsx(g,{sx:{minWidth:s?"1600px":"100%",height:"240px"},children:e.jsx(Ot,{option:p,style:{height:"100%",width:"100%",padding:"8px"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&r(c.data[0])}}})})}),e.jsx(g,{display:"flex",justifyContent:"flex-end",mr:s?2:5,mb:2,mt:.5,children:e.jsxs(J,{direction:s?"column":"row",spacing:s?2:1,alignItems:"flex-end",width:"100%",justifyContent:s?"flex-start":"flex-end",children:[e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(A,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.failed"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#8B5000",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#A36200",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#C17700",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#E29000",borderRadius:.5})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(A,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.without"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#ecedf0",borderRadius:.5,border:"1px solid #e0e1e4"})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(A,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.succeeded"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#9be9a8",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#40c463",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#30a14e",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#216e39",borderRadius:.5})]})]})})]})}Be.propTypes={};const Vt=Se(({className:t,...o})=>e.jsx(je,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function be({status:t,message:o,createdAt:n}){const{t:s}=E(),i=t===T.BACKUPS.STATUS.PROGRESS&&v().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,r=i&&s("common.timeoutError"),a=t===T.BACKUPS.STATUS.PROGRESS&&!i,p=t===T.BACKUPS.STATUS.SUCCEEDED&&!i;return a?e.jsxs(A,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):p?e.jsx(W,{type:"success",children:s("common.succeeded")}):e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(W,{type:"error",children:s("common.failed")})," ",e.jsx(je,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||r,children:e.jsx(Le,{children:e.jsx(it,{style:{width:"24px",height:"24px"},color:"error"})})})]})}be.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};be.defaultProps={message:""};function ke({metadata:t}){const{t:o}=E();if(Y(t))return e.jsx(W,{type:"success",children:o("common.succeeded")});const n=t.count||0,s=t.size||0,i=ct(s,{iec:!0}),r=e.jsxs(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(A,{variant:"body2",children:[o("common.fileCount"),": ",n]}),e.jsxs(A,{variant:"body2",children:[o("common.fileSize"),": ",i]})]});return e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(W,{type:"success",children:o("common.succeeded")})," ",e.jsx(Vt,{title:r,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Le,{children:e.jsx(lt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ke.propTypes={metadata:f.object};ke.defaultProps={metadata:{}};function Ie(){const{t,locale:o}=E(),{spaceGateways:n,backups:s,backupsLoading:i}=U(),r=j.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:p=>{var B;const{targetUrl:c,targetName:m,status:x,createdAt:u}=s[p],d=x===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,y=x===T.BACKUPS.STATUS.SUCCEEDED&&!d,b=m||((B=n.find(S=>c==null?void 0:c.includes(ge(S==null?void 0:S.endpoint))))==null?void 0:B.name)||"Unknown DID Space";return y?e.jsx(et,{fontSize:"16px",href:c,target:"_blank",children:b}):e.jsx(A,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:p=>{const c=t(p===0?"common.auto":"common.manual");return e.jsx(W,{children:c})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:p=>v(p).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:p=>Y(p)?"":v(p).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:p=>{const c=(s==null?void 0:s[p])??{},{status:m,message:x,createdAt:u,metadata:d}=c,y=m===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,b=m===T.BACKUPS.STATUS.PROGRESS&&!y,B=m===T.BACKUPS.STATUS.SUCCEEDED&&!y;return b?e.jsxs(A,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):B?e.jsx(ke,{metadata:d}):e.jsx(be,{status:m,message:x,createdAt:u})}}}],[s,n,t]),a=j.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:a?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(ut,{title:"",loading:i,data:s,columns:r,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Ie.propTypes={};var He=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,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"})]})]})};He.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Ke(){const{t}=E();return e.jsxs(g,{children:[e.jsxs(g,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(g,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(He,{viewBox:"0 0 228 258",style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(A,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(g,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Be,{})]})]}),e.jsx(Ie,{sx:{marginTop:"24px"}}),e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Qe,{})]})}Ke.propTypes={};var ve={},Gt=ye;Object.defineProperty(ve,"__esModule",{value:!0});var Ve=ve.default=void 0,Wt=Gt(Ae()),Yt=e;Ve=ve.default=(0,Wt.default)((0,Yt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ee={},Xt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var Ge=Ee.default=void 0,qt=Xt(Ae()),_t=e;Ge=Ee.default=(0,qt.default)((0,_t.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},$t=ye;Object.defineProperty(Re,"__esModule",{value:!0});var We=Re.default=void 0,es=$t(Ae()),ts=e;We=Re.default=(0,es.default)((0,ts.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Te({spaceGateway:t,onConfirm:o,onCancel:n}){const{t:s}=E(),[i,r]=j.useState(!1),[a,p]=j.useState(!1),c=(u,d)=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),r(d)},m=async u=>{try{u==null||u.stopPropagation(),p(!0),await(o==null?void 0:o(t)),r(!1)}catch(d){console.error(d),k.error(`${s("storage.space.gateway.delete.failed")}: ${X(d)}`)}finally{r(!1),p(!1)}},x=u=>{c(u,!1),n==null||n(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:u=>c(u,!0),children:[e.jsx(V,{style:{minWidth:24,color:"red"},children:e.jsx(Mt,{fontSize:"small"})}),e.jsx(G,{style:{color:"red"},children:s("common.delete")})]}),e.jsx(mt,{title:s("storage.spaces.gateway.delete.title"),open:i,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:a}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:a}},onConfirm:m,onCancel:x,children:e.jsx(A,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Te.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};Te.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function De({spaceGateway:t,selected:o,onDelete:n,onConnect:s,enableSwitchToSpace:i,backupInProgress:r,...a}){const{abortBlockletBackup:p}=U(),[c,m]=j.useState(null),{t:x}=E(),[u,d]=j.useState(!1),y=(S,l)=>{S.stopPropagation(),S.preventDefault(),m(l&&S.currentTarget)},b=async S=>{try{d(!0),y(S,!1),await s(t)}catch(l){console.error(l),k.error(l.message)}finally{d(!1)}},B=async S=>{try{d(!0),y(S,!1),await p()}catch(l){console.error(l),k.error(l.message)}finally{d(!1)}};return e.jsxs(e.Fragment,{children:[u||t!=null&&t.loading?e.jsx(w,{sx:{ml:1},size:"24px"}):e.jsx(tt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>y(S,!0),...a,children:e.jsx(Ut,{})}),e.jsxs(st,{id:"simple-menu",anchorEl:c,keepMounted:!0,open:!!c,onClose:S=>y(S,!1),children:[e.jsxs(K,{onClick:S=>{y(S,!1),window.open(Ue(t.endpoint?Rt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(G,{children:x("common.open")})]}),e.jsxs(K,{onClick:S=>{y(S,!1),window.open(Ue(Tt(t.endpoint),{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(We,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!o&&i&&e.jsxs(K,{onClick:b,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ge,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.connect.switchToSpace")})]}),r&&e.jsxs(K,{onClick:B,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!r&&e.jsx(Te,{spaceGateway:t,onConfirm:async()=>{m(null),await(n==null?void 0:n(t))},onCancel:()=>m(null)})]})]})}De.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};De.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const ss=Se(({className:t,...o})=>e.jsx(je,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function we({spaceGateway:t,spaceStatus:o,selected:n,onConnected:s,onDeleted:i,onBackedUp:r}){const{t:a,locale:p}=E(),{blocklet:c}=O(),{api:m,info:{did:x}}=z(),{appDid:u,appName:d,appDescription:y,scopes:b,appUrl:B,referrer:S}=Ne({blocklet:c}),{backupProgress:l,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:ne,refreshBackups:oe}=U(),[P,L]=j.useState(!1),[R,D]=j.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:a("storage.spaces.authorize.title",{appName:d},p),scan:a("storage.spaces.authorize.scan",{appName:d},p),confirm:"",success:e.jsx(A,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{D(C=>({...C,open:!1}))}}),re=n&&!P&&o===pe.DISCONNECTED,ae=n&&!P&&!t.loading&&o===pe.CONNECTED,Z=n&&P&&o===pe.CONNECTED&&(l==null?void 0:l.progress)>=0,q=async()=>{try{if(await Dt(t==null?void 0:t.endpoint)){await m.configBlocklet({input:{did:[c.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),k.success(a("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(C){console.error(C),s==null||s(C,t);return}D(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Pe.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:d,appDescription:y,scopes:b,appUrl:B,referrer:S,nodeDid:x,spaceDid:t.did}}))},ie=async(C,Q)=>{const h=Q(C.endpoint),N=ge(h),I=C.space?Q(C.space):{};if(t.did&&N!==t.did){D(de=>({...de,open:!1}));const H=a("storage.spaces.gateway.switch.failedForMismatchSpace",{name:I!=null&&I.name?I.name:""});k.error(H),s==null||s(new Error(H),t);return}const M={...t,name:I.name??"DID Space",did:I.did??ge(h),endpoint:h};await te(M),D(H=>({...H,open:!1})),s==null||s(null,M)},ce=async()=>{try{if(P)return;L(!0),await m.backupBlocklet({input:{appDid:c.appDid,to:"spaces"}})}catch(C){console.error(C),k.error(C.message),r==null||r(C,t)}finally{L(!0)}},le=async()=>{try{await se(t),k.success(a("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),i==null||i(null,t)}catch(C){console.error(C),i==null||i(C,t)}};return j.useEffect(()=>{l!=null&&l.completed?(n&&((l==null?void 0:l.progress)===100?(k.success(a("storage.spaces.backupSuccessfully")),r==null||r(null,t)):l.message&&(r==null||r(new Error(l==null?void 0:l.message),t)),l.progress=0,l.message=""),L(!1),setTimeout(()=>{ne(),oe()},1e3)):l.progress&&L(!0)},[l]),e.jsxs(e.Fragment,{children:[e.jsxs(g,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ae&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:a("storage.spaces.strategy.backupNow")}),re&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:q,children:a("storage.spaces.disconnected.reconnectNow")}),Z&&e.jsx(ss,{title:(l==null?void 0:l.message)&&e.jsx(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(A,{variant:"body2",children:l.message})}),children:e.jsxs(ue,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(w,{variant:"determinate",value:l==null?void 0:l.progress,size:14,sx:{mr:1}}),l==null?void 0:l.progress,"%"]})}),e.jsx(ht,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:ie,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:p},"get-endpoint")]}),e.jsx(De,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:q,enableSwitchToSpace:(l==null?void 0:l.completed)||Y(l==null?void 0:l.message),backupInProgress:Z})]})}we.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};we.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ye({...t}){const{t:o}=E();return e.jsxs(g,{...t,children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",children:o("storage.spaces.backup.records")})}),e.jsx(Be,{}),e.jsx(Ie,{})]})}Ye.propTypes={};function Xe({...t}){const{t:o}=E(),{autoBackup:n,updateAutoBackup:s}=U(),i=async()=>{try{const r=!(n!=null&&n.enabled);await s({enabled:r}),k.success(o(r?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(r){k.error(r.message)}};return e.jsx(Ft,{checked:!!(n!=null&&n.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(A,{marginRight:"8px",children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Xe.propTypes={};function ns(){const{t}=E(),{spaceGateways:o,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=U(),i=n&&!(o!=null&&o.length),r=({spaceGateway:a,spaceStatus:p,selected:c,refresh:m})=>e.jsx(we,{spaceGateway:a,spaceStatus:p,selected:c,onConnected:()=>m(),onBackedUp:x=>x&&m()});return e.jsxs(g,{display:"flex",flexDirection:"column",children:[e.jsx(xe,{sx:{button:{fontSize:"revert",fontWeight:500}},left:e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Xe,{}),e.jsx(ee,{})]})}),e.jsx(g,{mt:2,children:i?e.jsx(g,{display:"flex",justifyContent:"center",children:e.jsx(w,{})}):e.jsx(Oe,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(a=>e.jsx(Oe,{item:!0,xs:12,md:6,children:e.jsx(dt,{endpoint:a.endpoint,selected:s(a),action:r},a.endpoint)}))})})}),e.jsx(Ye,{sx:{marginTop:"24px"}}),e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Qe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=U();return t?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):Y(o)?e.jsx(Ke,{}):e.jsx(ns,{})}function rs(){return e.jsx(Ce,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:n,hasStorageEndpoint:s,loading:i,storageEndpoint:r}=Pt(),a=he(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return i?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):e.jsxs(g,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(Ct,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(Bt,{}),e.jsx(g,{sx:a,children:e.jsx(bt,{onConnect:n,storageEndpoint:r})})]})}function is(){const{t}=E();return e.jsxs(zt,{children:[e.jsxs(J,{spacing:1,marginBottom:2,children:[e.jsx(A,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(A,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function qe({navOrientation:t,...o}){const{t:n,locale:s}=E(),{blocklet:i}=O(),r=jt({key:"md"}),[a,p]=ot(),c=a.get("tab")||"backup",m=r?"horizontal":t,x=he(()=>{var l;const B=[{label:n("common.backup"),value:"backup"}],S=(l=i==null?void 0:i.capabilities)==null?void 0:l.didSpace;return(S===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&B.push({label:n("common.storage"),value:"storage"}),B},[s,m]),d=he(()=>({backup:e.jsx(rs,{}),storage:e.jsx(is,{})}))[c],y=B=>{p(S=>(B==="backup"?S.delete("tab"):S.set("tab",B),S))};if(x.length<=1)return e.jsx(me,{children:d});const b=e.jsx(ft,{tabs:x,current:c,orientation:m,onChange:y,sx:[{borderRight:1,height:"100%",borderColor:"divider"},m==="horizontal"&&{borderRight:0}]});if(m==="vertical")return e.jsx(g,{...o,children:e.jsxs(J,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(g,{sx:{flexShrink:0},children:e.jsx(xe,{left:b})}),e.jsx(g,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:d})})]})});if(m==="horizontal")return e.jsxs(g,{...o,children:[e.jsx(xe,{left:b}),e.jsx(me,{sx:{mt:2},children:d})]})}qe.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};qe.defaultProps={navOrientation:"vertical"};const me=Se(g)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,ag as r}from"./vendor-mui-core-DxD1UA4o.js";import{r as s}from"./vendor-react-DoD83n6N.js";import{a$ as a}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as t,ag as r}from"./vendor-mui-core-DxD1UA4o.js";import{r as s}from"./vendor-react-DoD83n6N.js";import{a$ as a}from"./vendor-ux-did-connect-DOjsg91L.js";import{R as e}from"./vendor-arcblock-ACo-BN0q.js";import"./vendor-utils-CTIzdAFg.js";import"./vendor-hooks-BwVH-TAd.js";import"./lottie-web-B6s7dDoL.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,H as d,a8 as Pe,ab as jt,T as Q,aa as C,E as _e,bo as ke,ce as et,bN as Te,bs as Re,bO as Ie,y as Se,b3 as Ee,a9 as tt,ag as ce,a1 as st,bg as Xe,br as vt,bn as yt,q as Je,bV as St}from"./vendor-mui-core-DxD1UA4o.js";import{c as ie,av as ue,A as Ct}from"./vendor-utils-CTIzdAFg.js";import{Y as J,p as P,b3 as Nt,r as Fe,f as wt,u as te,c4 as Tt,X as nt,B as De,a5 as at,bi as je,ak as Rt,aq as It,bM as Et}from"./vendor-ux-did-connect-CiLSrCOH.js";import{z as Dt,t as V,l as At,G as Qe}from"./index-tjRN_EVx.js";import{f as ee,a as Ae}from"./vendor-hooks-BwVH-TAd.js";import{S as he}from"./shorten-label-CwDvu4_S.js";import{I as it}from"./index-BRz2myBK.js";import{A as Ot,S as Lt,a as Pt,b as _t}from"./list-Bny5F0T2.js";import{R as Be}from"./relative-time-DESntOZH.js";import{b as ze}from"./dashboard-oxsbu66O.js";import{W as kt}from"./did-address-GAxLGeWB.js";import{p as ot}from"./util-Csa0tyHO.js";import{D as Ft,g as Bt}from"./traffic-Brsh4OZD.js";import{i as zt,a as Wt,B as Mt}from"./index-DIckhHU5.js";import{B as rt}from"./bundle-avatar-DNxC8z4b.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BtlDhznp.js";import"./index-D1fVmwHN.js";import"./InfoOutlined-DO0_Vjz-.js";import"./sdk-DRKovxXZ.js";import"./CheckCircle-B_wWOO2P.js";import"./index-D6v3bOtJ.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./useLocalStorage-BXnF_60k.js";import"./confirm-BX8_-j-l.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-k063P8TB.js";import"./useAsync-BmW5cnbx.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./base32-CQfYcymN.js";import"./iframe-C4N_8Wwh.js";import"./LaunchOutlined-CkYWJcA9.js";import"./ChevronLeft-BdrBCIFt.js";import"./ChevronRight-CO9My6tF.js";import"./index-DzDfEcNp.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-B7fWFwN5.js";const lt=b.createContext({}),{Provider:qt,Consumer:pn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=Dt(),[a,x]=b.useState([]),[u,T]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[y,S]=b.useState([]),[I,M]=b.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),T(se.paging),se.list}catch(_){return J.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=b.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},U=b.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=b.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw J.error(_.message),_}},[n,m]);b.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const F={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:H,getUser:U,componentDids:y,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:F},children:t})}function We(){const{notificationRecords:t}=b.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(Fe()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(Fe()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(Fe()),Zt=e;ut=Ke.default=(0,Qt.default)((0,Zt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:At(o,s)}):"",T=es(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),T=be(u);o[a]=T}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ve=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,T=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Q,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const m=[...t];T.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(y=>y!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=b.useState(null),x=b.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,T=b.useCallback(m=>{if(!m.startDate||!m.endDate){J.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){J.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ft,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(r),onChange:T})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=b.useState(ls),[x,u]=b.useState(!0),T=(y,S)=>{S.checked=y.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=y=>{y.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(y=>e.jsx(Re,{control:e.jsx(Ie,{checked:y.checked,onChange:S=>T(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:y=>u(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:T,blocklet:m}=We(),[y,S]=b.useState(!1),[I,M]=b.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=b.useState(null),[H,U]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,F]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=b.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!y&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),U(i.paging),S(!1)}catch(i){J.error(i.message),S(!1)}};b.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:v})=>{const[,k=[],$=[],K=[]]=v;N.pageSize!==l?F(W=>({...W,pageSize:l,page:1})):N.page!==i+1?F(W=>({...W,page:i+1})):N.searchText!==c?F(W=>({...W,searchText:c,page:1})):ue(k,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||F(W=>({...W,emailSendStatus:K,page:1})):F(W=>({...W,pushKitSendStatus:$,page:1})):F(W=>({...W,walletSendStatus:k,page:1}))},oe=b.useCallback(async(i,l)=>{if(!l)return!1;const c=await T(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[T,m]),se=b.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,v="")=>{if(!(!l.length||!i.length))try{s(i,l,c,v),L.anchorEl||(await xe(.5),f())}catch(k){console.error("handleResend error",{error:k})}},j=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(v=>I[v].receiver);await g(i,c,l),await xe(.5),p(),O([])},R=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(v){J.error(v.response?v.response.statusText:v.message)}},w=async(i,l,c,v=[],k=!0)=>{if(i.stopPropagation(),os(l,c)>=4){J.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await R(l,v,k);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],k),L.anchorEl||(await xe(.5),f()))}catch(K){J.error(K.message)}},Y=i=>{F(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,v)=>{i.stopPropagation();const k=c.filter($=>$!==l);F($=>({...$,[v]:k,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:v,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"wallet",onResend:k=>w(k,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"pushkit",onResend:k=>w(k,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"email",onResend:k=>w(k,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[v,k]=c,$=k[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:v},v),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:y,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:y,columns:ae,data:I,onChange:z,options:Z,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var k,$;const{type:l,pass:c,fail:v}=i;return!(D!=null&&D.result)||(k=D==null?void 0:D.result)!=null&&k[l]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Q,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:v})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:j})})]})})})}const cs=b.memo(gt),ds=ce.div`
|
|
1
|
+
import{r as b}from"./vendor-react-DoD83n6N.js";import{j as e,H as d,a8 as Pe,ab as jt,T as Q,aa as C,E as _e,bo as ke,ce as et,bN as Te,bs as Re,bO as Ie,y as Se,b3 as Ee,a9 as tt,ag as ce,a1 as st,bg as Xe,br as vt,bn as yt,q as Je,bV as St}from"./vendor-mui-core-DxD1UA4o.js";import{c as ie,av as ue,A as Ct}from"./vendor-utils-CTIzdAFg.js";import{Y as J,p as P,b3 as Nt,r as Fe,f as wt,u as te,c4 as Tt,X as nt,B as De,a5 as at,bi as je,ak as Rt,aq as It,bM as Et}from"./vendor-ux-did-connect-DOjsg91L.js";import{z as Dt,t as V,l as At,G as Qe}from"./index-BPa_QtWl.js";import{f as ee,a as Ae}from"./vendor-hooks-BwVH-TAd.js";import{S as he}from"./shorten-label-CwDvu4_S.js";import{I as it}from"./index-D22ZWGxu.js";import{A as Ot,S as Lt,a as Pt,b as _t}from"./list-CJt5nOcn.js";import{R as Be}from"./relative-time-BK3hjJNN.js";import{b as ze}from"./dashboard-vsk4QHJ1.js";import{W as kt}from"./did-address-CGHn52xI.js";import{p as ot}from"./util-DkIhTuT7.js";import{D as Ft,g as Bt}from"./traffic-B94bYvtf.js";import{i as zt,a as Wt,B as Mt}from"./index-xa5W6ExD.js";import{B as rt}from"./bundle-avatar-woUZoGoi.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-ACo-BN0q.js";import"./index-D1fVmwHN.js";import"./InfoOutlined-DSoJjRQo.js";import"./sdk-Hg_BMu_u.js";import"./CheckCircle-Av1UotA-.js";import"./index-4rY7Xp2W.js";import"./Location-B6FoL795.js";import"./Email-RGD-rKFl.js";import"./Timezone-bYzGwn3x.js";import"./useLocalStorage-DKl7XFfI.js";import"./confirm-_RIb3OmR.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-D38lbyGo.js";import"./get-safe-url-DMordnyN.js";import"./session-DB9Du-lc.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./base32-BhlNgZPk.js";import"./iframe-BEanRyio.js";import"./LaunchOutlined-wehxIahb.js";import"./ChevronLeft-De8Da-PB.js";import"./ChevronRight-CQOI2CyK.js";import"./index-DzDfEcNp.js";import"./vendor-mui-x-Bit8yv3W.js";import"./AdapterDayjs-BLBXeg9J.js";const lt=b.createContext({}),{Provider:qt,Consumer:pn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=Dt(),[a,x]=b.useState([]),[u,T]=b.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[y,S]=b.useState([]),[I,M]=b.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Z="";B&&B.includes("system")&&(Z="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Z,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),T(se.paging),se.list}catch(_){return J.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=b.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},U=b.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=b.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw J.error(_.message),_}},[n,m]);b.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const F={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:H,getUser:U,componentDids:y,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:F},children:t})}function We(){const{notificationRecords:t}=b.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(Fe()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(Fe()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(Fe()),Zt=e;ut=Ke.default=(0,Qt.default)((0,Zt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:At(o,s)}):"",T=es(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),T=be(u);o[a]=T}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ve=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,T=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(Q,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(ke,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const m=[...t];T.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(y=>y!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=b.useState(null),x=b.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,T=b.useCallback(m=>{if(!m.startDate||!m.endDate){J.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){J.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ft,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Bt(r),onChange:T})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=b.useState(ls),[x,u]=b.useState(!0),T=(y,S)=>{S.checked=y.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=y=>{y.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(ke,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(y=>e.jsx(Re,{control:e.jsx(Ie,{checked:y.checked,onChange:S=>T(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:y=>u(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:T,blocklet:m}=We(),[y,S]=b.useState(!1),[I,M]=b.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=b.useState(null),[H,U]=b.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,F]=b.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=b.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!y&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),U(i.paging),S(!1)}catch(i){J.error(i.message),S(!1)}};b.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Z={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:v})=>{const[,k=[],$=[],K=[]]=v;N.pageSize!==l?F(W=>({...W,pageSize:l,page:1})):N.page!==i+1?F(W=>({...W,page:i+1})):N.searchText!==c?F(W=>({...W,searchText:c,page:1})):ue(k,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||F(W=>({...W,emailSendStatus:K,page:1})):F(W=>({...W,pushKitSendStatus:$,page:1})):F(W=>({...W,walletSendStatus:k,page:1}))},oe=b.useCallback(async(i,l)=>{if(!l)return!1;const c=await T(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[T,m]),se=b.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,v="")=>{if(!(!l.length||!i.length))try{s(i,l,c,v),L.anchorEl||(await xe(.5),f())}catch(k){console.error("handleResend error",{error:k})}},j=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(v=>I[v].receiver);await g(i,c,l),await xe(.5),p(),O([])},R=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(v){J.error(v.response?v.response.statusText:v.message)}},w=async(i,l,c,v=[],k=!0)=>{if(i.stopPropagation(),os(l,c)>=4){J.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await R(l,v,k);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],k),L.anchorEl||(await xe(.5),f()))}catch(K){J.error(K.message)}},Y=i=>{F(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,v)=>{i.stopPropagation();const k=c.filter($=>$!==l);F($=>({...$,[v]:k,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:v,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"wallet",onResend:k=>w(k,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"pushkit",onResend:k=>w(k,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:v}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:v,channel:"email",onResend:k=>w(k,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ve},filterOptions:{names:A,fullWidth:!0,logic:ye,display:(i,l,c,v)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:v,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[v,k]=c,$=k[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:v},v),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:y,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:y,columns:ae,data:I,onChange:z,options:Z,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var k,$;const{type:l,pass:c,fail:v}=i;return!(D!=null&&D.result)||(k=D==null?void 0:D.result)!=null&&k[l]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=D==null?void 0:D.result)!=null&&$[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(Q,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:v})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:j})})]})})})}const cs=b.memo(gt),ds=ce.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a9 as h,aa as c,H as d,ag as g}from"./vendor-mui-core-DxD1UA4o.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{a$ as v,C as w,B as m}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as t,a9 as h,aa as c,H as d,ag as g}from"./vendor-mui-core-DxD1UA4o.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{a$ as v,C as w,B as m}from"./vendor-ux-did-connect-DOjsg91L.js";import{P}from"./page-header-DUh_2MUQ.js";import{C as T}from"./index-BPa_QtWl.js";import{u as B}from"./config-space-DZ9w_4_9.js";import{C as E,D,a as N}from"./connect-to-BdhN0BHi.js";import{S as u}from"./step-actions-CAgwlOEY.js";import{S as b}from"./layout-aS-gjZH3.js";import"./vendor-utils-CTIzdAFg.js";import"./vendor-hooks-BwVH-TAd.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-ACo-BN0q.js";import"./spaces-25E9GQ6_.js";import"./api-3sG9at7i.js";import"./DeleteOutline-Cgoi-K0i.js";import"./format-error-LAoTjvJe.js";import"./use-mobile-CHMVa8_W.js";import"./content-layout-BM34AwsG.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=T(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=B();return o?t.jsx(w,{relative:"parent",children:t.jsx(h,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(D,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=g(b)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as $,Y as W,c2 as Y,h as be,_ as fe,a5 as ge,bM as je}from"./vendor-ux-did-connect-CiLSrCOH.js";import{x as ye,m as de,j as we}from"./vendor-hooks-BwVH-TAd.js";import{r as C,b as X}from"./vendor-react-DoD83n6N.js";import{d as Z}from"./InfoOutlined-DO0_Vjz-.js";import{z as F,C as ce,t as ke}from"./index-tjRN_EVx.js";import{u as N,a as ve,C as K}from"./dashboard-oxsbu66O.js";import{H as o,j as e,D as Ee,ai as Ce,t as Te,aa as f,O as ie,T as S,a9 as U,aj as ee,z as Se,y as B,bs as ae,bO as V,ab as O,L as Q,A as G,bl as Re,E as A,I as _,C as Ie,bq as Me,ak as P,c4 as Pe,X as De,bg as J,bp as ze,b4 as We,c5 as Oe,c6 as Ae,b5 as qe,am as $e,bZ as Le,s as pe,v as Be,c7 as He,c8 as Fe,c9 as Ne,ca as Ue,cb as _e}from"./vendor-mui-core-DxD1UA4o.js";import{l as Ye}from"./vendor-arcblock-BtlDhznp.js";import{d as Ke}from"./ExpandLess-DRlih5VO.js";import{z as ue,x as Ve,y as Je}from"./vendor-utils-CTIzdAFg.js";import{C as Qe}from"./confirm-BX8_-j-l.js";import{A as Ge}from"./actions-BOikuUJD.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BXnF_60k.js";import"./PlayArrow-NjIpSDwJ.js";import"./get-safe-url-ZRaKUVld.js";import"./format-error-LAoTjvJe.js";import"./index-DIckhHU5.js";import"./session-DaQ4KCFD.js";import"./useAsyncRetry-k063P8TB.js";import"./useAsync-BmW5cnbx.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./MoreHoriz-B8cBSV22.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[l,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),a=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!a)return;const r=await(await fetch(`https://${a}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[a]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:l,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:l}){const{t:b}=$(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),a=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ae,{control:e.jsx(V,{onChange:h,checked:a>0&&a===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(O,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:u<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(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(ae,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Re,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),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(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ke,{}):e.jsx(Ye,{})})]})]})}),g.length>0&&e.jsx(Ie,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{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})]})]})},m)})})})]},r)})})}),l&&e.jsx(Me,{error:!0,sx:{mt:1},children:l})]})}te.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};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:l,onSubmit:b,onClose:R}){var s;const{t:p}=$(),[n,a]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{a({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[q,L]=I.split("-");return!q||!L?null:{type:q,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});W.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});W.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){W.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),a(l.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,a,d,c,l]),e.jsx(Ee,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ce,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Te,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(K,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(K,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:a,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Se,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.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};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ke(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function z(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{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(O,{title:t.tip,children:e.jsx(Pe,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(De,{orientation:"vertical",flexItem:!0})]})}z.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};z.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{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]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const l=new Date(c.createdAt).toLocaleDateString();d[l]||(d[l]=[]),(b=d[l])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:l}=F(),{t:b}=$(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:n,loadMore:a,loadingMore:v,loading:T}=ye(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return l.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(q=>{var L;return((L=q==null?void 0:q.meta)==null?void 0:L.name)==="ai-studio"}),I=Ve(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(Oe,{color:"error"}):e.jsx(Ae,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),g&&e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:a,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=$(),{api:l}=F(),{teamDid:b}=N(),{loading:R,error:p,data:n}=de(()=>l.getWebhookEndpoint({input:{teamDid:b,id:t}})),a=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!a?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(O,{title:a.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Le,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{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(z,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:a.status,color:he(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.listen"),value:e.jsx(O,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx(z,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx(z,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx(z,{label:c("common.createdBy"),value:e.jsx(O,{arrow:!0,title:(v=a.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=a.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("common.updatedBy"),value:e.jsx(O,{arrow:!0,title:(j=a.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=a.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:a.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function le(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:l=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:n}=$(),a=Be(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:a?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=le),l||(T.TableFooter=le),e.jsx(rt,{locale:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:a})});re.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};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(ge)`
|
|
1
|
+
import{u as $,Y as W,c2 as Y,h as be,_ as fe,a5 as ge,bM as je}from"./vendor-ux-did-connect-DOjsg91L.js";import{x as ye,m as de,j as we}from"./vendor-hooks-BwVH-TAd.js";import{r as C,b as X}from"./vendor-react-DoD83n6N.js";import{d as Z}from"./InfoOutlined-DSoJjRQo.js";import{z as F,C as ce,t as ke}from"./index-BPa_QtWl.js";import{u as N,a as ve,C as K}from"./dashboard-vsk4QHJ1.js";import{H as o,j as e,D as Ee,ai as Ce,t as Te,aa as f,O as ie,T as S,a9 as U,aj as ee,z as Se,y as B,bs as ae,bO as V,ab as O,L as Q,A as G,bl as Re,E as A,I as _,C as Ie,bq as Me,ak as P,c4 as Pe,X as De,bg as J,bp as ze,b4 as We,c5 as Oe,c6 as Ae,b5 as qe,am as $e,bZ as Le,s as pe,v as Be,c7 as He,c8 as Fe,c9 as Ne,ca as Ue,cb as _e}from"./vendor-mui-core-DxD1UA4o.js";import{l as Ye}from"./vendor-arcblock-ACo-BN0q.js";import{d as Ke}from"./ExpandLess-BNGLjxae.js";import{z as ue,x as Ve,y as Je}from"./vendor-utils-CTIzdAFg.js";import{C as Qe}from"./confirm-_RIb3OmR.js";import{A as Ge}from"./actions-CMsM02NP.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-DKl7XFfI.js";import"./PlayArrow-D38lbyGo.js";import"./get-safe-url-DMordnyN.js";import"./format-error-LAoTjvJe.js";import"./index-xa5W6ExD.js";import"./session-DB9Du-lc.js";import"./useAsyncRetry-BBomZj1z.js";import"./useAsync-DKE0K0bz.js";import"./useSetState-BL3ktMon.js";import"./use-mobile-CHMVa8_W.js";import"./MoreHoriz-Bo_R2nuS.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[l,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),a=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!a)return;const r=await(await fetch(`https://${a}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[a]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:l,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:l}){const{t:b}=$(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),a=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ae,{control:e.jsx(V,{onChange:h,checked:a>0&&a===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(O,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:u<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(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(ae,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Re,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),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(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ke,{}):e.jsx(Ye,{})})]})]})}),g.length>0&&e.jsx(Ie,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{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})]})]})},m)})})})]},r)})})}),l&&e.jsx(Me,{error:!0,sx:{mt:1},children:l})]})}te.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};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:l,onSubmit:b,onClose:R}){var s;const{t:p}=$(),[n,a]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{a({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[q,L]=I.split("-");return!q||!L?null:{type:q,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});W.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});W.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){W.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),a(l.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,a,d,c,l]),e.jsx(Ee,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ce,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Te,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(K,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(K,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:a,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Se,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.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};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ke(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function z(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{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(O,{title:t.tip,children:e.jsx(Pe,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(De,{orientation:"vertical",flexItem:!0})]})}z.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};z.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{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]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const l=new Date(c.createdAt).toLocaleDateString();d[l]||(d[l]=[]),(b=d[l])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:l}=F(),{t:b}=$(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:n,loadMore:a,loadingMore:v,loading:T}=ye(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return l.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(q=>{var L;return((L=q==null?void 0:q.meta)==null?void 0:L.name)==="ai-studio"}),I=Ve(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(Oe,{color:"error"}):e.jsx(Ae,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),g&&e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:a,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=$(),{api:l}=F(),{teamDid:b}=N(),{loading:R,error:p,data:n}=de(()=>l.getWebhookEndpoint({input:{teamDid:b,id:t}})),a=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!a?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(O,{title:a.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Le,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{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(z,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:a.status,color:he(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.listen"),value:e.jsx(O,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx(z,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx(z,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx(z,{label:c("common.createdBy"),value:e.jsx(O,{arrow:!0,title:(v=a.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=a.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("common.updatedBy"),value:e.jsx(O,{arrow:!0,title:(j=a.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=a.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:a.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function le(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:l=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:n}=$(),a=Be(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:a?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=le),l||(T.TableFooter=le),e.jsx(rt,{locale:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:a})});re.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};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(ge)`
|
|
2
2
|
.MuiPaper-root {
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as g,j as o,bl as re,ao as G,s as B,w as ie,aa as D,T as U,y as oe}from"./vendor-mui-core-DxD1UA4o.js";import{y as L,z as $,x as ae}from"./vendor-utils-CTIzdAFg.js";import{c as C}from"./vendor-arcblock-BtlDhznp.js";import{z as le,R as ce,O as de}from"./index-tjRN_EVx.js";import{r as q,b as pe,g as Y}from"./vendor-react-DoD83n6N.js";import{f as A,u as W}from"./vendor-hooks-BwVH-TAd.js";import{p as ue,o as E,h as me}from"./vendor-ux-did-connect-CiLSrCOH.js";const _=(e,t)=>{var s;let r="?v=";return t?r+=ce(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${de(e==null?void 0:e.status)?"~":""}`,r};function fe({blocklet:e}){var p,m,S,O,w,j,K;const{inService:t}=le(),r=(p=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:p.value,s=(m=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:m.value,n=(S=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:S.value,i=(O=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:O.value,l=(w=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:w.value,c=(j=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:j.value,a=((K=window.env)==null?void 0:K.apiPrefix)||"/",u=`${L(a,`/blocklet/logo/${t?"":e.meta.did}`)}${_(e,r)}`,d=`${L(a,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${_(e,s??r)}`,y=`${L(a,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${_(e,n??r)}`,h=`${L(a,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${_(e,i)}`,v=`${L(a,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${_(e,l)}`,f=`${L(a,`/blocklet/og-image/${t?"":e.meta.did}`)}${_(e,c)}`;return{logoUrl:u,rectLogoUrl:d,faviconUrl:y,splashPortraitUrl:h,splashLandscapeUrl:v,ogImageUrl:f}}function V({blocklet:e,style:t,size:r,...s}){const{logoUrl:n}=fe({blocklet:e}),{variant:i}=s;return o.jsx(re,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t),...s,children:o.jsx("img",{src:n,alt:"",style:{width:r}})})}V.propTypes={blocklet:g.object.isRequired,style:g.object,size:g.oneOfType([g.number,g.string])};V.defaultProps={style:{},size:40};const et=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var v,f,p,m;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 i=s[0].activity,l=i.type,c=(v=i.target)==null?void 0:v.type,a=(f=i.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,y=(m=n.activity.target)==null?void 0:m.id;if(l&&u&&l===u&&(!i.target&&!n.activity.target||i.target&&n.activity.target&&c===d&&a===y))s.push(n);else{if(s.length===1)t.push(s[0]);else{const S=Object.assign({},r,{items:s});t.push(S)}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},he=e=>!$(e.activity)&&!!e.activity.type&&!!e.activity.actor,tt=e=>he(e)&&!!e.actorInfo&&!!e.actorInfo.did,nt=e=>{const{severity:t}=e||{};return t&&["normal","success","info"].includes(t)},ge=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"},ye={[N.COMMENT]:(e,t)=>t>1?o.jsxs(o.Fragment,{children:["left ",t," comments on your ",e]}):o.jsxs(o.Fragment,{children:["commented on your ",e]}),[N.LIKE]:e=>o.jsxs(o.Fragment,{children:["liked your ",e]}),[N.FOLLOW]:()=>o.jsx(o.Fragment,{children:"followed you"}),[N.TIPS]:e=>o.jsxs(o.Fragment,{children:["gave tips to your ",e]}),[N.MENTION]:e=>o.jsxs(o.Fragment,{children:["mentioned you in ",e]}),[N.ASSIGN]:()=>o.jsx(o.Fragment,{children:"assigned you a task"})},T=q.memo(function({user:t,color:r=E.textBase}){const s=ae(L(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return o.jsx(G,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});T.propTypes={user:g.shape({did:g.string.isRequired,fullName:g.string.isRequired}).isRequired,color:g.string};T.displayName="UserLink";function st({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{type:i,target:l}=e||{},{type:c}=l||{},{linkColor:a=E.textBase}=s||{},u=A(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(m=>{m!=null&&m.did&&!p.has(m.did)&&p.set(m.did,m)}),p},[t]),d=A(()=>Array.isArray(r)?r.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[r,u]),y=W(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return o.jsx(T,{user:d[0],color:a});const p=d.slice(0,-1),m=d[d.length-1];if(d.length===2)return o.jsxs(o.Fragment,{children:[o.jsx(T,{user:p[0],color:a})," and ",o.jsx(T,{user:m,color:a})]});const S=d.length>3,O=S?d.slice(0,2):p;return o.jsxs(o.Fragment,{children:[O.map((w,j)=>o.jsxs(pe.Fragment,{children:[o.jsx(T,{user:w,color:a}),j<O.length-1?", ":""]},w.did)),S?`, and ${d.length-2} others`:o.jsxs(o.Fragment,{children:[", and ",o.jsx(T,{user:m,color:a})]})]})}),h=W(()=>{const p=ye[i];return p?p(c,t.length):null}),v=A(()=>{const p=y(),m=h();return!p||!m?null:o.jsxs(o.Fragment,{children:[p," ",m]})},[i,c,d,y,h]),f=A(()=>{if(!e)return null;const p=ge(e);return p!=null&&p.targetLink?L(n,p.targetLink):null},[e,n]);return!i||$(l)?null:o.jsxs(o.Fragment,{children:[v," ",o.jsx(G,{href:f,color:E.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:l.name})]})}const ve={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Q.propTypes={meta:g.object.isRequired};const xe=B(ie)(({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 ${E.dividerColor}`,boxShadow:"none"})),Le=B(D)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ee=B(D)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Q({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return o.jsxs(xe,{children:[o.jsxs(Le,{children:[o.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),o.jsx(U,{variant:"h5",color:E.textBase,children:"ArcBlock"})]}),o.jsxs(Ee,{children:[o.jsxs(D,{display:"flex",alignItems:"baseline",gap:1,children:[o.jsxs(U,{component:"span",variant:"h5",color:E.textBase,fontWeight:"bold",children:["+ ",t]}),o.jsx(U,{component:"span",variant:"subtitle2",color:E.textSubtitle,children:r})]}),o.jsx(oe,{variant:"outlined",size:"small",color:"secondary",endIcon:o.jsx(me,{icon:ve}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}X.propTypes={meta:g.object.isRequired,type:g.string.isRequired,hideTips:g.bool,sx:g.object};X.defaultProps={hideTips:!1,sx:{}};function X({meta:e,type:t,hideTips:r=!1,sx:s}){return $(e)?null:t==="tips"&&!r?o.jsx(Q,{meta:e}):o.jsx(U,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:E.textSubtitle,children:e.content})}var Se=q;function Te(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=Te(Se);function F(){return F=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},F.apply(this,arguments)}function Ce(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},R(e,t)}function _e(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,i;for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var z={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Ne=["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 Oe(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 we=["component","className","unsafeHTML"];function Z(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(Me(c))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),i=n.length,l=0;l<i;l++)Z(n[l],t)}function Me(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function k(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function J(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);J(e.parentNode,t)}}function je(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 I(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ee={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ae=Object.keys(ee),te=function(e){Ce(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,i){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,i)},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(z).forEach(function(i){n.style[i]=z[i]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,i=window.getComputedStyle(this.target);Ne.forEach(function(l){n.canvas.style[l]=i[l]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var i=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");Z(this.canvas,i);var l=this.putEllipsis(this.calcIndexes()),c={clamped:l,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},r.calcIndexes=function(){var n=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),l=i.length;if(!i.length)return n;var c=i.find(I);if(!c)return n;for(var a=1,u=c.offsetTop,d=1;d<l&&!(I(i[d])&&i[d].offsetTop-u>1&&(a++,n.push(d),u=i[d].offsetTop,a>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 i=this.nlUnits.pop(),l=this.makeEllipsisSpan();do J(i,this.canvas),je(i).appendChild(l),i=this.nlUnits.pop();while(i&&(!I(i)||l.offsetHeight>i.offsetHeight||l.offsetTop>i.offsetTop));return i&&k(i),this.nlUnits.forEach(k),!0},r.makeEllipsisSpan=function(){var n=this.props,i=n.ellipsisHTML,l=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var a=document.createElement("span");return a.className="LinesEllipsis-ellipsis",i?a.innerHTML=i:a.textContent=l,c.appendChild(a),c},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,i=this.state,l=i.html,c=i.clamped,a=this.props,u=a.component,d=a.className,y=a.unsafeHTML,h=_e(a,we);return b.default.createElement(u,F({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},Oe(h,Ae)),b.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?l:y}}))},t}(b.default.Component);te.defaultProps=ee;var Ue=te;const rt=Y(Ue),be=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ie=e=>{try{return new URL(e).host}catch{return e}};var it={getChainHost:be,getUrlHost:Ie},ot={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}},Fe={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"}},Re={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,Pe=(e,t)=>{P.set(e,t)},Be=(e="en_US")=>P.get(e)||P.get("en_US");var ne={registerLang:Pe,getLang:Be},De=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 $e=De,{getLang:M}=ne,He=(e,t)=>t===1?e:`${e}s`,Ke=1e-7;var We=(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=M(t.locale),s=[],n=(c,a)=>{const u=Math.floor(c*10**a+Ke);return(Math.round(u)/10**a).toFixed(a)},i=(c,a,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&a==="minute"))return;const{long:d}=r[a]||M("en_US")[a],{short:y}=r[a]||M("en_US")[a];let h=(u||c||"0").toString(),v,f;if(t.colonNotation){v=s.length>0?":":"",f="";const p=h.includes(".")?h.split(".")[0].length:h.length,m=s.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else v="",t.locale==="zh_CN"?Object.values(l).filter(p=>p>0).length>1?!l.days&&!l.hours&&l.minutes&&t.compact?f=d:f=y:l.minutes?f=d:f=y:f=t.verbose?` ${He(d,c)}`:y;s.push(v+h+f)},l=$e(e);if(i(Math.trunc(l.days/365),"year"),i(l.days%365,"day"),i(l.hours,"hour"),i(l.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(i(l.seconds,"second"),t.formatSubMilliseconds)i(l.milliseconds,"millisecond"),i(l.microseconds,"microsecond"),i(l.nanoseconds,"nanosecond");else{const c=l.milliseconds+l.microseconds/1e3+l.nanoseconds/1e6,a=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=a?c.toFixed(a):u;i(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,a=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,a),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");i(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(r.millisecond||M("en_US").millisecond).long,a=(r.millisecond||M("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:a}`:`0${t.verbose?` ${c}s`:a}`}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 ze=Fe,ke=Re,{registerLang:H}=ne,se=We;H("en_US",ze);H("zh_CN",ke);se.registerLang=H;var Ge=se;const at=Y(Ge);export{V as B,rt as H,X as M,tt as a,nt as b,it as c,ve as d,fe as e,ge as g,he as i,et as m,at as p,ot as s,st as u};
|
|
1
|
+
import{H as g,j as o,bl as re,ao as G,s as B,w as ie,aa as D,T as U,y as oe}from"./vendor-mui-core-DxD1UA4o.js";import{y as L,z as $,x as ae}from"./vendor-utils-CTIzdAFg.js";import{c as C}from"./vendor-arcblock-ACo-BN0q.js";import{z as le,R as ce,O as de}from"./index-BPa_QtWl.js";import{r as q,b as pe,g as Y}from"./vendor-react-DoD83n6N.js";import{f as A,u as W}from"./vendor-hooks-BwVH-TAd.js";import{p as ue,o as E,h as me}from"./vendor-ux-did-connect-DOjsg91L.js";const _=(e,t)=>{var s;let r="?v=";return t?r+=ce(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${de(e==null?void 0:e.status)?"~":""}`,r};function fe({blocklet:e}){var p,m,S,O,w,j,K;const{inService:t}=le(),r=(p=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:p.value,s=(m=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:m.value,n=(S=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:S.value,i=(O=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:O.value,l=(w=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:w.value,c=(j=((e==null?void 0:e.environments)||[]).find(x=>x.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:j.value,a=((K=window.env)==null?void 0:K.apiPrefix)||"/",u=`${L(a,`/blocklet/logo/${t?"":e.meta.did}`)}${_(e,r)}`,d=`${L(a,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${_(e,s??r)}`,y=`${L(a,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${_(e,n??r)}`,h=`${L(a,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${_(e,i)}`,v=`${L(a,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${_(e,l)}`,f=`${L(a,`/blocklet/og-image/${t?"":e.meta.did}`)}${_(e,c)}`;return{logoUrl:u,rectLogoUrl:d,faviconUrl:y,splashPortraitUrl:h,splashLandscapeUrl:v,ogImageUrl:f}}function V({blocklet:e,style:t,size:r,...s}){const{logoUrl:n}=fe({blocklet:e}),{variant:i}=s;return o.jsx(re,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t),...s,children:o.jsx("img",{src:n,alt:"",style:{width:r}})})}V.propTypes={blocklet:g.object.isRequired,style:g.object,size:g.oneOfType([g.number,g.string])};V.defaultProps={style:{},size:40};const et=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var v,f,p,m;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 i=s[0].activity,l=i.type,c=(v=i.target)==null?void 0:v.type,a=(f=i.target)==null?void 0:f.id,u=n.activity.type,d=(p=n.activity.target)==null?void 0:p.type,y=(m=n.activity.target)==null?void 0:m.id;if(l&&u&&l===u&&(!i.target&&!n.activity.target||i.target&&n.activity.target&&c===d&&a===y))s.push(n);else{if(s.length===1)t.push(s[0]);else{const S=Object.assign({},r,{items:s});t.push(S)}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},he=e=>!$(e.activity)&&!!e.activity.type&&!!e.activity.actor,tt=e=>he(e)&&!!e.actorInfo&&!!e.actorInfo.did,nt=e=>{const{severity:t}=e||{};return t&&["normal","success","info"].includes(t)},ge=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"},ye={[N.COMMENT]:(e,t)=>t>1?o.jsxs(o.Fragment,{children:["left ",t," comments on your ",e]}):o.jsxs(o.Fragment,{children:["commented on your ",e]}),[N.LIKE]:e=>o.jsxs(o.Fragment,{children:["liked your ",e]}),[N.FOLLOW]:()=>o.jsx(o.Fragment,{children:"followed you"}),[N.TIPS]:e=>o.jsxs(o.Fragment,{children:["gave tips to your ",e]}),[N.MENTION]:e=>o.jsxs(o.Fragment,{children:["mentioned you in ",e]}),[N.ASSIGN]:()=>o.jsx(o.Fragment,{children:"assigned you a task"})},T=q.memo(function({user:t,color:r=E.textBase}){const s=ae(L(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return o.jsx(G,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});T.propTypes={user:g.shape({did:g.string.isRequired,fullName:g.string.isRequired}).isRequired,color:g.string};T.displayName="UserLink";function st({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{type:i,target:l}=e||{},{type:c}=l||{},{linkColor:a=E.textBase}=s||{},u=A(()=>{if(!Array.isArray(t))return new Map;const p=new Map;return t.forEach(m=>{m!=null&&m.did&&!p.has(m.did)&&p.set(m.did,m)}),p},[t]),d=A(()=>Array.isArray(r)?r.map(p=>p?u.get(p)||{did:p,fullName:"System"}:null):[],[r,u]),y=W(()=>{if(!Array.isArray(d)||d.length===0)return null;if(d.length===1)return o.jsx(T,{user:d[0],color:a});const p=d.slice(0,-1),m=d[d.length-1];if(d.length===2)return o.jsxs(o.Fragment,{children:[o.jsx(T,{user:p[0],color:a})," and ",o.jsx(T,{user:m,color:a})]});const S=d.length>3,O=S?d.slice(0,2):p;return o.jsxs(o.Fragment,{children:[O.map((w,j)=>o.jsxs(pe.Fragment,{children:[o.jsx(T,{user:w,color:a}),j<O.length-1?", ":""]},w.did)),S?`, and ${d.length-2} others`:o.jsxs(o.Fragment,{children:[", and ",o.jsx(T,{user:m,color:a})]})]})}),h=W(()=>{const p=ye[i];return p?p(c,t.length):null}),v=A(()=>{const p=y(),m=h();return!p||!m?null:o.jsxs(o.Fragment,{children:[p," ",m]})},[i,c,d,y,h]),f=A(()=>{if(!e)return null;const p=ge(e);return p!=null&&p.targetLink?L(n,p.targetLink):null},[e,n]);return!i||$(l)?null:o.jsxs(o.Fragment,{children:[v," ",o.jsx(G,{href:f,color:E.primaryBase,target:"_blank",sx:{textDecoration:"none"},onClick:p=>{p.customPreventRedirect=!0},children:l.name})]})}const ve={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Q.propTypes={meta:g.object.isRequired};const xe=B(ie)(({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 ${E.dividerColor}`,boxShadow:"none"})),Le=B(D)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ee=B(D)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Q({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return o.jsxs(xe,{children:[o.jsxs(Le,{children:[o.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),o.jsx(U,{variant:"h5",color:E.textBase,children:"ArcBlock"})]}),o.jsxs(Ee,{children:[o.jsxs(D,{display:"flex",alignItems:"baseline",gap:1,children:[o.jsxs(U,{component:"span",variant:"h5",color:E.textBase,fontWeight:"bold",children:["+ ",t]}),o.jsx(U,{component:"span",variant:"subtitle2",color:E.textSubtitle,children:r})]}),o.jsx(oe,{variant:"outlined",size:"small",color:"secondary",endIcon:o.jsx(me,{icon:ve}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}X.propTypes={meta:g.object.isRequired,type:g.string.isRequired,hideTips:g.bool,sx:g.object};X.defaultProps={hideTips:!1,sx:{}};function X({meta:e,type:t,hideTips:r=!1,sx:s}){return $(e)?null:t==="tips"&&!r?o.jsx(Q,{meta:e}):o.jsx(U,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:E.textSubtitle,children:e.content})}var Se=q;function Te(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var b=Te(Se);function F(){return F=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},F.apply(this,arguments)}function Ce(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R(e,t)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},R(e,t)}function _e(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,i;for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var z={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Ne=["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 Oe(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 we=["component","className","unsafeHTML"];function Z(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(Me(c))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),i=n.length,l=0;l<i;l++)Z(n[l],t)}function Me(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function k(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function J(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);J(e.parentNode,t)}}function je(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 I(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ee={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ae=Object.keys(ee),te=function(e){Ce(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,i){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,i)},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(z).forEach(function(i){n.style[i]=z[i]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,i=window.getComputedStyle(this.target);Ne.forEach(function(l){n.canvas.style[l]=i[l]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var i=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");Z(this.canvas,i);var l=this.putEllipsis(this.calcIndexes()),c={clamped:l,html:this.canvas.innerHTML};this.setState(c,n.onReflow.bind(this,c))},r.calcIndexes=function(){var n=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),l=i.length;if(!i.length)return n;var c=i.find(I);if(!c)return n;for(var a=1,u=c.offsetTop,d=1;d<l&&!(I(i[d])&&i[d].offsetTop-u>1&&(a++,n.push(d),u=i[d].offsetTop,a>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 i=this.nlUnits.pop(),l=this.makeEllipsisSpan();do J(i,this.canvas),je(i).appendChild(l),i=this.nlUnits.pop();while(i&&(!I(i)||l.offsetHeight>i.offsetHeight||l.offsetTop>i.offsetTop));return i&&k(i),this.nlUnits.forEach(k),!0},r.makeEllipsisSpan=function(){var n=this.props,i=n.ellipsisHTML,l=n.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var a=document.createElement("span");return a.className="LinesEllipsis-ellipsis",i?a.innerHTML=i:a.textContent=l,c.appendChild(a),c},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,i=this.state,l=i.html,c=i.clamped,a=this.props,u=a.component,d=a.className,y=a.unsafeHTML,h=_e(a,we);return b.default.createElement(u,F({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+d,ref:function(f){return n.target=f}},Oe(h,Ae)),b.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?l:y}}))},t}(b.default.Component);te.defaultProps=ee;var Ue=te;const rt=Y(Ue),be=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ie=e=>{try{return new URL(e).host}catch{return e}};var it={getChainHost:be,getUrlHost:Ie},ot={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}},Fe={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"}},Re={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,Pe=(e,t)=>{P.set(e,t)},Be=(e="en_US")=>P.get(e)||P.get("en_US");var ne={registerLang:Pe,getLang:Be},De=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 $e=De,{getLang:M}=ne,He=(e,t)=>t===1?e:`${e}s`,Ke=1e-7;var We=(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=M(t.locale),s=[],n=(c,a)=>{const u=Math.floor(c*10**a+Ke);return(Math.round(u)/10**a).toFixed(a)},i=(c,a,u)=>{if((s.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&a==="minute"))return;const{long:d}=r[a]||M("en_US")[a],{short:y}=r[a]||M("en_US")[a];let h=(u||c||"0").toString(),v,f;if(t.colonNotation){v=s.length>0?":":"",f="";const p=h.includes(".")?h.split(".")[0].length:h.length,m=s.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else v="",t.locale==="zh_CN"?Object.values(l).filter(p=>p>0).length>1?!l.days&&!l.hours&&l.minutes&&t.compact?f=d:f=y:l.minutes?f=d:f=y:f=t.verbose?` ${He(d,c)}`:y;s.push(v+h+f)},l=$e(e);if(i(Math.trunc(l.days/365),"year"),i(l.days%365,"day"),i(l.hours,"hour"),i(l.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(i(l.seconds,"second"),t.formatSubMilliseconds)i(l.milliseconds,"millisecond"),i(l.microseconds,"microsecond"),i(l.nanoseconds,"nanosecond");else{const c=l.milliseconds+l.microseconds/1e3+l.nanoseconds/1e6,a=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=a?c.toFixed(a):u;i(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,a=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=n(c,a),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");i(Number.parseFloat(d,10),"second",d)}if(s.length===0){const c=(r.millisecond||M("en_US").millisecond).long,a=(r.millisecond||M("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:a}`:`0${t.verbose?` ${c}s`:a}`}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 ze=Fe,ke=Re,{registerLang:H}=ne,se=We;H("en_US",ze);H("zh_CN",ke);se.registerLang=H;var Ge=se;const at=Y(Ge);export{V as B,rt as H,X as M,tt as a,nt as b,it as c,ve as d,fe as e,ge as g,he as i,et as m,at as p,ot as s,st as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as i,ag as f,j as s,bE as D,aa as N,a9 as E}from"./vendor-mui-core-DxD1UA4o.js";import{a as A,l as $,u as P,m as M}from"./vendor-hooks-BwVH-TAd.js";import{N as q,R as F}from"./vendor-arcblock-
|
|
1
|
+
import{H as i,ag as f,j as s,bE as D,aa as N,a9 as E}from"./vendor-mui-core-DxD1UA4o.js";import{a as A,l as $,u as P,m as M}from"./vendor-hooks-BwVH-TAd.js";import{N as q,R as F}from"./vendor-arcblock-ACo-BN0q.js";import{r as m}from"./vendor-react-DoD83n6N.js";import{a$ as H,ak as U,u as j,aO as O,p as Y,b0 as S,X as B}from"./vendor-ux-did-connect-DOjsg91L.js";import{t as W,v as X,w as L,x as z}from"./index-BPa_QtWl.js";import{y as V}from"./vendor-utils-CTIzdAFg.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as K}from"./session-DB9Du-lc.js";import{b as G}from"./sdk-Hg_BMu_u.js";import{d as Q}from"./CheckCircle-Av1UotA-.js";import{w as Z}from"./wrap-locale-DjpRZNtr.js";function b({invitation:e,createPassportSvg:a,passportColor:c}){const[p,n]=m.useState(!1),{t}=m.useContext(H),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:W(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),x=m.useCallback(()=>{n(!0)},[]),r=m.useCallback(()=>{n(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(q,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(U,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:r,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(o=>s.jsx("li",{style:{listStyle:"circle"},children:o.description},o.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(D,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:i.object.isRequired,createPassportSvg:i.func.isRequired,passportColor:i.string};b.defaultProps={passportColor:"auto"};const ee=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,aa as g}from"./vendor-mui-core-DxD1UA4o.js";import{k as x,r as u}from"./vendor-react-DoD83n6N.js";import{u as v}from"./vendor-hooks-BwVH-TAd.js";import{I as w}from"./invitation-
|
|
1
|
+
import{j as i,aa as g}from"./vendor-mui-core-DxD1UA4o.js";import{k as x,r as u}from"./vendor-react-DoD83n6N.js";import{u as v}from"./vendor-hooks-BwVH-TAd.js";import{I as w}from"./invitation-D-l4US6a.js";import{L as I}from"./landing-page-D13wALfk.js";import{u as S,aQ as k,p as P}from"./vendor-ux-did-connect-DOjsg91L.js";import{H as T}from"./vendor-arcblock-ACo-BN0q.js";import{g as j}from"./get-safe-url-DW2Z07ex.js";import{u as E,d as L,c as R,s as W,a as C}from"./index-BPa_QtWl.js";import"./vendor-utils-CTIzdAFg.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DB9Du-lc.js";import"./sdk-Hg_BMu_u.js";import"./CheckCircle-Av1UotA-.js";import"./wrap-locale-DjpRZNtr.js";import"./lottie-web-B6s7dDoL.js";function q(c){var r;const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:d}=E(),{t:f}=S(),a=s.get("inviteId"),n=s.get("redirect"),h=u.useCallback(async()=>{const{data:t}=await L.get("invitation",{params:{inviteId:a}});return t},[a]),l=v(async(t,o=e=>e)=>{t&&(W(o(t.sessionToken)),C(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await d.refresh(),setTimeout(()=>{if(n){const e=decodeURIComponent(n);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=j(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(I,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(T,{children:i.jsx("title",{children:f("pageTitle.invite")})}),i.jsx(g,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(w,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:l,inService:!0})})]})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a9 as w,aa as v}from"./vendor-mui-core-DxD1UA4o.js";import{a as I,m as P,u as p}from"./vendor-hooks-BwVH-TAd.js";import{I as T}from"./invitation-
|
|
1
|
+
import{j as e,a9 as w,aa as v}from"./vendor-mui-core-DxD1UA4o.js";import{a as I,m as P,u as p}from"./vendor-hooks-BwVH-TAd.js";import{I as T}from"./invitation-D-l4US6a.js";import{L as k}from"./landing-page-D13wALfk.js";import{u as j,aQ as R,p as S}from"./vendor-ux-did-connect-DOjsg91L.js";import{H as L}from"./vendor-arcblock-ACo-BN0q.js";import{g as E}from"./get-safe-url-DW2Z07ex.js";import{u as C,c as W,s as F,a as N}from"./index-BPa_QtWl.js";import{k as H}from"./vendor-react-DoD83n6N.js";import"./vendor-utils-CTIzdAFg.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DB9Du-lc.js";import"./sdk-Hg_BMu_u.js";import"./CheckCircle-Av1UotA-.js";import"./wrap-locale-DjpRZNtr.js";import"./lottie-web-B6s7dDoL.js";function J(f){var m;const{searchParams:a}=new URL(window.location.href),{api:r,session:d}=C(),u=H(),{t:h}=j(),n=a.get("id"),c=a.get("redirect"),g=I({state:""}),s=P(async()=>{if(!n)return null;const{data:t}=await r.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),x=p(async(t,i=o=>o)=>{t&&(t.sessionToken&&F(i(t.sessionToken)),t.refreshToken&&N(i(t.refreshToken)),t.visitorId&&R(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.href=E(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return s.loading?e.jsx(w,{}):e.jsxs(k,{did:(m=window.blocklet)==null?void 0:m.appPid,children:[e.jsx(L,{children:e.jsx("title",{children:h("pageTitle.issuePassport")})}),e.jsx(v,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(T,{...f,action:"issue-passport",getDataFn:l,checkFn:r.get,createPassportSvg:W,onLoginSuccess:x,inService:!0,status:g.state})})]})}export{J as default};
|