@abtnode/webapp 1.17.4 → 1.17.5-beta-20251209-090953-3a59e7ac
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-AIDIzsfb.js → AdapterDayjs-CBmYJq_c.js} +1 -1
- package/dist/assets/{Add-l7OvfXrD.js → Add-BuqBIDFA.js} +1 -1
- package/dist/assets/ArrowDropDown-Dt1OnkjV.js +1 -0
- package/dist/assets/{Autocomplete-Bme-ElpV.js → Autocomplete-YxXH99vB.js} +1 -1
- package/dist/assets/{Breadcrumbs-Bf0qzrkp.js → Breadcrumbs-DngVGj6f.js} +1 -1
- package/dist/assets/{ButtonGroup-CMlvIctd.js → ButtonGroup-BtGO-VCX.js} +1 -1
- package/dist/assets/{CSSTransition-Cf_KzaPo.js → CSSTransition-Cj0uEEEn.js} +1 -1
- package/dist/assets/{CallMerge-DaaiIZ0e.js → CallMerge-C4Y56e44.js} +1 -1
- package/dist/assets/{CardContent-gyrk9EIw.js → CardContent-DIS6zA0P.js} +1 -1
- package/dist/assets/{ChevronLeft-OivB2aTv.js → ChevronLeft-ByepaSoC.js} +1 -1
- package/dist/assets/{ChevronRight-CV3PmYHH.js → ChevronRight-Cf_5Xzjf.js} +1 -1
- package/dist/assets/{Clear-Cz6Yzx0g.js → Clear-Ch6COz32.js} +1 -1
- package/dist/assets/{DeleteOutline-DmEDUBgP.js → DeleteOutline-ebJSYeqv.js} +1 -1
- package/dist/assets/{Done-BuJjZzMV.js → Done--5OjVF1L.js} +1 -1
- package/dist/assets/{Edit-HxzEBQ9h.js → Edit-Dynoa_c5.js} +1 -1
- package/dist/assets/{ErrorOutline-CUOja7My.js → ErrorOutline-Bre_iFld.js} +1 -1
- package/dist/assets/{FilterList-xUYmSJ-Y.js → FilterList-DA2GUvmN.js} +1 -1
- package/dist/assets/{Google-cG0hx3oK.js → Google-DgctB8-z.js} +1 -1
- package/dist/assets/{HelpOutline-DapRasSH.js → HelpOutline-ByUUQACF.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-9mIUY7eq.js → KeyboardArrowDown-BW2EjmL2.js} +1 -1
- package/dist/assets/{Launch-DITLracb.js → Launch-O8wdtoRZ.js} +1 -1
- package/dist/assets/{Link-DGt16osR.js → Link-C0DA-K7d.js} +1 -1
- package/dist/assets/{ListItemButton-Cs40YHcx.js → ListItemButton-Bi1hEGzW.js} +1 -1
- package/dist/assets/{ListSubheader-l4UAKUMT.js → ListSubheader-EtXBMK8f.js} +1 -1
- package/dist/assets/{LoadingButton-D6uT1qbm.js → LoadingButton-CC22g72o.js} +1 -1
- package/dist/assets/{MoreVert-BUlWqUnK.js → MoreVert-DIAAjKU1.js} +1 -1
- package/dist/assets/{OpenInNew-CCi7ydva.js → OpenInNew-OpUheJsd.js} +1 -1
- package/dist/assets/{Refresh-CGgBW-me.js → Refresh-wGxvonur.js} +1 -1
- package/dist/assets/{Search-3L2yy5pr.js → Search-BcGKbDLr.js} +1 -1
- package/dist/assets/{Stepper-D4Zig93k.js → Stepper-WKsCvhQB.js} +1 -1
- package/dist/assets/{Switch-B-AVsYNw.js → Switch-BhNob30A.js} +1 -1
- package/dist/assets/{TableSearch-CAaRXXpO.js → TableSearch-DsykJXmz.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-uvIn6Jyh.js → ToggleButtonGroup-BeovK254.js} +1 -1
- package/dist/assets/{UnfoldMore-DcBVcc2h.js → UnfoldMore-CQwxJsaq.js} +1 -1
- package/dist/assets/{Verified-BpzZH8QJ.js → Verified-BBY_HS8b.js} +1 -1
- package/dist/assets/{VerifiedUser-B-ONuNVC.js → VerifiedUser-CsU_SR-Q.js} +1 -1
- package/dist/assets/{ViewList-CvnWfuPG.js → ViewList-C5VNy_3l.js} +1 -1
- package/dist/assets/{_createAggregator-CqUOxBsA.js → _createAggregator-E-d6FWvu.js} +1 -1
- package/dist/assets/actions-C85Hfsv7.js +11 -0
- package/dist/assets/{actions-Dv4j7XcE.js → actions-CfPtVW_5.js} +1 -1
- package/dist/assets/{agreement-ttzsGTtZ.js → agreement-BOqKQigq.js} +1 -1
- package/dist/assets/api-1_6mJDDc.js +1 -0
- package/dist/assets/{appearance-BoEskUU3.js → appearance-CnOE1Lt3.js} +1 -1
- package/dist/assets/{audit-logs-BjJ1_rVq.js → audit-logs-C0TwpEZz.js} +1 -1
- package/dist/assets/{base-chart-AQkuFrPC.js → base-chart-CNeCrWCe.js} +1 -1
- package/dist/assets/{blocklet-D2MB-zOx.js → blocklet-DrlbndLu.js} +1 -1
- package/dist/assets/{chain-l1zX37z1.js → chain-C07zUxjw.js} +1 -1
- package/dist/assets/{click-to-copy-D16LYOaz.js → click-to-copy-mgbEjAVp.js} +1 -1
- package/dist/assets/cloneDeep-iGPmlcW1.js +1 -0
- package/dist/assets/{collapse-DjVUQHBf.js → collapse-DPhRCMT_.js} +1 -1
- package/dist/assets/{config-navigation-D5cL0ut2.js → config-navigation-C1AJjTTc.js} +3 -3
- package/dist/assets/{connect-to-MJFTP0S_.js → connect-to-Bng6Y8sS.js} +1 -1
- package/dist/assets/{cssMode-Fsxj3561.js → cssMode-DQGyC1Du.js} +1 -1
- package/dist/assets/{delete-confirm-xUATcCih.js → delete-confirm-DLgDxKNU.js} +1 -1
- package/dist/assets/{depsEqual-BNz3Z5UN.js → depsEqual-46Dc4Ni4.js} +1 -1
- package/dist/assets/{detail-cazmKFj_.js → detail-BYCOVu21.js} +3 -3
- package/dist/assets/{domains-vCwCURM3.js → domains-BjHKwYRN.js} +1 -1
- package/dist/assets/{download-O9kMYIC6.js → download-BuSoh4PJ.js} +1 -1
- package/dist/assets/{edit.svg-B0aHUSZw.js → edit.svg-CCrzTWgj.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-Do6mSgYp.js +1 -0
- package/dist/assets/engine-BomELkty.js +1 -0
- package/dist/assets/{freemarker2-DajhvZDQ.js → freemarker2-D8jMF7WR.js} +1 -1
- package/dist/assets/{get-safe-url-B_yWzv49.js → get-safe-url-D4wQQAus.js} +1 -1
- package/dist/assets/getValidReactChildren-C1VhNdur.js +1 -0
- package/dist/assets/{graphqlMode-DQTpyvXV.js → graphqlMode-gngK04Mz.js} +2 -2
- package/dist/assets/{handlebars-CFycpwy_.js → handlebars-CMFIkxCR.js} +1 -1
- package/dist/assets/{html-fOaqMnCB.js → html-BJoJrX2a.js} +1 -1
- package/dist/assets/{html-title-xzTyg8m0.js → html-title-CDtGVxaB.js} +1 -1
- package/dist/assets/{htmlMode-DwojGB9N.js → htmlMode-f2GdVJG0.js} +1 -1
- package/dist/assets/{iframe-DhbAf7eB.js → iframe-n69t61B3.js} +1 -1
- package/dist/assets/{index-CprJrzzj.js → index-B2Wn3GKA.js} +1 -1
- package/dist/assets/{index-jIRER_d6.js → index-B6Q2auFe.js} +1 -1
- package/dist/assets/{index-BI2RNyn2.js → index-B8GICsl0.js} +1 -1
- package/dist/assets/{index-BbWPK5o6.js → index-B8iCpTth.js} +1 -1
- package/dist/assets/{index-BEOeUot7.js → index-BD8Pal3n.js} +1 -1
- package/dist/assets/{index-B_8MhQGp.js → index-BNCPRSyc.js} +3 -3
- package/dist/assets/{index-XgkYfld7.js → index-BXUBcEWf.js} +3 -3
- package/dist/assets/{index-BFqAcspj.js → index-B_0Cq7vU.js} +2 -2
- package/dist/assets/{index-4yUut_bV.js → index-Bf_Lmy-N.js} +1 -1
- package/dist/assets/{index-hu34K3US.js → index-C18EUjkb.js} +1 -1
- package/dist/assets/{index-DkBdKcP-.js → index-C3qhc5Io.js} +1 -1
- package/dist/assets/{index-BCEB7zAW.js → index-C4kPl4ke.js} +1 -1
- package/dist/assets/{index-Bvn9twlG.js → index-CAgAgIsZ.js} +1 -1
- package/dist/assets/{index-B-V1EiVF.js → index-CD97LOq3.js} +2 -2
- package/dist/assets/{index-aZqjDrOh.js → index-CE7lTr2p.js} +1 -1
- package/dist/assets/{index-CBrQ9aZ7.js → index-CMIUu1l6.js} +1 -1
- package/dist/assets/{index-g_RqxcM4.js → index-CNTrtWQE.js} +1 -1
- package/dist/assets/{index-DeYmBhXX.js → index-COOkU215.js} +1 -1
- package/dist/assets/{index-BzMgQhvT.js → index-CWIZ2lDN.js} +1 -1
- package/dist/assets/{index-DcXoiIcd.js → index-CYGcc8pV.js} +1 -1
- package/dist/assets/{index-CPLXcmCK.js → index-CYKSh2bk.js} +4 -4
- package/dist/assets/{index-0EXUatvL.js → index-Cbs-jLgW.js} +1 -1
- package/dist/assets/{index-DBOqxRpP.js → index-ChDDmSQi.js} +1 -1
- package/dist/assets/{index-iLcm3xJO.js → index-ClArlBqp.js} +1 -1
- package/dist/assets/{index-COT6fHf0.js → index-CreKO5jV.js} +1 -1
- package/dist/assets/{index-BftkyDmu.js → index-Cwqr74ON.js} +1 -1
- package/dist/assets/{index-BACYRg7R.js → index-CypY1XVU.js} +9 -9
- package/dist/assets/{index-Cl5G4tna.js → index-D-dFB32M.js} +3 -3
- package/dist/assets/{index-4-FW3N_0.js → index-D901ppFO.js} +1 -1
- package/dist/assets/{index-KR6tqxjN.js → index-DGPreTV-.js} +1 -1
- package/dist/assets/{index-CO0vAndr.js → index-DI_priH-.js} +2 -2
- package/dist/assets/{index-gqKcev8E.js → index-DItDGwwa.js} +1 -1
- package/dist/assets/{index-CEPQQlo6.js → index-DVercaqG.js} +1 -1
- package/dist/assets/{index-CCv_8omK.js → index-DY4IRZzA.js} +6 -6
- package/dist/assets/index-DYf0NUXR.js +1 -0
- package/dist/assets/{index-BhmdgQ6h.js → index-Dvzf_pfH.js} +1 -1
- package/dist/assets/{index-BsntE0No.js → index-Dy6LJdxo.js} +1 -1
- package/dist/assets/{index-CGtaecKe.js → index-F-kjFBf8.js} +1 -1
- package/dist/assets/{index-DvBW_mZc.js → index-HpSfOeJE.js} +1 -1
- package/dist/assets/{index-i28M3WTw.js → index-TupnUKnA.js} +1 -1
- package/dist/assets/{index-kFk_mggT.js → index-XHh_P_2P.js} +1 -1
- package/dist/assets/{index-yORTeDE5.js → index-alA_n9r0.js} +1 -1
- package/dist/assets/{index-Cacyj92F.js → index-ocWe7l-X.js} +1 -1
- package/dist/assets/{index-BlnAC-LC.js → index-qmua1knN.js} +1 -1
- package/dist/assets/{index-BZw-IddS.js → index-rdWEFiu5.js} +1 -1
- package/dist/assets/{index-BddlETK4.js → index-rn280PvV.js} +1 -1
- package/dist/assets/{index.esm-Bsyk9Gld.js → index.esm-CAXrUMkM.js} +1 -1
- package/dist/assets/{install-from-url-4VtQ9_35.js → install-from-url-Wdi4EG68.js} +1 -1
- package/dist/assets/{invitation-B5QYli1h.js → invitation-nrKDA1Kn.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-RoIvuAJE.js → is-path-prefix-equal-CYEkz2os.js} +1 -1
- package/dist/assets/{item-CjFxs-Zt.js → item-CqSM8aGX.js} +1 -1
- package/dist/assets/{javascript-luLw15rJ.js → javascript-B6yQKjiF.js} +1 -1
- package/dist/assets/{jsonMode-Cxdqt0IL.js → jsonMode-DkoM9aoY.js} +1 -1
- package/dist/assets/{liquid-D1qp1ZF3.js → liquid-D7xIqXac.js} +1 -1
- package/dist/assets/{list-header-D-U957cP.js → list-header-BWEUzaBX.js} +1 -1
- package/dist/assets/{lock.svg-Dz9J-uBq.js → lock.svg-BSFciPfs.js} +1 -1
- package/dist/assets/{log--2ZY9nHz.js → log-CdkXyW5t.js} +1 -1
- package/dist/assets/{lottie-react.esm-C6caiayN.js → lottie-react.esm-RgV5Mvhb.js} +1 -1
- package/dist/assets/{mdx-Dzy-X9qt.js → mdx-Ddv0C9rb.js} +1 -1
- package/dist/assets/{memory-r4Kexlry.js → memory-dEa_r_d8.js} +1 -1
- package/dist/assets/{metric-BTKuNvY9.js → metric-Cat2Yufj.js} +1 -1
- package/dist/assets/omit-CfNSSESR.js +1 -0
- package/dist/assets/{overview-CFHOUNfH.js → overview-DEC4e0Df.js} +1 -1
- package/dist/assets/{permission-RtK6f5af.js → permission-C1lOJdTa.js} +1 -1
- package/dist/assets/{preference-C7Ge_XOi.js → preference-BHwgiNrV.js} +3 -3
- package/dist/assets/{python-hpNfnPxJ.js → python-9TSgWHrh.js} +1 -1
- package/dist/assets/{raf-schd.esm-rR8pKw9W.js → raf-schd.esm-CnfzVLep.js} +1 -1
- package/dist/assets/{razor-BI0kEBq5.js → razor-QGFiiIP_.js} +1 -1
- package/dist/assets/{rotate-session-key-B6NXbgEc.js → rotate-session-key-ICcx3tCe.js} +1 -1
- package/dist/assets/{runtime-CVAdQ8wh.js → runtime-CvzCs6VN.js} +1 -1
- package/dist/assets/schema-hfM92ahP.js +1 -0
- package/dist/assets/sdk-TMvcAePy.js +1 -0
- package/dist/assets/{service-Cy6pWzv_.js → service-DSCUseEH.js} +1 -1
- package/dist/assets/{shorten-label-CvhqR616.js → shorten-label-BguF3cwJ.js} +1 -1
- package/dist/assets/{simple-select-Dqs9YolY.js → simple-select-CBZtGNFi.js} +1 -1
- package/dist/assets/{spaces-Dif7Qa2a.js → spaces-DWWw-hnQ.js} +1 -1
- package/dist/assets/{status-DIqT0--1.js → status-BiPp7u_X.js} +1 -1
- package/dist/assets/{status-Dcx3B-gc.js → status-DA56DtZT.js} +1 -1
- package/dist/assets/{switch-control-BLvkR0UT.js → switch-control-33eNnRFB.js} +1 -1
- package/dist/assets/{table-icons-DHCKcouf.js → table-icons-Cx2WnWde.js} +1 -1
- package/dist/assets/{team-BV9bl_r7.js → team-Bv3LojgN.js} +1 -1
- package/dist/assets/{toLower-CL0ukT8_.js → toLower-uukMw69d.js} +1 -1
- package/dist/assets/toUpper-CEwZrf0n.js +1 -0
- package/dist/assets/{traffic-DrN7qkrg.js → traffic-QPS_JGtF.js} +1 -1
- package/dist/assets/{tsMode-Bqd_EuMj.js → tsMode-CihLBg_5.js} +1 -1
- package/dist/assets/{typescript-BVOjm5kD.js → typescript-CejJAf0y.js} +1 -1
- package/dist/assets/{url-evaluation-B5iexDQo.js → url-evaluation-mbcZFwZv.js} +1 -1
- package/dist/assets/{url-join-DGMfgD17.js → url-join-CWTNXc5s.js} +1 -1
- package/dist/assets/{use-mobile-DyKd7giP.js → use-mobile-DgLeM-D1.js} +1 -1
- package/dist/assets/{use-mobile-DvM8SqYH.js → use-mobile-v1FgCHxE.js} +1 -1
- package/dist/assets/{useAsync-DRXRxEMN.js → useAsync-qB657l8w.js} +1 -1
- package/dist/assets/{useAsyncRetry-l2Si2r3C.js → useAsyncRetry-BM67-AEe.js} +1 -1
- package/dist/assets/{useLocalStorage-CbBU4OS9.js → useLocalStorage-X_cL3pYP.js} +1 -1
- package/dist/assets/{useThemeProps-CRd6upHX.js → useThemeProps-BS8q21Ze.js} +1 -1
- package/dist/assets/{util-CziUIk8v.js → util-GsRauHGT.js} +1 -1
- package/dist/assets/{wait-container-CCe_xsZw.js → wait-container-B_Dc4NpO.js} +1 -1
- package/dist/assets/{without-wallet-DcI5W8cf.js → without-wallet-i0gb4gDU.js} +1 -1
- package/dist/assets/wrap-locale-LMhScF83.js +1 -0
- package/dist/assets/{xml-86YzaLiM.js → xml-CXKq8G6H.js} +1 -1
- package/dist/assets/{yaml-hqPmcqsD.js → yaml-DCnIpBTS.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +2 -2
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-Br_oPfQI.js +0 -1
- package/dist/assets/actions-DVOuh-Fv.js +0 -11
- package/dist/assets/api-CWyPHkC_.js +0 -1
- package/dist/assets/cloneDeep-BOd1J0Sv.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-CdT-VIlA.js +0 -1
- package/dist/assets/engine-7ix2eBzw.js +0 -1
- package/dist/assets/getValidReactChildren-BQH98pcn.js +0 -1
- package/dist/assets/index-BiAAgnpw.js +0 -1
- package/dist/assets/omit-BwCXmJ0x.js +0 -1
- package/dist/assets/schema-Dsc1QRMh.js +0 -1
- package/dist/assets/sdk-BJ8ul4G_.js +0 -1
- package/dist/assets/toUpper-CcZcHFDe.js +0 -1
- package/dist/assets/wrap-locale-B1uKF2jP.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aF as Fe,j as t,dt as _s,gz as Ss,iw as Es,V as le,bo as xe,K as B,O as Ce,H as V,o as x,f as gt,r as k,p as _e,bG as st,b as be,i as X,X as Un,bF as ft,Y as ve,ix as ks,t as ye,s as se,a4 as he,aW as uo,T as ce,$ as Zt,dI as mt,y as we,b9 as Rs,bK as Ps,aH as K,b2 as Ts,go as Is,gp as Ds,C as je,f5 as po,hv as Wn,x as Bs,ax as Kt,w as Os,iy as Us,iz as Ns,v as Be,iA as Ls,Z as As,a0 as Ms,iB as fo,bp as mo,R as Ne,f7 as zs,f2 as Fs,aA as qs,aB as $s,bl as Ws,aC as Hs,aD as pe,aO as Ks,cS as Gs,S as Vs,eO as cr,bj as Ys,h as Zs,dx as It,iC as Xs,f$ as ho,iD as Qs,iE as Js,ez as fe,iF as go,dG as ei,iG as ti,ha as ni,fP as ri,iH as oi,cJ as dr,hq as Hn,av as si,bB as Xt,dq as Me,bv as ii,bw as ur,z as Gt,cw as ai,G as ze,aP as pr,gk as xo,aT as He,h6 as li,bE as kt,cp as fr,hy as ci,fn as mr,bh as di,L as xt,E as yo,bn as ui,_ as pi,M as Rt,a_ as Kn,iI as fi,a$ as Le,az as hr,cQ as mi,ad as it,aM as vo,bY as Gn,cB as hi,iJ as gi,ba as xi,A as Vn,aV as Nn,g as yi,aS as ut,N as fn,W as vi,bH as Co,aI as Ci,by as bo,aR as bi,fe as gr,g7 as xr,g8 as yr,U as vr,cP as ji,g9 as wi,bX as _i,iK as Si}from"./index-CCv_8omK.js";import{y as Ei}from"./index-DkBdKcP-.js";import{a as ki,c as Ri,d as Pi,u as Yn,R as Ti}from"./actions-DVOuh-Fv.js";import{S as Ii}from"./switch-control-BLvkR0UT.js";import{u as De}from"./blocklet-D2MB-zOx.js";import{P as Ln,w as Qt}from"./permission-RtK6f5af.js";import{E as jo}from"./Edit-HxzEBQ9h.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-DHCKcouf.js";import{s as Ui,F as wo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-C7Ge_XOi.js";import{C as Cr}from"./click-to-copy-D16LYOaz.js";import{v as mn}from"./index-DcXoiIcd.js";import{A as zi}from"./Add-l7OvfXrD.js";import{A as Jt}from"./Link-DGt16osR.js";import{C as Fi,c as qi,b as $i,f as _o,A as Wi,_ as Hi,a as Ki,e as Gi,d as So,s as Vi,L as Yi,u as Zi,g as Xi,S as Qi}from"./item-CjFxs-Zt.js";import{T as Ji,L as ea,a as An,u as br,W as ta,P as na}from"./index-Cacyj92F.js";import{e as Eo}from"./engine-7ix2eBzw.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-MJFTP0S_.js";import{C as la,u as ca,A as da}from"./agreement-ttzsGTtZ.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-DjVUQHBf.js";import{D as ko}from"./Done-BuJjZzMV.js";import{C as ha}from"./Google-cG0hx3oK.js";import{I as Ro,f as ga,a as xa,B as ya}from"./install-from-url-4VtQ9_35.js";import{a as jr}from"./api-CWyPHkC_.js";import{v as Po,e as va,a as Vt}from"./util-CziUIk8v.js";import{u as To}from"./use-mobile-DvM8SqYH.js";import{A as Ca}from"./ArrowDropDown-Br_oPfQI.js";import{u as ba}from"./useLocalStorage-CbBU4OS9.js";import{r as en}from"./index-DvBW_mZc.js";import{b as tn}from"./without-wallet-DcI5W8cf.js";import{E as Zn}from"./ErrorOutline-CUOja7My.js";import{H as ja}from"./HelpOutline-DapRasSH.js";import{C as wa}from"./lock.svg-Dz9J-uBq.js";import{D as nn,R as _a,a as wr}from"./url-evaluation-B5iexDQo.js";import{L as Io}from"./Launch-DITLracb.js";import{D as Sa}from"./delete-confirm-xUATcCih.js";import{W as ht,B as Mn,m as Ea}from"./status-Dcx3B-gc.js";import{A as Do}from"./actions-Dv4j7XcE.js";import{v as hn}from"./index-BCEB7zAW.js";import{t as ka}from"./toUpper-CcZcHFDe.js";import{S as Ra}from"./Switch-B-AVsYNw.js";import{a as Pa}from"./team-BV9bl_r7.js";import"./MoreVert-BUlWqUnK.js";import"./get-safe-url-B_yWzv49.js";import"./ButtonGroup-CMlvIctd.js";import"./getValidReactChildren-BQH98pcn.js";import"./FilterList-xUYmSJ-Y.js";import"./CSSTransition-Cf_KzaPo.js";import"./emotion-cache.browser.esm-CdT-VIlA.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-rR8pKw9W.js";import"./redux-DfszZyTl.js";import"./useThemeProps-CRd6upHX.js";import"./html-title-xzTyg8m0.js";import"./Clear-Cz6Yzx0g.js";import"./ChevronRight-CV3PmYHH.js";import"./ChevronLeft-OivB2aTv.js";import"./Search-3L2yy5pr.js";import"./omit-BwCXmJ0x.js";import"./edit.svg-B0aHUSZw.js";import"./index-CBrQ9aZ7.js";import"./iframe-DhbAf7eB.js";import"./index-BZw-IddS.js";import"./KeyboardArrowDown-9mIUY7eq.js";import"./Autocomplete-Bme-ElpV.js";import"./ListSubheader-l4UAKUMT.js";import"./Verified-BpzZH8QJ.js";import"./VerifiedUser-B-ONuNVC.js";import"./DeleteOutline-DmEDUBgP.js";import"./url-join-DGMfgD17.js";import"./index-BojVbZw0.js";import"./spaces-Dif7Qa2a.js";import"./OpenInNew-CCi7ydva.js";import"./index-DRYJ0xIl.js";import"./index-CGtaecKe.js";import"./decode-DPztD6kB.js";import"./cloneDeep-BOd1J0Sv.js";import"./ListItemButton-Cs40YHcx.js";import"./Stepper-D4Zig93k.js";import"./is-path-prefix-equal-RoIvuAJE.js";const Ta=Fe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ia=Fe(t.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Bo=Fe(t.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Da=Fe(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Oo=Fe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ba=Fe(t.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Oa=Fe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ua=Fe(t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Na=Fe(t.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function _r(e,n){var r={};return n=_s(n),Ss(e,function(i,a,o){Es(r,a,n(i,a,o))}),r}function Uo({children:e=null,...n}){const{t:r}=le(),{api:i}=xe(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,f=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),V.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!o?.enabled;return t.jsxs(B,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(Ce,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Uo.propTypes={children:x.any};function Sr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const La={..._r(Oi,Sr),..._r(ki,Sr)},Aa=(e,n)=>{let{description:r}=e;return(Object.values(be.CHAIN_PROP_MAP).includes(e.key)||X.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},gn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,Er=e=>[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),xn=e=>[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function No({blocklet:e,ancestors:n=[]}){const r=xe(),{palette:i}=gt(),{inService:a}=r,{t:o}=k.useContext(_e),f=[...n.map(s=>s.meta.did),e.meta.did],c=()=>V.success(o("blocklet.config.changedTip")),d=s=>gn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){V.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(Er(s.key)===!1){V.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=xn(s.key);try{const R=await r.api.configBlocklet({input:{did:f,configs:[s]}});c(R.blocklet),h()}catch(R){V.error(ve(R)),b()}}),y=(s,h)=>new Promise(async(b,R)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){V.error(o("blocklet.config.environment.keyValueRequired")),R();return}if(Er(s.key)===!1){V.error(o("blocklet.config.environment.invalidKey")),R();return}if(s.key===be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=ks(s);if(M){V.error(M),R();return}}const E=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!gn(s,e,n)){V.error("Only key of custom env can be changed"),R();return}E.push({key:h.key,custom:xn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:f,configs:E}});c(M.blocklet),b()}catch(M){V.error(ve(M)),R()}}),p=s=>new Promise(async(h,b)=>{if(s.required){V.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!gn(s,e,n)){V.error(o("environmentTips.deleteForbidden")),b();return}try{const R=await r.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:xn(s.key)}]}});c(R.blocklet),h()}catch(R){V.error(ve(R)),b()}}),C=(e.configs||[]).filter(s=>!be.BLOCKLET_CONFIGURABLE_KEY[s.key]||[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),m=X.getSharedConfigObj(n[0],e),v=X.getComponentMissingConfigs(e,n[0]),j=C.map(s=>({...s,value:Object.values(be.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(m).includes(s.key)?m[s.key]:m[s.key]||s.value})),w=j.some(s=>s.key&&s.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(Cr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:R}=s;return t.jsx(kr,{children:t.jsx(ye,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:E=>R(E.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(Cr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:R}=s;return t.jsxs(kr,{children:[t.jsx(ye,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>R(E.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),Aa(b,o)]})}}];return t.jsxs(Ma,{children:[!!v.length&&t.jsx(Un,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(Un,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Ln,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(B,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:u(),icons:La,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:j,editable:s?S:{}})})})]})}No.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Ma=se.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BXUBcEWf.js","./index-DY4IRZzA.js","./index-DGkT7afN.css","./url-join-CWTNXc5s.js","./index-HpSfOeJE.js","./_createAggregator-E-d6FWvu.js","./depsEqual-46Dc4Ni4.js","./index-CMIUu1l6.js","./index-DRYJ0xIl.js","./toUpper-CEwZrf0n.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as Fe,j as t,dt as _s,gz as Ss,iw as Es,V as le,bo as xe,K as B,O as Ce,H as V,o as x,f as gt,r as k,p as _e,bG as st,b as be,i as X,X as Un,bF as ft,Y as ve,ix as ks,t as ye,s as se,a4 as he,aW as uo,T as ce,$ as Zt,dI as mt,y as we,b9 as Rs,bK as Ps,aH as K,b2 as Ts,go as Is,gp as Ds,C as je,f5 as po,hv as Wn,x as Bs,ax as Kt,w as Os,iy as Us,iz as Ns,v as Be,iA as Ls,Z as As,a0 as Ms,iB as fo,bp as mo,R as Ne,f7 as zs,f2 as Fs,aA as qs,aB as $s,bl as Ws,aC as Hs,aD as pe,aO as Ks,cS as Gs,S as Vs,eO as cr,bj as Ys,h as Zs,dx as It,iC as Xs,f$ as ho,iD as Qs,iE as Js,ez as fe,iF as go,dG as ei,iG as ti,ha as ni,fP as ri,iH as oi,cJ as dr,hq as Hn,av as si,bB as Xt,dq as Me,bv as ii,bw as ur,z as Gt,cw as ai,G as ze,aP as pr,gk as xo,aT as He,h6 as li,bE as kt,cp as fr,hy as ci,fn as mr,bh as di,L as xt,E as yo,bn as ui,_ as pi,M as Rt,a_ as Kn,iI as fi,a$ as Le,az as hr,cQ as mi,ad as it,aM as vo,bY as Gn,cB as hi,iJ as gi,ba as xi,A as Vn,aV as Nn,g as yi,aS as ut,N as fn,W as vi,bH as Co,aI as Ci,by as bo,aR as bi,fe as gr,g7 as xr,g8 as yr,U as vr,cP as ji,g9 as wi,bX as _i,iK as Si}from"./index-DY4IRZzA.js";import{y as Ei}from"./index-C3qhc5Io.js";import{a as ki,c as Ri,d as Pi,u as Yn,R as Ti}from"./actions-C85Hfsv7.js";import{S as Ii}from"./switch-control-33eNnRFB.js";import{u as De}from"./blocklet-DrlbndLu.js";import{P as Ln,w as Qt}from"./permission-C1lOJdTa.js";import{E as jo}from"./Edit-Dynoa_c5.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-Cx2WnWde.js";import{s as Ui,F as wo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-BHwgiNrV.js";import{C as Cr}from"./click-to-copy-mgbEjAVp.js";import{v as mn}from"./index-CYGcc8pV.js";import{A as zi}from"./Add-BuqBIDFA.js";import{A as Jt}from"./Link-C0DA-K7d.js";import{C as Fi,c as qi,b as $i,f as _o,A as Wi,_ as Hi,a as Ki,e as Gi,d as So,s as Vi,L as Yi,u as Zi,g as Xi,S as Qi}from"./item-CqSM8aGX.js";import{T as Ji,L as ea,a as An,u as br,W as ta,P as na}from"./index-ocWe7l-X.js";import{e as Eo}from"./engine-BomELkty.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-Bng6Y8sS.js";import{C as la,u as ca,A as da}from"./agreement-BOqKQigq.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-DPhRCMT_.js";import{D as ko}from"./Done--5OjVF1L.js";import{C as ha}from"./Google-DgctB8-z.js";import{I as Ro,f as ga,a as xa,B as ya}from"./install-from-url-Wdi4EG68.js";import{a as jr}from"./api-1_6mJDDc.js";import{v as Po,e as va,a as Vt}from"./util-GsRauHGT.js";import{u as To}from"./use-mobile-v1FgCHxE.js";import{A as Ca}from"./ArrowDropDown-Dt1OnkjV.js";import{u as ba}from"./useLocalStorage-X_cL3pYP.js";import{r as en}from"./index-HpSfOeJE.js";import{b as tn}from"./without-wallet-i0gb4gDU.js";import{E as Zn}from"./ErrorOutline-Bre_iFld.js";import{H as ja}from"./HelpOutline-ByUUQACF.js";import{C as wa}from"./lock.svg-BSFciPfs.js";import{D as nn,R as _a,a as wr}from"./url-evaluation-mbcZFwZv.js";import{L as Io}from"./Launch-O8wdtoRZ.js";import{D as Sa}from"./delete-confirm-DLgDxKNU.js";import{W as ht,B as Mn,m as Ea}from"./status-DA56DtZT.js";import{A as Do}from"./actions-CfPtVW_5.js";import{v as hn}from"./index-C4kPl4ke.js";import{t as ka}from"./toUpper-CEwZrf0n.js";import{S as Ra}from"./Switch-BhNob30A.js";import{a as Pa}from"./team-Bv3LojgN.js";import"./MoreVert-DIAAjKU1.js";import"./get-safe-url-D4wQQAus.js";import"./ButtonGroup-BtGO-VCX.js";import"./getValidReactChildren-C1VhNdur.js";import"./FilterList-DA2GUvmN.js";import"./CSSTransition-Cj0uEEEn.js";import"./emotion-cache.browser.esm-Do6mSgYp.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-CnfzVLep.js";import"./redux-DfszZyTl.js";import"./useThemeProps-BS8q21Ze.js";import"./html-title-CDtGVxaB.js";import"./Clear-Ch6COz32.js";import"./ChevronRight-Cf_5Xzjf.js";import"./ChevronLeft-ByepaSoC.js";import"./Search-BcGKbDLr.js";import"./omit-CfNSSESR.js";import"./edit.svg-CCrzTWgj.js";import"./index-CMIUu1l6.js";import"./iframe-n69t61B3.js";import"./index-rdWEFiu5.js";import"./KeyboardArrowDown-BW2EjmL2.js";import"./Autocomplete-YxXH99vB.js";import"./ListSubheader-EtXBMK8f.js";import"./Verified-BBY_HS8b.js";import"./VerifiedUser-CsU_SR-Q.js";import"./DeleteOutline-ebJSYeqv.js";import"./url-join-CWTNXc5s.js";import"./index-BojVbZw0.js";import"./spaces-DWWw-hnQ.js";import"./OpenInNew-OpUheJsd.js";import"./index-DRYJ0xIl.js";import"./index-F-kjFBf8.js";import"./decode-DPztD6kB.js";import"./cloneDeep-iGPmlcW1.js";import"./ListItemButton-Bi1hEGzW.js";import"./Stepper-WKsCvhQB.js";import"./is-path-prefix-equal-CYEkz2os.js";const Ta=Fe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ia=Fe(t.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Bo=Fe(t.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Da=Fe(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Oo=Fe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ba=Fe(t.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Oa=Fe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ua=Fe(t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Na=Fe(t.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function _r(e,n){var r={};return n=_s(n),Ss(e,function(i,a,o){Es(r,a,n(i,a,o))}),r}function Uo({children:e=null,...n}){const{t:r}=le(),{api:i}=xe(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,f=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),V.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){V.error(l.message)}},d=!!o?.enabled;return t.jsxs(B,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(Ce,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Uo.propTypes={children:x.any};function Sr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const La={..._r(Oi,Sr),..._r(ki,Sr)},Aa=(e,n)=>{let{description:r}=e;return(Object.values(be.CHAIN_PROP_MAP).includes(e.key)||X.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},gn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,Er=e=>[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),xn=e=>[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function No({blocklet:e,ancestors:n=[]}){const r=xe(),{palette:i}=gt(),{inService:a}=r,{t:o}=k.useContext(_e),f=[...n.map(s=>s.meta.did),e.meta.did],c=()=>V.success(o("blocklet.config.changedTip")),d=s=>gn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){V.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(Er(s.key)===!1){V.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=xn(s.key);try{const R=await r.api.configBlocklet({input:{did:f,configs:[s]}});c(R.blocklet),h()}catch(R){V.error(ve(R)),b()}}),y=(s,h)=>new Promise(async(b,R)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){V.error(o("blocklet.config.environment.keyValueRequired")),R();return}if(Er(s.key)===!1){V.error(o("blocklet.config.environment.invalidKey")),R();return}if(s.key===be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=ks(s);if(M){V.error(M),R();return}}const E=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!gn(s,e,n)){V.error("Only key of custom env can be changed"),R();return}E.push({key:h.key,custom:xn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:f,configs:E}});c(M.blocklet),b()}catch(M){V.error(ve(M)),R()}}),p=s=>new Promise(async(h,b)=>{if(s.required){V.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!gn(s,e,n)){V.error(o("environmentTips.deleteForbidden")),b();return}try{const R=await r.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:xn(s.key)}]}});c(R.blocklet),h()}catch(R){V.error(ve(R)),b()}}),C=(e.configs||[]).filter(s=>!be.BLOCKLET_CONFIGURABLE_KEY[s.key]||[be.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),m=X.getSharedConfigObj(n[0],e),v=X.getComponentMissingConfigs(e,n[0]),j=C.map(s=>({...s,value:Object.values(be.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(m).includes(s.key)?m[s.key]:m[s.key]||s.value})),w=j.some(s=>s.key&&s.key.startsWith("BWA_")),S={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(Cr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:R}=s;return t.jsx(kr,{children:t.jsx(ye,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:E=>R(E.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(Cr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:R}=s;return t.jsxs(kr,{children:[t.jsx(ye,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:E=>R(E.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),Aa(b,o)]})}}];return t.jsxs(Ma,{children:[!!v.length&&t.jsx(Un,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(Un,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Ln,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(B,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:u(),icons:La,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:j,editable:s?S:{}})})})]})}No.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Ma=se.div`
|
|
3
3
|
.config-table {
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
position: relative;
|
|
@@ -66,7 +66,7 @@ import{aF as Fe,j as t,dt as _s,gz as Ss,iw as Es,V as le,bo as xe,K as B,O as C
|
|
|
66
66
|
.ux-dialog_closeButton {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
69
|
-
`,Fa=k.lazy(()=>Ps(()=>import("./index-
|
|
69
|
+
`,Fa=k.lazy(()=>Ps(()=>import("./index-BXUBcEWf.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(e=>({default:e.Uploader}))),qa="/blocklet/component/upload",Rr=[".html",".htm",".tgz",".zip"],$a=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||K.MAX_UPLOAD_FILE_SIZE,Wa=$a*1024*1024;function Lo({did:e,prefix:n,headers:r=()=>({}),onUploaded:i=mt,open:a=!1,onClose:o=mt}){const{t:f,locale:c}=le(),d=k.useRef(null),l=k.useCallback(y=>{const{status:p,data:C}=y;if(p===200){i(C);return}V.error(f("blocklet.component.addComponentTip.uploadFailed"))},[i,f]);return k.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),t.jsx(Ha,{id:`component-uploader-${e}`,children:t.jsx(Fa,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:we(n,qa,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Rr,maxFileSize:Wa,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:Rr.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Lo.propTypes={did:x.string.isRequired,prefix:x.string.isRequired,open:x.bool,headers:x.func,onUploaded:x.func,onClose:x.func};const Ha=Rs(B)`
|
|
70
70
|
.uploader-wrapper {
|
|
71
71
|
display: inline-flex;
|
|
72
72
|
position: relative;
|
|
@@ -486,7 +486,7 @@ import{aF as Fe,j as t,dt as _s,gz as Ss,iw as Es,V as le,bo as xe,K as B,O as C
|
|
|
486
486
|
margin-left: 4px;
|
|
487
487
|
transform: translateY(-1px);
|
|
488
488
|
}
|
|
489
|
-
`;function gs({blocklet:e,ancestors:n,mountPoint:r,href:i}){const[a,o]=k.useState(!1),[f,c]=k.useState(!1),[d,l]=k.useState(!1),[y,p]=k.useState(r),{api:C}=xe(),m=!n.length,v=m?e.meta.did:n.map(E=>E.meta.did)[0],{t:j}=le(),{confirmApi:w,confirmHolder:S}=xo();k.useEffect(()=>{c(!1),o(!1),l(!1)},[r]);const u=()=>{o(!1),c(!1),p(r)},s=async()=>{l(!0),o(!1);try{const E={rootDid:v,mountPoint:Le.urlPathFriendly(y)};m||(E.did=e.meta.did),await C.updateComponentMountPoint({input:E})}catch(E){throw E.message=ve(E),V.error(E.message),E}finally{u()}},h=He(()=>{w.open({title:j("common.noticeTitle"),content:t.jsxs(B,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(ce,{sx:{mb:1.5},children:j("blocklet.mountPoint.description1")}),t.jsx(ce,{component:"li",children:j("blocklet.mountPoint.case1")}),t.jsx(ce,{component:"li",children:j("blocklet.mountPoint.case2")}),t.jsx(ce,{sx:{mt:1.5},children:j("blocklet.mountPoint.description2")})]}),confirmButtonText:j("common.confirm"),cancelButtonText:j("common.cancel"),async onConfirm(E){await s(),E()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),b=E=>{E?.preventDefault(),Le.urlPathFriendly(y)!==r?h():c(!1)},R=f?t.jsxs(B,{sx:{ml:1},children:[t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-cy":"edit-mount-point-submit",onClick:b,children:t.jsx(B,{component:pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:u,children:t.jsx(B,{component:pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>c(!0),children:t.jsx(B,{component:pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:a?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(B,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[S,f?t.jsx("form",{onSubmit:b,children:t.jsx(ye,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:y,onChange:E=>p(E.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:r})}):t.jsx(B,{component:"a",target:"_blank",href:i,rel:"noopener noreferrer",title:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(B,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:Ci(r)})}),d?t.jsx(je,{size:20,sx:{ml:1}}):R]},r)}gs.propTypes={mountPoint:x.string.isRequired,href:x.string.isRequired,blocklet:x.object.isRequired,ancestors:x.array.isRequired};const Wd=e=>!e?.meta?.group,co=(e,n)=>{const r=e.split("/").slice(1);let i=n,a=0;const o=[];for(;i&&a<r.length;){const f=i.children.find(c=>c.meta.did===r[a]);i=f,a++,f&&o.push(f.meta.title)}return o.join(" / ")},Hd=(e,n)=>{window.IS_DEBUG&&console.log("blocklet status","blueStatus:",e,"greenStatus:",n);const r=e==="running"||n==="running",i=e==="stopping"||n==="stopping",a=e==="downloading"&&n==="downloading";let o="",f="";return i?(o="stopping",f=""):r?o="running":o=e||n||"",r&&e!==n&&(f=e==="running"?n:e),a&&(o="running",f="downloading"),o==="running"&&f==="stopped"&&(f=""),e===n&&(o=e,f=""),{primaryStatus:o,secondaryStatus:f}};function qn({blocklet:e,ancestors:n=[],depth:r=0,onRemove:i=()=>{},onStart:a=()=>{},onStop:o=()=>{},onRestart:f=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l,locale:y}=k.useContext(_e),p=Vn(),[C,m]=k.useState(),[v,j]=k.useState(!1),[w,S]=k.useState(!1),[u,s]=k.useState(null),{info:h,inService:b}=xe(),[R,E]=k.useState(!1),[M,F]=k.useState(!1),{deletingBlocklets:P}=Yn();let{status:D}=e;r===1&&P.includes(e.meta.did)&&(D="deleting");const I=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),L=c(I),z=X.isInProgress(d.status),q=X.isInProgress(e.status);let G="";if(z||q||r===1&&P.includes(e.meta.did))G=l("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const g=e.dependents.filter(_=>_.required);if(g.length){const _=g.map(T=>co(T.id,d));G=l("blocklet.component.tip.requiredBy",{name:_.join(", ")})}}const ne=He(()=>{const g=e.meta.did;if(b){const _=Gt(we(K.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/developers/logs"),{locale:y,component:g});window.location.href=_}else{const _=Gt(we("/blocklets",d.appPid,"/logs"),{locale:y,component:g});p(_)}}),oe=async(...g)=>{S(!0);try{await i(...g)}catch{}S(!1),j(!1)},{usingDocker:U,usingIsolation:ie}=k.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const g=!!h?.enableDocker||window.blocklet?.enableDocker,_=[...d.configs,...e.configs].find(H=>H.key==="SKIP_DOCKER"&&H.value),T=[...d.configs,...e.configs].find(H=>H.key==="USE_DOCKER"&&H.value),$=[...d.configs,...e.configs].find(H=>H.key==="SKIP_DOCKER_NETWORK"&&H.value);return{usingDocker:g?!_:!!T,usingIsolation:g&&!$&&(h?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,h?.enableDocker,h?.enableDockerNetwork,d.configs,e.meta.group]),{primaryStatus:N,secondaryStatus:O}=Hd(D,e.greenStatus);return t.jsxs(t.Fragment,{children:[t.jsxs(ir,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(B,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(bo,{blocklet:e,ancestors:n}),t.jsxs(B,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(B,{className:"component-header",onClick:()=>m(e),children:[t.jsx(B,{className:"component-name",children:X.getDisplayName(e,!0)}),t.jsx(B,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5},children:[N&&t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:N,source:e.source,progress:e.progress}),O&&(N==="running"&&Ea[O]==="error"?t.jsx(Ce,{title:l("blocklet.status.failWithOldVersion"),children:t.jsx(B,{sx:{display:"flex",color:"warning.main",ml:1},children:t.jsx(Zn,{})})}):t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:O,source:e.source,progress:e.progress})),t.jsx(ya,{style:{whiteSpace:"nowrap"},mode:e.mode||""}),e.mode!=="development"&&U&&t.jsx(Ce,{title:l("blocklet.usingDocker"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:So})})}),e.mode!=="development"&&ie&&t.jsx(Ce,{title:l("blocklet.usingIsolation"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(Ce,{title:[`${l("common.dependents")}: `,e.dependents.map(g=>t.jsx(B,{sx:{pl:1},children:`${co(g.id,d)} ${g.required?`(${l("common.required")})`:""}`},g.id))],children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:"octicon:package-dependents-16"})})})]})]})]},e),Eo.hasMountPoint(e.meta)&&t.jsx(gs,{blocklet:e,ancestors:n,mountPoint:I,href:L},I),t.jsx("div",{style:{flex:1}}),t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[X.hasStartEngine(e.meta)&&t.jsx(Ce,{title:l("common.visit"),children:t.jsx(B,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:L,rel:"noopener noreferrer",children:t.jsx(he,{size:"small",children:t.jsx(Io,{fontSize:"small"})})})}),t.jsx(fs,{blocklet:d,component:e,onStart:a,onStop:o,disabled:!["starting","stopping"].includes(d.status)&&X.isInProgress(d.status)}),t.jsx(he,{size:"small",onClick:()=>F(!0),disabled:z||q,children:t.jsx(Oo,{fontSize:"small"})}),t.jsx($n,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(Do,{"data-cy":"component-actions",actions:[X.hasStartEngine(e.meta)||Wd(e)?{icon:t.jsx(bi,{}),text:l("common.detail"),onClick:()=>{m(e)}}:null,{icon:t.jsx(Ti,{}),text:l("common.restart"),onClick:()=>{s({title:`${l("common.restart")} ${e.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{S(!0),await f(e),S(!1),s(null)},onCancel:()=>s(null)})},disabled:w||z||q||!X.isBlockletRunning(e)},{icon:t.jsx(nn,{}),text:l("common.delete"),onClick:()=>{j(!0)},disabled:z||q||!!G,tip:G},{
|
|
489
|
+
`;function gs({blocklet:e,ancestors:n,mountPoint:r,href:i}){const[a,o]=k.useState(!1),[f,c]=k.useState(!1),[d,l]=k.useState(!1),[y,p]=k.useState(r),{api:C}=xe(),m=!n.length,v=m?e.meta.did:n.map(E=>E.meta.did)[0],{t:j}=le(),{confirmApi:w,confirmHolder:S}=xo();k.useEffect(()=>{c(!1),o(!1),l(!1)},[r]);const u=()=>{o(!1),c(!1),p(r)},s=async()=>{l(!0),o(!1);try{const E={rootDid:v,mountPoint:Le.urlPathFriendly(y)};m||(E.did=e.meta.did),await C.updateComponentMountPoint({input:E})}catch(E){throw E.message=ve(E),V.error(E.message),E}finally{u()}},h=He(()=>{w.open({title:j("common.noticeTitle"),content:t.jsxs(B,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(ce,{sx:{mb:1.5},children:j("blocklet.mountPoint.description1")}),t.jsx(ce,{component:"li",children:j("blocklet.mountPoint.case1")}),t.jsx(ce,{component:"li",children:j("blocklet.mountPoint.case2")}),t.jsx(ce,{sx:{mt:1.5},children:j("blocklet.mountPoint.description2")})]}),confirmButtonText:j("common.confirm"),cancelButtonText:j("common.cancel"),async onConfirm(E){await s(),E()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),b=E=>{E?.preventDefault(),Le.urlPathFriendly(y)!==r?h():c(!1)},R=f?t.jsxs(B,{sx:{ml:1},children:[t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-cy":"edit-mount-point-submit",onClick:b,children:t.jsx(B,{component:pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:u,children:t.jsx(B,{component:pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(he,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>c(!0),children:t.jsx(B,{component:pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:a?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(B,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[S,f?t.jsx("form",{onSubmit:b,children:t.jsx(ye,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:y,onChange:E=>p(E.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:r})}):t.jsx(B,{component:"a",target:"_blank",href:i,rel:"noopener noreferrer",title:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(B,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:Ci(r)})}),d?t.jsx(je,{size:20,sx:{ml:1}}):R]},r)}gs.propTypes={mountPoint:x.string.isRequired,href:x.string.isRequired,blocklet:x.object.isRequired,ancestors:x.array.isRequired};const Wd=e=>!e?.meta?.group,co=(e,n)=>{const r=e.split("/").slice(1);let i=n,a=0;const o=[];for(;i&&a<r.length;){const f=i.children.find(c=>c.meta.did===r[a]);i=f,a++,f&&o.push(f.meta.title)}return o.join(" / ")},Hd=(e,n)=>{window.IS_DEBUG&&console.log("blocklet status","blueStatus:",e,"greenStatus:",n);const r=e==="running"||n==="running",i=e==="stopping"||n==="stopping",a=e==="downloading"&&n==="downloading";let o="",f="";return i?(o="stopping",f=""):r?o="running":o=e||n||"",r&&e!==n&&(f=e==="running"?n:e),a&&(o="running",f="downloading"),o==="running"&&f==="stopped"&&(f=""),e===n&&(o=e,f=""),{primaryStatus:o,secondaryStatus:f}};function qn({blocklet:e,ancestors:n=[],depth:r=0,onRemove:i=()=>{},onStart:a=()=>{},onStop:o=()=>{},onRestart:f=()=>{},getComponentUrl:c=()=>window.location.origin,app:d=null}){const{t:l,locale:y}=k.useContext(_e),p=Vn(),[C,m]=k.useState(),[v,j]=k.useState(!1),[w,S]=k.useState(!1),[u,s]=k.useState(null),{info:h,inService:b}=xe(),[R,E]=k.useState(!1),[M,F]=k.useState(!1),{deletingBlocklets:P}=Yn();let{status:D}=e;r===1&&P.includes(e.meta.did)&&(D="deleting");const I=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),L=c(I),z=X.isInProgress(d.status),q=X.isInProgress(e.status);let G="";if(z||q||r===1&&P.includes(e.meta.did))G=l("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const g=e.dependents.filter(_=>_.required);if(g.length){const _=g.map(T=>co(T.id,d));G=l("blocklet.component.tip.requiredBy",{name:_.join(", ")})}}const ne=He(()=>{const g=e.meta.did;if(b){const _=Gt(we(K.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/developers/logs"),{locale:y,component:g});window.location.href=_}else{const _=Gt(we("/blocklets",d.appPid,"/logs"),{locale:y,component:g});p(_)}}),oe=async(...g)=>{S(!0);try{await i(...g)}catch{}S(!1),j(!1)},{usingDocker:U,usingIsolation:ie}=k.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const g=!!h?.enableDocker||window.blocklet?.enableDocker,_=[...d.configs,...e.configs].find(H=>H.key==="SKIP_DOCKER"&&H.value),T=[...d.configs,...e.configs].find(H=>H.key==="USE_DOCKER"&&H.value),$=[...d.configs,...e.configs].find(H=>H.key==="SKIP_DOCKER_NETWORK"&&H.value);return{usingDocker:g?!_:!!T,usingIsolation:g&&!$&&(h?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,h?.enableDocker,h?.enableDockerNetwork,d.configs,e.meta.group]),{primaryStatus:N,secondaryStatus:O}=Hd(D,e.greenStatus);return t.jsxs(t.Fragment,{children:[t.jsxs(ir,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(B,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(bo,{blocklet:e,ancestors:n}),t.jsxs(B,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(B,{className:"component-header",onClick:()=>m(e),children:[t.jsx(B,{className:"component-name",children:X.getDisplayName(e,!0)}),t.jsx(B,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5},children:[N&&t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:N,source:e.source,progress:e.progress}),O&&(N==="running"&&Ea[O]==="error"?t.jsx(Ce,{title:l("blocklet.status.failWithOldVersion"),children:t.jsx(B,{sx:{display:"flex",color:"warning.main",ml:1},children:t.jsx(Zn,{})})}):t.jsx(Mn,{style:{whiteSpace:"nowrap"},status:O,source:e.source,progress:e.progress})),t.jsx(ya,{style:{whiteSpace:"nowrap"},mode:e.mode||""}),e.mode!=="development"&&U&&t.jsx(Ce,{title:l("blocklet.usingDocker"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:So})})}),e.mode!=="development"&&ie&&t.jsx(Ce,{title:l("blocklet.usingIsolation"),children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(Ce,{title:[`${l("common.dependents")}: `,e.dependents.map(g=>t.jsx(B,{sx:{pl:1},children:`${co(g.id,d)} ${g.required?`(${l("common.required")})`:""}`},g.id))],children:t.jsx(B,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(pe,{icon:"octicon:package-dependents-16"})})})]})]})]},e),Eo.hasMountPoint(e.meta)&&t.jsx(gs,{blocklet:e,ancestors:n,mountPoint:I,href:L},I),t.jsx("div",{style:{flex:1}}),t.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[X.hasStartEngine(e.meta)&&t.jsx(Ce,{title:l("common.visit"),children:t.jsx(B,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:L,rel:"noopener noreferrer",children:t.jsx(he,{size:"small",children:t.jsx(Io,{fontSize:"small"})})})}),t.jsx(fs,{blocklet:d,component:e,onStart:a,onStop:o,disabled:!["starting","stopping"].includes(d.status)&&X.isInProgress(d.status)}),t.jsx(he,{size:"small",onClick:()=>F(!0),disabled:z||q,children:t.jsx(Oo,{fontSize:"small"})}),t.jsx($n,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(Do,{"data-cy":"component-actions",actions:[X.hasStartEngine(e.meta)||Wd(e)?{icon:t.jsx(bi,{}),text:l("common.detail"),onClick:()=>{m(e)}}:null,{icon:t.jsx(Ti,{}),text:l("common.restart"),onClick:()=>{s({title:`${l("common.restart")} ${e.meta.title}`,description:l("blocklet.action.restartDescription"),confirm:l("blocklet.action.confirmRestart"),cancel:l("common.cancel"),onConfirm:async()=>{S(!0),await f(e),S(!1),s(null)},onCancel:()=>s(null)})},disabled:w||z||q||!X.isBlockletRunning(e)},{icon:t.jsx(nn,{}),text:l("common.delete"),onClick:()=>{j(!0)},disabled:z||q||!!G,tip:G},{separator:!0},{icon:t.jsx(pe,{icon:"mdi:variable"}),onClick:()=>{E(!0)},text:t.jsx($n,{color:"error",badgeContent:"",variant:"dot",invisible:!X.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(B,{sx:{width:"100%"},children:l("common.environments")})}),disabled:z||q},{icon:t.jsx(pe,{icon:"heroicons:command-line"}),text:l("common.logs"),onClick:ne,disabled:z||q||!!G,tip:G}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(on,{},"line"),t.jsx(hs,{componentInfo:C,onClose:m,blocklet:e,app:d,depth:r}),t.jsx(ps,{blocklet:d,component:e,remove:oe,onCancel:()=>j(!1),hideBtn:!0,showConfirm:v},"delete-component"),u&&t.jsx(it,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"confirm-setting"),R&&t.jsx(Xn,{open:!0,hiddenChildren:!0,onClose:()=>E(!1),blocklet:e,ancestors:n}),M&&t.jsx(or,{open:!0,onClose:()=>F(!1),blocklet:e,ancestors:n})]})}qn.propTypes={blocklet:x.object.isRequired,ancestors:x.array,depth:x.number,onRemove:x.func,onStart:x.func,onStop:x.func,onRestart:x.func,getComponentUrl:x.func,app:x.object};const $n=se(Co)`
|
|
490
490
|
.BaseBadge-badge {
|
|
491
491
|
top: ${e=>e.top*8||6}px;
|
|
492
492
|
right: ${e=>e.right*8||6}px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as P,V as E,A as C,j as e,Z as W,C as j,cG as I,K as T,w as k,H as u,aH as S,u as U,x as v,ar as N,af as R}from"./index-
|
|
1
|
+
import{r as P,V as E,A as C,j as e,Z as W,C as j,cG as I,K as T,w as k,H as u,aH as S,u as U,x as v,ar as N,af as R}from"./index-DY4IRZzA.js";import{w as b}from"./wrap-locale-LMhScF83.js";import{g as L}from"./get-safe-url-D4wQQAus.js";import"./index-DItDGwwa.js";function H({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const K=b(H);function V(){const{info:n}=U(),a=v(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(K,{SessionContext:N,webWalletUrl:a,onSuccess:r})}export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as x}from"./index-
|
|
1
|
+
import{be as x}from"./index-DY4IRZzA.js";function D(a,i){for(var r=0;r<i.length;r++){const e=i[r];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in a)){const t=Object.getOwnPropertyDescriptor(e,s);t&&Object.defineProperty(a,s,t.get?t:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var l,w;function J(){if(w)return l;w=1;var a={default:l,call:function(i,r,e){var s="";typeof r=="function"&&(e=r,r={});var t={data:r===void 0?null:r};if(typeof e=="function"){var n="dscb"+window.dscb++;window[n]=e,t._dscbstub=n}return t=JSON.stringify(t),window._dsbridge?s=_dsbridge.call(i,t):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(s=prompt("_dsbridge="+i,t)),JSON.parse(s||"{}").data},register:function(i,r,e){var s=e?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){a.call("_dsb.dsinit")},0)),typeof r=="object"?s._obs[i]=r:s[i]=r},registerAsyn:function(i,r){this.register(i,r,!0)},hasNativeMethod:function(i,r){return this.call("_dsb.hasNativeMethod",{name:i,type:r||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};return function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:a,close:function(){a.call("_dsb.closePage")},_handleMessageFromNative:function(e){var s=JSON.parse(e.data),t={id:e.callbackId,complete:!0},n=this._dsf[e.method],o=this._dsaf[e.method],v=function(_,p){t.data=_.apply(p,s),a.call("_dsb.returnValue",t)},g=function(_,p){s.push(function(O,j){t.data=O,t.complete=j!==!1,a.call("_dsb.returnValue",t)}),_.apply(p,s)};if(n)v(n,this._dsf);else if(o)g(o,this._dsaf);else{var u=e.method.split(".");if(u.length<2)return;var b=u.pop(),h=u.join("."),c=this._dsf._obs,f=c[h]||{},d=f[b];if(d&&typeof d=="function"){v(d,f);return}if(c=this._dsaf._obs,f=c[h]||{},d=f[b],d&&typeof d=="function"){g(d,f);return}}}};for(var r in i)window[r]=i[r];a.register("_hasJavascriptMethod",function(e,s){var t=e.split(".");if(t.length<2)return!!(_dsf[t]||_dsaf[t]);var e=t.pop(),n=t.join("."),o=_dsf._obs[n]||_dsaf._obs[n];return o&&!!o[e]})}}(),l=a,l}var y=J();const N=x(y),k=D({__proto__:null,default:N},[y]);export{k as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as je,j as e,u as Q,r as h,e as $e,aG as Wr,aH as _,aI as ln,aJ as Vn,aK as qr,aL as cn,aM as rt,V as M,ad as le,s as re,aN as dn,o as f,aO as Hr,aP as un,aQ as Gr,H as te,M as mn,T as L,t as H,O as fe,aR as Ae,C as K,X as be,v as Z,aS as Xn,Y as pe,K as W,p as mt,aT as Kr,R as V,aE as Ie,a9 as et,N as it,aU as Yr,d as Ht,aV as Oe,aW as me,aa as Vr,aX as Xr,aY as Qr,y as Zr,A as Qn,W as fn,g as pn,h as ne,aZ as Gt,a as At,b as ft,a_ as Zn,a$ as Jn,U as er,a4 as It,b0 as Jr,b1 as ei,b2 as ti,b3 as ni,b4 as ot,i as gn,b5 as ri,b6 as ii,a6 as kt,b7 as oi,a7 as Lt,L as Kt,I as ai,b8 as si,b9 as tr,a8 as li,ba as nr,bb as De,bc as Re,bd as ci,be as Yt,bf as di,$ as rr,D as Ot,f as ir,bg as ui,bh as hn,ak as mi,bi as fi,bj as ee,bk as pi,S as xn,l as yn,m as bn,bl as gi,bm as hi,bn as xi}from"./index-
|
|
1
|
+
import{aF as je,j as e,u as Q,r as h,e as $e,aG as Wr,aH as _,aI as ln,aJ as Vn,aK as qr,aL as cn,aM as rt,V as M,ad as le,s as re,aN as dn,o as f,aO as Hr,aP as un,aQ as Gr,H as te,M as mn,T as L,t as H,O as fe,aR as Ae,C as K,X as be,v as Z,aS as Xn,Y as pe,K as W,p as mt,aT as Kr,R as V,aE as Ie,a9 as et,N as it,aU as Yr,d as Ht,aV as Oe,aW as me,aa as Vr,aX as Xr,aY as Qr,y as Zr,A as Qn,W as fn,g as pn,h as ne,aZ as Gt,a as At,b as ft,a_ as Zn,a$ as Jn,U as er,a4 as It,b0 as Jr,b1 as ei,b2 as ti,b3 as ni,b4 as ot,i as gn,b5 as ri,b6 as ii,a6 as kt,b7 as oi,a7 as Lt,L as Kt,I as ai,b8 as si,b9 as tr,a8 as li,ba as nr,bb as De,bc as Re,bd as ci,be as Yt,bf as di,$ as rr,D as Ot,f as ir,bg as ui,bh as hn,ak as mi,bi as fi,bj as ee,bk as pi,S as xn,l as yn,m as bn,bl as gi,bm as hi,bn as xi}from"./index-DY4IRZzA.js";import{u as yi,T as bi}from"./html-title-CDtGVxaB.js";import{A as vi}from"./ArrowDropDown-Dt1OnkjV.js";import{u as Vt,C as B,a as vn}from"./index.esm-CAXrUMkM.js";import{S as se}from"./switch-control-33eNnRFB.js";import{P as ie}from"./permission-C1lOJdTa.js";import{H as or,g as ji}from"./index-D901ppFO.js";import{A as ar}from"./Link-C0DA-K7d.js";import{A as wi}from"./actions-CfPtVW_5.js";import{S as Ci}from"./Switch-BhNob30A.js";import{D as ve,R as sr,a as Ft,b as Si}from"./url-evaluation-mbcZFwZv.js";import{D as pt}from"./delete-confirm-DLgDxKNU.js";import{v as at}from"./index-C4kPl4ke.js";import{s as ki}from"./logo-BKA11TRi.js";import{u as Di}from"./useLocalStorage-X_cL3pYP.js";import{R as Ri}from"./Refresh-wGxvonur.js";import{L as Ti}from"./LoadingButton-CC22g72o.js";import{C as Ei,R as Pi,P as lr,S as _i}from"./rotate-session-key-ICcx3tCe.js";import{A as Fe}from"./Add-BuqBIDFA.js";import{B as cr,D as jn,W as Ke}from"./status-DA56DtZT.js";import{i as Ai}from"./is-path-prefix-equal-CYEkz2os.js";import{N as Ii}from"./ChevronRight-Cf_5Xzjf.js";import{I as Li}from"./MoreVert-DIAAjKU1.js";import{E as dr}from"./Edit-Dynoa_c5.js";import{A as Oi}from"./CallMerge-C4Y56e44.js";import{C as Fi}from"./CardContent-DIS6zA0P.js";import"./FilterList-DA2GUvmN.js";import"./CSSTransition-Cj0uEEEn.js";import"./emotion-cache.browser.esm-Do6mSgYp.js";import"./index-C18EUjkb.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-46Dc4Ni4.js";import"./index-C3qhc5Io.js";import"./TableSearch-DsykJXmz.js";import"./Search-BcGKbDLr.js";import"./Clear-Ch6COz32.js";import"./click-to-copy-mgbEjAVp.js";import"./visuallyHidden-Dan1xhjv.js";const Ni=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),$i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ui=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),ur=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),zi=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Mi=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Bi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",mr=h.createContext({}),{Provider:Wi,Consumer:fs}=mr,wn=[ye,_.DOMAIN_FOR_IP_SITE,_.DOMAIN_FOR_IP_SITE_REGEXP],qi=(t,r)=>{if(t.name===_.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===_.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=wn.includes(t.name),i=wn.includes(r.name);return n&&i?cn(t.name,r.name):n?-1:i?1:cn(t.name,r.name)},Cn=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:d=[],corsAllowedOrigins:m=[]}=o;let{domain:c,domainAliases:u}=o;u=u||[],[_.DOMAIN_FOR_IP_SITE,_.DOMAIN_FOR_IP_SITE_REGEXP].includes(c)&&(c=ye,u.find(y=>y.value===n)||u.unshift({protected:!1,value:n}));const j={id:s,name:c,type:"domain",items:[],domainAliases:u,isProtected:o.isProtected,corsAllowedOrigins:m};return(d||[]).forEach(y=>{const{id:x,isProtected:D,from:{pathPrefix:b},to:k}=y;if(k.type===_.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(k.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",k.type=_.ROUTING_RULE_TYPES.DAEMON):S=k.did,j.items.push({id:x,name:ln(b||"/"),title:S,type:"rule",isProtected:D,pathPrefix:b,to:k})}else j.items.push({id:x,pathPrefix:b,name:ln(b||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:D,to:k})}),j.items=Vn(j.items,y=>y.name),j}).sort(qi),l=a.reduce((o,s)=>{let{name:d}=s;return d.endsWith(_.BLOCKLET_SITE_GROUP_SUFFIX)&&([d]=d.split(".")),o[d]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Hi=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const d=l.rules.filter(m=>!m.name.startsWith(_.WELLKNOWN_PATH_PREFIX))[0];s=d?d.name:"/"}return rt(o.value,s,a)},Gi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(d=>!d.name.startsWith(_.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>rt(s.value,o,i))},Ki=t=>{const r=t.map(i=>i.domain).filter(i=>![_.DOMAIN_FOR_IP_SITE_REGEXP,_.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function Sn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,d]=h.useState([]),m=$e(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),g=P||[];await Promise.all(g.map(async C=>(C.domainAliases=await Wr(C.domainAliases,{getIP:qr}),C)));const p=Ki(g);a(g),o(p.domains);const v=Cn({sites:g,nodePort:n.port});d((v?.sites||[]).map(C=>C.domainAliases.map(F=>F.value)).filter(C=>C.length))},[n]),c=(P,g)=>{a(p=>p.map(v=>v.id===P?g.domain?g:{...g,domain:v.domain}:v))},u=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),j=async P=>{const g=await r.addRoutingSite({input:P});a(i.concat(g.site))},y=async(P,g)=>{const p=await r.updateRoutingSite({input:{id:P,...g}});if(p.site&&p.site.id){const v=i.findIndex(C=>C.id===p.site.id);v!==-1&&(i.splice(v,1,p.site),a([].concat(i)))}},x=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(g=>g.id!==P))},D=async(P,g,p)=>{const v=await r.addDomainAlias({input:{id:P,domainAlias:g,force:p}});c(P,v.site)},b=async(P,g)=>{const p=await r.deleteDomainAlias({input:{id:P,domainAlias:g}});c(P,p.site)},k=async(P,g)=>{const{site:p}=await r.addRoutingRule({input:{id:P,rule:g}});c(P,p)},S=async(P,g)=>{const{site:p}=await r.updateRoutingRule({input:{id:P,rule:g}});c(P,p)},T=async(P,g)=>{const{site:p}=await r.deleteRoutingRule({input:{id:P,ruleId:g}});c(P,p)},w={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:j,updateSite:y,deleteSite:x,addDomainAlias:D,deleteDomainAlias:b,takeSnapshot:u,addRule:k,updateRule:S,deleteRule:T}},{sites:R,siteMap:E}=Cn({sites:i,nodePort:n.port});return w.sites=R,w.siteMap=E,w.domains=l,w.allDomains=s,w.getBlockletUrl=({did:P,domain:g,mountPoint:p,params:v})=>Hi({did:P,domain:g,mountPoint:p,siteMap:w.siteMap,params:v}),w.getBlockletUrls=({did:P,mountPoint:g,params:p})=>Gi({did:P,mountPoint:g,siteMap:w.siteMap,params:p}),e.jsx(Wi,{value:{routing:w},children:t})}function de(){const{routing:t}=h.useContext(mr);return t}function Xt(t){const r=[_.DOMAIN_FOR_IP_SITE_REGEXP,_.DOMAIN_FOR_DEFAULT_SITE,_.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Yi(){return null}function fr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=M(),a=()=>{n(null)},l=async s=>{if(s){let d=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d==="/"?dn.push(`${s.pathname}`):(d.endsWith("/")&&(d=d.substring(0,d.length-1)),dn.push(`${d}${s.pathname}`)),window.location.reload()}},o=(s,...d)=>{let m=typeof t=="function"?t(s,...d):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Vi,{children:[e.jsx(Yi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}fr.propTypes={confirm:f.oneOfType([f.object,f.string,f.func])};const Vi=re.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-CCv_8omK.js";import{d as Pt,H as at,g as _t}from"./index-4-FW3N_0.js";import{R as _e,S as Bt}from"./actions-DVOuh-Fv.js";import{B as zt}from"./index-BsntE0No.js";import{S as me}from"./shorten-label-CvhqR616.js";import{v as ot}from"./index-BCEB7zAW.js";import{T as Wt}from"./html-title-xzTyg8m0.js";import{R as Mt}from"./Refresh-CGgBW-me.js";import{D as Kt,g as Ht}from"./traffic-DrN7qkrg.js";import{u as qt}from"./use-mobile-DvM8SqYH.js";import"./FilterList-xUYmSJ-Y.js";import"./CSSTransition-Cf_KzaPo.js";import"./emotion-cache.browser.esm-CdT-VIlA.js";import"./index-hu34K3US.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BNz3Z5UN.js";import"./index-DkBdKcP-.js";import"./TableSearch-CAaRXXpO.js";import"./Search-3L2yy5pr.js";import"./Clear-Cz6Yzx0g.js";import"./MoreVert-BUlWqUnK.js";import"./useLocalStorage-CbBU4OS9.js";import"./url-evaluation-B5iexDQo.js";import"./get-safe-url-B_yWzv49.js";import"./ButtonGroup-CMlvIctd.js";import"./getValidReactChildren-BQH98pcn.js";import"./permission-RtK6f5af.js";import"./index.esm-Bsyk9Gld.js";import"./collapse-DjVUQHBf.js";import"./blocklet-D2MB-zOx.js";import"./Switch-B-AVsYNw.js";import"./iframe-DhbAf7eB.js";import"./ChevronLeft-OivB2aTv.js";import"./ChevronRight-CV3PmYHH.js";import"./index-DBii9-f-.js";import"./base-chart-AQkuFrPC.js";import"./index-CEPQQlo6.js";import"./AdapterDayjs-AIDIzsfb.js";import"./useThemeProps-CRd6upHX.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),$t=Ge(e.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"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),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,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.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(U,{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(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),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(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-DY4IRZzA.js";import{d as Pt,H as at,g as _t}from"./index-D901ppFO.js";import{R as _e,S as Bt}from"./actions-C85Hfsv7.js";import{B as zt}from"./index-Dy6LJdxo.js";import{S as me}from"./shorten-label-BguF3cwJ.js";import{v as ot}from"./index-C4kPl4ke.js";import{T as Wt}from"./html-title-CDtGVxaB.js";import{R as Mt}from"./Refresh-wGxvonur.js";import{D as Kt,g as Ht}from"./traffic-QPS_JGtF.js";import{u as qt}from"./use-mobile-v1FgCHxE.js";import"./FilterList-DA2GUvmN.js";import"./CSSTransition-Cj0uEEEn.js";import"./emotion-cache.browser.esm-Do6mSgYp.js";import"./index-C18EUjkb.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-46Dc4Ni4.js";import"./index-C3qhc5Io.js";import"./TableSearch-DsykJXmz.js";import"./Search-BcGKbDLr.js";import"./Clear-Ch6COz32.js";import"./MoreVert-DIAAjKU1.js";import"./useLocalStorage-X_cL3pYP.js";import"./url-evaluation-mbcZFwZv.js";import"./get-safe-url-D4wQQAus.js";import"./ButtonGroup-BtGO-VCX.js";import"./getValidReactChildren-C1VhNdur.js";import"./permission-C1lOJdTa.js";import"./index.esm-CAXrUMkM.js";import"./collapse-DPhRCMT_.js";import"./blocklet-DrlbndLu.js";import"./Switch-BhNob30A.js";import"./iframe-n69t61B3.js";import"./ChevronLeft-ByepaSoC.js";import"./ChevronRight-Cf_5Xzjf.js";import"./index-DBii9-f-.js";import"./base-chart-CNeCrWCe.js";import"./index-DVercaqG.js";import"./AdapterDayjs-CBmYJq_c.js";import"./useThemeProps-BS8q21Ze.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),$t=Ge(e.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"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),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,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.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(U,{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(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),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(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,p as n,j as t,s as r}from"./index-
|
|
1
|
+
import{r as o,p as n,j as t,s as r}from"./index-DY4IRZzA.js";import{p as a}from"./index-alA_n9r0.js";function c(){const{t:s}=o.useContext(n);return t.jsx(e,{style:{paddingTop:"25vh"},children:t.jsx(a,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const e=r.main``;export{c as default};
|