@abtnode/blocklet-services 1.16.43-beta-20250502-005537-bb1702b6 → 1.16.43-beta-20250505-062139-b156e7da
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-BWhMsmQP.js → AdapterDayjs-Bxdv5BBD.js} +1 -1
- package/dist/assets/{ArrowDropDown-DUCtp8oo.js → ArrowDropDown-CtOiDsfU.js} +1 -1
- package/dist/assets/{CheckCircle-yKW43XdV.js → CheckCircle-msbMBqZj.js} +1 -1
- package/dist/assets/{ChevronLeft-6AvuBihM.js → ChevronLeft-DmV9D3fU.js} +1 -1
- package/dist/assets/{ChevronRight-BsdsjNxw.js → ChevronRight-Br0ablb7.js} +1 -1
- package/dist/assets/{DeleteOutline-D_I07sPe.js → DeleteOutline-BU7WZ4i1.js} +1 -1
- package/dist/assets/{Done-DLTvHdZB.js → Done-SwUOq9KC.js} +1 -1
- package/dist/assets/{Download-DKz_gZX5.js → Download-Drp0bexG.js} +1 -1
- package/dist/assets/{Edit-odNPT5GK.js → Edit-CFF31Js3.js} +1 -1
- package/dist/assets/{Error-js7ePZ5o.js → Error-2fR4-pmz.js} +1 -1
- package/dist/assets/{ExpandLess-TUium4RQ.js → ExpandLess-C2a4bF6C.js} +1 -1
- package/dist/assets/{Google-C7d25Q5r.js → Google-ZTmw0mlG.js} +1 -1
- package/dist/assets/{InfoOutlined-BjII93aR.js → InfoOutlined-hS_Bn_IB.js} +1 -1
- package/dist/assets/{Launch-ryL3I8d9.js → Launch-BvpJnrFC.js} +1 -1
- package/dist/assets/{LaunchOutlined-D21Xchdf.js → LaunchOutlined-DwFeZSV7.js} +1 -1
- package/dist/assets/{MoreHoriz-DHyMdwpT.js → MoreHoriz-DrhBbQGZ.js} +1 -1
- package/dist/assets/{PlayArrow-zDVVYX6u.js → PlayArrow-CeIK7-yb.js} +1 -1
- package/dist/assets/{TuneOutlined-Bv7cSbWT.js → TuneOutlined-B-fSgZvP.js} +1 -1
- package/dist/assets/{ViewList-Ca1IEB31.js → ViewList-CAnQTEEQ.js} +1 -1
- package/dist/assets/{access-control-CwSjARsN.js → access-control-DygMvGXu.js} +1 -1
- package/dist/assets/{actions-BW0Vx00_.js → actions-BEVLXA8P.js} +1 -1
- package/dist/assets/{add-component-core-DXp_ntZ3.js → add-component-core-BLsZRe6K.js} +18 -18
- package/dist/assets/{add-resource-CmPIp37F.js → add-resource-uxj6Fg77.js} +1 -1
- package/dist/assets/{addon-FArG2oUy.js → addon-DPxkCqqP.js} +1 -1
- package/dist/assets/{advanced-mJXTlRFz.js → advanced-RHwLVN7K.js} +1 -1
- package/dist/assets/{appearance-D9WrcbPF.js → appearance-BeAcEscd.js} +1 -1
- package/dist/assets/{ar-Duy7ZH--.js → ar-5Vd7BsNt.js} +2 -2
- package/dist/assets/{audit-logs-CVUuBgdy.js → audit-logs-CPqbAeYP.js} +1 -1
- package/dist/assets/authorize-DsVtgYBZ.js +1 -0
- package/dist/assets/{base32-C_EKY5vU.js → base32-CwrkOaA2.js} +1 -1
- package/dist/assets/{branding-Cywl-fod.js → branding-D8yn967G.js} +1 -1
- package/dist/assets/{branding-BoSHL25b.js → branding-DtA4kERo.js} +2 -2
- package/dist/assets/{bundle-avatar-BXQsJw7m.js → bundle-avatar-DB3E7EOv.js} +1 -1
- package/dist/assets/{button-h00yLUET.js → button-Cd9-2VCv.js} +1 -1
- package/dist/assets/{click-to-copy-0s0a7Ak5.js → click-to-copy-j_gx9gFG.js} +1 -1
- package/dist/assets/{complete--raviZZ4.js → complete-ByIPtiSe.js} +1 -1
- package/dist/assets/{component-C3maTG8x.js → component-Cmj8wMD5.js} +1 -1
- package/dist/assets/{config-e3P85n7z.js → config-BNKhoBDx.js} +1 -1
- package/dist/assets/{config-Die5cVWR.js → config-CQRZ09xB.js} +1 -1
- package/dist/assets/{config-navigation-DhvlW96p.js → config-navigation-C1Z6kyB3.js} +3 -3
- package/dist/assets/{config-space-CHI2AzS5.js → config-space-CcDRmzuH.js} +1 -1
- package/dist/assets/{confirm-BqrhdaU7.js → confirm-oEG91BF3.js} +1 -1
- package/dist/assets/{connect-cpTXz6hq.js → connect-C9XH2QgZ.js} +1 -1
- package/dist/assets/{connect-DGOqnhoS.js → connect-DB3ixc3c.js} +1 -1
- package/dist/assets/{connect-to-C1xSYa-8.js → connect-to-B_yuzVhS.js} +1 -1
- package/dist/assets/{dashboard-CvJ8cVy-.js → dashboard-DyRSlDZ8.js} +3 -3
- package/dist/assets/{de-jJ-wrtW1.js → de-oCaVyGvF.js} +2 -2
- package/dist/assets/{delete-confirm-CmXluMcs.js → delete-confirm-4a9iCk5U.js} +1 -1
- package/dist/assets/{did-address-C6ni99I7.js → did-address-DXsoioR-.js} +1 -1
- package/dist/assets/{domain-B7m2mZGp.js → domain-CuSBV4D5.js} +1 -1
- package/dist/assets/{domain-action-card-DIGUxqW7.js → domain-action-card-BH2naaFL.js} +1 -1
- package/dist/assets/domains-BSI91pSw.js +1 -0
- package/dist/assets/{email-CxndZMem.js → email-BLXsjGCd.js} +1 -1
- package/dist/assets/{es-CoGP0eAj.js → es-BUCdgg9a.js} +2 -2
- package/dist/assets/{exchange-passport-JjK-mItt.js → exchange-passport-xhqvffW9.js} +1 -1
- package/dist/assets/{fr-yctlgsrj.js → fr-BDos80TL.js} +2 -2
- package/dist/assets/{fuel-bktBZZhG.js → fuel-kVR_XCvg.js} +1 -1
- package/dist/assets/{gen-access-key-CPCwDcVa.js → gen-access-key-C9I6m66S.js} +1 -1
- package/dist/assets/{get-safe-url-C-CJKtkC.js → get-safe-url-DGnHBj8n.js} +1 -1
- package/dist/assets/{get-safe-url-cyoeQ7Mw.js → get-safe-url-R3dJEaue.js} +1 -1
- package/dist/assets/{hi-Dh_pGPBD.js → hi-DwEZmyg8.js} +1 -1
- package/dist/assets/{home-BclSkhw2.js → home-BWQuOq0X.js} +1 -1
- package/dist/assets/{id-cicarMJv.js → id-BVUMyK9S.js} +2 -2
- package/dist/assets/{iframe-DZlnwo40.js → iframe-CsfqLmob.js} +1 -1
- package/dist/assets/{index-htPha6tP.js → index-B72n4V2s.js} +1 -1
- package/dist/assets/{index-C4pzdyRW.js → index-Be-8LeGB.js} +1 -1
- package/dist/assets/{index-CiIQJxvH.js → index-Bf8i5DPA.js} +1 -1
- package/dist/assets/{index-DdLPuFP7.js → index-C2QrzzaU.js} +1 -1
- package/dist/assets/{index-C8EYAWok.js → index-CjjuFvKr.js} +4 -4
- package/dist/assets/{index-BAstW3VS.js → index-D10IrMQr.js} +1 -1
- package/dist/assets/{index-17ov_POl.js → index-DJxPLtmA.js} +1 -1
- package/dist/assets/{index-CksPySYI.js → index-DMRB_27Q.js} +5 -5
- package/dist/assets/{index-BhX4Vx5B.js → index-DQ5v58Z8.js} +1 -1
- package/dist/assets/{index-C0x4zVBW.js → index-DYxnn9uv.js} +2 -2
- package/dist/assets/{index-Bdi900W2.js → index-Db1S67Mk.js} +3 -3
- package/dist/assets/{index-DJeuTVoT.js → index-DcUWE37M.js} +3 -3
- package/dist/assets/{index-C-rU1lEd.js → index-WYf-xVMZ.js} +1 -1
- package/dist/assets/{index-D_z5kVUS.js → index-aGp3zmpA.js} +1 -1
- package/dist/assets/{index-CLD6I2fv.js → index-bodAuphN.js} +1 -1
- package/dist/assets/{index-BugTfB-J.js → index-gw8hsltc.js} +1 -1
- package/dist/assets/{index-COTyGW2s.js → index-tf7PEogm.js} +1 -1
- package/dist/assets/{index-DxR1P6Lh.js → index-v90LUntw.js} +4 -4
- package/dist/assets/{invitation-sucipANy.js → invitation-UWUoMJEH.js} +1 -1
- package/dist/assets/{invite-Bkpf8YcY.js → invite-CGi_9MV3.js} +1 -1
- package/dist/assets/{issue-passport-Dm4XKvqR.js → issue-passport-Ca9_iJlv.js} +1 -1
- package/dist/assets/{item-CCsztPdL.js → item-BA9iP7co.js} +1 -1
- package/dist/assets/{ja-Bm56AvcM.js → ja-CFMQ-LyA.js} +2 -2
- package/dist/assets/{ko-B0ZZ2RWO.js → ko-NIkLevaH.js} +2 -2
- package/dist/assets/landing-page-Blz2w-aH.js +1 -0
- package/dist/assets/{layout-DV03YuuA.js → layout-DW9l-R-4.js} +1 -1
- package/dist/assets/{list-BgP6u-5j.js → list-VlrLfNLt.js} +1 -1
- package/dist/assets/localization-CtfwjqIp.js +1 -0
- package/dist/assets/{log-B4LRFTNR.js → log-CetSCivl.js} +1 -1
- package/dist/assets/{logger-8RyN9oiF.js → logger-DXiDU1hr.js} +1 -1
- package/dist/assets/{login-oauth-callback-CPP0UVME.js → login-oauth-callback-Cz4HDfxL.js} +1 -1
- package/dist/assets/{login-B6TE3gqj.js → login-pGpA2dx5.js} +1 -1
- package/dist/assets/{logo-uploader-DMxsEq63.js → logo-uploader-hb4ghrVp.js} +3 -3
- package/dist/assets/{lost-passport-ekwdQ24A.js → lost-passport-BrhFEayy.js} +1 -1
- package/dist/assets/{open-window-BjXpEOv2.js → open-window-BqTbT6lB.js} +1 -1
- package/dist/assets/{overview-CJRHh92f.js → overview-B3dRi3yE.js} +1 -1
- package/dist/assets/{page-header-MKUHlyAT.js → page-header-BYtqLM5e.js} +1 -1
- package/dist/assets/{passport-item-jrknj0MQ.js → passport-item-FiBabn6e.js} +1 -1
- package/dist/assets/{permission-PNXSTeNL.js → permission-B0bwGXNp.js} +1 -1
- package/dist/assets/{preferences-9BJlt30G.js → preferences-vpGHHPV1.js} +1 -1
- package/dist/assets/{profile-embed-CIWdUuC6.js → profile-embed-BhW6p4Xz.js} +1 -1
- package/dist/assets/{pt-6Xqu-_a4.js → pt-CDHE_zWG.js} +1 -1
- package/dist/assets/{publish-resource-BQg2Vwb0.js → publish-resource-8ginQRUx.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-C1Wt0pHO.js → react-beautiful-dnd.esm-J_09ZTBJ.js} +1 -1
- package/dist/assets/{relative-time-cijkMMnc.js → relative-time-Ca1sd_aF.js} +1 -1
- package/dist/assets/{ru-y0N1jyVB.js → ru-l1raGUU5.js} +1 -1
- package/dist/assets/{runtime-71FSw-R0.js → runtime-CS1kGNvF.js} +1 -1
- package/dist/assets/sdk-DGCdjl0b.js +1 -0
- package/dist/assets/{security-Y5seZEn6.js → security-CgsJIaze.js} +1 -1
- package/dist/assets/{session-DLQ0rbYE.js → session-B_RsakU4.js} +1 -1
- package/dist/assets/{setup-4hj9RPfM.js → setup-Bpmp0hS9.js} +3 -3
- package/dist/assets/{spaces-CP1iyRKS.js → spaces-DHRCc5pJ.js} +1 -1
- package/dist/assets/{start-Bt5Vo3K8.js → start-b8VtKWzD.js} +1 -1
- package/dist/assets/{starting-progress-yIv14mT6.js → starting-progress-Cq6oMvtd.js} +1 -1
- package/dist/assets/{status-BKlS-OSq.js → status-BUWzSxch.js} +1 -1
- package/dist/assets/{step-actions-DMwF4axn.js → step-actions-tjbtKF9G.js} +1 -1
- package/dist/assets/{studio-BR3c6nt5.js → studio-Dt-yrfsf.js} +1 -1
- package/dist/assets/{switch-control-yJOWKqcv.js → switch-control-CYExQdC4.js} +1 -1
- package/dist/assets/{th-CJa7646q.js → th-BBE2_3AB.js} +1 -1
- package/dist/assets/{traffic-BzRbyLJ-.js → traffic-cstjgILR.js} +1 -1
- package/dist/assets/{transfer-Ds9NQ12A.js → transfer-Ceah-H6_.js} +1 -1
- package/dist/assets/{unsubscribe-hfXD8-ea.js → unsubscribe-DqbdiPdh.js} +1 -1
- package/dist/assets/{use-blocklet-logo-BOYeM9RY.js → use-blocklet-logo-ZrVs0Fgp.js} +1 -1
- package/dist/assets/{useLocalStorage-CXDkfohf.js → useLocalStorage-B_V0diy4.js} +1 -1
- package/dist/assets/{user-center-CBh-mxjZ.js → user-center-BNt97_Oy.js} +1 -1
- package/dist/assets/{util-D-LnEy9h.js → util-CxKY-YuQ.js} +1 -1
- package/dist/assets/{util-DJFgW-07.js → util-DmIsJ5RI.js} +1 -1
- package/dist/assets/{vendor-arcblock-Dkhgjlzn.js → vendor-arcblock-DpCuGvAS.js} +2 -2
- package/dist/assets/{vendor-ux-did-connect-D4-ZeZHm.js → vendor-ux-did-connect-CeGz2B7G.js} +39 -35
- package/dist/assets/{vi-Rc5fwdQU.js → vi-CVeuRNnr.js} +1 -1
- package/dist/assets/wrap-locale-DcoOFDfm.js +1 -0
- package/dist/assets/{zh-J32RyrWT.js → zh-BQbRU3Dp.js} +2 -2
- package/dist/assets/{zh-tw-BSUxp5LQ.js → zh-tw-Ca0tJhqz.js} +2 -2
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +30 -30
- package/dist/assets/authorize-Bk0sIDAH.js +0 -1
- package/dist/assets/domains-DV-Gl3-a.js +0 -1
- package/dist/assets/landing-page-BJMRDSCP.js +0 -1
- package/dist/assets/localization-CTzQFuMS.js +0 -1
- package/dist/assets/sdk-BXECCi1q.js +0 -1
- package/dist/assets/wrap-locale-Dob_mf2V.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad as jt,T as J,aa as C,E as _e,bp as Fe,bA as et,bR as Te,bt as Re,bS as Ie,y as Se,b4 as Ee,ab as tt,ah as ce,a1 as st,m as yt,bd as Xe,bs as vt,bo as St,q as Ze,bZ as Ct}from"./vendor-mui-core-B6POpIBB.js";import{e as ie,aA as ue,C as Nt}from"./vendor-utils-CjMBJT5V.js";import{a2 as Z,n as P,ba as wt,r as ke,F as Tt,u as te,bS as Rt,a1 as nt,a as De,ab as at,bp as je,aq as It,av as Et,bw as Dt}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{z as At,t as V,l as Ot,I as Je}from"./index-CksPySYI.js";import{f as ee,a as Ae}from"./vendor-hooks-DXGUREV9.js";import{S as he}from"./shorten-label-SbKUBkvs.js";import{I as it}from"./index-D_z5kVUS.js";import{A as Lt,S as Pt,a as _t,b as Ft,B as kt}from"./list-BgP6u-5j.js";import{R as Be}from"./relative-time-cijkMMnc.js";import{a as ze}from"./dashboard-CvJ8cVy-.js";import{W as Bt}from"./did-address-C6ni99I7.js";import{p as ot}from"./util-D-LnEy9h.js";import{D as zt,g as Wt}from"./traffic-BzRbyLJ-.js";import{i as Mt,b as qt}from"./use-blocklet-logo-BOYeM9RY.js";import{B as rt}from"./bundle-avatar-BXQsJw7m.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Dkhgjlzn.js";import"./index-DIe9psLc.js";import"./sdk-BXECCi1q.js";import"./InfoOutlined-BjII93aR.js";import"./CheckCircle-yKW43XdV.js";import"./index-C-rU1lEd.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-CXDkfohf.js";import"./confirm-BqrhdaU7.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./session-DLQ0rbYE.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./base32-C_EKY5vU.js";import"./iframe-DZlnwo40.js";import"./LaunchOutlined-D21Xchdf.js";import"./ChevronLeft-6AvuBihM.js";import"./ChevronRight-BsdsjNxw.js";import"./index-BUHlfcy3.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-BWhMsmQP.js";const lt=j.createContext({}),{Provider:Kt,Consumer:mn}=lt;function $t({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=j.useState([]),[u,R]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=j.useState([]),[I,M]=j.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Q="";B&&B.includes("system")&&(Q="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Q,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),R(se.paging),se.list}catch(_){return Z.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=j.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),$=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},H=j.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=j.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw Z.error(_.message),_}},[n,m]);j.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const k={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:$,getUser:H,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(Kt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(wt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,Vt=Ut(ke()),Gt=e;ct=Me.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Yt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Xt=Yt(ke()),Zt=e;dt=qe.default=(0,Xt.default)((0,Zt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(ke()),es=e;ut=Ke.default=(0,Qt.default)((0,es.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const ts=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Ot(o,s)}):"",R=ts(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:R}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:R,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ss=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ns=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},as=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),is=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),os=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},rs=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ls=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>Tt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:R}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}$e.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 $e({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:R=>{const m=[...t];R.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}He.propTypes={value:d.array.isRequired,onChange:d.func};function He({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=j.useState(null),x=j.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=j.useCallback(m=>{if(!m.startDate||!m.endDate){Z.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){Z.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Je(t[0],n)," - ",Je(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Wt(r),onChange:R})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const cs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=j.useState(cs),[x,u]=j.useState(!0),R=(v,S)=>{S.checked=v.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=v=>{v.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(J,{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(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>R(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:R,blocklet:m}=We(),[v,S]=j.useState(!1),[I,M]=j.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=j.useState(null),[$,H]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=j.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),H(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};j.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Q={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:$.page-1,rowsPerPage:$.pageSize,count:$.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:y})=>{const[,F=[],U=[],K=[]]=y;N.pageSize!==l?k(W=>({...W,pageSize:l,page:1})):N.page!==i+1?k(W=>({...W,page:i+1})):N.searchText!==c?k(W=>({...W,searchText:c,page:1})):ue(F,N.walletSendStatus)?ue(U,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:U,page:1})):k(W=>({...W,walletSendStatus:F,page:1}))},oe=j.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?as(c):i==="email"?ss(m,c):i==="pushKit"?ns(m,c):i==="webhook"?is(c):!0:!1},[R,m]),se=j.useCallback(i=>os(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,y="")=>{if(!(!l.length||!i.length))try{s(i,l,c,y),L.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(y=>I[y].receiver);await g(i,c,l),await xe(.5),p(),O([])},T=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(y){Z.error(y.response?y.response.statusText:y.message)}},w=async(i,l,c,y=[],F=!0)=>{if(i.stopPropagation(),rs(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,y,F);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Nt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],F),L.anchorEl||(await xe(.5),f()))}catch(K){Z.error(K.message)}},Y=i=>{k(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,y)=>{i.stopPropagation();const F=c.filter(U=>U!==l);k(U=>({...U,[y]:F,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(Bt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:y,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:F=>w(F,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>w(F,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"email",onResend:F=>w(F,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,F]=c,U=F[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:y},y),e.jsx(de,{status:U.status,updatedAt:U.sendAt,reason:U.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[y],!1)})]},y)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(He,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(us,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx(Ue,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ps,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var F,U;const{type:l,pass:c,fail:y}=i;return!(D!=null&&D.result)||(F=D==null?void 0:D.result)!=null&&F[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(U=D==null?void 0:D.result)!=null&&U[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:b})})]})})})}const ds=j.memo(gt),us=ce.div`
|
|
1
|
+
import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad as jt,T as J,aa as C,E as _e,bp as Fe,bA as et,bR as Te,bt as Re,bS as Ie,y as Se,b4 as Ee,ab as tt,ah as ce,a1 as st,m as yt,bd as Xe,bs as vt,bo as St,q as Ze,bZ as Ct}from"./vendor-mui-core-B6POpIBB.js";import{e as ie,aA as ue,C as Nt}from"./vendor-utils-CjMBJT5V.js";import{a2 as Z,n as P,ba as wt,r as ke,F as Tt,u as te,bT as Rt,a1 as nt,a as De,ab as at,bq as je,aq as It,av as Et,bx as Dt}from"./vendor-ux-did-connect-CeGz2B7G.js";import{z as At,t as V,l as Ot,I as Je}from"./index-DMRB_27Q.js";import{f as ee,a as Ae}from"./vendor-hooks-DXGUREV9.js";import{S as he}from"./shorten-label-SbKUBkvs.js";import{I as it}from"./index-aGp3zmpA.js";import{A as Lt,S as Pt,a as _t,b as Ft,B as kt}from"./list-VlrLfNLt.js";import{R as Be}from"./relative-time-Ca1sd_aF.js";import{a as ze}from"./dashboard-DyRSlDZ8.js";import{W as Bt}from"./did-address-DXsoioR-.js";import{p as ot}from"./util-CxKY-YuQ.js";import{D as zt,g as Wt}from"./traffic-cstjgILR.js";import{i as qt,b as Mt}from"./use-blocklet-logo-ZrVs0Fgp.js";import{B as rt}from"./bundle-avatar-DB3E7EOv.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DpCuGvAS.js";import"./index-DIe9psLc.js";import"./sdk-DGCdjl0b.js";import"./InfoOutlined-hS_Bn_IB.js";import"./CheckCircle-msbMBqZj.js";import"./index-WYf-xVMZ.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-B_V0diy4.js";import"./confirm-oEG91BF3.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-CeIK7-yb.js";import"./get-safe-url-DGnHBj8n.js";import"./session-B_RsakU4.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./base32-CwrkOaA2.js";import"./iframe-CsfqLmob.js";import"./LaunchOutlined-DwFeZSV7.js";import"./ChevronLeft-DmV9D3fU.js";import"./ChevronRight-Br0ablb7.js";import"./index-BUHlfcy3.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-Bxdv5BBD.js";const lt=j.createContext({}),{Provider:Kt,Consumer:mn}=lt;function $t({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=j.useState([]),[u,R]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=j.useState([]),[I,q]=j.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...M}=_;let Q="";B&&B.includes("system")&&(Q="system");const z=B?B.filter(f=>f!=="system"):[],oe={...M,source:Q,componentDids:z},se=await n.getNotificationSendLog({input:oe});return q(oe),x(se.list),R(se.paging),se.list}catch(_){return Z.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=j.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),$=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},H=j.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=j.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw Z.error(_.message),_}},[n,m]);j.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const k={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:$,getUser:H,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(Kt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(wt,{type:Ht[t],children:t})}var qe={},Ut=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Vt=Ut(ke()),Gt=e;ct=qe.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var Me={},Yt=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var dt=Me.default=void 0,Xt=Yt(ke()),Zt=e;dt=Me.default=(0,Xt.default)((0,Zt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(ke()),es=e;ut=Ke.default=(0,Qt.default)((0,es.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const ts=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Ot(o,s)}):"",R=ts(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:R}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:R,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ss=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ns=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},as=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),is=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),os=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},rs=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ls=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>Tt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:R}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}$e.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 $e({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:R=>{const m=[...t];R.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}He.propTypes={value:d.array.isRequired,onChange:d.func};function He({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=j.useState(null),x=j.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=j.useCallback(m=>{if(!m.startDate||!m.endDate){Z.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){Z.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Je(t[0],n)," - ",Je(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Wt(r),onChange:R})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const cs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=j.useState(cs),[x,u]=j.useState(!0),R=(v,S)=>{S.checked=v.target.checked;const I=o.map(q=>({...q,checked:q.value===S.value?S.checked:q.checked}));a(I)},m=v=>{v.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(J,{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(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>R(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:R,blocklet:m}=We(),[v,S]=j.useState(!1),[I,q]=j.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=j.useState(null),[$,H]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=j.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));q(l),H(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};j.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},M=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Q={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:$.page-1,rowsPerPage:$.pageSize,count:$.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:M},z=({page:i,rowsPerPage:l,searchText:c,filterList:y})=>{const[,F=[],U=[],K=[]]=y;N.pageSize!==l?k(W=>({...W,pageSize:l,page:1})):N.page!==i+1?k(W=>({...W,page:i+1})):N.searchText!==c?k(W=>({...W,searchText:c,page:1})):ue(F,N.walletSendStatus)?ue(U,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:U,page:1})):k(W=>({...W,walletSendStatus:F,page:1}))},oe=j.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?as(c):i==="email"?ss(m,c):i==="pushKit"?ns(m,c):i==="webhook"?is(c):!0:!1},[R,m]),se=j.useCallback(i=>os(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,y="")=>{if(!(!l.length||!i.length))try{s(i,l,c,y),L.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(y=>I[y].receiver);await g(i,c,l),await xe(.5),p(),O([])},T=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(y){Z.error(y.response?y.response.statusText:y.message)}},w=async(i,l,c,y=[],F=!0)=>{if(i.stopPropagation(),rs(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,y,F);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Nt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],F),L.anchorEl||(await xe(.5),f()))}catch(K){Z.error(K.message)}},Y=i=>{k(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,y)=>{i.stopPropagation();const F=c.filter(U=>U!==l);k(U=>({...U,[y]:F,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(Bt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:y,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:F=>w(F,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>w(F,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"email",onResend:F=>w(F,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,F]=c,U=F[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:y},y),e.jsx(de,{status:U.status,updatedAt:U.sendAt,reason:U.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[y],!1)})]},y)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(He,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(us,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx(Ue,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ps,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var F,U;const{type:l,pass:c,fail:y}=i;return!(D!=null&&D.result)||(F=D==null?void 0:D.result)!=null&&F[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(U=D==null?void 0:D.result)!=null&&U[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:b})})]})})})}const ds=j.memo(gt),us=ce.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -27,7 +27,7 @@ import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad
|
|
|
27
27
|
}
|
|
28
28
|
font-size: 12px;
|
|
29
29
|
}
|
|
30
|
-
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function fs(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function ms(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:R}=s,m=ls(t),v=n?x.length:x,S=n?u.length:u,I=n?R.length:R,
|
|
30
|
+
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function fs(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function ms(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:R}=s,m=ls(t),v=n?x.length:x,S=n?u.length:u,I=n?R.length:R,q=async G=>{G.stopPropagation();const $=n?[...new Set([...x,...u].map(H=>H))]:[];await r([t],[],!0,$)},E=v+S,L=E>0?v/E*100:0,D=E>0?S/E*100:0;return e.jsxs(hs,{successRatio:L,failedRatio:D,children:[e.jsxs(J,{variant:"h6",children:[m," (",s.total,")"]}),e.jsxs(J,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:a("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(ne,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",a("notification.sendStatus.failed")]}),e.jsxs(ne,{config:{status:"pending"},enableTooltip:!1,children:[fe(I)," ",a("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(De,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:q,children:a("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:r}){const o=ee(()=>s==="simple"?fs(t):ms(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(a=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:a.name,children:a.value},a.name))}):e.jsx(Xe,{container:!0,spacing:2,children:o.map(a=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:a.value},a.name))})}const hs=ce(C)`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
align-items: flex-start;
|
|
@@ -45,7 +45,7 @@ import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad
|
|
|
45
45
|
bottom: 0;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=We(),[R,m]=j.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=Ae({tab:r||"info"}),I=j.useCallback(async(h,O,A=!0,_=[])=>{var Q;if(!h.length||!t.id)return;const B=O.length>0?O:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map(z=>z.receiver);if(!B.length)return;let
|
|
48
|
+
`;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=We(),[R,m]=j.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=Ae({tab:r||"info"}),I=j.useCallback(async(h,O,A=!0,_=[])=>{var Q;if(!h.length||!t.id)return;const B=O.length>0?O:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map(z=>z.receiver);if(!B.length)return;let M=[...h];if(M.includes(P.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),M=M.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.PUSH)),M.includes(P.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),M=M.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!M.length)try{m(!0),await u({notificationId:t.id,receivers:B,channels:M,resendFailedOnly:A,...M.includes("webhook")&&_.length?{webhookUrls:_}:{}}),Z.success("Message has been sent!")}catch(z){console.error("handleResend error",{error:z}),Z.error(z.response?z.response.statusText:z.message)}finally{m(!1)}},[n,t.id,t==null?void 0:t.receivers,u,o]),q=ee(()=>qt(t),[t]),E=ee(()=>Mt(t),[t]),L=ee(()=>q?t==null?void 0:t.actorInfo:[],[t]),D=ee(()=>{var h;return(n==null?void 0:n.did)||((h=n==null?void 0:n.meta)==null?void 0:h.did)||""},[n]);function G(){return[{name:o("notification.from"),value:q&&E?e.jsx(Lt,{actors:L,teamDid:D,size:32,showName:!0}):e.jsx(Pt,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(he,{maxLength:50,children:t.title})},{name:o("notification.body"),value:q?e.jsx(_t,{notification:t,blocklet:n}):e.jsx(Ft,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(ge,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Be,{value:t.createdAt,locale:a,shouldUpdate:!0})}].map(O=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:O.name,children:O.value},O.name))}const $={info:{label:o("common.basicInfo"),value:"info",component:G},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},H=Object.values($).map(({label:h,value:O})=>({label:h,value:O})),N=$[S.tab]||$.info,k=h=>{S.tab=h};return e.jsx(It,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(xs,{children:[e.jsx(C,{mx:3,className:"tabs",children:e.jsx(Et,{tabs:H,current:S.tab,onChange:k,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(ds,{notificationId:t.id,resending:R,handleResend:I}),S.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:R,onResend:I}),S.tab==="info"&&e.jsx(N.component,{})]})]})})}const gs=j.memo(xt),xs=ce.div`
|
|
49
49
|
& > .notification-row {
|
|
50
50
|
padding: 0;
|
|
51
51
|
}
|
|
@@ -92,7 +92,7 @@ import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad
|
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
94
94
|
}
|
|
95
|
-
`;function me({blocklet:t,label:s}){var n;return e.jsx(bs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function js(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function ys({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=j.useState(!1),{data:a,paging:x,blocklet:u,fetch:R,getComponent:m,componentDids:v,inService:S,teamDid:I}=We(),
|
|
95
|
+
`;function me({blocklet:t,label:s}){var n;return e.jsx(bs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function js(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function ys({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=j.useState(!1),{data:a,paging:x,blocklet:u,fetch:R,getComponent:m,componentDids:v,inService:S,teamDid:I}=We(),q=j.useRef(null),[E,L]=j.useState(null),[D,G]=j.useState("info"),$=`notification-records-${(se=u.meta)==null?void 0:se.did}`,H=Dt($),[N,k]=j.useState({pageSize:H.rowsPerPage||10,page:H.page?H.page+1:1,dids:H.dids||[],dateRange:H.dateRange||[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),h=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var b;const g=p.did||((b=p.meta)==null?void 0:b.did);v.includes(g)&&(p.ancestors=[u],f.push(p))}),f},[v,u]),O=async f=>{try{o(!0),await R(f),o(!1)}finally{o(!1)}};j.useEffect(()=>{O(N)},[N]),j.useEffect(()=>{const f=a.find(p=>p.id===(E==null?void 0:E.id));E&&f&&L({...f})},[a]);const A=(f,p,g,b)=>{f.stopPropagation();const T=g.filter(w=>w!==p);k(w=>({...w,[b]:T,page:1}))},_=({page:f,rowsPerPage:p,filterList:g})=>{const[b=[],,,,T=[]]=g;N.pageSize!==p?k(w=>({...w,pageSize:p,page:1})):N.page!==f+1?k(w=>({...w,page:f+1})):ue(N.dids,b)?ue(N.severities,T)||k(w=>({...w,severities:T,page:1})):k(w=>({...w,dids:b,page:1}))},B=j.useCallback(()=>{L(null),G("info")},[]),M=j.useCallback(()=>{R(N)},[R,N]),Q=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,g)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const b=h.find(w=>{var X;return(w.did||((X=w.meta)==null?void 0:X.did))===p});return e.jsx(me,{blocklet:b,label:(b==null?void 0:b.title)||((T=b==null?void 0:b.meta)==null?void 0:T.title)},p)}),update:(f,p,g)=>(f[g].splice(p,1),f)},filterOptions:{names:h,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,g,b)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(vt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[g],renderValue:T=>e.jsx(C,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(w=>{var X;if(w==="system")return e.jsx("span",{children:s("notification.system")},w);const Y=h.find(ae=>{var i;return(ae.did||((i=ae.meta)==null?void 0:i.did))===w});return e.jsx(me,{blocklet:Y,label:(Y==null?void 0:Y.title)||((X=Y==null?void 0:Y.meta)==null?void 0:X.title)},w)})}),onChange:T=>{f[g]=T.target.value,p(f[g],g,b)},children:[e.jsx(Ze,{value:"system",children:s("notification.system")}),h.map(T=>{var Y,X;const w=T.did||((Y=T.meta)==null?void 0:Y.did);return e.jsx(Ze,{value:w,children:e.jsx(me,{blocklet:T,label:T.title||((X=T.meta)==null?void 0:X.title)})},w)})]})]})},customBodyRenderLite:f=>{var b,T;const p=a[f],g=m(p.componentDid);return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(rt,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(kt,{blocklet:u,size:32}),e.jsx(he,{maxLength:50,children:((b=g==null?void 0:g.meta)==null?void 0:b.title)||((T=u==null?void 0:u.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f],{receivers:g}=p;return e.jsx(Ct,{total:g.length,renderSurplus:b=>b<100?e.jsxs("span",{children:["+",b]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:b=>{b.stopPropagation(),L(p),G("receivers")},children:g.map(b=>{const{receiverUser:T}=b,w=ot(T.avatar,I,S);return e.jsx(nt,{alt:T.fullName,src:`${w}?imageFilter=resize&w=48&h=48`,size:32,did:b.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},b.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(C,{onClick:g=>{g.stopPropagation(),L(p),G("statistics")},children:e.jsx(Ne,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(he,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=a[f];return e.jsx(ge,{severity:p.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:f=>e.jsx(Ge,{list:f,label:s("notification.severity"),onDelete:(p,g)=>{p.stopPropagation(),A(p,g,Q[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:Qe,fullWidth:!0,logic:ve,display:(f,p,g,b)=>e.jsx(js,{label:s("notification.severity"),filterList:f,onChange:p,index:g,column:b,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=a[f];return e.jsx(Be,{value:p,locale:n,shouldUpdate:!0})}}}],z=f=>{k(p=>({...p,dateRange:f,page:1}))},oe=[...t||[]];return e.jsxs(C,{ref:q,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(vs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:r,locale:n,columns:Q,data:a,durable:$,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...H,onRowClick:(f,{dataIndex:p})=>{L(a[p])}},customPreButtons:[e.jsx(He,{value:N.dateRange,onChange:z})],customButtons:oe,components:{TableFilterList:f=>e.jsx(Ue,{...f,itemComponent:p=>e.jsx(Ce,{...p,canDelete:g=>{var T;const b=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(b==null?void 0:b.name)==="sender"}})})}})})}),E&&e.jsx(gs,{refresh:M,onCancel:B,notification:E,blocklet:u,tab:D})]})}const vs=ce.div`
|
|
96
96
|
td.MuiTableCell-footer {
|
|
97
97
|
border: none !important;
|
|
98
98
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as q,a2 as z,bP as K,I as be,bQ as ge,a4 as fe,ab as je,bw as ye}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{t as we,m as de,j as ke}from"./vendor-hooks-DXGUREV9.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-BjII93aR.js";import{z as F,E as ve,F as Y,C as ce,t as Ee}from"./index-CksPySYI.js";import{u as N}from"./dashboard-CvJ8cVy-.js";import{H as o,j as e,D as Ce,aj as Te,t as Se,aa as g,O as ie,T as S,ab as U,ak as ee,z as Re,y as B,bt as le,bS as V,ad as W,L as Q,A as G,be as Ie,E as A,I as _,C as Me,br as Pe,al as P,ch as De,X as $e,bd as J,bq as ze,b5 as We,ci as Ae,cj as Oe,b6 as qe,an as Le,c1 as Be,s as pe,v as He,ck as Fe,cl as Ne,cm as Ue,cn as _e,co as Ke}from"./vendor-mui-core-B6POpIBB.js";import{q as Ye}from"./vendor-arcblock-Dkhgjlzn.js";import{d as Ve}from"./ExpandLess-TUium4RQ.js";import{b as ue,z as Je,A as Qe}from"./vendor-utils-CjMBJT5V.js";import{C as Ge}from"./confirm-BqrhdaU7.js";import{A as Xe}from"./actions-BW0Vx00_.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CXDkfohf.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./format-error-BrmqJs5a.js";import"./session-DLQ0rbYE.js";import"./use-blocklet-logo-BOYeM9RY.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./MoreHoriz-DHyMdwpT.js";const Ze=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:s}=ce(),l=(y=(j=s==null?void 0:s.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const x={};return d&&(d.sources.forEach(r=>{x[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{x[r.source]&&(x[r.source].events.push(r),x[r.source].count+=1)})),x},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(x){p(x instanceof Error?x:new Error(String(x)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),s=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:f}])=>{const E=f.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(s).reduce((r,w)=>r+w,0),[s]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(f=>({...f,[w]:!f[w]}))},y=(r,w)=>{const f={};r.forEach(E=>{const u=`${E.type}-${E.source}`;f[u]=!w}),c(E=>({...E,...f}))},x=r=>{const w={};Object.values(t).forEach(({events:f})=>{f.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:x,checked:l>0&&l===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:f,count:E}],u)=>{const M=s[r]>0,i=s[r]===f.length&&f.length>0,h=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:n})=>u<Object.keys(t).length-1?`1px solid ${n.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:n=>{n.target.closest(".MuiFormControlLabel-root")||T(r,n)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:f.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:n=>{n.stopPropagation(),y(f,i)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Ie,{src:w.logo,sx:{width:24,height:24}}),e.jsx(g,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:s[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:n=>`${n.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),f.length>0&&e.jsx(_,{size:"small",edge:"end",children:h?e.jsx(Ve,{}):e.jsx(Ye,{})})]})]})}),f.length>0&&e.jsx(Me,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:f.map(n=>{const m=`${n.type}-${n.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(n),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:n.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:n.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Pe,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var n;const{t:p}=q(),[s,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:x}=Ze(),{control:r,handleSubmit:w,formState:{errors:f},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(s).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[s,u,M]);const i=()=>{l({}),E(),R()},h=async m=>{const k=Object.keys(s).filter(I=>s[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[O,L]=I.split("-");return!O||!L?null:{type:O,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ce,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(h),children:[e.jsx(Te,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Se,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Y,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!f.url,helperText:(k=f.url)==null?void 0:k.message})}}),e.jsx(Y,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!f.description,helperText:(k=f.description)==null?void 0:k.message})}}),e.jsx(Y,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&x&&Object.keys(x).length>0&&e.jsx(te,{eventsBySource:x,selectedEvents:s,setSelectedEvents:l,error:(n=f.selectedEvents)==null?void 0:n.message}),!j&&(!x||Object.keys(x).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Re,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function xe(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const et=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?Ee(t).locale(et(c)).format(d):"-"}function tt(t){return typeof t=="number"?!1:ue(t)}function ot(t){return t>=200&&t<300}function $(t){const d=tt(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(De,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx($e,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};$.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=F(),{t:b}=q(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:s,loadMore:l,loadingMore:v,loading:T}=we(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(s==null?void 0:s.list)||[],[y,x]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,y]);const w=u=>{x(u)};if(T)return e.jsx(U,{});const f=s&&s.list.length<s.paging.total,E=u=>{var M,i,h,n,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((h=u.responseBody)!=null&&h.agentId)){const k=(m=(n=p==null?void 0:p.site)==null?void 0:n.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(O=>{var L;return((L=O==null?void 0:O.meta)==null?void 0:L.name)==="ai-studio"}),I=Je(Qe(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(g,{component:be,icon:ge})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:ot(i.responseStatus)===!1?e.jsx(Ae,{color:"error"}):e.jsx(Oe,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),f&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(g,{children:E(y)})]}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function he({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:s}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=s==null?void 0:s.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(g,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(W,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Be,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:l.status,color:xe(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(x=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:x==null?void 0:x.type},x))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}he.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx(Le,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(he,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:s}=q(),l=He(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:s,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(je)`
|
|
1
|
+
import{u as q,a2 as z,bQ as K,I as be,bR as ge,a4 as fe,ab as je,bx as ye}from"./vendor-ux-did-connect-CeGz2B7G.js";import{t as we,m as de,j as ke}from"./vendor-hooks-DXGUREV9.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-hS_Bn_IB.js";import{z as F,E as ve,F as Y,C as ce,t as Ee}from"./index-DMRB_27Q.js";import{u as N}from"./dashboard-DyRSlDZ8.js";import{H as o,j as e,D as Ce,aj as Te,t as Se,aa as g,O as ie,T as S,ab as U,ak as ee,z as Re,y as B,bt as le,bS as V,ad as W,L as Q,A as G,be as Ie,E as A,I as _,C as Me,br as Pe,al as P,ch as De,X as $e,bd as J,bq as ze,b5 as We,ci as Ae,cj as Oe,b6 as qe,an as Le,c1 as Be,s as pe,v as He,ck as Fe,cl as Ne,cm as Ue,cn as _e,co as Ke}from"./vendor-mui-core-B6POpIBB.js";import{q as Ye}from"./vendor-arcblock-DpCuGvAS.js";import{d as Ve}from"./ExpandLess-C2a4bF6C.js";import{b as ue,z as Je,A as Qe}from"./vendor-utils-CjMBJT5V.js";import{C as Ge}from"./confirm-oEG91BF3.js";import{A as Xe}from"./actions-BEVLXA8P.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-B_V0diy4.js";import"./PlayArrow-CeIK7-yb.js";import"./get-safe-url-DGnHBj8n.js";import"./format-error-BrmqJs5a.js";import"./session-B_RsakU4.js";import"./use-blocklet-logo-ZrVs0Fgp.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./MoreHoriz-DrhBbQGZ.js";const Ze=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:s}=ce(),l=(y=(j=s==null?void 0:s.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const x={};return d&&(d.sources.forEach(r=>{x[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{x[r.source]&&(x[r.source].events.push(r),x[r.source].count+=1)})),x},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(x){p(x instanceof Error?x:new Error(String(x)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),s=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:f}])=>{const E=f.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(s).reduce((r,w)=>r+w,0),[s]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(f=>({...f,[w]:!f[w]}))},y=(r,w)=>{const f={};r.forEach(E=>{const u=`${E.type}-${E.source}`;f[u]=!w}),c(E=>({...E,...f}))},x=r=>{const w={};Object.values(t).forEach(({events:f})=>{f.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:x,checked:l>0&&l===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:f,count:E}],u)=>{const M=s[r]>0,i=s[r]===f.length&&f.length>0,h=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:n})=>u<Object.keys(t).length-1?`1px solid ${n.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:n=>{n.target.closest(".MuiFormControlLabel-root")||T(r,n)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:f.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:n=>{n.stopPropagation(),y(f,i)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Ie,{src:w.logo,sx:{width:24,height:24}}),e.jsx(g,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:s[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:n=>`${n.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),f.length>0&&e.jsx(_,{size:"small",edge:"end",children:h?e.jsx(Ve,{}):e.jsx(Ye,{})})]})]})}),f.length>0&&e.jsx(Me,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:f.map(n=>{const m=`${n.type}-${n.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(n),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:n.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:n.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Pe,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var n;const{t:p}=q(),[s,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:x}=Ze(),{control:r,handleSubmit:w,formState:{errors:f},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(s).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[s,u,M]);const i=()=>{l({}),E(),R()},h=async m=>{const k=Object.keys(s).filter(I=>s[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[O,L]=I.split("-");return!O||!L?null:{type:O,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ce,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(h),children:[e.jsx(Te,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Se,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Y,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!f.url,helperText:(k=f.url)==null?void 0:k.message})}}),e.jsx(Y,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!f.description,helperText:(k=f.description)==null?void 0:k.message})}}),e.jsx(Y,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&x&&Object.keys(x).length>0&&e.jsx(te,{eventsBySource:x,selectedEvents:s,setSelectedEvents:l,error:(n=f.selectedEvents)==null?void 0:n.message}),!j&&(!x||Object.keys(x).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Re,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function xe(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const et=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?Ee(t).locale(et(c)).format(d):"-"}function tt(t){return typeof t=="number"?!1:ue(t)}function ot(t){return t>=200&&t<300}function $(t){const d=tt(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(De,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx($e,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};$.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=F(),{t:b}=q(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:s,loadMore:l,loadingMore:v,loading:T}=we(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(s==null?void 0:s.list)||[],[y,x]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,y]);const w=u=>{x(u)};if(T)return e.jsx(U,{});const f=s&&s.list.length<s.paging.total,E=u=>{var M,i,h,n,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((h=u.responseBody)!=null&&h.agentId)){const k=(m=(n=p==null?void 0:p.site)==null?void 0:n.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(O=>{var L;return((L=O==null?void 0:O.meta)==null?void 0:L.name)==="ai-studio"}),I=Je(Qe(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(g,{component:be,icon:ge})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:ot(i.responseStatus)===!1?e.jsx(Ae,{color:"error"}):e.jsx(Oe,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),f&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(g,{children:E(y)})]}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function he({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:s}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=s==null?void 0:s.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(g,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(W,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Be,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:l.status,color:xe(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(x=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:x==null?void 0:x.type},x))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}he.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx(Le,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(he,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:s}=q(),l=He(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:s,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(je)`
|
|
2
2
|
.MuiPaper-root {
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
overflow: hidden;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Z,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a9 as rn,j as n,aa as ae,bp as Yt,bs as Zt,bo as Qt,q as xt,T as Be,O as lt,ab as rt,by as nr,ak as tt,H as K,ah as Se,e as Wn,ad as wt,w as Hn,y as nn,b5 as Gn,b6 as Yn,I as Zn,bi as Qn,bt as Xn,bS as Jn}from"./vendor-mui-core-B6POpIBB.js";import{v as Ie,B as Xt,e as Jt,_ as ei,ax as ti,n as Rr,A as ri,b as ni}from"./vendor-utils-CjMBJT5V.js";import{r as on,bA as ut,bB as ii,bC as oi,bD as an,bE as ai,bF as si,bG as ci,bH as sn,bI as li,bJ as ir,bK as ui,bL as fi,bM as di,bN as pi,aM as or,bO as cn,aD as mi,k as hi,u as Te,a1 as gi,a0 as yi,aq as Ye,a as je,i as vi,as as bi,d as xi,b5 as ft,a2 as Fe,bq as wi,n as Ze,a4 as ln,am as Ei,I as ji,av as Si,b7 as Ci,ab as un,aa as fn,bw as Pi,$ as Ai}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{c as Ke,a as Ii,X as dn,O as Et,I as Oi,Y as Ri}from"./vendor-arcblock-Dkhgjlzn.js";import{d as Ti}from"./ViewList-Ca1IEB31.js";import{a1 as Ni,f as Di,z as Ae,at as ar,l as Qe,a2 as _i,U as Xe,au as Li,C as pn,av as mn,t as Ui,b as ki}from"./index-CksPySYI.js";import{U as hn,C as gn,I as qi}from"./index-C-rU1lEd.js";import{k as Bi,u as sr,a as cr,l as Ki,f as Mi}from"./vendor-hooks-DXGUREV9.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-CvJ8cVy-.js";import{W as lr}from"./did-address-C6ni99I7.js";import{P as Me}from"./permission-PNXSTeNL.js";import{C as At}from"./click-to-copy-0s0a7Ak5.js";import{T as vn}from"./index-DdLPuFP7.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Fi}from"./useAsync-GjVghrwi.js";import{I as Pe}from"./index-D_z5kVUS.js";import{d as $i}from"./DeleteOutline-D_I07sPe.js";import{C as dt}from"./confirm-BqrhdaU7.js";import{u as pt}from"./session-DLQ0rbYE.js";import{i as bn,a as jt,p as xn}from"./util-D-LnEy9h.js";import{b as Vi}from"./sdk-BXECCi1q.js";import{A as zi}from"./actions-BW0Vx00_.js";import{S as Wi}from"./shorten-label-SbKUBkvs.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-CXDkfohf.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./use-blocklet-logo-BOYeM9RY.js";import"./InfoOutlined-BjII93aR.js";import"./dot-WAAJ-O65.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-BWhMsmQP.js";import"./base32-C_EKY5vU.js";import"./MoreHoriz-DHyMdwpT.js";var ur={},Hi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Gi=Hi(on()),Yi=n;wn=ur.default=(0,Gi.default)((0,Yi.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Zi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const En=dr;var vt={},Qi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),jn="%[a-f0-9]{2}",Nr=new RegExp("("+jn+")|([^%]+?)","gi"),Dr=new RegExp("("+jn+")+","gi");function er(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],er(r),er(i))}function Xi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=er(t,r).join(""),t=e.match(Nr)||[];return e}}function Ji(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Xi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),u=0;u<a.length;u++){var m=a[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var eo=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ji(e)}},to=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ro=function(e,t){for(var r={},i=Object.keys(e),a=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(a?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Qi,r=eo,i=to,a=ro,u=s=>s==null;function m(s){switch(s.arrayFormat){case"index":return o=>(l,d)=>{const E=l.length;return d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[",E,"]"].join("")]:[...l,[b(o,s),"[",b(E,s),"]=",b(d,s)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[]"].join("")]:[...l,[b(o,s),"[]=",b(d,s)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,s),"=",b(d,s)].join("")]:[[l,b(d,s)].join(s.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,b(o,s)]:[...l,[b(o,s),"=",b(d,s)].join("")]}}function x(s){let o;switch(s.arrayFormat){case"index":return(l,d,E)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){E[l]=d;return}E[l]===void 0&&(E[l]={}),E[l][o[1]]=d};case"bracket":return(l,d,E)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){E[l]=d;return}if(E[l]===void 0){E[l]=[d];return}E[l]=[].concat(E[l],d)};case"comma":case"separator":return(l,d,E)=>{const P=typeof d=="string"&&d.includes(s.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,s).includes(s.arrayFormatSeparator);d=S?h(d,s):d;const J=P||S?d.split(s.arrayFormatSeparator).map(G=>h(G,s)):d===null?d:h(d,s);E[l]=J};default:return(l,d,E)=>{if(E[l]===void 0){E[l]=d;return}E[l]=[].concat(E[l],d)}}}function j(s){if(typeof s!="string"||s.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(s,o){return o.encode?o.strict?t(s):encodeURIComponent(s):s}function h(s,o){return o.decode?r(s):s}function N(s){return Array.isArray(s)?s.sort():typeof s=="object"?N(Object.keys(s)).sort((o,l)=>Number(o)-Number(l)).map(o=>s[o]):s}function C(s){const o=s.indexOf("#");return o!==-1&&(s=s.slice(0,o)),s}function A(s){let o="";const l=s.indexOf("#");return l!==-1&&(o=s.slice(l)),o}function y(s){s=C(s);const o=s.indexOf("?");return o===-1?"":s.slice(o+1)}function B(s,o){return o.parseNumbers&&!Number.isNaN(Number(s))&&typeof s=="string"&&s.trim()!==""?s=Number(s):o.parseBooleans&&s!==null&&(s.toLowerCase()==="true"||s.toLowerCase()==="false")&&(s=s.toLowerCase()==="true"),s}function w(s,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const l=x(o),d=Object.create(null);if(typeof s!="string"||(s=s.trim().replace(/^[?#&]/,""),!s))return d;for(const E of s.split("&")){if(E==="")continue;let[P,S]=i(o.decode?E.replace(/\+/g," "):E,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const E of Object.keys(d)){const P=d[E];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=B(P[S],o);else d[E]=B(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((E,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?E[P]=N(S):E[P]=S,E},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(s,o)=>{if(!s)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(s[S])||o.skipEmptyString&&s[S]==="",d=m(o),E={};for(const S of Object.keys(s))l(S)||(E[S]=s[S]);const P=Object.keys(E);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=s[S];return J===void 0?"":J===null?b(S,o):Array.isArray(J)?J.reduce(d(S),[]).join("&"):b(S,o)+"="+b(J,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(s,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(s,"#");return Object.assign({url:l.split("?")[0]||"",query:w(y(s),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(s,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(s.url).split("?")[0]||"",d=e.extract(s.url),E=e.parse(d,{sort:!1}),P=Object.assign(E,s.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(s.url);return s.fragmentIdentifier&&(J=`#${b(s.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(s,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:E,fragmentIdentifier:P}=e.parseUrl(s,l);return e.stringifyUrl({url:d,query:a(E,o),fragmentIdentifier:P},l)},e.exclude=(s,o,l)=>{const d=Array.isArray(o)?E=>!o.includes(E):(E,P)=>!o(E,P);return e.pick(s,d,l)}})(vt);const at=$n,no={parseNumbers:!1,parseBooleans:!1},io={skipNull:!1,skipEmptyString:!1},oo=(e,t)=>{var r,i;const{navigateMode:a="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},no),u),j=Object.assign(Object.assign({},io),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),C=Bi(),A=Z.useRef(typeof e=="function"?e():e||{}),y=Z.useMemo(()=>vt.parse(b.search,x),[b.search]),B=Z.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[B,sr(s=>{const o=typeof s=="function"?s(B):s;C(),h&&h[a]({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},b.state),N&&N({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},{replace:a==="replace",state:b.state})})]},ao=oo;var Dt={exports:{}},_t={},_r;function Sn(){if(_r)return _t;_r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function i(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&a(o,l)}function a(o,l){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,P){return E.__proto__=P,E},a(o,l)}function u(o){var l=j();return function(){var E=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(E,arguments,S)}else P=E.apply(this,arguments);return m(this,P)}}function m(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(o)}function x(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,C;function A(o,l,d){d||(d=Error);function E(S,J,G){return typeof l=="string"?l:l(S,J,G)}var P=function(S){i(G,S);var J=u(G);function G(Y,W,$){var H;return r(this,G),H=J.call(this,E(Y,W,$)),H.code=o,H}return t(G)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(E){return String(E)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function B(o,l,d){return o.substr(0,l.length)===l}function w(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function s(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,l,d){N===void 0&&(N=tr()),N(typeof o=="string","'name' must be a string");var E;typeof l=="string"&&B(l,"not ")?(E="must not be",l=l.replace(/^not /,"")):E="must be";var P;if(w(o," argument"))P="The ".concat(o," ").concat(E," ").concat(y(l,"type"));else{var S=s(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(E," ").concat(y(l,"type"))}return P+=". Received type ".concat(e(d)),P},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";C===void 0&&(C=ut);var E=C.inspect(l);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(E)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var E;return d&&d.constructor&&d.constructor.name?E="instance of ".concat(d.constructor.name):E="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(E,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];N===void 0&&(N=tr()),N(l.length>0,"At least one arg needs to be specified");var E="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:E+="".concat(l[0]," argument");break;case 2:E+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:E+=l.slice(0,P-1).join(", "),E+=", and ".concat(l[P-1]," arguments");break}return"".concat(E," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function so(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(I);O&&(q=q.filter(function(k){return Object.getOwnPropertyDescriptor(I,k).enumerable})),M.push.apply(M,q)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(q){r(I,q,M[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(q){Object.defineProperty(I,q,Object.getOwnPropertyDescriptor(M,q))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function a(I,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(I,m(q.key),q)}}function u(I,O,M){return O&&a(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=x(I,"string");return o(O)==="symbol"?O:String(O)}function x(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var q=M.call(I,O||"default");if(o(q)!=="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function j(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var q=s(I),k;if(O){var g=s(this).constructor;k=Reflect.construct(q,arguments,g)}else k=q.apply(this,arguments);return h(this,k)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function C(I){var O=typeof Map=="function"?new Map:void 0;return C=function(q){if(q===null||!B(q))return q;if(typeof q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(q))return O.get(q);O.set(q,k)}function k(){return A(q,arguments,s(this).constructor)}return k.prototype=Object.create(q.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),w(k,q)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(k,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(k,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(q,k){return q.__proto__=k,q},w(I,O)}function s(I){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},s(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var l=ut,d=l.inspect,E=Sn(),P=E.codes.ERR_INVALID_ARG_TYPE;function S(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function J(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Y="",W="",$="",H={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},de=10;function we(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(q){M[q]=I[q]}),Object.defineProperty(M,"message",{value:I.message}),M}function Q(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function me(I,O,M){var q="",k="",g=0,p="",v=!1,_=Q(I),R=_.split(`
|
|
1
|
+
import{r as Z,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a9 as rn,j as n,aa as ae,bp as Yt,bs as Zt,bo as Qt,q as xt,T as Be,O as lt,ab as rt,by as nr,ak as tt,H as K,ah as Se,e as Wn,ad as wt,w as Hn,y as nn,b5 as Gn,b6 as Yn,I as Zn,bi as Qn,bt as Xn,bS as Jn}from"./vendor-mui-core-B6POpIBB.js";import{v as Ie,B as Xt,e as Jt,_ as ei,ax as ti,n as Rr,A as ri,b as ni}from"./vendor-utils-CjMBJT5V.js";import{r as on,bB as ut,bC as ii,bD as oi,bE as an,bF as ai,bG as si,bH as ci,bI as sn,bJ as li,bK as ir,bL as ui,bM as fi,bN as di,bO as pi,aM as or,bP as cn,aD as mi,k as hi,u as Te,a1 as gi,a0 as yi,aq as Ye,a as je,i as vi,as as bi,d as xi,b5 as ft,a2 as Fe,br as wi,n as Ze,a4 as ln,am as Ei,I as ji,av as Si,b7 as Ci,ab as un,aa as fn,bx as Pi,$ as Ai}from"./vendor-ux-did-connect-CeGz2B7G.js";import{c as Ke,a as Ii,X as dn,O as Et,I as Oi,Y as Ri}from"./vendor-arcblock-DpCuGvAS.js";import{d as Ti}from"./ViewList-CAnQTEEQ.js";import{a1 as Ni,f as Di,z as Ae,at as ar,l as Qe,a2 as _i,U as Xe,au as Li,C as pn,av as mn,t as Ui,b as ki}from"./index-DMRB_27Q.js";import{U as hn,C as gn,I as qi}from"./index-WYf-xVMZ.js";import{k as Bi,u as sr,a as cr,l as Ki,f as Mi}from"./vendor-hooks-DXGUREV9.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-DyRSlDZ8.js";import{W as lr}from"./did-address-DXsoioR-.js";import{P as Me}from"./permission-B0bwGXNp.js";import{C as At}from"./click-to-copy-j_gx9gFG.js";import{T as vn}from"./index-C2QrzzaU.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Fi}from"./useAsync-GjVghrwi.js";import{I as Pe}from"./index-aGp3zmpA.js";import{d as $i}from"./DeleteOutline-BU7WZ4i1.js";import{C as dt}from"./confirm-oEG91BF3.js";import{u as pt}from"./session-B_RsakU4.js";import{i as bn,a as jt,p as xn}from"./util-CxKY-YuQ.js";import{b as Vi}from"./sdk-DGCdjl0b.js";import{A as zi}from"./actions-BEVLXA8P.js";import{S as Wi}from"./shorten-label-SbKUBkvs.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-B_V0diy4.js";import"./PlayArrow-CeIK7-yb.js";import"./get-safe-url-DGnHBj8n.js";import"./use-blocklet-logo-ZrVs0Fgp.js";import"./InfoOutlined-hS_Bn_IB.js";import"./dot-WAAJ-O65.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-Bxdv5BBD.js";import"./base32-CwrkOaA2.js";import"./MoreHoriz-DrhBbQGZ.js";var ur={},Hi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Gi=Hi(on()),Yi=n;wn=ur.default=(0,Gi.default)((0,Yi.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Zi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const En=dr;var vt={},Qi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),jn="%[a-f0-9]{2}",Nr=new RegExp("("+jn+")|([^%]+?)","gi"),Dr=new RegExp("("+jn+")+","gi");function er(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],er(r),er(i))}function Xi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=er(t,r).join(""),t=e.match(Nr)||[];return e}}function Ji(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Xi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),u=0;u<a.length;u++){var m=a[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var eo=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ji(e)}},to=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ro=function(e,t){for(var r={},i=Object.keys(e),a=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(a?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Qi,r=eo,i=to,a=ro,u=s=>s==null;function m(s){switch(s.arrayFormat){case"index":return o=>(l,d)=>{const E=l.length;return d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[",E,"]"].join("")]:[...l,[b(o,s),"[",b(E,s),"]=",b(d,s)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[]"].join("")]:[...l,[b(o,s),"[]=",b(d,s)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,s),"=",b(d,s)].join("")]:[[l,b(d,s)].join(s.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,b(o,s)]:[...l,[b(o,s),"=",b(d,s)].join("")]}}function x(s){let o;switch(s.arrayFormat){case"index":return(l,d,E)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){E[l]=d;return}E[l]===void 0&&(E[l]={}),E[l][o[1]]=d};case"bracket":return(l,d,E)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){E[l]=d;return}if(E[l]===void 0){E[l]=[d];return}E[l]=[].concat(E[l],d)};case"comma":case"separator":return(l,d,E)=>{const P=typeof d=="string"&&d.includes(s.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,s).includes(s.arrayFormatSeparator);d=S?h(d,s):d;const J=P||S?d.split(s.arrayFormatSeparator).map(G=>h(G,s)):d===null?d:h(d,s);E[l]=J};default:return(l,d,E)=>{if(E[l]===void 0){E[l]=d;return}E[l]=[].concat(E[l],d)}}}function j(s){if(typeof s!="string"||s.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(s,o){return o.encode?o.strict?t(s):encodeURIComponent(s):s}function h(s,o){return o.decode?r(s):s}function N(s){return Array.isArray(s)?s.sort():typeof s=="object"?N(Object.keys(s)).sort((o,l)=>Number(o)-Number(l)).map(o=>s[o]):s}function C(s){const o=s.indexOf("#");return o!==-1&&(s=s.slice(0,o)),s}function A(s){let o="";const l=s.indexOf("#");return l!==-1&&(o=s.slice(l)),o}function y(s){s=C(s);const o=s.indexOf("?");return o===-1?"":s.slice(o+1)}function B(s,o){return o.parseNumbers&&!Number.isNaN(Number(s))&&typeof s=="string"&&s.trim()!==""?s=Number(s):o.parseBooleans&&s!==null&&(s.toLowerCase()==="true"||s.toLowerCase()==="false")&&(s=s.toLowerCase()==="true"),s}function w(s,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const l=x(o),d=Object.create(null);if(typeof s!="string"||(s=s.trim().replace(/^[?#&]/,""),!s))return d;for(const E of s.split("&")){if(E==="")continue;let[P,S]=i(o.decode?E.replace(/\+/g," "):E,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const E of Object.keys(d)){const P=d[E];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=B(P[S],o);else d[E]=B(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((E,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?E[P]=N(S):E[P]=S,E},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(s,o)=>{if(!s)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(s[S])||o.skipEmptyString&&s[S]==="",d=m(o),E={};for(const S of Object.keys(s))l(S)||(E[S]=s[S]);const P=Object.keys(E);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=s[S];return J===void 0?"":J===null?b(S,o):Array.isArray(J)?J.reduce(d(S),[]).join("&"):b(S,o)+"="+b(J,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(s,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(s,"#");return Object.assign({url:l.split("?")[0]||"",query:w(y(s),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(s,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(s.url).split("?")[0]||"",d=e.extract(s.url),E=e.parse(d,{sort:!1}),P=Object.assign(E,s.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(s.url);return s.fragmentIdentifier&&(J=`#${b(s.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(s,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:E,fragmentIdentifier:P}=e.parseUrl(s,l);return e.stringifyUrl({url:d,query:a(E,o),fragmentIdentifier:P},l)},e.exclude=(s,o,l)=>{const d=Array.isArray(o)?E=>!o.includes(E):(E,P)=>!o(E,P);return e.pick(s,d,l)}})(vt);const at=$n,no={parseNumbers:!1,parseBooleans:!1},io={skipNull:!1,skipEmptyString:!1},oo=(e,t)=>{var r,i;const{navigateMode:a="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},no),u),j=Object.assign(Object.assign({},io),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),C=Bi(),A=Z.useRef(typeof e=="function"?e():e||{}),y=Z.useMemo(()=>vt.parse(b.search,x),[b.search]),B=Z.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[B,sr(s=>{const o=typeof s=="function"?s(B):s;C(),h&&h[a]({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},b.state),N&&N({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},{replace:a==="replace",state:b.state})})]},ao=oo;var Dt={exports:{}},_t={},_r;function Sn(){if(_r)return _t;_r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function i(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&a(o,l)}function a(o,l){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,P){return E.__proto__=P,E},a(o,l)}function u(o){var l=j();return function(){var E=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(E,arguments,S)}else P=E.apply(this,arguments);return m(this,P)}}function m(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(o)}function x(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,C;function A(o,l,d){d||(d=Error);function E(S,J,G){return typeof l=="string"?l:l(S,J,G)}var P=function(S){i(G,S);var J=u(G);function G(Y,W,$){var H;return r(this,G),H=J.call(this,E(Y,W,$)),H.code=o,H}return t(G)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(E){return String(E)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function B(o,l,d){return o.substr(0,l.length)===l}function w(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function s(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,l,d){N===void 0&&(N=tr()),N(typeof o=="string","'name' must be a string");var E;typeof l=="string"&&B(l,"not ")?(E="must not be",l=l.replace(/^not /,"")):E="must be";var P;if(w(o," argument"))P="The ".concat(o," ").concat(E," ").concat(y(l,"type"));else{var S=s(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(E," ").concat(y(l,"type"))}return P+=". Received type ".concat(e(d)),P},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";C===void 0&&(C=ut);var E=C.inspect(l);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(E)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var E;return d&&d.constructor&&d.constructor.name?E="instance of ".concat(d.constructor.name):E="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(E,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];N===void 0&&(N=tr()),N(l.length>0,"At least one arg needs to be specified");var E="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:E+="".concat(l[0]," argument");break;case 2:E+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:E+=l.slice(0,P-1).join(", "),E+=", and ".concat(l[P-1]," arguments");break}return"".concat(E," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function so(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(I);O&&(q=q.filter(function(k){return Object.getOwnPropertyDescriptor(I,k).enumerable})),M.push.apply(M,q)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(q){r(I,q,M[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(q){Object.defineProperty(I,q,Object.getOwnPropertyDescriptor(M,q))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function a(I,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(I,m(q.key),q)}}function u(I,O,M){return O&&a(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=x(I,"string");return o(O)==="symbol"?O:String(O)}function x(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var q=M.call(I,O||"default");if(o(q)!=="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function j(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var q=s(I),k;if(O){var g=s(this).constructor;k=Reflect.construct(q,arguments,g)}else k=q.apply(this,arguments);return h(this,k)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function C(I){var O=typeof Map=="function"?new Map:void 0;return C=function(q){if(q===null||!B(q))return q;if(typeof q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(q))return O.get(q);O.set(q,k)}function k(){return A(q,arguments,s(this).constructor)}return k.prototype=Object.create(q.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),w(k,q)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(k,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(k,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(q,k){return q.__proto__=k,q},w(I,O)}function s(I){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},s(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var l=ut,d=l.inspect,E=Sn(),P=E.codes.ERR_INVALID_ARG_TYPE;function S(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function J(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Y="",W="",$="",H={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},de=10;function we(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(q){M[q]=I[q]}),Object.defineProperty(M,"message",{value:I.message}),M}function Q(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function me(I,O,M){var q="",k="",g=0,p="",v=!1,_=Q(I),R=_.split(`
|
|
2
2
|
`),L=Q(O).split(`
|
|
3
3
|
`),V=0,ne="";if(M==="strictEqual"&&o(I)==="object"&&o(O)==="object"&&I!==null&&O!==null&&(M="strictEqualObject"),R.length===1&&L.length===1&&R[0]!==L[0]){var ce=R[0].length+L[0].length;if(ce<=de){if((o(I)!=="object"||I===null)&&(o(O)!=="object"||O===null)&&(I!==0||O!==0))return"".concat(H[M],`
|
|
4
4
|
|