@abtnode/blocklet-services 1.16.43-beta-20250427-132304-6da95c55 → 1.16.43-beta-20250427-232837-e671de06
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/access-control-B20P1UrY.js +1 -1
- package/dist/assets/add-component-core-DG9mQFsr.js +1 -1
- package/dist/assets/add-resource-BoS5YkVy.js +1 -1
- package/dist/assets/advanced-DTe2fs5L.js +1 -1
- package/dist/assets/audit-logs-CydL26ZC.js +1 -1
- package/dist/assets/branding-CAMtNLMU.js +1 -1
- package/dist/assets/complete-BzCBoyhn.js +1 -1
- package/dist/assets/component-5gjaNHCg.js +1 -1
- package/dist/assets/config-1xq1_d84.js +1 -1
- package/dist/assets/config-navigation-Dvjz9nAh.js +1 -1
- package/dist/assets/connect-Bbc2y5nS.js +1 -1
- package/dist/assets/dashboard-8QXGSoVu.js +2 -2
- package/dist/assets/domain-ag7_Ivc1.js +1 -1
- package/dist/assets/email-DKpgximx.js +1 -1
- package/dist/assets/exchange-passport-Izkf8qpM.js +1 -1
- package/dist/assets/fuel-CcBzY6Bt.js +1 -1
- package/dist/assets/index-BGgGfqEc.js +1 -1
- package/dist/assets/index-BnmeT4Bk.js +1 -1
- package/dist/assets/index-C8QMe2NL.js +1 -1
- package/dist/assets/index-DNG6b9sp.js +1 -1
- package/dist/assets/index-DO3_1y-L.js +1 -1
- package/dist/assets/index-DO4cSlUf.js +1 -1
- package/dist/assets/index-EnQ254k3.js +1 -1
- package/dist/assets/index-bb90BUf4.js +1 -1
- package/dist/assets/index-n0Q-fETi.js +1 -1
- package/dist/assets/index-slEV_y-C.js +1 -1
- package/dist/assets/invite-Cbz8B2uW.js +1 -1
- package/dist/assets/issue-passport-Dd_yyO08.js +1 -1
- package/dist/assets/item-nK3D7WH5.js +1 -1
- package/dist/assets/login-DjB23H9M.js +1 -1
- package/dist/assets/lost-passport-Do1Pl0xI.js +1 -1
- package/dist/assets/open-window-D8MZhu_7.js +1 -1
- package/dist/assets/overview-DLA9wj6a.js +1 -1
- package/dist/assets/publish-resource-BEc_A5mC.js +1 -1
- package/dist/assets/runtime-DXl0lfXF.js +1 -1
- package/dist/assets/security-BhkfG23R.js +1 -1
- package/dist/assets/setup-BmYxTt6Z.js +2 -2
- package/dist/assets/start-CVexuuAk.js +1 -1
- package/dist/assets/step-actions-D_1PFeFs.js +1 -1
- package/package.json +21 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-Chqr_or_.js","assets/vendor-mui-core-CQ38ohp2.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-DldnaMbZ.js","assets/vendor-ux-did-connect-BdkhddhO.js","assets/vendor-utils-BNHJB5U7.js","assets/vendor-hooks-DftG_2gV.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DO3_1y-L.js","assets/vendor-arcblock-ScFEr-lj.js","assets/index-B1ljmpu4.css","assets/Download-Ch4RfGRW.js","assets/bundle-avatar-D0t7RLGx.js","assets/log-D33dFtt_.css","assets/index-BGgGfqEc.js","assets/ViewList-e3CoNi3K.js","assets/index-B_vrglsK.js","assets/Phone-KP65huHK.js","assets/Location-B8EOY3d0.js","assets/Email-Dz2Eyqu0.js","assets/Timezone-Ce4E1Xey.js","assets/did-address-DUThaBlf.js","assets/permission-BGM09622.js","assets/session-VIMbdc9j.js","assets/click-to-copy-BGyXQL2i.js","assets/index-Dl4W1N74.js","assets/vendor-mui-x-B0hsmEJ3.js","assets/AdapterDayjs-BUGplkxR.js","assets/format-error-BrmqJs5a.js","assets/useAsync-CGW40D2-.js","assets/index-CGBZONPv.js","assets/DeleteOutline-C2sY6hfm.js","assets/confirm-DqvNmeoz.js","assets/util-Dw9Eiuko.js","assets/base32-p9VcJrwv.js","assets/sdk-CTe6rL6c.js","assets/actions-DA-6s_nQ.js","assets/MoreHoriz-CX_pwfPT.js","assets/shorten-label-DFzv9EKX.js","assets/PlayArrow-DFH1Psjx.js","assets/get-safe-url-
|
|
2
|
-
import{c as ce,u as Yn,p as Ps,h as et,f as er,g as tr,i as Ls,j as ks,k as Ds,m as As,l as Rn,n as Os,E as Ms,o as $s,H as Ns,_ as M,R as Us}from"./vendor-arcblock-ScFEr-lj.js";import{H as w,j as s,a8 as Z,ag as V,I as ct,ap as zs,aj as nr,X as Ht,q as Bs,b4 as Hs,aa as ue,b5 as qs,bw as Fs,T as B,bu as Vs,bs as Le,bv as Pn,a9 as R,bJ as Ws,v as se,a5 as lt,bK as Ks,ad as Gs,be as Qs,ao as qt,bL as rr,ac as ke,bM as Zs,aq as Js,ah as Xs,ak as tt,O as re,bt as Ct,bo as ae,bN as sr,bO as or,bP as ir,E as me,b3 as ar,y as Ys,bg as eo}from"./vendor-mui-core-CQ38ohp2.js";import{r as j,L as cr,f as lr,g as ur,u as to,l as no}from"./vendor-react-DEoibe3W.js";import{r as J,b4 as ro,b2 as ut,b5 as so,B as ge,j as z,a1 as Ln,Y as N,u as W,an as oo,m as dr,i as Ft,k as io,d as ao,W as Vt,aX as co,a4 as fr,ar as pr,b6 as lo,I as uo,C as nt,b7 as fo,b8 as po,_ as mo,al as ho}from"./vendor-ux-did-connect-BdkhddhO.js";import{z as Se,f as F,A as gt,B as go,b as xo,C as Wt,D as vo,E as mr,F as te,G as hr,t as je,H as gr,I as yo,n as Ce,J as bo,K as jo,u as wo,j as kn,g as _o,L as Dn,h as So,l as xt,k as Co,m as Io,M as To,O as Eo,Q as Ge,e as qe,R as Ro,T as Po,U as Lo,N as ko,V as vt,c as An}from"./index-DO3_1y-L.js";import{ad as Do,y as we,ae as Ao,z as Qe,I as xr,x as vr,af as Oo}from"./vendor-utils-BNHJB5U7.js";import{_ as On}from"./useLocalStorage-DldnaMbZ.js";import{C as Mn}from"./confirm-DqvNmeoz.js";import{d as Mo}from"./PlayArrow-DFH1Psjx.js";import{g as $n}from"./get-safe-url-DBsPGn--.js";import{f as Kt}from"./format-error-BrmqJs5a.js";import{u as yr}from"./session-VIMbdc9j.js";import{f as xe,a as br,u as q,w as $o}from"./vendor-hooks-DftG_2gV.js";import{i as No,u as Uo,M as zo,c as De,s as rt,H as Bo,p as jr}from"./index-DcBUShKK.js";import{d as Ho}from"./InfoOutlined-CQB5qKm-.js";import{_ as wr,D as qo}from"./dot-BE1YP292.js";import{_ as _r}from"./useSetState-CWq0AVWn.js";import{u as Sr}from"./use-mobile-C_flBrm-.js";const Cr=j.createContext({});function Gt({children:e,type:t}){const[n,r]=j.useState([]),o=j.useRef([]),i=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(g=>l.find(p=>p===g));Do(u,n).forEach(g=>a(g))};return s.jsx(Cr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:i,removeDeletingDid:a,matchDeletingDid:c},children:e})}Gt.propTypes={type:w.string,children:w.node.isRequired};Gt.defaultProps={type:"blocklets"};function Hl(){return j.useContext(Cr)}var Qt={},Fo=Z;Object.defineProperty(Qt,"__esModule",{value:!0});var Ir=Qt.default=void 0,Vo=Fo(J()),Wo=s;Ir=Qt.default=(0,Vo.default)((0,Wo.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Zt={},Ko=Z;Object.defineProperty(Zt,"__esModule",{value:!0});var Tr=Zt.default=void 0,Go=Ko(J()),Qo=s;Tr=Zt.default=(0,Go.default)((0,Qo.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Jt={},Zo=Z;Object.defineProperty(Jt,"__esModule",{value:!0});var Er=Jt.default=void 0,Jo=Zo(J()),Xo=s;Er=Jt.default=(0,Jo.default)((0,Xo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Xt={},Yo=Z;Object.defineProperty(Xt,"__esModule",{value:!0});var Yt=Xt.default=void 0,ei=Yo(J()),ti=s;Yt=Xt.default=(0,ei.default)((0,ti.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var en={},ni=Z;Object.defineProperty(en,"__esModule",{value:!0});var Rr=en.default=void 0,ri=ni(J()),si=s;Rr=en.default=(0,ri.default)((0,si.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var tn={},oi=Z;Object.defineProperty(tn,"__esModule",{value:!0});var Pr=tn.default=void 0,ii=oi(J()),ai=s;Pr=tn.default=(0,ii.default)((0,ai.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var nn={},ci=Z;Object.defineProperty(nn,"__esModule",{value:!0});var Lr=nn.default=void 0,li=ci(J()),ui=s;Lr=nn.default=(0,li.default)((0,ui.jsx)("path",{d:"M12 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-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var rn=function(e){return s.jsx("svg",{...e,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};rn.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};rn.displayName="dashboard";var sn={},di=Z;Object.defineProperty(sn,"__esModule",{value:!0});var kr=sn.default=void 0,fi=di(J()),pi=s;kr=sn.default=(0,fi.default)((0,pi.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const be={Start:Mo,Stop:Ir,Restart:Tr,Reload:Er,Remove:ro,Config:Yt,Log:Rr,Group:Pr,Cancel:Lr,Dashboard:rn,Overview:kr},mi=(e,t)=>{if(!e)return"";const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(we(n.origin,t));return o.search=r.toString(),o.toString()},hi="internal",gi="external";function on({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:o,getComponentUrl:i,useBlockletUrlEvaluation:a,...c}){const l=Se(),[u,d]=j.useState(null),[g,p]=j.useState(null),[v,S]=j.useState(!1),[y,P]=j.useState(null),{t:f}=j.useContext(ut),[b]=On("skip-blocklet-setup",!1),{loading:x,recommendedUrl:L}=a(e),[k]=On("blocklet-type-filter",hi),h=F.isInProgress(e.status),[T,C]=j.useState(!1);j.useEffect(()=>{var $,G;if(!(e!=null&&e.controller))return;C(((G=($=e==null?void 0:e.controller)==null?void 0:$.status)==null?void 0:G.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var X,ie,fe;try{const Y=await l.api.getLauncherSession({input:{launcherSessionId:(X=e==null?void 0:e.controller)==null?void 0:X.launcherSessionId,launcherUrl:(ie=e==null?void 0:e.controller)==null?void 0:ie.launcherUrl}});if(Y!=null&&Y.error){console.error("get launcher session failed",Y.error);return}C([z.LAUNCH_SESSION_STATUS.overdue,z.LAUNCH_SESSION_STATUS.canceled,z.LAUNCH_SESSION_STATUS.terminated].includes((fe=Y==null?void 0:Y.launcherSession)==null?void 0:fe.status))}catch(Y){console.error("call getLauncherSession error",Y)}})()},[]);const{inService:I}=l,m=(E,$,G=!1)=>async()=>{const X=async ze=>{var He;t({action:E,blocklet:e}),S(!0),p(E);let Be=!1;try{if(E==="remove")await $(ze);else if(E==="start"){if(!F.hasRunnableComponent(e)){N.error(f("blocklet.noComponent"));return}if(!I&&!b&&!((He=e.settings)!=null&&He.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!Ln(L)){N.error(f("blocklet.gotoVisitError"));return}const ne=go(l.info),En=new URL(L);En.searchParams.set("serverUrl",ne),window.open($n(En.href,{allowDomains:null})),n({action:E,blocklet:e});return}const pe=e.children.filter(ne=>!F.isInProgress(ne.status)&&ne.status!=="running").map(ne=>ne.meta.did),ye={did:e.meta.did,componentDids:pe};await $({input:ye})}else if(["stop","restart","reload"].includes(E)){const pe=e.children.filter(ne=>ne.status==="running").map(ne=>ne.meta.did),ye={did:e.meta.did,componentDids:pe};await $({input:ye})}else{const pe={did:e.meta.did};await $({input:pe})}E==="remove"?Be=!0:await xo(1e3),E==="reload"&&N.success(f("blocklet.reloadSuccess")),P(null),n({action:E,blocklet:e})}catch(pe){const ye=`Blocklet ${E} failed: ${Kt(pe)}`;throw n({action:E,blocklet:e,error:new Error(ye)}),new Error(ye)}finally{Be||S(!1)}},ie=()=>{S(!1),P(null)},fe=F.getDisplayName(e,!0),Y=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>s.jsx(B,{component:"div",children:s.jsx(B,{gutterBottom:!0,children:f("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(ze,Be)=>s.jsxs(B,{component:"div",children:[s.jsx(B,{gutterBottom:!0,children:f("blocklet.action.removeApplicationDescription")}),s.jsxs(Vs,{name:"removeType",value:ze.removeType,onChange:He=>Be({...ze,removeType:He.target.value}),children:[s.jsx(Le,{value:"backup",control:s.jsx(Pn,{}),label:f("blocklet.action.removeApplicationAfterBackup")}),s.jsx(Le,{value:"complete",control:s.jsx(Pn,{}),label:f("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},Rs={stop:{title:`${f("common.stop")} ${fe}`,description:f("blocklet.action.stopDescription"),confirm:f("blocklet.action.confirmStop"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie},restart:{title:`${f("common.restart")} ${fe}`,description:f("blocklet.action.restartDescription"),confirm:f("blocklet.action.confirmRestart"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie},remove:{title:`${f("common.remove")} ${fe}`,confirm:f("blocklet.action.confirmRemove"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie,...Y},cancelDownload:{title:`${f("common.cancel")}`,description:f("blocklet.action.cancelDownloadDescription",{name:fe}),confirm:f("common.confirm"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie}};G?P(Rs[E]):await X()},_=!!u,D=E=>{try{E.stopPropagation(),E.preventDefault()}catch{}d(E.currentTarget)},A=E=>{try{E.stopPropagation(),E.preventDefault()}catch{}d(null)},H=async(E,$)=>{try{$.stopPropagation(),$.preventDefault()}catch{}if(typeof E.handler=="function")try{S(!0),p(E.action),await E.handler()}catch(G){console.error(`Blocklet ${E.name} failed: `,G)}finally{S(!1),d(null)}else d(null)},K=!I&&F.isDeletableBlocklet(e)?{action:"remove",icon:be.Remove,name:f("common.remove"),handler:m("remove",async({removeType:E})=>{E==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:h}:null,ht={action:"remove",icon:({sx:E,...$})=>s.jsx(be.Cancel,{sx:{...E,paddingRight:"2px",zoom:.95},...$}),name:f("common.cancel"),handler:m("cancelDownload",l.api.cancelDownloadBlocklet,!0)},Ts=F.getAppMissingConfigs(e),Es=()=>{var X;const E=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),$=i==null?void 0:i({mountPoint:E,blocklet:e});if(!$||!Ln($)){N.error(f("blocklet.gotoVisitError"));return}const G=(X=e==null?void 0:e.site)==null?void 0:X.domainAliases;window.open($n(mi($,".well-known/service/admin"),{allowDomains:G==null?void 0:G.map(ie=>ie.value)}))};let Ue=[{action:"start",icon:be.Start,inExternal:!0,name:f("common.start"),handler:m("start",l.api.startBlocklet),disabled:T||e.children.every(E=>E.status==="running")||gt(e.status)||x||h},{action:"stop",icon:be.Stop,inExternal:!0,name:f("common.stop"),handler:m("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:be.Restart,name:f("common.restart"),handler:m("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},gt(e.status)?ht:K,{separator:!0},I?null:{action:"dashboard",icon:({style:E,...$})=>s.jsx(be.Dashboard,{...$,style:{...E,width:"26px",height:"26px",paddingRight:"3px"}}),name:f("sidebar.dashboard"),handler:Es}].filter(Boolean);return k===gi&&(Ue=Ue.filter(E=>E.inExternal)),r==="menu"?s.jsxs(Nn,{"data-cy":"blocklet-actions",children:[s.jsx(ct,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:D,size:"small",disabled:!o||!gt(e.status)&&v,children:s.jsx(so,{})}),s.jsxs(zs,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:_,onClose:A,PaperProps:{},children:[Ts.length>0&&s.jsxs(nr,{style:{maxWidth:"400px"},severity:"error",children:[f("blocklet.config.missingRequired"),s.jsx("br",{}),s.jsx(cr,{to:`/blocklets/${e.meta.did}/components`,children:f("blocklet.config.gotoFix")})]}),Ue.map((E,$)=>E.separator?s.jsx(Ht,{},`separator-${$}`):s.jsxs(Bs,{dense:!0,onClick:G=>H(E,G),disabled:v||E.disabled,"data-cy":`${E.action}-blocklet`,children:[s.jsx(Hs,{style:{minWidth:24},children:g===E.action&&v?s.jsx(ue,{size:16,sx:{marginRight:1}}):s.jsx(E.icon,{fontSize:"small"})}),s.jsx(qs,{primary:E.name})]},E.name))]}),y&&s.jsx(Mn,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]}):s.jsxs(Nn,{"data-cy":"blocklet-actions",...c,children:[s.jsx(Fs,{children:Ue.filter(E=>!E.separator&&!E.onlyInMenu).map(E=>s.jsxs(ge,{title:E.name,"data-cy":`${E.action}-blocklet`,onClick:()=>H(E),disabled:!!E.disabled||v,children:[g===E.action&&v?s.jsx(ue,{size:16,sx:{marginRight:1}}):s.jsx(E.icon,{}),s.jsx("span",{className:"blocklet-action-text",children:E.name})]},E.name))}),y&&s.jsx(Mn,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}on.propTypes={getComponentUrl:w.func,blocklet:w.object.isRequired,onStart:w.func.isRequired,onComplete:w.func.isRequired,variant:w.oneOf(["menu","group"]),hasPermission:w.bool,useBlockletUrlEvaluation:w.func};on.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const Nn=V.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-Chqr_or_.js","assets/vendor-mui-core-CQ38ohp2.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-DldnaMbZ.js","assets/vendor-ux-did-connect-BdkhddhO.js","assets/vendor-utils-BNHJB5U7.js","assets/vendor-hooks-DftG_2gV.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DO3_1y-L.js","assets/vendor-arcblock-ScFEr-lj.js","assets/index-B1ljmpu4.css","assets/Download-Ch4RfGRW.js","assets/bundle-avatar-D0t7RLGx.js","assets/log-D33dFtt_.css","assets/index-BGgGfqEc.js","assets/ViewList-e3CoNi3K.js","assets/index-B_vrglsK.js","assets/Phone-KP65huHK.js","assets/Location-B8EOY3d0.js","assets/Email-Dz2Eyqu0.js","assets/Timezone-Ce4E1Xey.js","assets/did-address-DUThaBlf.js","assets/permission-BGM09622.js","assets/session-VIMbdc9j.js","assets/click-to-copy-BGyXQL2i.js","assets/index-Dl4W1N74.js","assets/vendor-mui-x-B0hsmEJ3.js","assets/AdapterDayjs-BUGplkxR.js","assets/format-error-BrmqJs5a.js","assets/useAsync-CGW40D2-.js","assets/index-CGBZONPv.js","assets/DeleteOutline-C2sY6hfm.js","assets/confirm-DqvNmeoz.js","assets/util-Dw9Eiuko.js","assets/base32-p9VcJrwv.js","assets/sdk-CTe6rL6c.js","assets/actions-DA-6s_nQ.js","assets/MoreHoriz-CX_pwfPT.js","assets/shorten-label-DFzv9EKX.js","assets/PlayArrow-DFH1Psjx.js","assets/get-safe-url-Bq9SFfX6.js","assets/index-DcBUShKK.js","assets/InfoOutlined-CQB5qKm-.js","assets/dot-BE1YP292.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-DlKplWTG.js","assets/index-C8QMe2NL.js","assets/ExpandLess-BiMmSOBl.js","assets/index-DNG6b9sp.js","assets/Error-CSFUqG0m.js","assets/empty-spinner-DmDm8XzF.js","assets/list-header-CgF1S4js.js","assets/QuestionMarkCircle-p6m3avKp.js","assets/index-DVQCgvFb.js","assets/index-DKhrYmrN.js","assets/api-BrU7j0QA.js","assets/ChevronRight-ZTqWK-Ga.js","assets/react-beautiful-dnd.esm-ByydTUk4.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-nK3D7WH5.js","assets/Launch-fxgQvk19.js","assets/Done-JLiLhELm.js","assets/delete-confirm-_BzUlhv2.js","assets/ArrowDropDown-B0sLkJoY.js","assets/index-CHbpkZwO.js","assets/index-C0Iiqot3.css","assets/index-SDdS_qt8.js","assets/overview-DLA9wj6a.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-CygZ0LuY.js","assets/omit-bLid3PKQ.js","assets/spaces-WkJCApHO.js","assets/domains-BDxEOJh6.js","assets/domain-action-card-D3w6jyPR.js","assets/util-Bjy-tP7q.js","assets/CheckCircle-BNrN9mgy.js","assets/index-DO4cSlUf.js","assets/passport-item-CWtlyIE_.js","assets/Google-GOp5YvmZ.js","assets/cloneDeep-SfcdeqEN.js","assets/EditIcon-Bi2cR-_u.js","assets/LockIcon-fuTfhB_G.js","assets/appearance-DYi32tlk.js","assets/audit-logs-CydL26ZC.js","assets/relative-time-Djw-K4Zu.js","assets/index-BnmeT4Bk.js","assets/list-Dmtz4mRb.js","assets/use-app-logo-B8Kl9EZt.js","assets/traffic-T11hxc--.js","assets/iframe-DZ181i8X.js","assets/LaunchOutlined-BV4_W1pb.js","assets/ChevronLeft-Dq00IS01.js","assets/index-BT0GBmWF.js","assets/config-navigation-Dvjz9nAh.js","assets/index-YbJjfDTR.js","assets/slicedToArray-CPl5_eGD.js","assets/simple-select-DlrdVbaI.js","assets/index-EnQ254k3.js","assets/use-mobile-C_flBrm-.js","assets/connect-to-Ck5O2M1K.js","assets/config-space-CYg-72ab.js","assets/index-CYeIiQ6Q.js","assets/switch-control-5fEOPVKs.js","assets/index-bb90BUf4.js","assets/security-BhkfG23R.js","assets/config-Bh19ZUJ-.js","assets/branding-CAMtNLMU.js","assets/logo-uploader-CJrdpVcQ.js","assets/advanced-DTe2fs5L.js","assets/runtime-DXl0lfXF.js","assets/index-n0Q-fETi.js","assets/Edit-CY6fFHQM.js","assets/component-5gjaNHCg.js","assets/TuneOutlined-Dy2qPFGI.js","assets/add-component-core-DG9mQFsr.js","assets/launch-result-message-C9huWJUf.js","assets/page-header-CWY8mxlT.js","assets/index-Cjjg2_Xp.js","assets/content-layout-BPaAeaMQ.js","assets/add-component-core-D-IRi6XF.css","assets/index-DuH8q5ir.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ce,u as Yn,p as Ps,h as et,f as er,g as tr,i as Ls,j as ks,k as Ds,m as As,l as Rn,n as Os,E as Ms,o as $s,H as Ns,_ as M,R as Us}from"./vendor-arcblock-ScFEr-lj.js";import{H as w,j as s,a8 as Z,ag as V,I as ct,ap as zs,aj as nr,X as Ht,q as Bs,b4 as Hs,aa as ue,b5 as qs,bw as Fs,T as B,bu as Vs,bs as Le,bv as Pn,a9 as R,bJ as Ws,v as se,a5 as lt,bK as Ks,ad as Gs,be as Qs,ao as qt,bL as rr,ac as ke,bM as Zs,aq as Js,ah as Xs,ak as tt,O as re,bt as Ct,bo as ae,bN as sr,bO as or,bP as ir,E as me,b3 as ar,y as Ys,bg as eo}from"./vendor-mui-core-CQ38ohp2.js";import{r as j,L as cr,f as lr,g as ur,u as to,l as no}from"./vendor-react-DEoibe3W.js";import{r as J,b4 as ro,b2 as ut,b5 as so,B as ge,j as z,a1 as Ln,Y as N,u as W,an as oo,m as dr,i as Ft,k as io,d as ao,W as Vt,aX as co,a4 as fr,ar as pr,b6 as lo,I as uo,C as nt,b7 as fo,b8 as po,_ as mo,al as ho}from"./vendor-ux-did-connect-BdkhddhO.js";import{z as Se,f as F,A as gt,B as go,b as xo,C as Wt,D as vo,E as mr,F as te,G as hr,t as je,H as gr,I as yo,n as Ce,J as bo,K as jo,u as wo,j as kn,g as _o,L as Dn,h as So,l as xt,k as Co,m as Io,M as To,O as Eo,Q as Ge,e as qe,R as Ro,T as Po,U as Lo,N as ko,V as vt,c as An}from"./index-DO3_1y-L.js";import{ad as Do,y as we,ae as Ao,z as Qe,I as xr,x as vr,af as Oo}from"./vendor-utils-BNHJB5U7.js";import{_ as On}from"./useLocalStorage-DldnaMbZ.js";import{C as Mn}from"./confirm-DqvNmeoz.js";import{d as Mo}from"./PlayArrow-DFH1Psjx.js";import{g as $n}from"./get-safe-url-Bq9SFfX6.js";import{f as Kt}from"./format-error-BrmqJs5a.js";import{u as yr}from"./session-VIMbdc9j.js";import{f as xe,a as br,u as q,w as $o}from"./vendor-hooks-DftG_2gV.js";import{i as No,u as Uo,M as zo,c as De,s as rt,H as Bo,p as jr}from"./index-DcBUShKK.js";import{d as Ho}from"./InfoOutlined-CQB5qKm-.js";import{_ as wr,D as qo}from"./dot-BE1YP292.js";import{_ as _r}from"./useSetState-CWq0AVWn.js";import{u as Sr}from"./use-mobile-DlKplWTG.js";const Cr=j.createContext({});function Gt({children:e,type:t}){const[n,r]=j.useState([]),o=j.useRef([]),i=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(g=>l.find(p=>p===g));Do(u,n).forEach(g=>a(g))};return s.jsx(Cr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:i,removeDeletingDid:a,matchDeletingDid:c},children:e})}Gt.propTypes={type:w.string,children:w.node.isRequired};Gt.defaultProps={type:"blocklets"};function Hl(){return j.useContext(Cr)}var Qt={},Fo=Z;Object.defineProperty(Qt,"__esModule",{value:!0});var Ir=Qt.default=void 0,Vo=Fo(J()),Wo=s;Ir=Qt.default=(0,Vo.default)((0,Wo.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Zt={},Ko=Z;Object.defineProperty(Zt,"__esModule",{value:!0});var Tr=Zt.default=void 0,Go=Ko(J()),Qo=s;Tr=Zt.default=(0,Go.default)((0,Qo.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var Jt={},Zo=Z;Object.defineProperty(Jt,"__esModule",{value:!0});var Er=Jt.default=void 0,Jo=Zo(J()),Xo=s;Er=Jt.default=(0,Jo.default)((0,Xo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Xt={},Yo=Z;Object.defineProperty(Xt,"__esModule",{value:!0});var Yt=Xt.default=void 0,ei=Yo(J()),ti=s;Yt=Xt.default=(0,ei.default)((0,ti.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var en={},ni=Z;Object.defineProperty(en,"__esModule",{value:!0});var Rr=en.default=void 0,ri=ni(J()),si=s;Rr=en.default=(0,ri.default)((0,si.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var tn={},oi=Z;Object.defineProperty(tn,"__esModule",{value:!0});var Pr=tn.default=void 0,ii=oi(J()),ai=s;Pr=tn.default=(0,ii.default)((0,ai.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var nn={},ci=Z;Object.defineProperty(nn,"__esModule",{value:!0});var Lr=nn.default=void 0,li=ci(J()),ui=s;Lr=nn.default=(0,li.default)((0,ui.jsx)("path",{d:"M12 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-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var rn=function(e){return s.jsx("svg",{...e,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};rn.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};rn.displayName="dashboard";var sn={},di=Z;Object.defineProperty(sn,"__esModule",{value:!0});var kr=sn.default=void 0,fi=di(J()),pi=s;kr=sn.default=(0,fi.default)((0,pi.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const be={Start:Mo,Stop:Ir,Restart:Tr,Reload:Er,Remove:ro,Config:Yt,Log:Rr,Group:Pr,Cancel:Lr,Dashboard:rn,Overview:kr},mi=(e,t)=>{if(!e)return"";const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(we(n.origin,t));return o.search=r.toString(),o.toString()},hi="internal",gi="external";function on({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:o,getComponentUrl:i,useBlockletUrlEvaluation:a,...c}){const l=Se(),[u,d]=j.useState(null),[g,p]=j.useState(null),[v,S]=j.useState(!1),[y,P]=j.useState(null),{t:f}=j.useContext(ut),[b]=On("skip-blocklet-setup",!1),{loading:x,recommendedUrl:L}=a(e),[k]=On("blocklet-type-filter",hi),h=F.isInProgress(e.status),[T,C]=j.useState(!1);j.useEffect(()=>{var $,G;if(!(e!=null&&e.controller))return;C(((G=($=e==null?void 0:e.controller)==null?void 0:$.status)==null?void 0:G.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var X,ie,fe;try{const Y=await l.api.getLauncherSession({input:{launcherSessionId:(X=e==null?void 0:e.controller)==null?void 0:X.launcherSessionId,launcherUrl:(ie=e==null?void 0:e.controller)==null?void 0:ie.launcherUrl}});if(Y!=null&&Y.error){console.error("get launcher session failed",Y.error);return}C([z.LAUNCH_SESSION_STATUS.overdue,z.LAUNCH_SESSION_STATUS.canceled,z.LAUNCH_SESSION_STATUS.terminated].includes((fe=Y==null?void 0:Y.launcherSession)==null?void 0:fe.status))}catch(Y){console.error("call getLauncherSession error",Y)}})()},[]);const{inService:I}=l,m=(E,$,G=!1)=>async()=>{const X=async ze=>{var He;t({action:E,blocklet:e}),S(!0),p(E);let Be=!1;try{if(E==="remove")await $(ze);else if(E==="start"){if(!F.hasRunnableComponent(e)){N.error(f("blocklet.noComponent"));return}if(!I&&!b&&!((He=e.settings)!=null&&He.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!Ln(L)){N.error(f("blocklet.gotoVisitError"));return}const ne=go(l.info),En=new URL(L);En.searchParams.set("serverUrl",ne),window.open($n(En.href,{allowDomains:null})),n({action:E,blocklet:e});return}const pe=e.children.filter(ne=>!F.isInProgress(ne.status)&&ne.status!=="running").map(ne=>ne.meta.did),ye={did:e.meta.did,componentDids:pe};await $({input:ye})}else if(["stop","restart","reload"].includes(E)){const pe=e.children.filter(ne=>ne.status==="running").map(ne=>ne.meta.did),ye={did:e.meta.did,componentDids:pe};await $({input:ye})}else{const pe={did:e.meta.did};await $({input:pe})}E==="remove"?Be=!0:await xo(1e3),E==="reload"&&N.success(f("blocklet.reloadSuccess")),P(null),n({action:E,blocklet:e})}catch(pe){const ye=`Blocklet ${E} failed: ${Kt(pe)}`;throw n({action:E,blocklet:e,error:new Error(ye)}),new Error(ye)}finally{Be||S(!1)}},ie=()=>{S(!1),P(null)},fe=F.getDisplayName(e,!0),Y=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>s.jsx(B,{component:"div",children:s.jsx(B,{gutterBottom:!0,children:f("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(ze,Be)=>s.jsxs(B,{component:"div",children:[s.jsx(B,{gutterBottom:!0,children:f("blocklet.action.removeApplicationDescription")}),s.jsxs(Vs,{name:"removeType",value:ze.removeType,onChange:He=>Be({...ze,removeType:He.target.value}),children:[s.jsx(Le,{value:"backup",control:s.jsx(Pn,{}),label:f("blocklet.action.removeApplicationAfterBackup")}),s.jsx(Le,{value:"complete",control:s.jsx(Pn,{}),label:f("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},Rs={stop:{title:`${f("common.stop")} ${fe}`,description:f("blocklet.action.stopDescription"),confirm:f("blocklet.action.confirmStop"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie},restart:{title:`${f("common.restart")} ${fe}`,description:f("blocklet.action.restartDescription"),confirm:f("blocklet.action.confirmRestart"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie},remove:{title:`${f("common.remove")} ${fe}`,confirm:f("blocklet.action.confirmRemove"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie,...Y},cancelDownload:{title:`${f("common.cancel")}`,description:f("blocklet.action.cancelDownloadDescription",{name:fe}),confirm:f("common.confirm"),cancel:f("common.cancel"),onConfirm:X,onCancel:ie}};G?P(Rs[E]):await X()},_=!!u,D=E=>{try{E.stopPropagation(),E.preventDefault()}catch{}d(E.currentTarget)},A=E=>{try{E.stopPropagation(),E.preventDefault()}catch{}d(null)},H=async(E,$)=>{try{$.stopPropagation(),$.preventDefault()}catch{}if(typeof E.handler=="function")try{S(!0),p(E.action),await E.handler()}catch(G){console.error(`Blocklet ${E.name} failed: `,G)}finally{S(!1),d(null)}else d(null)},K=!I&&F.isDeletableBlocklet(e)?{action:"remove",icon:be.Remove,name:f("common.remove"),handler:m("remove",async({removeType:E})=>{E==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:h}:null,ht={action:"remove",icon:({sx:E,...$})=>s.jsx(be.Cancel,{sx:{...E,paddingRight:"2px",zoom:.95},...$}),name:f("common.cancel"),handler:m("cancelDownload",l.api.cancelDownloadBlocklet,!0)},Ts=F.getAppMissingConfigs(e),Es=()=>{var X;const E=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),$=i==null?void 0:i({mountPoint:E,blocklet:e});if(!$||!Ln($)){N.error(f("blocklet.gotoVisitError"));return}const G=(X=e==null?void 0:e.site)==null?void 0:X.domainAliases;window.open($n(mi($,".well-known/service/admin"),{allowDomains:G==null?void 0:G.map(ie=>ie.value)}))};let Ue=[{action:"start",icon:be.Start,inExternal:!0,name:f("common.start"),handler:m("start",l.api.startBlocklet),disabled:T||e.children.every(E=>E.status==="running")||gt(e.status)||x||h},{action:"stop",icon:be.Stop,inExternal:!0,name:f("common.stop"),handler:m("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:be.Restart,name:f("common.restart"),handler:m("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},gt(e.status)?ht:K,{separator:!0},I?null:{action:"dashboard",icon:({style:E,...$})=>s.jsx(be.Dashboard,{...$,style:{...E,width:"26px",height:"26px",paddingRight:"3px"}}),name:f("sidebar.dashboard"),handler:Es}].filter(Boolean);return k===gi&&(Ue=Ue.filter(E=>E.inExternal)),r==="menu"?s.jsxs(Nn,{"data-cy":"blocklet-actions",children:[s.jsx(ct,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:D,size:"small",disabled:!o||!gt(e.status)&&v,children:s.jsx(so,{})}),s.jsxs(zs,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:_,onClose:A,PaperProps:{},children:[Ts.length>0&&s.jsxs(nr,{style:{maxWidth:"400px"},severity:"error",children:[f("blocklet.config.missingRequired"),s.jsx("br",{}),s.jsx(cr,{to:`/blocklets/${e.meta.did}/components`,children:f("blocklet.config.gotoFix")})]}),Ue.map((E,$)=>E.separator?s.jsx(Ht,{},`separator-${$}`):s.jsxs(Bs,{dense:!0,onClick:G=>H(E,G),disabled:v||E.disabled,"data-cy":`${E.action}-blocklet`,children:[s.jsx(Hs,{style:{minWidth:24},children:g===E.action&&v?s.jsx(ue,{size:16,sx:{marginRight:1}}):s.jsx(E.icon,{fontSize:"small"})}),s.jsx(qs,{primary:E.name})]},E.name))]}),y&&s.jsx(Mn,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]}):s.jsxs(Nn,{"data-cy":"blocklet-actions",...c,children:[s.jsx(Fs,{children:Ue.filter(E=>!E.separator&&!E.onlyInMenu).map(E=>s.jsxs(ge,{title:E.name,"data-cy":`${E.action}-blocklet`,onClick:()=>H(E),disabled:!!E.disabled||v,children:[g===E.action&&v?s.jsx(ue,{size:16,sx:{marginRight:1}}):s.jsx(E.icon,{}),s.jsx("span",{className:"blocklet-action-text",children:E.name})]},E.name))}),y&&s.jsx(Mn,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}on.propTypes={getComponentUrl:w.func,blocklet:w.object.isRequired,onStart:w.func.isRequired,onComplete:w.func.isRequired,variant:w.oneOf(["menu","group"]),hasPermission:w.bool,useBlockletUrlEvaluation:w.func};on.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const Nn=V.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,a9 as e,H as h,ag as v}from"./vendor-mui-core-CQ38ohp2.js";import{n as C,f as k,ai as b,d as B}from"./index-DO3_1y-L.js";import{D as w,a as I,b as E}from"./domain-action-card-D3w6jyPR.js";import{b2 as T}from"./vendor-ux-did-connect-BdkhddhO.js";import{P as A}from"./page-header-CWY8mxlT.js";import{r}from"./vendor-react-DEoibe3W.js";import{_ as L}from"./useSetState-CWq0AVWn.js";import{S as x}from"./button-BeZibzB9.js";import{S as W}from"./layout-Cw-hwCHs.js";import{S as H}from"./step-actions-D_1PFeFs.js";import"./vendor-arcblock-ScFEr-lj.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./ExpandLess-BiMmSOBl.js";import"./permission-BGM09622.js";import"./session-VIMbdc9j.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./actions-DA-6s_nQ.js";import"./MoreHoriz-CX_pwfPT.js";import"./delete-confirm-_BzUlhv2.js";import"./click-to-copy-BGyXQL2i.js";import"./util-Bjy-tP7q.js";import"./InfoOutlined-CQB5qKm-.js";import"./index-CGBZONPv.js";import"./CheckCircle-BNrN9mgy.js";import"./content-layout-BPaAeaMQ.js";import"./use-mobile-
|
|
1
|
+
import{j as o,a9 as e,H as h,ag as v}from"./vendor-mui-core-CQ38ohp2.js";import{n as C,f as k,ai as b,d as B}from"./index-DO3_1y-L.js";import{D as w,a as I,b as E}from"./domain-action-card-D3w6jyPR.js";import{b2 as T}from"./vendor-ux-did-connect-BdkhddhO.js";import{P as A}from"./page-header-CWY8mxlT.js";import{r}from"./vendor-react-DEoibe3W.js";import{_ as L}from"./useSetState-CWq0AVWn.js";import{S as x}from"./button-BeZibzB9.js";import{S as W}from"./layout-Cw-hwCHs.js";import{S as H}from"./step-actions-D_1PFeFs.js";import"./vendor-arcblock-ScFEr-lj.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./ExpandLess-BiMmSOBl.js";import"./permission-BGM09622.js";import"./session-VIMbdc9j.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./actions-DA-6s_nQ.js";import"./MoreHoriz-CX_pwfPT.js";import"./delete-confirm-_BzUlhv2.js";import"./click-to-copy-BGyXQL2i.js";import"./util-Bjy-tP7q.js";import"./InfoOutlined-CQB5qKm-.js";import"./index-CGBZONPv.js";import"./CheckCircle-BNrN9mgy.js";import"./content-layout-BPaAeaMQ.js";import"./use-mobile-DlKplWTG.js";function d({onNext:s,onPrevious:D}){var u,f;const{t:n}=r.useContext(T),[S,p]=r.useState(!1),{blocklet:i}=C(),[l,j]=r.useState(""),y=(((i==null?void 0:i.site)||{}).domainAliases||[]).map(t=>k.replaceSlotToIp(t.value,l)),[a,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=(f=(u=i.environments)==null?void 0:u.find(t=>t.key==="BLOCKLET_APP_PK"))==null?void 0:f.value,P=y.find(t=>b.isDidDomain(t));return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{j(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(_,{children:[o.jsx(e,{className:"header",children:o.jsx(A,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:D})}),o.jsxs(e,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(e,{children:[o.jsx(e,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o.jsx(e,{display:"inline",children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(e,{mt:1,children:o.jsx(I,{blocklet:i,bugDidDomainProps:{appPk:c,appId:i.appPid,siteId:i.site.id,teamDid:i.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:i.appPid,siteId:i.site.id,teamDid:i.meta.did,cnameDomain:P,currentIp:l,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),p(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};m(g),s()},onError:p}})})]}),o.jsx(e,{children:o.jsx(E,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(e,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1,children:o.jsx(e,{display:"inline",children:n("setup.domain.skipDescription")})})})})]}),o.jsx(H,{mt:8,disabled:!!a.addDomainState.text,blocklet:i,onStartNow:()=>s("complete"),children:a.domain?o.jsx(x,{variant:"contained",loading:!!a.addDomainState.text,disabled:S||!!a.addDomainState.text||!a.domain,onClick:()=>s(),children:a.addDomainState.text||n("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!a.addDomainState.text,onClick:()=>s(),children:n("setup.continue")})})]})}function xt(s){return o.jsx(w,{children:o.jsx(d,{...s})})}d.propTypes={onNext:h.func,onPrevious:h.func};d.defaultProps={onNext:()=>{},onPrevious:()=>{}};const _=v(W)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: hidden;
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as b,H as ee,l as te}from"./vendor-arcblock-ScFEr-lj.js";import{a8 as se,j as e,ak as g,T as j,y as T,ao as ne,a9 as $,O as H,aa as ie,ag as oe}from"./vendor-mui-core-CQ38ohp2.js";import{r as o,h as re}from"./vendor-react-DEoibe3W.js";import{J as h}from"./vendor-utils-BNHJB5U7.js";import{j as p,r as ae,u as ce,o as le,Y as w,W as ue,n as de,az as fe}from"./vendor-ux-did-connect-BdkhddhO.js";import{L as me}from"./landing-page-BMM_oJb1.js";import{u as pe,d as M}from"./index-DO3_1y-L.js";import{f as S}from"./format-error-BrmqJs5a.js";import{d as ge}from"./CheckCircle-BNrN9mgy.js";import{g as D}from"./get-safe-url-
|
|
2
|
+
import{_ as b,H as ee,l as te}from"./vendor-arcblock-ScFEr-lj.js";import{a8 as se,j as e,ak as g,T as j,y as T,ao as ne,a9 as $,O as H,aa as ie,ag as oe}from"./vendor-mui-core-CQ38ohp2.js";import{r as o,h as re}from"./vendor-react-DEoibe3W.js";import{J as h}from"./vendor-utils-BNHJB5U7.js";import{j as p,r as ae,u as ce,o as le,Y as w,W as ue,n as de,az as fe}from"./vendor-ux-did-connect-BdkhddhO.js";import{L as me}from"./landing-page-BMM_oJb1.js";import{u as pe,d as M}from"./index-DO3_1y-L.js";import{f as S}from"./format-error-BrmqJs5a.js";import{d as ge}from"./CheckCircle-BNrN9mgy.js";import{g as D}from"./get-safe-url-DBsPGn--.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";var N;(N=window.env)!=null&&N.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},he=se;Object.defineProperty(P,"__esModule",{value:!0});var F=P.default=void 0,ye=he(ae()),xe=e;F=P.default=(0,ye.default)((0,xe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const Ee=oe.form`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aa as E,a9 as T}from"./vendor-mui-core-CQ38ohp2.js";import{r as j,f as W}from"./vendor-react-DEoibe3W.js";import{u as k,C as L,an as S,Y as h,j as I,b1 as R}from"./vendor-ux-did-connect-BdkhddhO.js";import{L as U}from"./landing-page-BMM_oJb1.js";import{w as b}from"./wrap-locale-DMTYAE64.js";import{g as v}from"./get-safe-url-
|
|
1
|
+
import{j as e,aa as E,a9 as T}from"./vendor-mui-core-CQ38ohp2.js";import{r as j,f as W}from"./vendor-react-DEoibe3W.js";import{u as k,C as L,an as S,Y as h,j as I,b1 as R}from"./vendor-ux-did-connect-BdkhddhO.js";import{L as U}from"./landing-page-BMM_oJb1.js";import{w as b}from"./wrap-locale-DMTYAE64.js";import{g as v}from"./get-safe-url-Bq9SFfX6.js";import{S as N,s as _,a as B}from"./index-DO3_1y-L.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";function F({SessionContext:a,webWalletUrl:n,onSuccess:s}){var d,g;const{api:t,session:i}=j.useContext(a),{t:o,locale:f}=k(),u=W(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),w=async(r,C)=>{s(r,C),await i.refresh(),h.success(o("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(I.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=v(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{h.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(L,{children:e.jsx(E,{})}):e.jsx(U,{did:((d=window==null?void 0:window.blocklet)==null?void 0:d.appPid)||((g=window==null?void 0:window.env)==null?void 0:g.appPid),children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(S,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:n,onSuccess:w,onError:P,locale:f,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const A=b(F);function G(){const a=R(),n=(s,t)=>{s.sessionToken&&(_(t(s.sessionToken)),B(t(s.refreshToken)))};return e.jsx(A,{SessionContext:N,webWalletUrl:a,onSuccess:n})}export{G as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a9 as t,aa as P,ao as W,H as d,ag as B}from"./vendor-mui-core-CQ38ohp2.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{y as v}from"./vendor-utils-BNHJB5U7.js";import{d as I}from"./Launch-fxgQvk19.js";import{b2 as L,an as $}from"./vendor-ux-did-connect-BdkhddhO.js";import{W as E}from"./did-address-DUThaBlf.js";import{P as T}from"./page-header-CWY8mxlT.js";import{n as z,u as A}from"./index-DO3_1y-L.js";import{S as D}from"./layout-Cw-hwCHs.js";import{S as F}from"./step-actions-D_1PFeFs.js";import{S as m}from"./button-BeZibzB9.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./content-layout-BPaAeaMQ.js";import"./use-mobile-
|
|
1
|
+
import{j as e,a9 as t,aa as P,ao as W,H as d,ag as B}from"./vendor-mui-core-CQ38ohp2.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{y as v}from"./vendor-utils-BNHJB5U7.js";import{d as I}from"./Launch-fxgQvk19.js";import{b2 as L,an as $}from"./vendor-ux-did-connect-BdkhddhO.js";import{W as E}from"./did-address-DUThaBlf.js";import{P as T}from"./page-header-CWY8mxlT.js";import{n as z,u as A}from"./index-DO3_1y-L.js";import{S as D}from"./layout-Cw-hwCHs.js";import{S as F}from"./step-actions-D_1PFeFs.js";import{S as m}from"./button-BeZibzB9.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./content-layout-BPaAeaMQ.js";import"./use-mobile-DlKplWTG.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:h,actions:j}=z(),{api:y}=A(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(H,{children:[e.jsx("div",{className:"header",children:e.jsx(T,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${C}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(E,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(I,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx($,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:k,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:p})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:b})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const H=B(D)`
|
|
2
2
|
.qr-body {
|
|
3
3
|
width: 580px;
|
|
4
4
|
${n=>n.theme.breakpoints.down("md")} {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Y,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a8 as rn,j as n,a9 as ae,bo as Yt,br as Zt,bn as Qt,q as xt,T as Be,O as lt,aa as rt,bx as nr,aj as tt,H as K,ag as je,ac as wt,w as Wn,y as nn,b4 as Hn,b5 as Gn,I as Yn,bg as Zn,bs as Qn,bS as Jn}from"./vendor-mui-core-CQ38ohp2.js";import{q as Ie,B as Jt,c as Xt,Z as Xn,aw as ei,n as Rr,y as ti,z as ri}from"./vendor-utils-BNHJB5U7.js";import{r as on,bx as ut,by as ni,bz as ii,bA as an,bB as oi,bC as ai,bD as si,bE as sn,bF as ci,bG as ir,bH as li,bI as ui,bJ as fi,bK as di,aJ as or,bL as cn,az as pi,f as mi,u as Te,X as hi,W as gi,al as Ye,B as Ee,c as yi,an as vi,d as bi,b2 as ft,Y as Fe,bm as xi,j as Ze,_ as ln,ah as wi,I as Ei,ar as ji,b4 as Si,a5 as un,a4 as fn,bt as Ci,V as Pi}from"./vendor-ux-did-connect-BdkhddhO.js";import{c as Ke,a as Ai,V as dn,K as Et,B as Ii,W as Oi}from"./vendor-arcblock-ScFEr-lj.js";import{d as Ri}from"./ViewList-e3CoNi3K.js";import{a1 as Ti,f as Ni,z as Pe,at as ar,l as Qe,a2 as Di,U as Je,au as _i,C as pn,av as mn,t as Li,b as Ui}from"./index-DO3_1y-L.js";import{U as hn,C as gn,I as ki}from"./index-B_vrglsK.js";import{k as qi,u as sr,a as cr,l as Bi,f as Ki}from"./vendor-hooks-DftG_2gV.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-8QXGSoVu.js";import{W as lr}from"./did-address-DUThaBlf.js";import{P as Me}from"./permission-BGM09622.js";import{C as At}from"./click-to-copy-BGyXQL2i.js";import{T as vn}from"./index-Dl4W1N74.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Mi}from"./useAsync-CGW40D2-.js";import{I as Ce}from"./index-CGBZONPv.js";import{d as Fi}from"./DeleteOutline-C2sY6hfm.js";import{C as dt}from"./confirm-DqvNmeoz.js";import{u as pt}from"./session-VIMbdc9j.js";import{i as bn,a as jt,p as xn}from"./util-Dw9Eiuko.js";import{b as $i}from"./sdk-CTe6rL6c.js";import{A as Vi}from"./actions-DA-6s_nQ.js";import{S as zi}from"./shorten-label-DFzv9EKX.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";import"./base32-p9VcJrwv.js";import"./MoreHoriz-CX_pwfPT.js";var ur={},Wi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Hi=Wi(on()),Gi=n;wn=ur.default=(0,Hi.default)((0,Gi.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 Yi=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={},Zi=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 Qi(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=Qi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),u=0;u<c.length;u++){var m=c[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var Xi=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)}},eo=(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)]},to=function(e,t){for(var r={},i=Object.keys(e),c=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(c?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Zi,r=Xi,i=eo,c=to,u=a=>a==null;function m(a){switch(a.arrayFormat){case"index":return o=>(l,d)=>{const w=l.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[b(o,a),"[",w,"]"].join("")]:[...l,[b(o,a),"[",b(w,a),"]=",b(d,a)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[b(o,a),"[]"].join("")]:[...l,[b(o,a),"[]=",b(d,a)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,a),"=",b(d,a)].join("")]:[[l,b(d,a)].join(a.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,b(o,a)]:[...l,[b(o,a),"=",b(d,a)].join("")]}}function x(a){let o;switch(a.arrayFormat){case"index":return(l,d,w)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){w[l]=d;return}w[l]===void 0&&(w[l]={}),w[l][o[1]]=d};case"bracket":return(l,d,w)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){w[l]=d;return}if(w[l]===void 0){w[l]=[d];return}w[l]=[].concat(w[l],d)};case"comma":case"separator":return(l,d,w)=>{const P=typeof d=="string"&&d.includes(a.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,a).includes(a.arrayFormatSeparator);d=S?h(d,a):d;const J=P||S?d.split(a.arrayFormatSeparator).map(Z=>h(Z,a)):d===null?d:h(d,a);w[l]=J};default:return(l,d,w)=>{if(w[l]===void 0){w[l]=d;return}w[l]=[].concat(w[l],d)}}}function j(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function h(a,o){return o.decode?r(a):a}function N(a){return Array.isArray(a)?a.sort():typeof a=="object"?N(Object.keys(a)).sort((o,l)=>Number(o)-Number(l)).map(o=>a[o]):a}function C(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function A(a){let o="";const l=a.indexOf("#");return l!==-1&&(o=a.slice(l)),o}function y(a){a=C(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function k(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function E(a,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 a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const w of a.split("&")){if(w==="")continue;let[P,S]=i(o.decode?w.replace(/\+/g," "):w,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const w of Object.keys(d)){const P=d[w];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=k(P[S],o);else d[w]=k(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((w,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?w[P]=N(S):w[P]=S,w},Object.create(null))}e.extract=y,e.parse=E,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(a[S])||o.skipEmptyString&&a[S]==="",d=m(o),w={};for(const S of Object.keys(a))l(S)||(w[S]=a[S]);const P=Object.keys(w);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=a[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=(a,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(a,"#");return Object.assign({url:l.split("?")[0]||"",query:E(y(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(a.url).split("?")[0]||"",d=e.extract(a.url),w=e.parse(d,{sort:!1}),P=Object.assign(w,a.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(a.url);return a.fragmentIdentifier&&(J=`#${b(a.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(a,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:w,fragmentIdentifier:P}=e.parseUrl(a,l);return e.stringifyUrl({url:d,query:c(w,o),fragmentIdentifier:P},l)},e.exclude=(a,o,l)=>{const d=Array.isArray(o)?w=>!o.includes(w):(w,P)=>!o(w,P);return e.pick(a,d,l)}})(vt);const at=$n,ro={parseNumbers:!1,parseBooleans:!1},no={skipNull:!1,skipEmptyString:!1},io=(e,t)=>{var r,i;const{navigateMode:c="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},ro),u),j=Object.assign(Object.assign({},no),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=qi(),A=Y.useRef(typeof e=="function"?e():e||{}),y=Y.useMemo(()=>vt.parse(b.search,x),[b.search]),k=Y.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[k,sr(a=>{const o=typeof a=="function"?a(k):a;C(),h&&h[c]({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:c==="replace",state:b.state})})]},oo=io;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&&c(o,l)}function c(o,l){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,P){return w.__proto__=P,w},c(o,l)}function u(o){var l=j();return function(){var w=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(w,arguments,S)}else P=w.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 w(S,J,Z){return typeof l=="string"?l:l(S,J,Z)}var P=function(S){i(Z,S);var J=u(Z);function Z(G,W,F){var H;return r(this,Z),H=J.call(this,w(G,W,F)),H.code=o,H}return t(Z)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(w){return String(w)}),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 k(o,l,d){return o.substr(0,l.length)===l}function E(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function a(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 w;typeof l=="string"&&k(l,"not ")?(w="must not be",l=l.replace(/^not /,"")):w="must be";var P;if(E(o," argument"))P="The ".concat(o," ").concat(w," ").concat(y(l,"type"));else{var S=a(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(w," ").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 w=C.inspect(l);return w.length>128&&(w="".concat(w.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(w)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var w;return d&&d.constructor&&d.constructor.name?w="instance of ".concat(d.constructor.name):w="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(w,".")},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 w="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:w+="".concat(l[0]," argument");break;case 2:w+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:w+=l.slice(0,P-1).join(", "),w+=", and ".concat(l[P-1]," arguments");break}return"".concat(w," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function ao(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(I);O&&(B=B.filter(function(q){return Object.getOwnPropertyDescriptor(I,q).enumerable})),M.push.apply(M,B)}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(B){r(I,B,M[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(B){Object.defineProperty(I,B,Object.getOwnPropertyDescriptor(M,B))})}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 c(I,O){for(var M=0;M<O.length;M++){var B=O[M];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(I,m(B.key),B)}}function u(I,O,M){return O&&c(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 B=M.call(I,O||"default");if(o(B)!=="object")return B;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&&E(I,O)}function b(I){var O=y();return function(){var B=a(I),q;if(O){var g=a(this).constructor;q=Reflect.construct(B,arguments,g)}else q=B.apply(this,arguments);return h(this,q)}}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(B){if(B===null||!k(B))return B;if(typeof B!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(B))return O.get(B);O.set(B,q)}function q(){return A(B,arguments,a(this).constructor)}return q.prototype=Object.create(B.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),E(q,B)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(q,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(q,v),R=new _;return p&&E(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 k(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function E(I,O){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,q){return B.__proto__=q,B},E(I,O)}function a(I){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},a(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,w=Sn(),P=w.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 Z="",G="",W="",F="",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:"},pe=10;function Q(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(B){M[B]=I[B]}),Object.defineProperty(M,"message",{value:I.message}),M}function fe(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 Ae(I,O,M){var B="",q="",g=0,p="",v=!1,_=fe(I),R=_.split(`
|
|
1
|
+
import{r as Y,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a8 as rn,j as n,a9 as ae,bo as Yt,br as Zt,bn as Qt,q as xt,T as Be,O as lt,aa as rt,bx as nr,aj as tt,H as K,ag as je,ac as wt,w as Wn,y as nn,b4 as Hn,b5 as Gn,I as Yn,bg as Zn,bs as Qn,bS as Jn}from"./vendor-mui-core-CQ38ohp2.js";import{q as Ie,B as Jt,c as Xt,Z as Xn,aw as ei,n as Rr,y as ti,z as ri}from"./vendor-utils-BNHJB5U7.js";import{r as on,bx as ut,by as ni,bz as ii,bA as an,bB as oi,bC as ai,bD as si,bE as sn,bF as ci,bG as ir,bH as li,bI as ui,bJ as fi,bK as di,aJ as or,bL as cn,az as pi,f as mi,u as Te,X as hi,W as gi,al as Ye,B as Ee,c as yi,an as vi,d as bi,b2 as ft,Y as Fe,bm as xi,j as Ze,_ as ln,ah as wi,I as Ei,ar as ji,b4 as Si,a5 as un,a4 as fn,bt as Ci,V as Pi}from"./vendor-ux-did-connect-BdkhddhO.js";import{c as Ke,a as Ai,V as dn,K as Et,B as Ii,W as Oi}from"./vendor-arcblock-ScFEr-lj.js";import{d as Ri}from"./ViewList-e3CoNi3K.js";import{a1 as Ti,f as Ni,z as Pe,at as ar,l as Qe,a2 as Di,U as Je,au as _i,C as pn,av as mn,t as Li,b as Ui}from"./index-DO3_1y-L.js";import{U as hn,C as gn,I as ki}from"./index-B_vrglsK.js";import{k as qi,u as sr,a as cr,l as Bi,f as Ki}from"./vendor-hooks-DftG_2gV.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-8QXGSoVu.js";import{W as lr}from"./did-address-DUThaBlf.js";import{P as Me}from"./permission-BGM09622.js";import{C as At}from"./click-to-copy-BGyXQL2i.js";import{T as vn}from"./index-Dl4W1N74.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Mi}from"./useAsync-CGW40D2-.js";import{I as Ce}from"./index-CGBZONPv.js";import{d as Fi}from"./DeleteOutline-C2sY6hfm.js";import{C as dt}from"./confirm-DqvNmeoz.js";import{u as pt}from"./session-VIMbdc9j.js";import{i as bn,a as jt,p as xn}from"./util-Dw9Eiuko.js";import{b as $i}from"./sdk-CTe6rL6c.js";import{A as Vi}from"./actions-DA-6s_nQ.js";import{S as zi}from"./shorten-label-DFzv9EKX.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";import"./base32-p9VcJrwv.js";import"./MoreHoriz-CX_pwfPT.js";var ur={},Wi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Hi=Wi(on()),Gi=n;wn=ur.default=(0,Hi.default)((0,Gi.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 Yi=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={},Zi=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 Qi(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=Qi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),u=0;u<c.length;u++){var m=c[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var Xi=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)}},eo=(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)]},to=function(e,t){for(var r={},i=Object.keys(e),c=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(c?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Zi,r=Xi,i=eo,c=to,u=a=>a==null;function m(a){switch(a.arrayFormat){case"index":return o=>(l,d)=>{const w=l.length;return d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[b(o,a),"[",w,"]"].join("")]:[...l,[b(o,a),"[",b(w,a),"]=",b(d,a)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,[b(o,a),"[]"].join("")]:[...l,[b(o,a),"[]=",b(d,a)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,a),"=",b(d,a)].join("")]:[[l,b(d,a)].join(a.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||a.skipNull&&d===null||a.skipEmptyString&&d===""?l:d===null?[...l,b(o,a)]:[...l,[b(o,a),"=",b(d,a)].join("")]}}function x(a){let o;switch(a.arrayFormat){case"index":return(l,d,w)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){w[l]=d;return}w[l]===void 0&&(w[l]={}),w[l][o[1]]=d};case"bracket":return(l,d,w)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){w[l]=d;return}if(w[l]===void 0){w[l]=[d];return}w[l]=[].concat(w[l],d)};case"comma":case"separator":return(l,d,w)=>{const P=typeof d=="string"&&d.includes(a.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,a).includes(a.arrayFormatSeparator);d=S?h(d,a):d;const J=P||S?d.split(a.arrayFormatSeparator).map(Z=>h(Z,a)):d===null?d:h(d,a);w[l]=J};default:return(l,d,w)=>{if(w[l]===void 0){w[l]=d;return}w[l]=[].concat(w[l],d)}}}function j(a){if(typeof a!="string"||a.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(a,o){return o.encode?o.strict?t(a):encodeURIComponent(a):a}function h(a,o){return o.decode?r(a):a}function N(a){return Array.isArray(a)?a.sort():typeof a=="object"?N(Object.keys(a)).sort((o,l)=>Number(o)-Number(l)).map(o=>a[o]):a}function C(a){const o=a.indexOf("#");return o!==-1&&(a=a.slice(0,o)),a}function A(a){let o="";const l=a.indexOf("#");return l!==-1&&(o=a.slice(l)),o}function y(a){a=C(a);const o=a.indexOf("?");return o===-1?"":a.slice(o+1)}function k(a,o){return o.parseNumbers&&!Number.isNaN(Number(a))&&typeof a=="string"&&a.trim()!==""?a=Number(a):o.parseBooleans&&a!==null&&(a.toLowerCase()==="true"||a.toLowerCase()==="false")&&(a=a.toLowerCase()==="true"),a}function E(a,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 a!="string"||(a=a.trim().replace(/^[?#&]/,""),!a))return d;for(const w of a.split("&")){if(w==="")continue;let[P,S]=i(o.decode?w.replace(/\+/g," "):w,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const w of Object.keys(d)){const P=d[w];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=k(P[S],o);else d[w]=k(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((w,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?w[P]=N(S):w[P]=S,w},Object.create(null))}e.extract=y,e.parse=E,e.stringify=(a,o)=>{if(!a)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(a[S])||o.skipEmptyString&&a[S]==="",d=m(o),w={};for(const S of Object.keys(a))l(S)||(w[S]=a[S]);const P=Object.keys(w);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=a[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=(a,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(a,"#");return Object.assign({url:l.split("?")[0]||"",query:E(y(a),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(a,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(a.url).split("?")[0]||"",d=e.extract(a.url),w=e.parse(d,{sort:!1}),P=Object.assign(w,a.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(a.url);return a.fragmentIdentifier&&(J=`#${b(a.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(a,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:w,fragmentIdentifier:P}=e.parseUrl(a,l);return e.stringifyUrl({url:d,query:c(w,o),fragmentIdentifier:P},l)},e.exclude=(a,o,l)=>{const d=Array.isArray(o)?w=>!o.includes(w):(w,P)=>!o(w,P);return e.pick(a,d,l)}})(vt);const at=$n,ro={parseNumbers:!1,parseBooleans:!1},no={skipNull:!1,skipEmptyString:!1},io=(e,t)=>{var r,i;const{navigateMode:c="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},ro),u),j=Object.assign(Object.assign({},no),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=qi(),A=Y.useRef(typeof e=="function"?e():e||{}),y=Y.useMemo(()=>vt.parse(b.search,x),[b.search]),k=Y.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[k,sr(a=>{const o=typeof a=="function"?a(k):a;C(),h&&h[c]({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:c==="replace",state:b.state})})]},oo=io;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&&c(o,l)}function c(o,l){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,P){return w.__proto__=P,w},c(o,l)}function u(o){var l=j();return function(){var w=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(w,arguments,S)}else P=w.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 w(S,J,Z){return typeof l=="string"?l:l(S,J,Z)}var P=function(S){i(Z,S);var J=u(Z);function Z(G,W,F){var H;return r(this,Z),H=J.call(this,w(G,W,F)),H.code=o,H}return t(Z)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(w){return String(w)}),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 k(o,l,d){return o.substr(0,l.length)===l}function E(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function a(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 w;typeof l=="string"&&k(l,"not ")?(w="must not be",l=l.replace(/^not /,"")):w="must be";var P;if(E(o," argument"))P="The ".concat(o," ").concat(w," ").concat(y(l,"type"));else{var S=a(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(w," ").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 w=C.inspect(l);return w.length>128&&(w="".concat(w.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(w)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var w;return d&&d.constructor&&d.constructor.name?w="instance of ".concat(d.constructor.name):w="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(w,".")},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 w="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:w+="".concat(l[0]," argument");break;case 2:w+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:w+=l.slice(0,P-1).join(", "),w+=", and ".concat(l[P-1]," arguments");break}return"".concat(w," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function ao(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(I);O&&(B=B.filter(function(q){return Object.getOwnPropertyDescriptor(I,q).enumerable})),M.push.apply(M,B)}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(B){r(I,B,M[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(B){Object.defineProperty(I,B,Object.getOwnPropertyDescriptor(M,B))})}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 c(I,O){for(var M=0;M<O.length;M++){var B=O[M];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(I,m(B.key),B)}}function u(I,O,M){return O&&c(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 B=M.call(I,O||"default");if(o(B)!=="object")return B;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&&E(I,O)}function b(I){var O=y();return function(){var B=a(I),q;if(O){var g=a(this).constructor;q=Reflect.construct(B,arguments,g)}else q=B.apply(this,arguments);return h(this,q)}}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(B){if(B===null||!k(B))return B;if(typeof B!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(B))return O.get(B);O.set(B,q)}function q(){return A(B,arguments,a(this).constructor)}return q.prototype=Object.create(B.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),E(q,B)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(q,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(q,v),R=new _;return p&&E(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 k(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function E(I,O){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,q){return B.__proto__=q,B},E(I,O)}function a(I){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},a(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,w=Sn(),P=w.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 Z="",G="",W="",F="",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:"},pe=10;function Q(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(B){M[B]=I[B]}),Object.defineProperty(M,"message",{value:I.message}),M}function fe(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 Ae(I,O,M){var B="",q="",g=0,p="",v=!1,_=fe(I),R=_.split(`
|
|
2
2
|
`),L=fe(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<=pe){if((o(I)!=="object"||I===null)&&(o(O)!=="object"||O===null)&&(I!==0||O!==0))return"".concat(H[M],`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a8 as Pe,ac as yt,T as J,a9 as C,E as Fe,bo as _e,bz as et,bR as Te,bs as Re,bS as Ie,y as Se,b3 as Ee,aa as tt,ag as ce,a1 as st,bb as Xe,br as jt,bn as vt,q as Ze,bZ as St}from"./vendor-mui-core-CQ38ohp2.js";import{c as ie,az as ue,A as Ct}from"./vendor-utils-BNHJB5U7.js";import{Y as Z,j as P,b6 as Nt,r as ke,A as wt,u as te,bO as Tt,X as nt,B as Ae,a5 as at,al as Rt,ar as It,bt as Et}from"./vendor-ux-did-connect-BdkhddhO.js";import{z as At,t as V,l as Dt,I as Je}from"./index-DO3_1y-L.js";import{f as ee,a as De}from"./vendor-hooks-DftG_2gV.js";import{S as he}from"./shorten-label-DFzv9EKX.js";import{I as it}from"./index-CGBZONPv.js";import{A as Ot,S as Lt,a as Pt,b as Ft,B as _t}from"./list-Dmtz4mRb.js";import{R as Be}from"./relative-time-Djw-K4Zu.js";import{a as ze}from"./dashboard-8QXGSoVu.js";import{W as kt}from"./did-address-DUThaBlf.js";import{p as ot}from"./util-Dw9Eiuko.js";import{D as Bt,g as zt}from"./traffic-T11hxc--.js";import{i as Wt,a as Mt}from"./index-DcBUShKK.js";import{B as rt}from"./bundle-avatar-D0t7RLGx.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./index-DKhrYmrN.js";import"./use-app-logo-B8Kl9EZt.js";import"./InfoOutlined-CQB5qKm-.js";import"./sdk-CTe6rL6c.js";import"./CheckCircle-BNrN9mgy.js";import"./index-B_vrglsK.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./session-VIMbdc9j.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";import"./base32-p9VcJrwv.js";import"./iframe-DZ181i8X.js";import"./LaunchOutlined-BV4_W1pb.js";import"./ChevronLeft-Dq00IS01.js";import"./ChevronRight-ZTqWK-Ga.js";import"./index-BT0GBmWF.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";const lt=y.createContext({}),{Provider:qt,Consumer:mn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=y.useState([]),[u,R]=y.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]=y.useState([]),[I,M]=y.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...D}={})=>{if(!m)return[];try{const F={paging:{page:h,pageSize:O},...D,teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=F;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(F){return Z.error(F.message),[]}},A=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=y.useCallback(h=>{const O=s.children.find(D=>{var F;return((F=D.meta)==null?void 0:F.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:D,...F})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:D.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),...F}})},U=y.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=y.useCallback(async({page:h=1,pageSize:O=20,...D}={})=>{try{const F={paging:{page:h,pageSize:O},...D,userName:D.searchText||"",teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:F})}catch(F){throw Z.error(F.message),F}},[n,m]);y.useEffect(()=>{m&&A()},[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:H,getUser:U,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=y.useContext(lt);return t}const ye={common:{black:"#000",white:"#fff"},primary:{main:"#3773F2",contrastText:"#fff"},secondary:{main:"#16CED1",contrastText:"#fff"},error:{main:"#F16E6E",contrastText:"#fff"},warning:{main:"#DE9E37",contrastText:"#fff"},info:{main:"#0775F8",contrastText:"#fff"},success:{main:"#34BE74",contrastText:"#fff"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{default:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}};ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(ke()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(ke()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Zt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Zt(ke()),Qt=e;ut=Ke.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Dt(o,s)}):"",R=es(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},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},je=(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},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(yt,{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(Fe,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(_e,{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(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=y.useState(null),x=y.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=y.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(Bt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:zt(r),onChange:R})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=y.useState(ls),[x,u]=y.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(_e,{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]=y.useState(!1),[I,M]=y.useState([]),E=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[A,G]=y.useState(null),[H,U]=y.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=y.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=y.useState([]),D=[{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"}],F=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),U(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};y.useEffect(()=>{F()},[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(Ae,{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:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:j})=>{const[,_=[],$=[],K=[]]=j;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(_,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:$,page:1})):k(W=>({...W,walletSendStatus:_,page:1}))},oe=y.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[R,m]),se=y.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,j="")=>{if(!(!l.length||!i.length))try{s(i,l,c,j),L.anchorEl||(await xe(.5),f())}catch(_){console.error("handleResend error",{error:_})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(j=>I[j].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(j){Z.error(j.response?j.response.statusText:j.message)}},w=async(i,l,c,j=[],_=!0)=>{if(i.stopPropagation(),os(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,j,_);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],_),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,j)=>{i.stopPropagation();const _=c.filter($=>$!==l);k($=>({...$,[j]:_,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:j,filterValues:D})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"wallet",onResend:_=>w(_,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:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"pushkit",onResend:_=>w(_,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:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"email",onResend:_=>w(_,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:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{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[j,_]=c,$=_[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:j},j),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>F(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[A==null?void 0:A.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(A==null?void 0:A.channel).map(i=>{var _,$;const{type:l,pass:c,fail:j}=i;return!(A!=null&&A.result)||(_=A==null?void 0:A.result)!=null&&_[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=A==null?void 0:A.result)!=null&&$[l]?ye.success.main:"inherit"},children:[A!=null&&A.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:ye.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:ye.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:j})]},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 cs=y.memo(gt),ds=ce.div`
|
|
1
|
+
import{r as y}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a8 as Pe,ac as yt,T as J,a9 as C,E as Fe,bo as _e,bz as et,bR as Te,bs as Re,bS as Ie,y as Se,b3 as Ee,aa as tt,ag as ce,a1 as st,bb as Xe,br as jt,bn as vt,q as Ze,bZ as St}from"./vendor-mui-core-CQ38ohp2.js";import{c as ie,az as ue,A as Ct}from"./vendor-utils-BNHJB5U7.js";import{Y as Z,j as P,b6 as Nt,r as ke,A as wt,u as te,bO as Tt,X as nt,B as Ae,a5 as at,al as Rt,ar as It,bt as Et}from"./vendor-ux-did-connect-BdkhddhO.js";import{z as At,t as V,l as Dt,I as Je}from"./index-DO3_1y-L.js";import{f as ee,a as De}from"./vendor-hooks-DftG_2gV.js";import{S as he}from"./shorten-label-DFzv9EKX.js";import{I as it}from"./index-CGBZONPv.js";import{A as Ot,S as Lt,a as Pt,b as Ft,B as _t}from"./list-Dmtz4mRb.js";import{R as Be}from"./relative-time-Djw-K4Zu.js";import{a as ze}from"./dashboard-8QXGSoVu.js";import{W as kt}from"./did-address-DUThaBlf.js";import{p as ot}from"./util-Dw9Eiuko.js";import{D as Bt,g as zt}from"./traffic-T11hxc--.js";import{i as Wt,a as Mt}from"./index-DcBUShKK.js";import{B as rt}from"./bundle-avatar-D0t7RLGx.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./index-DKhrYmrN.js";import"./use-app-logo-B8Kl9EZt.js";import"./InfoOutlined-CQB5qKm-.js";import"./sdk-CTe6rL6c.js";import"./CheckCircle-BNrN9mgy.js";import"./index-B_vrglsK.js";import"./Phone-KP65huHK.js";import"./Location-B8EOY3d0.js";import"./Email-Dz2Eyqu0.js";import"./Timezone-Ce4E1Xey.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./session-VIMbdc9j.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./base32-p9VcJrwv.js";import"./iframe-DZ181i8X.js";import"./LaunchOutlined-BV4_W1pb.js";import"./ChevronLeft-Dq00IS01.js";import"./ChevronRight-ZTqWK-Ga.js";import"./index-BT0GBmWF.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./AdapterDayjs-BUGplkxR.js";const lt=y.createContext({}),{Provider:qt,Consumer:mn}=lt;function Kt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=y.useState([]),[u,R]=y.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]=y.useState([]),[I,M]=y.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...D}={})=>{if(!m)return[];try{const F={paging:{page:h,pageSize:O},...D,teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=F;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(F){return Z.error(F.message),[]}},A=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=y.useCallback(h=>{const O=s.children.find(D=>{var F;return((F=D.meta)==null?void 0:F.did)===h});if(O)return O.ancestors=[s],O},[s]),H=async({notificationId:h,receivers:O,channels:D,...F})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:D.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),...F}})},U=y.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=y.useCallback(async({page:h=1,pageSize:O=20,...D}={})=>{try{const F={paging:{page:h,pageSize:O},...D,userName:D.searchText||"",teamDid:m,dateRange:D.dateRange?[V(D.dateRange[0]).toISOString(),V(D.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:F})}catch(F){throw Z.error(F.message),F}},[n,m]);y.useEffect(()=>{m&&A()},[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:H,getUser:U,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(qt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=y.useContext(lt);return t}const ye={common:{black:"#000",white:"#fff"},primary:{main:"#3773F2",contrastText:"#fff"},secondary:{main:"#16CED1",contrastText:"#fff"},error:{main:"#F16E6E",contrastText:"#fff"},warning:{main:"#DE9E37",contrastText:"#fff"},info:{main:"#0775F8",contrastText:"#fff"},success:{main:"#34BE74",contrastText:"#fff"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{default:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}};ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,$t=Ut(ke()),Vt=e;ct=Me.default=(0,$t.default)((0,Vt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Gt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Yt=Gt(ke()),Xt=e;dt=qe.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Zt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Jt=Zt(ke()),Qt=e;ut=Ke.default=(0,Jt.default)((0,Qt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const es=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Dt(o,s)}):"",R=es(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},ts=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ss=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ns=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),as=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),is=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},os=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},je=(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},rs=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>wt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(yt,{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(Fe,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(_e,{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(He,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=y.useState(null),x=y.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=y.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(Bt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:zt(r),onChange:R})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Tt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const ls=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=y.useState(ls),[x,u]=y.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(_e,{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]=y.useState(!1),[I,M]=y.useState([]),E=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[A,G]=y.useState(null),[H,U]=y.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=y.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=y.useState([]),D=[{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"}],F=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),U(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};y.useEffect(()=>{F()},[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(Ae,{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:H.page-1,rowsPerPage:H.pageSize,count:H.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:j})=>{const[,_=[],$=[],K=[]]=j;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(_,N.walletSendStatus)?ue($,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:$,page:1})):k(W=>({...W,walletSendStatus:_,page:1}))},oe=y.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?ns(c):i==="email"?ts(m,c):i==="pushKit"?ss(m,c):i==="webhook"?as(c):!0:!1},[R,m]),se=y.useCallback(i=>is(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,j="")=>{if(!(!l.length||!i.length))try{s(i,l,c,j),L.anchorEl||(await xe(.5),f())}catch(_){console.error("handleResend error",{error:_})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(j=>I[j].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(j){Z.error(j.response?j.response.statusText:j.message)}},w=async(i,l,c,j=[],_=!0)=>{if(i.stopPropagation(),os(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,j,_);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],_),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,j)=>{i.stopPropagation();const _=c.filter($=>$!==l);k($=>({...$,[j]:_,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(kt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:j,filterValues:D})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"wallet",onResend:_=>w(_,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:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"pushkit",onResend:_=>w(_,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:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:j}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:j,channel:"email",onResend:_=>w(_,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:je},filterOptions:{names:D,fullWidth:!0,logic:ve,display:(i,l,c,j)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:j,filterValues:D})}}},{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[j,_]=c,$=_[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:j},j),e.jsx(de,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(Ue,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>F(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ds,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx($e,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(us,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[A==null?void 0:A.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(A==null?void 0:A.channel).map(i=>{var _,$;const{type:l,pass:c,fail:j}=i;return!(A!=null&&A.result)||(_=A==null?void 0:A.result)!=null&&_[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=A==null?void 0:A.result)!=null&&$[l]?ye.success.main:"inherit"},children:[A!=null&&A.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:ye.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:ye.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:j})]},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 cs=y.memo(gt),ds=ce.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as $,Y as W,bM as Y,I as be,_ as fe,a5 as ge,bt as je}from"./vendor-ux-did-connect-BdkhddhO.js";import{t as ye,m as de,j as we}from"./vendor-hooks-DftG_2gV.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-CQB5qKm-.js";import{z as F,E as ke,F as K,C as ce,t as ve}from"./index-DO3_1y-L.js";import{u as N}from"./dashboard-8QXGSoVu.js";import{H as o,j as e,D as Ee,ai as Ce,t as Te,a9 as f,O as ie,T as S,aa as U,aj as ee,z as Se,y as B,bs as le,bS as V,ac as A,L as Q,A as G,bc as Re,E as O,I as _,C as Ie,bq as Me,ak as P,ce as Pe,X as De,bb as J,bp as ze,b4 as We,cf as Ae,cg as Oe,b5 as qe,am as $e,c1 as Le,s as pe,v as Be,ch as He,ci as Fe,cj as Ne,ck as Ue,cl as _e}from"./vendor-mui-core-CQ38ohp2.js";import{q as Ye}from"./vendor-arcblock-ScFEr-lj.js";import{d as Ke}from"./ExpandLess-BiMmSOBl.js";import{z as ue,x as Ve,y as Je}from"./vendor-utils-BNHJB5U7.js";import{C as Qe}from"./confirm-DqvNmeoz.js";import{A as Ge}from"./actions-DA-6s_nQ.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./format-error-BrmqJs5a.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";import"./MoreHoriz-CX_pwfPT.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),l=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[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}=$(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:h,checked:l>0&&l===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{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(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:u<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Re,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(O,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ke,{}):e.jsx(Ye,{})})]})]})}),g.length>0&&e.jsx(Ie,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Me,{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 s;const{t:p}=$(),[n,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=ke({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{l({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[q,L]=I.split("-");return!q||!L?null:{type:q,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});W.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});W.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){W.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ee,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ce,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Te,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(K,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(K,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:l,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Se,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ve(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function z(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(A,{title:t.tip,children:e.jsx(Pe,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(De,{orientation:"vertical",flexItem:!0})]})}z.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};z.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const 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}=$(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:n,loadMore:l,loadingMore:v,loading:T}=ye(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=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(q=>{var L;return((L=q==null?void 0:q.meta)==null?void 0:L.name)==="ai-studio"}),I=Ve(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(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))}),g&&e.jsx(f,{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(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=$(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:n}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(A,{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(Le,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(z,{label:c("common.status"),value:e.jsx(O,{size:"small",variant:"filled",label:l.status,color:he(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.listen"),value:e.jsx(A,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(O,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(z,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx(z,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx(z,{label:c("common.createdBy"),value:e.jsx(A,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(O,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("common.updatedBy"),value:e.jsx(A,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(O,{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})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function 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:n}=$(),l=Be(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:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile: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(ge)`
|
|
1
|
+
import{u as $,Y as W,bM as Y,I as be,_ as fe,a5 as ge,bt as je}from"./vendor-ux-did-connect-BdkhddhO.js";import{t as ye,m as de,j as we}from"./vendor-hooks-DftG_2gV.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-CQB5qKm-.js";import{z as F,E as ke,F as K,C as ce,t as ve}from"./index-DO3_1y-L.js";import{u as N}from"./dashboard-8QXGSoVu.js";import{H as o,j as e,D as Ee,ai as Ce,t as Te,a9 as f,O as ie,T as S,aa as U,aj as ee,z as Se,y as B,bs as le,bS as V,ac as A,L as Q,A as G,bc as Re,E as O,I as _,C as Ie,bq as Me,ak as P,ce as Pe,X as De,bb as J,bp as ze,b4 as We,cf as Ae,cg as Oe,b5 as qe,am as $e,c1 as Le,s as pe,v as Be,ch as He,ci as Fe,cj as Ne,ck as Ue,cl as _e}from"./vendor-mui-core-CQ38ohp2.js";import{q as Ye}from"./vendor-arcblock-ScFEr-lj.js";import{d as Ke}from"./ExpandLess-BiMmSOBl.js";import{z as ue,x as Ve,y as Je}from"./vendor-utils-BNHJB5U7.js";import{C as Qe}from"./confirm-DqvNmeoz.js";import{A as Ge}from"./actions-DA-6s_nQ.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./format-error-BrmqJs5a.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./MoreHoriz-CX_pwfPT.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),l=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[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}=$(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:h,checked:l>0&&l===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{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(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:u<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Re,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(O,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ke,{}):e.jsx(Ye,{})})]})]})}),g.length>0&&e.jsx(Ie,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Me,{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 s;const{t:p}=$(),[n,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=ke({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{l({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[q,L]=I.split("-");return!q||!L?null:{type:q,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});W.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});W.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){W.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ee,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ce,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Te,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(K,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(K,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:l,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Se,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ve(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function z(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(A,{title:t.tip,children:e.jsx(Pe,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(De,{orientation:"vertical",flexItem:!0})]})}z.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};z.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const 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}=$(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:n,loadMore:l,loadingMore:v,loading:T}=ye(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=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(q=>{var L;return((L=q==null?void 0:q.meta)==null?void 0:L.name)==="ai-studio"}),I=Ve(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(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))}),g&&e.jsx(f,{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(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=$(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:n}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(A,{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(Le,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(z,{label:c("common.status"),value:e.jsx(O,{size:"small",variant:"filled",label:l.status,color:he(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.listen"),value:e.jsx(A,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(O,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(z,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx(z,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx(z,{label:c("common.createdBy"),value:e.jsx(A,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(O,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(z,{label:c("common.updatedBy"),value:e.jsx(A,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(O,{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})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function 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:n}=$(),l=Be(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:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile: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(ge)`
|
|
2
2
|
.MuiPaper-root {
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
overflow: hidden;
|