@abtnode/webapp 1.16.27-beta-8f022f16 → 1.16.27-beta-9397aa36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-BlWdL5hq.js → Add-BYcTrfwq.js} +1 -1
- package/dist/assets/{ArrowDropDown-BRSuKRSZ.js → ArrowDropDown-Ce8utXjU.js} +1 -1
- package/dist/assets/{Autocomplete-DzQAgmMV.js → Autocomplete-BgbFIwgC.js} +1 -1
- package/dist/assets/{Breadcrumbs-BQD6r-rf.js → Breadcrumbs-DhzWQAd5.js} +1 -1
- package/dist/assets/{ButtonGroup-CqHbqvIj.js → ButtonGroup-DsDQPFq5.js} +1 -1
- package/dist/assets/{CheckCircle-CSPlY_20.js → CheckCircle-z0EmvxpD.js} +1 -1
- package/dist/assets/{ChevronLeft-zlmw0JTD.js → ChevronLeft-CwZ4eGkY.js} +1 -1
- package/dist/assets/{ChevronRight-hhdO2z__.js → ChevronRight-DF2TQuxF.js} +1 -1
- package/dist/assets/{Close-BfNzQHXc.js → Close-TD13_jXp.js} +1 -1
- package/dist/assets/{Delete-HYXbanP_.js → Delete-B32Y4H9I.js} +1 -1
- package/dist/assets/DeleteOutline-CfcGLGyQ.js +1 -0
- package/dist/assets/DeleteOutline-DvvZ31vT.js +1 -0
- package/dist/assets/{Done-1q2rveFh.js → Done-Dh00ds6i.js} +1 -1
- package/dist/assets/{Edit-BowBuCq8.js → Edit-BJLfjGzO.js} +1 -1
- package/dist/assets/{EditIcon-nFgXy_Ap.js → EditIcon-BM1-fNyQ.js} +1 -1
- package/dist/assets/{FilterList-CFsrQPpD.js → FilterList-0wFVrPUc.js} +1 -1
- package/dist/assets/{Google-Dm0Bt78U.js → Google-Bh_n6egY.js} +1 -1
- package/dist/assets/{Https-CspPw1QL.js → Https-C3LwivZ6.js} +1 -1
- package/dist/assets/{InfoOutlined-DD-Zg0Tj.js → InfoOutlined-Dv-PS_K9.js} +1 -1
- package/dist/assets/{InputAdornment-Dy1fA12v.js → InputAdornment-BsJrfw9W.js} +1 -1
- package/dist/assets/{InputLabel-BXQy_ZSg.js → InputLabel-3Wx_imEU.js} +1 -1
- package/dist/assets/{LastPage-C7awZPyV.js → LastPage-IxsHKdZG.js} +1 -1
- package/dist/assets/{Launch-Eb8N22dN.js → Launch-0VxvnuWe.js} +1 -1
- package/dist/assets/{Link-euuV_LRf.js → Link-D4THmfDH.js} +1 -1
- package/dist/assets/{LoadingButton-DVHwr9De.js → LoadingButton-kMo-bLLA.js} +1 -1
- package/dist/assets/{LockIcon-Ca85OyYH.js → LockIcon-DVMXWBuj.js} +1 -1
- package/dist/assets/{Loop-vUb_fmsc.js → Loop-8YHpWrw7.js} +1 -1
- package/dist/assets/{MoreVert-gaCnI5Xf.js → MoreVert-Dy-UXLSF.js} +1 -1
- package/dist/assets/{Pagination-DfzcotPN.js → Pagination-CvzuQKWn.js} +1 -1
- package/dist/assets/{Public-BEijyP_7.js → Public-Cy1SlD9D.js} +1 -1
- package/dist/assets/{SchemaReference.es-ncoplB18.js → SchemaReference.es-Wg6qjI2Q.js} +1 -1
- package/dist/assets/{Search-Cz2kpFbT.js → Search-CLqP6dSG.js} +1 -1
- package/dist/assets/{Select-D6ACs1xY.js → Select-DacRJUpT.js} +1 -1
- package/dist/assets/{Skeleton-DWKEXisW.js → Skeleton-B635xq9w.js} +1 -1
- package/dist/assets/{Slider-DKraNvrD.js → Slider-kWM3QD3U.js} +1 -1
- package/dist/assets/{Stepper-CZFVEfLi.js → Stepper-CfMuItAU.js} +1 -1
- package/dist/assets/{TextField-DRrSIaR4.js → TextField-ChYCqgnF.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CBvNwQed.js → ToggleButtonGroup-D-TzdChr.js} +1 -1
- package/dist/assets/{ViewList-CxKdhgAh.js → ViewList-C9rEsLfO.js} +1 -1
- package/dist/assets/{actions-QLA3pt8S.js → actions-BwC0xihZ.js} +1 -1
- package/dist/assets/{actions-jzQJLd83.js → actions-DLUCcZnb.js} +1 -1
- package/dist/assets/{agreement-Bd_YDn4J.js → agreement-C-3kwpSq.js} +1 -1
- package/dist/assets/api-Dg1aNjni.js +1 -0
- package/dist/assets/{app-avatar-DH3uT_Nr.js → app-avatar-CLoA8FKQ.js} +1 -1
- package/dist/assets/{audit-logs-DwuYsIhc.js → audit-logs-CQgLtoSJ.js} +1 -1
- package/dist/assets/{brace-fold.es-DBcYme5k.js → brace-fold.es-C7pAHsAz.js} +1 -1
- package/dist/assets/{bundle-avatar-4GKn5oRs.js → bundle-avatar-C0jAIMBi.js} +1 -1
- package/dist/assets/{chart-BhmgRFRd.js → chart-CCJil07D.js} +1 -1
- package/dist/assets/{click-to-copy-BJBKnF7C.js → click-to-copy-BxRY2T53.js} +1 -1
- package/dist/assets/{closebrackets.es-CLLTB-Rw.js → closebrackets.es-CW-znL7B.js} +1 -1
- package/dist/assets/{codemirror.es-DiBSlxeg.js → codemirror.es-BCKCN0pa.js} +1 -1
- package/dist/assets/{comment.es-DTp5sWbp.js → comment.es--JXaP270.js} +1 -1
- package/dist/assets/{config-navigation-Dh_BXFIi.js → config-navigation-9U1-i3qG.js} +1 -1
- package/dist/assets/{delete-confirm-CNU7dJ17.js → delete-confirm-Cu52-w9K.js} +1 -1
- package/dist/assets/{detail-CESxJL-2.js → detail-TSZFt17G.js} +3 -3
- package/dist/assets/{dialog.es-D1H3OJaa.js → dialog.es-DdP5pxPG.js} +1 -1
- package/dist/assets/{download-Htx7YW1G.js → download-BTNda_FN.js} +1 -1
- package/dist/assets/{foldgutter.es-C2ROsMEX.js → foldgutter.es-gix6KVwn.js} +1 -1
- package/dist/assets/getValidReactChildren-BSSAKXXh.js +1 -0
- package/dist/assets/{hint.es-QDCU5iC6.js → hint.es-BkoxNExU.js} +1 -1
- package/dist/assets/{hint.es2-BteAZTtw.js → hint.es2-D0UclqLD.js} +1 -1
- package/dist/assets/{iframe-CIfJru42.js → iframe-Dry0Q1RC.js} +1 -1
- package/dist/assets/{index-BFmN77vD.js → index-4SekL7Au.js} +1 -1
- package/dist/assets/{index-f3gCWa9h.js → index-58xom0se.js} +1 -1
- package/dist/assets/index-7VEn8pMG.js +21 -0
- package/dist/assets/{index-BsU6rGWy.js → index-BOyFzt02.js} +1 -1
- package/dist/assets/{index-DnYXtUxe.js → index-BPb4u19B.js} +1 -1
- package/dist/assets/{index-rJLRm37D.js → index-BYxU5EuJ.js} +1 -1
- package/dist/assets/{index-DWTs3F9i.js → index-BkfzVG1e.js} +1 -1
- package/dist/assets/{index-Bm4qa0nV.js → index-BmYduQjf.js} +1 -1
- package/dist/assets/{index-DNRVE0NP.js → index-Bq3EqJlL.js} +1 -1
- package/dist/assets/{index-CpNJmBAT.js → index-ByTAZBnH.js} +1 -1
- package/dist/assets/{index-BrX8n3kg.js → index-C6Wak-Bp.js} +1 -1
- package/dist/assets/{index-Dz5x-Zd5.js → index-C9snPGrA.js} +1 -1
- package/dist/assets/{index-BcsyQdON.js → index-CJjmaZOb.js} +1 -1
- package/dist/assets/{index-D4Db9ftV.js → index-CLLusFhD.js} +1 -1
- package/dist/assets/index-CPsoyw3K.js +54 -0
- package/dist/assets/{index-DFCC9v5j.js → index-CV5o0SmN.js} +5 -5
- package/dist/assets/{index-GQiNlTaJ.js → index-CZxztyyO.js} +1 -1
- package/dist/assets/{index-BZvR35Hj.js → index-CcI2gztc.js} +1 -1
- package/dist/assets/{index-DddM0S9V.js → index-CivlhCtE.js} +1 -1
- package/dist/assets/{index-Hkok7PnJ.js → index-CpMrB60J.js} +3 -3
- package/dist/assets/{index-DI-gzmKu.js → index-CwvvU6sG.js} +1 -1
- package/dist/assets/{index-uyaXmUh9.js → index-Cybcu3bZ.js} +1 -1
- package/dist/assets/{index-C39X5nSU.js → index-D1IHJL8V.js} +1 -1
- package/dist/assets/{index-C01qpSwK.js → index-D1qmIEQe.js} +1 -1
- package/dist/assets/{index-RLS72NCQ.js → index-D2aPyZEh.js} +3 -3
- package/dist/assets/{index-8fCm2Jic.js → index-D4mUNiA3.js} +1 -1
- package/dist/assets/{index-BNasUWiN.js → index-DHBWVWpd.js} +1 -1
- package/dist/assets/{index--hCEdE0S.js → index-DHy7fnHK.js} +1 -1
- package/dist/assets/{index-2dK67bGl.js → index-DKleljgS.js} +1 -1
- package/dist/assets/{index-CN4-jpgI.js → index-DYIWxxvc.js} +10 -10
- package/dist/assets/{index-CgLCDu24.js → index-DZ38lcnS.js} +2 -2
- package/dist/assets/{index-DBd7rWWn.js → index-DdImsIrU.js} +1 -1
- package/dist/assets/{index-D1-aBvtW.js → index-DdYi7g5A.js} +1 -1
- package/dist/assets/{index-CJRh33cD.js → index-DyLmBsrc.js} +1 -1
- package/dist/assets/{index-Bh-DJU8Z.js → index-MgqsR5Yr.js} +1 -1
- package/dist/assets/{index-DEBI0lGj.js → index-MraPT5rJ.js} +1 -1
- package/dist/assets/{index-Mdw0srMB.js → index-RXFOkpdO.js} +1 -1
- package/dist/assets/{index-rfYAdo12.js → index-Z23xnW60.js} +1 -1
- package/dist/assets/{index-DBlH-4qz.js → index-cto27BjI.js} +2 -2
- package/dist/assets/{index-CTyxnc1Q.js → index-fzAzVQZ7.js} +1 -1
- package/dist/assets/{index-B6H1TQgD.js → index-nk7Jeg9T.js} +1 -1
- package/dist/assets/{index-Bu9Gdw_x.js → index-tCtD2xpl.js} +1 -1
- package/dist/assets/{index-B2x_NkGk.js → index-udgf9h3j.js} +1 -1
- package/dist/assets/{index.es-BU-QQy1a.js → index.es-VZygEdns.js} +1 -1
- package/dist/assets/{index.esm-UN3QaGsN.js → index.esm-Bpp1W-0n.js} +1 -1
- package/dist/assets/{info-addon.es-30ukilBE.js → info-addon.es-Dz55t6aF.js} +1 -1
- package/dist/assets/{info.es-2lPs4qsI.js → info.es-DlvBMDVd.js} +1 -1
- package/dist/assets/{install-from-url-BQJWpTKl.js → install-from-url-BfQGdJqB.js} +1 -1
- package/dist/assets/{invitation-BpNMGSxV.js → invitation-Db4MC3JQ.js} +1 -1
- package/dist/assets/{isEqual-C9LQO0Wo.js → isEqual-SGvPf73-.js} +1 -1
- package/dist/assets/{item-CE4vGuWF.js → item-BftAM0Zi.js} +1 -1
- package/dist/assets/{javascript.es-C13fQY0O.js → javascript.es-BNj6-t-x.js} +1 -1
- package/dist/assets/{jump-to-line.es-BqUFIspc.js → jump-to-line.es-DgFeCONV.js} +1 -1
- package/dist/assets/{jump.es-E5FdtiiP.js → jump.es-DW68RHsu.js} +1 -1
- package/dist/assets/{line-ODorkEX8.js → line-1yBH41Wd.js} +3 -3
- package/dist/assets/{lint.es-CmOxC0-j.js → lint.es-DmdHzCyK.js} +1 -1
- package/dist/assets/{lint.es2-f8EXNnrq.js → lint.es2-CgJGCOHv.js} +1 -1
- package/dist/assets/{lint.es3-BxgO4Daf.js → lint.es3-BL6uCIJs.js} +1 -1
- package/dist/assets/{list-header-DF2AUmaz.js → list-header-CwzHI2Rt.js} +1 -1
- package/dist/assets/{log-CNVd8L59.js → log-Ec_QJxk0.js} +1 -1
- package/dist/assets/{lottie-BuomNMnt.js → lottie-LUS1MfCT.js} +1 -1
- package/dist/assets/{matchbrackets.es-Dhn5dtU-.js → matchbrackets.es-CHrUGVwe.js} +1 -1
- package/dist/assets/{memory-BSkx1Ub2.js → memory-yOjaiNVs.js} +1 -1
- package/dist/assets/{mode.es-BfudmPy3.js → mode.es-CmPIaKTd.js} +1 -1
- package/dist/assets/{mode.es2-DvlBoAjR.js → mode.es2-CpVpeZ6j.js} +1 -1
- package/dist/assets/{mode.es3-JiFk1pWJ.js → mode.es3-BhW-mRJe.js} +1 -1
- package/dist/assets/{onlineParser.es-BSW2adyc.js → onlineParser.es-DLbzJOgY.js} +1 -1
- package/dist/assets/{overview-CXRCvckQ.js → overview-BjZwvO3w.js} +1 -1
- package/dist/assets/{react-DwbfLI7Z.js → react-BX905qse.js} +3 -3
- package/dist/assets/{redux-Bu4pculE.js → redux-BfgfWfKE.js} +1 -1
- package/dist/assets/{resource-dialog-BL8JdZuL.js → resource-dialog-D46mQ3iv.js} +1 -1
- package/dist/assets/{runtime-KfScM6FA.js → runtime-BudjolOf.js} +1 -1
- package/dist/assets/{search.es-yd0fhcZk.js → search.es-J1x6rp7i.js} +1 -1
- package/dist/assets/{searchcursor.es-Dy_G_QZQ.js → searchcursor.es-DGZQjnVx.js} +1 -1
- package/dist/assets/service-1xIndkC2.js +1 -0
- package/dist/assets/{show-hint.es-BbqPLgHC.js → show-hint.es-DgCG1PfH.js} +1 -1
- package/dist/assets/{slicedToArray-CUj4BDqr.js → slicedToArray-j5L_xxoK.js} +1 -1
- package/dist/assets/{spaces-DbeGuVPF.js → spaces-BzjtPxcp.js} +1 -1
- package/dist/assets/{sublime.es-Bu1xK-a6.js → sublime.es-BmvW8WLk.js} +1 -1
- package/dist/assets/{switch-control-Oh1i031K.js → switch-control-2xhJNPLI.js} +1 -1
- package/dist/assets/{table-icons-gSPlUUro.js → table-icons-DNH5IpNS.js} +2 -2
- package/dist/assets/{tag-tXL4aJpc.js → tag-DwIjrotQ.js} +1 -1
- package/dist/assets/{team-B2Py-5R-.js → team-Bds6tH0s.js} +1 -1
- package/dist/assets/{toUpper-fPzt0_fA.js → toUpper-DmN3YmMF.js} +1 -1
- package/dist/assets/{traffic-C7SAOKwi.js → traffic-DRJFVCky.js} +1 -1
- package/dist/assets/{url-evaluation-OWrig3n8.js → url-evaluation-Dw2A031X.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-tLVaGUOx.js → use-blocklet-info-for-connect-did-spaces-CWFXmzXz.js} +1 -1
- package/dist/assets/{useLocalStorage-Den65TTd.js → useLocalStorage-C7ck6rDl.js} +1 -1
- package/dist/assets/{util-BjsuBWBH.js → util-BHhvzew-.js} +1 -1
- package/dist/assets/{wait-container-CnNsD3cH.js → wait-container-DrkB9Qje.js} +1 -1
- package/dist/assets/{withStyles-fo91W1eJ.js → withStyles-DQBIFjtv.js} +1 -1
- package/dist/assets/{wrap-locale-BSXKmMbJ.js → wrap-locale-BMwksOY3.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/DeleteOutline-mQ8p8X2l.js +0 -1
- package/dist/assets/api-sSit_7Kw.js +0 -1
- package/dist/assets/getValidReactChildren-BXQ8AiZt.js +0 -1
- package/dist/assets/index-C2H71CT1.js +0 -21
- package/dist/assets/index-DQZaP4Az.js +0 -54
- package/dist/assets/service-BUuflGft.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aL as S,aM as D,j as e,bm as _,r as p,f as O,m as u,aY as U,aZ as E,V as F,cl as V,B as $,C as k,be as Q,a8 as Y,a9 as R,O as Z,cm as w,cn as A,co as L,aa as I,a7 as M,az as P,a3 as T,Q as G,au as H,n as J,P as a,o as K,cp as W}from"./index-
|
|
1
|
+
import{aL as S,aM as D,j as e,bm as _,r as p,f as O,m as u,aY as U,aZ as E,V as F,cl as V,B as $,C as k,be as Q,a8 as Y,a9 as R,O as Z,cm as w,cn as A,co as L,aa as I,a7 as M,az as P,a3 as T,Q as G,au as H,n as J,P as a,o as K,cp as W}from"./index-cto27BjI.js";import{f as X}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-CvzuQKWn.js";import"./LastPage-IxsHKdZG.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ae=te(S()),ie=e;g=x.default=(0,ae.default)((0,ie.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:i,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[f,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:v}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await i.readBlockletNotifications({input:{id:t,teamDid:j}}):await i.readNotifications({input:{id:t}}),r(),b(!1)},N=async t=>{d?await i.readBlockletNotifications({input:{id:t,teamDid:j}}):await i.readNotifications({input:{id:t}}),r()},m=f?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,v),children:X(new Date(t.createdAt),K(v))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:f,onChange:()=>q(!f),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(Q,{}),e.jsxs(Y,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),m.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),m.length>0&&m.map(t=>t.action?e.jsxs(R,{component:Z,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(M,{children:e.jsx(P,{title:n("notification.markAsRead"),children:e.jsx(T,{edge:"end","aria-label":"delete",onClick:()=>N(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(M,{children:e.jsx(P,{title:n("notification.markAsRead"),children:e.jsx(T,{edge:"end","aria-label":"delete",onClick:()=>N(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!m.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
|
|
2
2
|
min-height: 60vh;
|
|
3
3
|
|
|
4
4
|
.page-header {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,j as t,fC as hn,cr as X,fD as xn,fi as ce,Q as T,at as _t,az as Y,m as _,eI as vn,db as ht,fE as yn,q as K,fF as $e,fG as bn,aH as jn,cq as wn,dV as xt,S as ve,bm as H,U as Me,fH as Ue,au as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fI as Sn,k as Fe,aT as Cn,x as In,y as Pn,fh as Rn,f as me,ae as we,V as Q,cl as te,A as ie,fJ as An,aL as $t,aM as Mt,b as Z,df as Dn,t as Ut,F as q,a2 as vt,W as We,cw as On,cn as Tn,fK as zt,aO as En,aE as kn,aa as Ln,fj as Fn,a3 as Bn,bs as Nn,aY as _n,aZ as $n,R as Mn}from"./index-DBlH-4qz.js";import{c as Un}from"./index-rJLRm37D.js";import{d as ye}from"./Add-BlWdL5hq.js";import{d as zn}from"./Loop-vUb_fmsc.js";import{d as Wn}from"./ViewList-CxKdhgAh.js";import{L as qn,S as Vn,d as Wt}from"./list-header-DF2AUmaz.js";import{D as qe,g as Hn}from"./index-BNasUWiN.js";import"./index-B6H1TQgD.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-BL8JdZuL.js";import{T as Kn}from"./index-C01qpSwK.js";import{E as Vt}from"./index-f3gCWa9h.js";import"./index-DEBI0lGj.js";import{W as Ht}from"./tag-tXL4aJpc.js";import{b as G,u as Kt}from"./team-B2Py-5R-.js";import{C as Se}from"./click-to-copy-BJBKnF7C.js";import{F as Qt,S as Yt}from"./Select-D6ACs1xY.js";import{I as Gt}from"./InputLabel-BXQy_ZSg.js";import{T as Xt}from"./TextField-DRrSIaR4.js";import{I as Be}from"./index-GQiNlTaJ.js";import{d as Qn}from"./Delete-HYXbanP_.js";import{A as Yn}from"./actions-QLA3pt8S.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var R=m[j];e=e.replace(new RegExp(R,"g"),n[R])}return e}var rr=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 nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var R=i[j],p=e[R];(m?n.indexOf(R)!==-1:n(R,p,e))&&(r[R]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function R(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=R(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:R}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),R),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,R)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,R(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Pt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Pt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Pt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Rt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:R}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Rt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Rt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[R,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:R}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await R.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
|
|
1
|
+
import{r as I,j as t,fC as hn,cr as X,fD as xn,fi as ce,Q as T,at as _t,az as Y,m as _,eI as vn,db as ht,fE as yn,q as K,fF as $e,fG as bn,aH as jn,cq as wn,dV as xt,S as ve,bm as H,U as Me,fH as Ue,au as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fI as Sn,k as Fe,aT as Cn,x as In,y as Pn,fh as Rn,f as me,ae as we,V as Q,cl as te,A as ie,fJ as An,aL as $t,aM as Mt,b as Z,df as Dn,t as Ut,F as q,a2 as vt,W as We,cw as On,cn as Tn,fK as zt,aO as En,aE as kn,aa as Ln,fj as Fn,a3 as Bn,bs as Nn,aY as _n,aZ as $n,R as Mn}from"./index-cto27BjI.js";import{c as Un}from"./index-BYxU5EuJ.js";import{d as ye}from"./Add-BYcTrfwq.js";import{d as zn}from"./Loop-8YHpWrw7.js";import{d as Wn}from"./ViewList-C9rEsLfO.js";import{L as qn,S as Vn,d as Wt}from"./list-header-CwzHI2Rt.js";import{D as qe,g as Hn}from"./index-DHBWVWpd.js";import"./index-nk7Jeg9T.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-D46mQ3iv.js";import{T as Kn}from"./index-D1qmIEQe.js";import{E as Vt}from"./index-58xom0se.js";import"./index-MraPT5rJ.js";import{W as Ht}from"./tag-DwIjrotQ.js";import{b as G,u as Kt}from"./team-Bds6tH0s.js";import{C as Se}from"./click-to-copy-BxRY2T53.js";import{F as Qt,S as Yt}from"./Select-DacRJUpT.js";import{I as Gt}from"./InputLabel-3Wx_imEU.js";import{T as Xt}from"./TextField-ChYCqgnF.js";import{I as Be}from"./index-CZxztyyO.js";import{d as Qn}from"./Delete-B32Y4H9I.js";import{A as Yn}from"./actions-BwC0xihZ.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var R=m[j];e=e.replace(new RegExp(R,"g"),n[R])}return e}var rr=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 nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var R=i[j],p=e[R];(m?n.indexOf(R)!==-1:n(R,p,e))&&(r[R]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function R(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=R(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:R}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),R),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,R)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,R(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Pt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Pt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Pt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Rt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:R}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Rt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Rt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[R,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:R}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await R.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
`;function Qe({teamDid:e,onCancel:n,onSuccess:r,onError:i,endpoint:m}){const{api:j,info:R}=H(),{api:p}=I.useContext(Sn),[g,h]=I.useState(!1),{t:u,locale:w}=K(),[f,y]=I.useState(""),[A,C]=I.useState(!1),[x,o]=I.useState(0),[s,a]=I.useState(""),[l,c]=I.useState(""),b=!!Fe(R,"ownerNft.did"),d=Cn(async()=>{if(b){const{state:B}=await j.getDelegationState();return B}return{delegated:!0}});if(d.loading)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx("div",{style:{display:"flex",justifyContent:"center"},children:t.jsx(oe,{})})});if(d.error)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx(se,{type:"error",variant:"icon",children:ee(d.error)})});const v=async()=>{y(null),h(!0);try{const{inviteInfo:B}=await j.createTransferInvitation({input:{teamDid:e,role:"owner",remark:l.trim()}});a(B),o(W.length-1)}catch(B){const ne=ee(B);y(ne),i(B)}finally{h(!1)}},k=()=>{C(!0),o(1)},M=()=>{C(!1),o(0)},W=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(se,{type:"warning",children:[t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.progress")}),t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),t.jsx(se,{type:"warning",children:t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:B=>{y(null),c(B.target.value)},disabled:g,"data-cy":"transfer-node-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:n,onConfirm:b&&!Fe(d,"value.delegated")?k:v},{body:()=>t.jsx(In,{action:"delegate-transfer-nft",open:A,locale:w,checkFn:p.get,onClose:M,onSuccess:v,checkTimeout:5*60*1e3,webWalletUrl:Pn(R),extraParams:{targetDID:R.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const B=Ue({inviteId:s.inviteId,endpoint:m});return t.jsxs("div",{children:[t.jsx(jr,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:de(s.expireDate,w)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:B})]})},confirm:u("common.confirm"),onConfirm:r}],$=W[x];return t.jsxs(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[$.cancel&&t.jsx(z,{onClick:$.onCancel,color:"inherit",children:$.cancel}),t.jsxs(z,{onClick:$.onConfirm,color:"primary",disabled:g,variant:"contained",autoFocus:!0,children:[g&&t.jsx(oe,{size:16}),$.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof $.body=="function"?$.body():$.body}),!!f&&t.jsx(se,{type:"error",variant:"icon",children:f})]})}Qe.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,endpoint:S.string};Qe.defaultProps={onError:()=>{},endpoint:""};const jr=V.div`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as l,bh as m,u as p,j as s,U as u}from"./index-
|
|
1
|
+
import{z as l,bh as m,u as p,j as s,U as u}from"./index-cto27BjI.js";import{L as g,D as v}from"./download-BTNda_FN.js";import{F as f,S as h}from"./Select-DacRJUpT.js";import"./ButtonGroup-DsDQPFq5.js";import"./getValidReactChildren-BSSAKXXh.js";function k(){const i=l(),{name:a="abtnode"}=m(),{info:n}=p(),r=n.routing.provider,o=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(r){const e=`Service Gateway(${r})`;o.push({id:`service-gateway-${r}`,name:e,types:["error","access"]})}const c=e=>{i(`/logs/${e.target.value}`)},d=s.jsx(f,{sx:{minWidth:240},children:s.jsx(h,{value:a,onChange:c,size:"small",children:o.map(e=>s.jsx(u,{value:e.id,children:e.name},e.id))})}),t=o.find(e=>e.id===a)||o[0];return s.jsx(g,{name:t.name,logId:t.id,types:t.types,prepend:d,postpend:s.jsx(v,{id:n.did,name:"blocklet-server"})},t.id)}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bY as vt,bZ as mt,bT as X,bU as jt,c4 as Ht,bV as p,r as d,b_ as St,bX as at,c0 as N,j as u,c1 as gt,d5 as se,d6 as Ot,d7 as At,d8 as Xt,b$ as st,bc as ae,d9 as ft,da as ie,s as ce,db as $,P as W}from"./index-DBlH-4qz.js";import{K as de,a as ue}from"./Delete-HYXbanP_.js";let Y;function _t(){if(Y)return Y;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Y="reverse",t.scrollLeft>0?Y="default":(t.scrollLeft=1,t.scrollLeft===0&&(Y="negative")),document.body.removeChild(t),Y}function be(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(_t()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function pe(t){return mt("MuiTab",t)}const fe=vt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=fe,he=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ve=t=>{const{classes:e,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=t,g={root:["root",a&&v&&"labelIcon",`textColor${Ht(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return gt(g,pe,e)},me=X(jt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${Ht(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>p({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:p({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Se=d.forwardRef(function(e,l){const s=St({props:e,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:T,onFocus:F,selected:w,selectionFollowsFocus:x,textColor:_="inherit",value:R,wrapped:it=!1}=s,D=at(s,he),K=p({},s,{disabled:a,disableFocusRipple:v,selected:w,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:_,wrapped:it}),q=ve(K),L=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:N(q.iconWrapper,b.props.className)}):b,tt=E=>{!w&&m&&m(E,R),T&&T(E)},U=E=>{x&&!w&&m&&m(E,R),F&&F(E)};return u.jsxs(me,p({focusRipple:!v,className:N(q.root,n),ref:l,role:"tab","aria-selected":w,disabled:a,onClick:tt,onFocus:U,ownerState:K,tabIndex:w?0:-1},D,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[L,y]}):u.jsxs(d.Fragment,{children:[y,L]}),B]}))}),xt=Se;function ge(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function xe(t,e,l,s={},n=()=>{}){const{ease:a=ge,duration:v=300}=s;let h=null;const b=e[t];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const T=Math.min(1,(m-h)/v);if(e[t]=a(T)*(l-b)+b,T>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const ye=["onChange"],Ce={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Be(t){const{onChange:e}=t,l=at(t,ye),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return se(()=>{const v=Ot(()=>{const b=s.current;a(),b!==s.current&&e(s.current)}),h=At(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[e]),d.useEffect(()=>{a(),e(s.current)},[e]),u.jsx("div",p({style:Ce,ref:n},l))}function Te(t){return mt("MuiTabScrollButton",t)}const we=vt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Me=we,Ie=["className","slots","slotProps","direction","orientation","disabled"],Re=t=>{const{classes:e,orientation:l,disabled:s}=t;return gt({root:["root",l,s&&"disabled"]},Te,e)},Ee=X(jt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>p({width:40,flexShrink:0,opacity:.8,[`&.${Me.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ze=d.forwardRef(function(e,l){var s,n;const a=St({props:e,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=at(a,Ie),y=Xt(),m=p({isRtl:y},a),T=Re(m),F=(s=h.StartScrollButtonIcon)!=null?s:de,w=(n=h.EndScrollButtonIcon)!=null?n:ue,x=st({elementType:F,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),_=st({elementType:w,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(Ee,p({component:"div",className:N(T.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx(F,p({},x)):u.jsx(w,p({},_))}))}),We=ze;function Pe(t){return mt("MuiTabs",t)}const ke=vt("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ht=ke,Ne=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Nt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,$t=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,nt=(t,e,l)=>{let s=!1,n=l(t,e);for(;n;){if(n===t.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(t,n);else{n.focus();return}}},$e=t=>{const{vertical:e,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=t;return gt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Pe,b)},Fe=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${ht.scrollButtons}`]:e.scrollButtons},{[`& .${ht.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${ht.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Le=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.scroller,l.fixed&&e.fixed,l.hideScrollbar&&e.hideScrollbar,l.scrollableX&&e.scrollableX,l.scrollableY&&e.scrollableY]}})(({ownerState:t})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),je=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.flexContainer,l.vertical&&e.flexContainerVertical,l.centered&&e.centered]}})(({ownerState:t})=>p({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),He=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Oe=X(Be)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Ft={},Ae=d.forwardRef(function(e,l){const s=St({props:e,name:"MuiTabs"}),n=ae(),a=Xt(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:T=!1,indicatorColor:F="primary",onChange:w,orientation:x="horizontal",ScrollButtonComponent:_=We,scrollButtons:R="auto",selectionFollowsFocus:it,slots:D={},slotProps:K={},TabIndicatorProps:q={},TabScrollButtonProps:L={},textColor:tt="primary",value:U,variant:E="standard",visibleScrollbar:ct=!1}=s,Ut=at(s,Ne),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",et=C?"top":"left",ot=C?"bottom":"right",dt=C?"clientHeight":"clientWidth",Z=C?"height":"width",j=p({},s,{component:m,allowScrollButtonsMobile:T,indicatorColor:F,orientation:x,vertical:C,scrollButtons:R,textColor:tt,variant:E,visibleScrollbar:ct,fixed:!M,hideScrollbar:M&&!ct,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!T}),P=$e(j),Yt=st({elementType:D.StartScrollButtonIcon,externalSlotProps:K.startScrollButtonIcon,ownerState:j}),Vt=st({elementType:D.EndScrollButtonIcon,externalSlotProps:K.endScrollButtonIcon,ownerState:j}),[Ct,Kt]=d.useState(!1),[H,Bt]=d.useState(Ft),[Tt,Gt]=d.useState(!1),[wt,Zt]=d.useState(!1),[Mt,Jt]=d.useState(!1),[It,Qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Rt=new Map,z=d.useRef(null),O=d.useRef(null),Et=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:be(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=O.current.children;if(i.length>0){const f=i[Rt.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},J=ft(()=>{const{tabsMeta:o,tabMeta:r}=Et();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[Z]:r?r[Z]:0};if(isNaN(H[i])||isNaN(H[Z]))Bt(f);else{const S=Math.abs(H[i]-f[i]),I=Math.abs(H[Z]-f[Z]);(S>=1||I>=1)&&Bt(f)}}),ut=(o,{animation:r=!0}={})=>{r?xe(G,z.current,o,{duration:n.transitions.duration.standard}):z.current[G]=o},zt=o=>{let r=z.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_t()==="reverse"?-1:1),ut(r)},Wt=()=>{const o=z.current[dt];let r=0;const c=Array.from(O.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[dt]>o){i===0&&(r=o);break}r+=f[dt]}return r},te=()=>{zt(-1*Wt())},ee=()=>{zt(Wt())},oe=d.useCallback(o=>{Qt({overflow:null,scrollbarWidth:o})},[]),le=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Oe,{onChange:oe,className:N(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(R==="auto"&&(Tt||wt)||R===!0);return o.scrollButtonStart=c?u.jsx(_,p({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Yt},orientation:x,direction:a?"right":"left",onClick:te,disabled:!Tt},L,{className:N(P.scrollButtons,L.className)})):null,o.scrollButtonEnd=c?u.jsx(_,p({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Vt},orientation:x,direction:a?"left":"right",onClick:ee,disabled:!wt},L,{className:N(P.scrollButtons,L.className)})):null,o},Pt=ft(o=>{const{tabsMeta:r,tabMeta:c}=Et();if(!(!c||!r)){if(c[et]<r[et]){const i=r[G]+(c[et]-r[et]);ut(i,{animation:o})}else if(c[ot]>r[ot]){const i=r[G]+(c[ot]-r[ot]);ut(i,{animation:o})}}}),lt=ft(()=>{M&&R!==!1&&Jt(!Mt)});d.useEffect(()=>{const o=Ot(()=>{z.current&&J()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Q=>{var k;(k=r)==null||k.unobserve(Q)}),I.addedNodes.forEach(Q=>{var k;(k=r)==null||k.observe(Q)})}),o(),lt()},i=At(z.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(O.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(O.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[J,lt]),d.useEffect(()=>{const o=Array.from(O.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&R!==!1){const c=o[0],i=o[r-1],f={root:z.current,threshold:.99},S=pt=>{Gt(!pt[0].isIntersecting)},I=new IntersectionObserver(S,f);I.observe(c);const Q=pt=>{Zt(!pt[0].isIntersecting)},k=new IntersectionObserver(Q,f);return k.observe(i),()=>{I.disconnect(),k.disconnect()}}},[M,R,Mt,B==null?void 0:B.length]),d.useEffect(()=>{Kt(!0)},[]),d.useEffect(()=>{J()}),d.useEffect(()=>{Pt(Ft!==H)},[Pt,H]),d.useImperativeHandle(b,()=>({updateIndicator:J,updateScrollButtons:lt}),[J,lt]);const kt=u.jsx(He,p({},q,{className:N(P.indicator,q.className),ownerState:j,style:p({},H,q.style)}));let rt=0;const re=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?rt:o.props.value;Rt.set(r,rt);const c=r===U;return rt+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ct&&kt,selected:c,selectionFollowsFocus:it,onChange:w,textColor:tt,value:r},rt===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ne=o=>{const r=O.current,c=ie(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),nt(r,c,$t);break;case S:o.preventDefault(),nt(r,c,Nt);break;case"Home":o.preventDefault(),nt(r,null,Nt);break;case"End":o.preventDefault(),nt(r,null,$t);break}},bt=le();return u.jsxs(Fe,p({className:N(P.root,y),ownerState:j,ref:l,as:m},Ut,{children:[bt.scrollButtonStart,bt.scrollbarSizeListener,u.jsxs(Le,{className:P.scroller,ownerState:j,style:{overflow:It.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ct?void 0:-It.scrollbarWidth},ref:z,children:[u.jsx(je,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:j,onKeyDown:ne,ref:O,role:"tablist",children:re}),Ct&&kt]}),bt.scrollButtonEnd]}))}),yt=Ae,Lt="index",V={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Xe=ce(yt)(({theme:t})=>({[`& .${V.tabs}`]:{},[`& .${V.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Dt({tabs:t,current:e,onChange:l,...s}){return u.jsx(yt,{scrollButtons:"auto",value:e,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:$.backgroundsBgComponent,padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:$.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:$.lineBorderBase,color:$.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}Dt.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function qt({tabs:t,current:e,onChange:l,...s}){return u.jsx(yt,{scrollButtons:"auto",value:e,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:$.strokeBorderStrong,bottom:0}},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:$.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:$.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:$.foregroundsFgBase},...s.sx},children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qt.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function _e({tabs:t,current:e,onChange:l,...s}){return s.variant==="card"?u.jsx(Dt,{...s,tabs:t,current:e,onChange:l}):s.variant==="line"?u.jsx(qt,{...s,tabs:t,current:e,onChange:l}):u.jsx(Xe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[V.tabs,s.className||""].join(" "),children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}_e.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};export{_e as T,yt as a,xt as b,ht as t};
|
|
1
|
+
import{bY as vt,bZ as mt,bT as X,bU as jt,c4 as Ht,bV as p,r as d,b_ as St,bX as at,c0 as N,j as u,c1 as gt,d5 as se,d6 as Ot,d7 as At,d8 as Xt,b$ as st,bc as ae,d9 as ft,da as ie,s as ce,db as $,P as W}from"./index-cto27BjI.js";import{K as de,a as ue}from"./Delete-B32Y4H9I.js";let Y;function _t(){if(Y)return Y;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Y="reverse",t.scrollLeft>0?Y="default":(t.scrollLeft=1,t.scrollLeft===0&&(Y="negative")),document.body.removeChild(t),Y}function be(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(_t()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function pe(t){return mt("MuiTab",t)}const fe=vt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=fe,he=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ve=t=>{const{classes:e,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=t,g={root:["root",a&&v&&"labelIcon",`textColor${Ht(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return gt(g,pe,e)},me=X(jt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${Ht(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>p({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:p({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Se=d.forwardRef(function(e,l){const s=St({props:e,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:T,onFocus:F,selected:w,selectionFollowsFocus:x,textColor:_="inherit",value:R,wrapped:it=!1}=s,D=at(s,he),K=p({},s,{disabled:a,disableFocusRipple:v,selected:w,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:_,wrapped:it}),q=ve(K),L=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:N(q.iconWrapper,b.props.className)}):b,tt=E=>{!w&&m&&m(E,R),T&&T(E)},U=E=>{x&&!w&&m&&m(E,R),F&&F(E)};return u.jsxs(me,p({focusRipple:!v,className:N(q.root,n),ref:l,role:"tab","aria-selected":w,disabled:a,onClick:tt,onFocus:U,ownerState:K,tabIndex:w?0:-1},D,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[L,y]}):u.jsxs(d.Fragment,{children:[y,L]}),B]}))}),xt=Se;function ge(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function xe(t,e,l,s={},n=()=>{}){const{ease:a=ge,duration:v=300}=s;let h=null;const b=e[t];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const T=Math.min(1,(m-h)/v);if(e[t]=a(T)*(l-b)+b,T>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const ye=["onChange"],Ce={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Be(t){const{onChange:e}=t,l=at(t,ye),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return se(()=>{const v=Ot(()=>{const b=s.current;a(),b!==s.current&&e(s.current)}),h=At(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[e]),d.useEffect(()=>{a(),e(s.current)},[e]),u.jsx("div",p({style:Ce,ref:n},l))}function Te(t){return mt("MuiTabScrollButton",t)}const we=vt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Me=we,Ie=["className","slots","slotProps","direction","orientation","disabled"],Re=t=>{const{classes:e,orientation:l,disabled:s}=t;return gt({root:["root",l,s&&"disabled"]},Te,e)},Ee=X(jt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>p({width:40,flexShrink:0,opacity:.8,[`&.${Me.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ze=d.forwardRef(function(e,l){var s,n;const a=St({props:e,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=at(a,Ie),y=Xt(),m=p({isRtl:y},a),T=Re(m),F=(s=h.StartScrollButtonIcon)!=null?s:de,w=(n=h.EndScrollButtonIcon)!=null?n:ue,x=st({elementType:F,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),_=st({elementType:w,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(Ee,p({component:"div",className:N(T.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx(F,p({},x)):u.jsx(w,p({},_))}))}),We=ze;function Pe(t){return mt("MuiTabs",t)}const ke=vt("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ht=ke,Ne=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Nt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,$t=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,nt=(t,e,l)=>{let s=!1,n=l(t,e);for(;n;){if(n===t.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(t,n);else{n.focus();return}}},$e=t=>{const{vertical:e,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=t;return gt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Pe,b)},Fe=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${ht.scrollButtons}`]:e.scrollButtons},{[`& .${ht.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${ht.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Le=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.scroller,l.fixed&&e.fixed,l.hideScrollbar&&e.hideScrollbar,l.scrollableX&&e.scrollableX,l.scrollableY&&e.scrollableY]}})(({ownerState:t})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),je=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.flexContainer,l.vertical&&e.flexContainerVertical,l.centered&&e.centered]}})(({ownerState:t})=>p({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),He=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Oe=X(Be)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Ft={},Ae=d.forwardRef(function(e,l){const s=St({props:e,name:"MuiTabs"}),n=ae(),a=Xt(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:T=!1,indicatorColor:F="primary",onChange:w,orientation:x="horizontal",ScrollButtonComponent:_=We,scrollButtons:R="auto",selectionFollowsFocus:it,slots:D={},slotProps:K={},TabIndicatorProps:q={},TabScrollButtonProps:L={},textColor:tt="primary",value:U,variant:E="standard",visibleScrollbar:ct=!1}=s,Ut=at(s,Ne),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",et=C?"top":"left",ot=C?"bottom":"right",dt=C?"clientHeight":"clientWidth",Z=C?"height":"width",j=p({},s,{component:m,allowScrollButtonsMobile:T,indicatorColor:F,orientation:x,vertical:C,scrollButtons:R,textColor:tt,variant:E,visibleScrollbar:ct,fixed:!M,hideScrollbar:M&&!ct,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!T}),P=$e(j),Yt=st({elementType:D.StartScrollButtonIcon,externalSlotProps:K.startScrollButtonIcon,ownerState:j}),Vt=st({elementType:D.EndScrollButtonIcon,externalSlotProps:K.endScrollButtonIcon,ownerState:j}),[Ct,Kt]=d.useState(!1),[H,Bt]=d.useState(Ft),[Tt,Gt]=d.useState(!1),[wt,Zt]=d.useState(!1),[Mt,Jt]=d.useState(!1),[It,Qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Rt=new Map,z=d.useRef(null),O=d.useRef(null),Et=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:be(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=O.current.children;if(i.length>0){const f=i[Rt.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},J=ft(()=>{const{tabsMeta:o,tabMeta:r}=Et();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[Z]:r?r[Z]:0};if(isNaN(H[i])||isNaN(H[Z]))Bt(f);else{const S=Math.abs(H[i]-f[i]),I=Math.abs(H[Z]-f[Z]);(S>=1||I>=1)&&Bt(f)}}),ut=(o,{animation:r=!0}={})=>{r?xe(G,z.current,o,{duration:n.transitions.duration.standard}):z.current[G]=o},zt=o=>{let r=z.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_t()==="reverse"?-1:1),ut(r)},Wt=()=>{const o=z.current[dt];let r=0;const c=Array.from(O.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[dt]>o){i===0&&(r=o);break}r+=f[dt]}return r},te=()=>{zt(-1*Wt())},ee=()=>{zt(Wt())},oe=d.useCallback(o=>{Qt({overflow:null,scrollbarWidth:o})},[]),le=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Oe,{onChange:oe,className:N(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(R==="auto"&&(Tt||wt)||R===!0);return o.scrollButtonStart=c?u.jsx(_,p({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Yt},orientation:x,direction:a?"right":"left",onClick:te,disabled:!Tt},L,{className:N(P.scrollButtons,L.className)})):null,o.scrollButtonEnd=c?u.jsx(_,p({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Vt},orientation:x,direction:a?"left":"right",onClick:ee,disabled:!wt},L,{className:N(P.scrollButtons,L.className)})):null,o},Pt=ft(o=>{const{tabsMeta:r,tabMeta:c}=Et();if(!(!c||!r)){if(c[et]<r[et]){const i=r[G]+(c[et]-r[et]);ut(i,{animation:o})}else if(c[ot]>r[ot]){const i=r[G]+(c[ot]-r[ot]);ut(i,{animation:o})}}}),lt=ft(()=>{M&&R!==!1&&Jt(!Mt)});d.useEffect(()=>{const o=Ot(()=>{z.current&&J()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Q=>{var k;(k=r)==null||k.unobserve(Q)}),I.addedNodes.forEach(Q=>{var k;(k=r)==null||k.observe(Q)})}),o(),lt()},i=At(z.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(O.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(O.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[J,lt]),d.useEffect(()=>{const o=Array.from(O.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&R!==!1){const c=o[0],i=o[r-1],f={root:z.current,threshold:.99},S=pt=>{Gt(!pt[0].isIntersecting)},I=new IntersectionObserver(S,f);I.observe(c);const Q=pt=>{Zt(!pt[0].isIntersecting)},k=new IntersectionObserver(Q,f);return k.observe(i),()=>{I.disconnect(),k.disconnect()}}},[M,R,Mt,B==null?void 0:B.length]),d.useEffect(()=>{Kt(!0)},[]),d.useEffect(()=>{J()}),d.useEffect(()=>{Pt(Ft!==H)},[Pt,H]),d.useImperativeHandle(b,()=>({updateIndicator:J,updateScrollButtons:lt}),[J,lt]);const kt=u.jsx(He,p({},q,{className:N(P.indicator,q.className),ownerState:j,style:p({},H,q.style)}));let rt=0;const re=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?rt:o.props.value;Rt.set(r,rt);const c=r===U;return rt+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ct&&kt,selected:c,selectionFollowsFocus:it,onChange:w,textColor:tt,value:r},rt===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ne=o=>{const r=O.current,c=ie(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),nt(r,c,$t);break;case S:o.preventDefault(),nt(r,c,Nt);break;case"Home":o.preventDefault(),nt(r,null,Nt);break;case"End":o.preventDefault(),nt(r,null,$t);break}},bt=le();return u.jsxs(Fe,p({className:N(P.root,y),ownerState:j,ref:l,as:m},Ut,{children:[bt.scrollButtonStart,bt.scrollbarSizeListener,u.jsxs(Le,{className:P.scroller,ownerState:j,style:{overflow:It.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ct?void 0:-It.scrollbarWidth},ref:z,children:[u.jsx(je,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:j,onKeyDown:ne,ref:O,role:"tablist",children:re}),Ct&&kt]}),bt.scrollButtonEnd]}))}),yt=Ae,Lt="index",V={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Xe=ce(yt)(({theme:t})=>({[`& .${V.tabs}`]:{},[`& .${V.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Dt({tabs:t,current:e,onChange:l,...s}){return u.jsx(yt,{scrollButtons:"auto",value:e,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:$.backgroundsBgComponent,padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:$.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:$.lineBorderBase,color:$.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}Dt.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function qt({tabs:t,current:e,onChange:l,...s}){return u.jsx(yt,{scrollButtons:"auto",value:e,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:$.strokeBorderStrong,bottom:0}},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:$.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:$.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:$.foregroundsFgBase},...s.sx},children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qt.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function _e({tabs:t,current:e,onChange:l,...s}){return s.variant==="card"?u.jsx(Dt,{...s,tabs:t,current:e,onChange:l}):s.variant==="line"?u.jsx(qt,{...s,tabs:t,current:e,onChange:l}):u.jsx(Xe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[V.tabs,s.className||""].join(" "),children:t.map(n=>u.jsx(xt,{className:V.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}_e.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};export{_e as T,yt as a,xt as b,ht as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__fileDeps=["./index-
|
|
2
|
-
import{r as p,cs as B,ct as F,cu as H,cv as q,aL as O,aM as G,j as s,n as R,P as y,H as Q,cw as V,f as J,cx as K,x as M,Q as x,cn as Y,W as Z,B as I,m as D,O as ee,cy as te,bq as se,cz as ae,cA as ne,u as oe,y as re,an as ie,bl as ce,af as le}from"./index-
|
|
1
|
+
const __vite__fileDeps=["./index-DdImsIrU.js","./index-cto27BjI.js","./index-D7K8de1w.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{r as p,cs as B,ct as F,cu as H,cv as q,aL as O,aM as G,j as s,n as R,P as y,H as Q,cw as V,f as J,cx as K,x as M,Q as x,cn as Y,W as Z,B as I,m as D,O as ee,cy as te,bq as se,cz as ae,cA as ne,u as oe,y as re,an as ie,bl as ce,af as le}from"./index-cto27BjI.js";import{d as pe}from"./CheckCircle-z0EmvxpD.js";import{d as de}from"./ViewList-C9rEsLfO.js";import{d as ue}from"./Done-Dh00ds6i.js";import{w as me}from"./wrap-locale-BMwksOY3.js";import{S as fe,a as he,b as xe}from"./Stepper-CfMuItAU.js";var S=function(e){if(!e)return 0;var r=q(e).valueOf()-Date.now();return r<0?0:r},ge=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},ve=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return B(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,f=F(p.useState(function(){return S(a)}),2),h=f[0],u=f[1],n=H(b);p.useEffect(function(){if(!a){u(0);return}u(S(a));var w=setInterval(function(){var o,c=S(a);u(c),c===0&&(clearInterval(w),(o=n.current)===null||o===void 0||o.call(n))},v);return function(){return clearInterval(w)}},[a,v]);var j=p.useMemo(function(){return ge(h)},[h]);return[h,j]},k={},be=G;Object.defineProperty(k,"__esModule",{value:!0});var E=k.default=void 0,we=be(O()),je=s;E=k.default=(0,we.default)((0,je.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:e,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,f]=p.useState(0),h=p.useRef(null),u=o=>{if(o<0||o>e.length-1)return;g(o);const c=h.current.clientWidth;f(o*(r+i)-(c-r)/2+i*.5),d(o)};p.useEffect(()=>{u(v);const o=c=>c.preventDefault();h.current.addEventListener("touchmove",o,{passive:!1})},[]);let n;const j=o=>{n=o.touches[0].clientX},w=o=>{const c=o.changedTouches[0],P=n-c.clientX;Math.abs(P)>60&&(P>0?u(b+1):u(b-1))};return s.jsx(ye,{ref:h,onTouchStart:j,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((o,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:o.src}})},o.id))})})}const ye=R.div`
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
5
5
|
overflow: hidden;
|
|
@@ -33,7 +33,7 @@ import{r as p,cs as B,ct as F,cu as H,cv as q,aL as O,aM as G,j as s,n as R,P as
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`;T.propTypes={list:y.array,width:y.number,height:y.number,cardSpace:y.number,onSelect:y.func,defaultIndex:y.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};const $=()=>{const{searchParams:e}=new URL(window.location.href);return e.get("fromWallet")==="1"};function Pe({icon:e,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(E,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(e)]})}function Se({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(e),g=Q(t=>t.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),f=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:h,clearPassportId:u}=ne(),{t:n,locale:j}=p.useContext(J),{wallet:w}=K(),[o,c]=p.useState(0),{searchParams:P}=new URL(window.location.href),C=()=>{a.activeStep++},W=t=>{a.user=t.user},A=()=>{C()},z=(t,m)=>{t!=null&&t.passportId&&h(t.passportId),t!=null&&t.sessionToken&&(f.current.sessionToken=m(t.sessionToken)),t!=null&&t.refreshToken&&(f.current.refreshToken=m(t.refreshToken)),a.success=!0,C()},U=()=>new Promise(t=>{try{b.logout(()=>{t()})}catch{t()}}),L=async()=>{if(w&&$()){se(()=>import("./index-
|
|
36
|
+
`;T.propTypes={list:y.array,width:y.number,height:y.number,cardSpace:y.number,onSelect:y.func,defaultIndex:y.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};const $=()=>{const{searchParams:e}=new URL(window.location.href);return e.get("fromWallet")==="1"};function Pe({icon:e,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(E,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(e)]})}function Se({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(e),g=Q(t=>t.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),f=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:h,clearPassportId:u}=ne(),{t:n,locale:j}=p.useContext(J),{wallet:w}=K(),[o,c]=p.useState(0),{searchParams:P}=new URL(window.location.href),C=()=>{a.activeStep++},W=t=>{a.user=t.user},A=()=>{C()},z=(t,m)=>{t!=null&&t.passportId&&h(t.passportId),t!=null&&t.sessionToken&&(f.current.sessionToken=m(t.sessionToken)),t!=null&&t.refreshToken&&(f.current.refreshToken=m(t.refreshToken)),a.success=!0,C()},U=()=>new Promise(t=>{try{b.logout(()=>{t()})}catch{t()}}),L=async()=>{if(w&&$()){se(()=>import("./index-DdImsIrU.js").then(m=>m.i),__vite__mapDeps([0,1,2]),import.meta.url).then(m=>{m.call("arcClosePage")});return}await U(),ae(d)&&d({sessionToken:f.current.sessionToken,refreshToken:f.current.refreshToken});const t=P.get("redirect");if(t){window.location.replace(t);return}u(),window.location.replace("/")},X=t=>{a.passport=t.target.value},[N]=ve({leftTime:o,onEnd:()=>{L()}}),_=[{label:n("lostPassport.selectPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(t=>({src:l({title:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto"}),name:t.title,id:t.id})),onSelect:t=>X({target:{value:a.user.passportTypes[t].name}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:n("common.next")})})]}):s.jsx(M,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:j,messages:{title:n("lostPassport.dialog.title"),scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")}})},{label:n("lostPassport.receivePassport"),content:()=>{var m;const t={receiverDid:a.user.did,passportName:a.passport,teamDid:((m=window==null?void 0:window.blocklet)==null?void 0:m.did)||""};return s.jsx(M,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:j,messages:{title:`${n("lostPassport.dialog.title")}`,scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")},extraParams:t})}},{label:n("common.complete"),content:()=>(o===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(pe,{style:{fontSize:60}})}),s.jsx(D,{component:"p",variant:"body1",className:"subheader",children:n("issuePassport.dialog.success")}),s.jsx(D,{component:"p",variant:"body2",color:"gray",children:w&&$()?n("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):n("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:L,children:n("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(ke,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(fe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:_.map(({label:t})=>s.jsx(he,{children:s.jsx(xe,{StepIconComponent:Pe,children:t})},t))}),s.jsx("div",{className:"stepper-content",children:_[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(ee,{to:"/",style:{color:"#4598FA"},children:n("lostPassport.return")})})]})})}const ke=R(te)`
|
|
37
37
|
padding-top: 46px;
|
|
38
38
|
padding-bottom: 46px;
|
|
39
39
|
height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cY as P,dH as M,dI as E,dJ as g,dK as Y,dL as N,dM as j}from"./index-
|
|
1
|
+
import{cY as P,dH as M,dI as E,dJ as g,dK as Y,dL as N,dM as j}from"./index-cto27BjI.js";import{a as X}from"./isEqual-SGvPf73-.js";var V={},i={},d={},J=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});d.toStrictHex=d.toBytes=d.toBits=d.DID_PREFIX=void 0;const K=J(M),H=g,v="did:abt:";d.DID_PREFIX=v;const q=e=>{try{if((0,H.isHexStrict)(e))return E.from((0,H.stripHexPrefix)(e),"hex");let t=(0,H.fromBase58)(e.replace(v,""));for(;t.length<26;)t=E.concat([E.from([0]),t]);return t}catch(t){throw new Error(`Cannot convert DID string to byte array: ${t.message}`)}};d.toBytes=q;const G=(e,t)=>(0,K.default)((0,H.toBN)(e).toString(2),t,"0");d.toBits=G;const W=(e,t)=>{const s=e.replace(/^0x/i,"");return typeof t=="number"&&t%2===0?(0,K.default)(e,t,"0"):s.length%2===0?s:`0${s}`};d.toStrictHex=W;var $=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});i.DidType=i.toChecksumAddress=i.isEthereumDid=i.isEthereumType=i.toTypeInfoStr=i.toTypeInfo=i.fromTypeInfo=i.DID_TYPE_ETHEREUM=i.DID_TYPE_ARCBLOCK=void 0;const m=g,b=$(Y),z=$(X),C=$(N),o=j,T=d,D={pk:"key",address:"encoding"},B={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ED25519,hash:o.types.HashType.SHA3,address:o.types.EncodingType.BASE58};i.DID_TYPE_ARCBLOCK=B;const R={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ETHEREUM,hash:o.types.HashType.KECCAK,address:o.types.EncodingType.BASE16};i.DID_TYPE_ETHEREUM=R;const L=e=>{const t=["pk","hash","address"];return(0,z.default)((0,C.default)(e,t),(0,C.default)(R,t))};i.isEthereumType=L;const F=e=>{const t=(0,m.toAddress)(e);return/^(0x)?[0-9a-f]{40}$/i.test(t)?/^(0x|0X)?[0-9a-f]{40}$/.test(t)||/^(0x|0X)?[0-9A-F]{40}$/.test(t)?!0:Q(t):!1};i.isEthereumDid=F;const Q=e=>{const t=e.replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t.toLowerCase()).replace(/^0x/i,"");for(let r=0;r<40;r++)if(parseInt(s[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(s[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},Z=e=>{if(typeof e>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error(`Given address "${e}" is not a valid Ethereum address.`);const t=e.toLowerCase().replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t).replace(/^0x/i,"");let r="0x";for(let n=0;n<t.length;n++)parseInt(s[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r};i.toChecksumAddress=Z;function k(e={}){let t={};["default","arcblock"].includes(e)?t=B:["eth","ethereum"].includes(e)?t=R:t={...B,...e};const{role:s,pk:r,hash:n,address:u}=t;Object.keys(t).forEach(l=>{const _=(0,b.default)(`${D[l]||l}Type`);if(Object.values(o.types[_]).includes(t[l])===!1)throw new Error(`Unsupported ${l} type: ${t[l]}`)});const p={role:s,pk:r,hash:n,address:u};return L(p)===!1&&[o.types.RoleType.ROLE_NODE,o.types.RoleType.ROLE_VALIDATOR,o.types.RoleType.ROLE_TETHER,o.types.RoleType.ROLE_SWAP].includes(p.role)&&(p.hash=o.types.HashType.SHA2),p}i.DidType=k;k.toJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,b.default)(`${D[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=n[u.indexOf(e[s])],t},{});k.fromJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,b.default)(`${D[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=u[n.indexOf(e[s])],t},{});const x=e=>{const t=k(e),s=(0,T.toBits)(t.role,6),r=(0,T.toBits)(t.pk,5),n=(0,T.toBits)(t.hash,5),u=`${s}${r}${n}`,p=(0,m.stripHexPrefix)((0,m.numberToHex)(parseInt(u,2)));return(0,T.toStrictHex)(p,4)};i.fromTypeInfo=x;const w=e=>{let t={};try{if(F(e))t=R;else{const r=(0,T.toBytes)(e).slice(0,2),n=(0,T.toStrictHex)(E.from(r).toString("hex")),u=(0,T.toBits)(new m.BN(n,16),16),p=u.slice(0,6),l=u.slice(6,11),_=u.slice(11,16);t={role:parseInt(p,2),pk:parseInt(l,2),hash:parseInt(_,2),address:(0,m.isHex)((0,m.toAddress)(e))?o.types.EncodingType.BASE16:o.types.EncodingType.BASE58}}return Object.keys(t).forEach(s=>{Object.values(o.types[`${(0,b.default)(D[s]||s)}Type`]).includes(t[s])===!1&&delete t[s]}),t}catch{return t}};i.toTypeInfo=w;const ee=e=>{const t=w(e);return Object.keys(t).reduce((s,r)=>{const n=o.types[`${(0,b.default)(D[r]||r)}Type`];return s[r]=Object.keys(n).find(u=>n[u]===t[r]),s},{})};i.toTypeInfoStr=ee;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const t=j;Object.defineProperty(e,"types",{enumerable:!0,get:function(){return t.types}});const s=g;Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return s.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return s.toDid}});const r=i;Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return r.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return r.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return r.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return r.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return r.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return r.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return r.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return r.toTypeInfoStr}});const n=d;Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return n.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return n.toStrictHex}});const u=(y,a)=>{const c=(0,r.DidType)(a),f=(0,t.getSigner)(c.pk).getPublicKey(y);return p(f.indexOf("0x")===0?f:`0x${f}`,c)};e.fromSecretKey=u;const p=(y,a)=>{const c=(0,r.DidType)(a),h=(0,t.getHasher)(c.hash)(y,1);return l(h,c)};e.fromPublicKey=p;const l=(y,a)=>{const c=(0,r.DidType)(a),f=(0,s.stripHexPrefix)(y).slice(0,40),h=(0,t.getHasher)(c.hash),I=(0,r.fromTypeInfo)(c),S=(0,s.stripHexPrefix)(h(`0x${I}${f}`,1)).slice(0,8),O=`0x${I}${f}${S}`;return(0,r.isEthereumType)(c)?(0,r.toChecksumAddress)(`0x${y.slice(-40)}`):c.address===t.types.EncodingType.BASE58?(0,s.toBase58)(O):O};e.fromPublicKeyHash=l;const _=(y,a=t.types.RoleType.ROLE_ACCOUNT)=>{const c=Object.keys(t.types.RoleType),f=Object.values(t.types.RoleType);if(f.indexOf(a)===-1)throw new Error(`Unsupported role type ${a} when gen ddi from hash`);const h=(0,r.DidType)({role:t.types.RoleType[c[f.indexOf(a)]]});return l(y,h)};e.fromHash=_;const U=(y,a)=>{if(A(y)===!1)return!1;const c=(0,r.toTypeInfo)(y),f=p(a,c),h=y.replace(n.DID_PREFIX,"");return f===h};e.isFromPublicKey=U;const A=y=>{if(!y)return!1;const a=(0,s.toAddress)(String(y)),{hash:c}=(0,r.toTypeInfo)(a);if(typeof c>"u")return!1;if((0,r.isEthereumDid)(a))return!0;const f=(0,t.getHasher)(c),h=(0,n.toBytes)(a),I=(0,n.toStrictHex)(E.from(h.slice(0,22)).toString("hex")),S=(0,n.toStrictHex)(E.from(h.slice(22,26)).toString("hex")),O=(0,s.stripHexPrefix)(f(`0x${I}`,1)).slice(0,8);return S===O};e.isValid=A})(V);export{V as l};
|