@abtnode/webapp 1.16.45-beta-20250628-221915-2d6b9a34 → 1.16.45-beta-20250630-233332-04c2bd6f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-WnXfrwG8.js → AdapterDayjs-BHlyhiPJ.js} +1 -1
- package/dist/assets/{Add-ClFw4Dnq.js → Add-CKZvwomV.js} +1 -1
- package/dist/assets/{ArrowDropDown-B-z5TNuh.js → ArrowDropDown-CTqTvgvP.js} +1 -1
- package/dist/assets/{Autocomplete-Dn9blQmP.js → Autocomplete-BSy3e1ZV.js} +1 -1
- package/dist/assets/{Breadcrumbs-B0YoukvK.js → Breadcrumbs-Dx36e97U.js} +1 -1
- package/dist/assets/{ButtonGroup-BrCuoPMx.js → ButtonGroup-Cv9T_ybJ.js} +1 -1
- package/dist/assets/{CSSTransition-DyO7mCpS.js → CSSTransition-D_ivveoB.js} +1 -1
- package/dist/assets/{CallMerge-CExHqb6s.js → CallMerge-1pQL6_dZ.js} +1 -1
- package/dist/assets/{CardContent-ponMszq2.js → CardContent-Bht0UPSu.js} +1 -1
- package/dist/assets/{ChevronLeft-C_FjrhWT.js → ChevronLeft-DlyVdCfr.js} +1 -1
- package/dist/assets/{ChevronRight-C3Djwe6Q.js → ChevronRight-DoFFwAxz.js} +1 -1
- package/dist/assets/{Clear-tcJv2g6U.js → Clear-h2RSseCa.js} +1 -1
- package/dist/assets/{Close-CMiVzKm3.js → Close-L6Q6a3RE.js} +1 -1
- package/dist/assets/{Community-gplY8wfW.js → Community-OIzGuElq.js} +1 -1
- package/dist/assets/{Delete-vq0xV4m5.js → Delete-DSwbRjGm.js} +1 -1
- package/dist/assets/{DeleteOutline-uICQncS-.js → DeleteOutline-BbkjMdAN.js} +1 -1
- package/dist/assets/{Done-BFO7tVAe.js → Done-B9t-lcQ7.js} +1 -1
- package/dist/assets/{Edit-Cy7H9XRh.js → Edit-B7OHuMt8.js} +1 -1
- package/dist/assets/{ErrorOutline-jp9UMRon.js → ErrorOutline-Dj5RjmYU.js} +1 -1
- package/dist/assets/{HelpOutline-D7cgnTBl.js → HelpOutline-BFcbReM4.js} +1 -1
- package/dist/assets/{Holiday-CRgOW0vy.js → Holiday-DLceWWRW.js} +1 -1
- package/dist/assets/{Launch-DpU-CLIS.js → Launch-BZfUR2wT.js} +1 -1
- package/dist/assets/{Link-8raCv9wv.js → Link-CkeMp94q.js} +1 -1
- package/dist/assets/{ListItemButton-CTTpzKD1.js → ListItemButton-D3dXwiba.js} +1 -1
- package/dist/assets/{ListSubheader-DcCd9d8k.js → ListSubheader-OdrZyzwN.js} +1 -1
- package/dist/assets/{LoadingButton-ClbjkcHM.js → LoadingButton-BfU5BygV.js} +1 -1
- package/dist/assets/{LockIcon-mm84bgIc.js → LockIcon-tb1yw67V.js} +1 -1
- package/dist/assets/{Meeting-CPKZMx1H.js → Meeting-Bl59MmZs.js} +1 -1
- package/dist/assets/{MoreHoriz-DAtcBD-9.js → MoreHoriz-BREqCusY.js} +1 -1
- package/dist/assets/{MoreVert-CEjQfu0K.js → MoreVert-6SZ5-4Oc.js} +1 -1
- package/dist/assets/{OffSick-BUNd7ouW.js → OffSick-D_SYzKwE.js} +1 -1
- package/dist/assets/{OpenInNew-2n62FKFZ.js → OpenInNew-DJezkARI.js} +1 -1
- package/dist/assets/{Public-CHhJjIAi.js → Public-Cgg-rE8P.js} +1 -1
- package/dist/assets/{Refresh-BAgv0sMT.js → Refresh-CToXYqtZ.js} +1 -1
- package/dist/assets/{SchemaReference.es-o3PMozx_.js → SchemaReference.es-DON6qWUb.js} +1 -1
- package/dist/assets/{Search-DVnChAqf.js → Search-BWsSz0TZ.js} +1 -1
- package/dist/assets/{Slider-BrIHm-eU.js → Slider-qd584sGN.js} +1 -1
- package/dist/assets/{Stepper-Vvl_tjzl.js → Stepper-D5qb4eez.js} +1 -1
- package/dist/assets/{Switch-CVCvuqvb.js → Switch-B5mZ5gaW.js} +1 -1
- package/dist/assets/{TableRow-Cc4t6Du4.js → TableRow-Cm_wAjgF.js} +1 -1
- package/dist/assets/{TableSearch-BLF8cfXo.js → TableSearch-CbLOqG0x.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-kN-Ox0Ve.js → ToggleButtonGroup-BsAN6BnK.js} +1 -1
- package/dist/assets/{Verified-B06y23xT.js → Verified-FiZjuwhy.js} +1 -1
- package/dist/assets/{VerifiedUser-BqzMhYik.js → VerifiedUser-CzSXnLhU.js} +1 -1
- package/dist/assets/{ViewColumn-DPG1LzJR.js → ViewColumn-B1nkIYjz.js} +1 -1
- package/dist/assets/{ViewList-DmKQCu8a.js → ViewList-COZmXWce.js} +1 -1
- package/dist/assets/{WorkingRemotely-CpfTuPvc.js → WorkingRemotely-DwhCL9h1.js} +1 -1
- package/dist/assets/{_createAggregator-Gs8KSpWa.js → _createAggregator-BdCza_P-.js} +1 -1
- package/dist/assets/{actions-CLAOJycQ.js → actions-BTcKDonC.js} +1 -1
- package/dist/assets/{actions-BiWifybs.js → actions-Bvcwob0t.js} +1 -1
- package/dist/assets/{agreement-DcZ6KgNg.js → agreement-EANMw4mp.js} +1 -1
- package/dist/assets/api-BJ-yIghe.js +1 -0
- package/dist/assets/{appearance-Bl29K6v5.js → appearance-CZSOZlgx.js} +1 -1
- package/dist/assets/{ar-BN95HEFs.js → ar-muZ8yq-3.js} +1 -1
- package/dist/assets/{audit-logs-DuExXKbR.js → audit-logs-vOsLrHtf.js} +1 -1
- package/dist/assets/{base-chart-ekFash8m.js → base-chart-DMVk_dMy.js} +1 -1
- package/dist/assets/{blocklet-Cfh-Xrih.js → blocklet-DfNwfvjT.js} +1 -1
- package/dist/assets/{brace-fold.es-D4DmIvCt.js → brace-fold.es-CESAnWUV.js} +1 -1
- package/dist/assets/{chain-DU2c_k4h.js → chain-DaWBsVEZ.js} +1 -1
- package/dist/assets/{click-to-copy-dfoyY_lM.js → click-to-copy-Bx0WCh-p.js} +1 -1
- package/dist/assets/cloneDeep-CvMji3zz.js +1 -0
- package/dist/assets/{closebrackets.es-CQUNg-Pn.js → closebrackets.es-C817QEGa.js} +1 -1
- package/dist/assets/{codemirror.es-ByZ_m-CY.js → codemirror.es-gmfriNw8.js} +1 -1
- package/dist/assets/{collapse-CR_PBgme.js → collapse-Ds1jlCkQ.js} +1 -1
- package/dist/assets/{comment.es-BwPvE6E1.js → comment.es-DO9iblZv.js} +1 -1
- package/dist/assets/{config-navigation-lZcf32HC.js → config-navigation-DmriUtLF.js} +3 -3
- package/dist/assets/{connect-to-Bmy3u_bk.js → connect-to-8NfHLbgD.js} +1 -1
- package/dist/assets/{de-BmXl3Jnb.js → de-C7PyfZoI.js} +1 -1
- package/dist/assets/{delete-confirm-C75lI5W7.js → delete-confirm-BbG1Njy7.js} +1 -1
- package/dist/assets/{detail-CXHfmx0j.js → detail-Bwjs-FKS.js} +3 -3
- package/dist/assets/{dialog.es-CeOH4OgU.js → dialog.es-DunCYlTS.js} +1 -1
- package/dist/assets/{domains-RJq5LjW1.js → domains-3lFyCckU.js} +1 -1
- package/dist/assets/{download-Cm9MnB1L.js → download-DhL2-FKU.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CH16KKaA.js +1 -0
- package/dist/assets/{es-C0fHeuzj.js → es-DLm4lJg0.js} +1 -1
- package/dist/assets/{foldgutter.es-IJZjNq_B.js → foldgutter.es-Caubyucg.js} +1 -1
- package/dist/assets/{fr-CO0NFjy0.js → fr-CKdoTmsi.js} +1 -1
- package/dist/assets/{get-safe-url-CtuFSgMF.js → get-safe-url-CIlQ_jPL.js} +1 -1
- package/dist/assets/{get-safe-url-yal5CMKC.js → get-safe-url-DdRvX178.js} +1 -1
- package/dist/assets/getValidReactChildren-Ds2y77el.js +1 -0
- package/dist/assets/{hi-Cms3dwY-.js → hi-C_IKh6W5.js} +1 -1
- package/dist/assets/{hint.es-BjGBkW4x.js → hint.es-CruRhaN-.js} +1 -1
- package/dist/assets/{hint.es2-B5zzitgD.js → hint.es2-DQ7u-Cnl.js} +1 -1
- package/dist/assets/{id-Bo8dj7EE.js → id-DG7dMeJq.js} +1 -1
- package/dist/assets/{iframe-D7RblVkl.js → iframe-CoA6LAJN.js} +1 -1
- package/dist/assets/{index-ByyRbNAi.js → index-6QG0eJbd.js} +1 -1
- package/dist/assets/{index-B9Zj0MjA.js → index-B3guyKGC.js} +1 -1
- package/dist/assets/{index-T0AaJV4t.js → index-B77QTgjk.js} +1 -1
- package/dist/assets/{index-Cn3hRzDh.js → index-BCBJCT1W.js} +1 -1
- package/dist/assets/{index-CbI1JhKK.js → index-BI05or-g.js} +1 -1
- package/dist/assets/{index-DyR416TT.js → index-BJcQfMN9.js} +1 -1
- package/dist/assets/{index-MjSkHF60.js → index-BRwxtxxr.js} +1 -1
- package/dist/assets/{index-Bt5kVv-q.js → index-BVFznPvg.js} +1 -1
- package/dist/assets/{index-BUiQz1Ab.js → index-BXLWgGxr.js} +1 -1
- package/dist/assets/{index-C7UfoPX9.js → index-BXZ_Sepb.js} +1 -1
- package/dist/assets/{index-DvpErIn0.js → index-Bd9sXNp9.js} +1 -1
- package/dist/assets/{index-DNrbJzny.js → index-BdgxyWV7.js} +1 -1
- package/dist/assets/{index-qtvsfy9m.js → index-C5kA3CHn.js} +1 -1
- package/dist/assets/{index-xvfMzmUf.js → index-C6SovgLi.js} +3 -3
- package/dist/assets/{index-C2a0z7LQ.js → index-CHE9ROUg.js} +1 -1
- package/dist/assets/{index-BvMV51AL.js → index-CIbq35qJ.js} +1 -1
- package/dist/assets/{index-BG5KLOZK.js → index-CJ2iy25m.js} +1 -1
- package/dist/assets/{index-CovWC1Ok.js → index-CKT_pMKI.js} +1 -1
- package/dist/assets/{index-DWdh-5Vi.js → index-CKzGu37_.js} +1 -1
- package/dist/assets/{index-B090kNMk.js → index-CMclvolP.js} +1 -1
- package/dist/assets/{index-Cpypikxn.js → index-COTljNoO.js} +1 -1
- package/dist/assets/{index-ok_zOsNR.js → index-CPbeDmEg.js} +1 -1
- package/dist/assets/{index-Cful1BDq.js → index-CVGZhJsl.js} +1 -1
- package/dist/assets/{index-BU6w7RS4.js → index-C_KkIIIE.js} +1 -1
- package/dist/assets/{index-Bn8vq2pI.js → index-C_tSdokL.js} +1 -1
- package/dist/assets/{index-kVMWdWEQ.js → index-CdkvSBOv.js} +3 -3
- package/dist/assets/{index-DWd3cILy.js → index-D-VVWMa1.js} +1 -1
- package/dist/assets/{index-DiPveja-.js → index-D0_0NC6P.js} +1 -1
- package/dist/assets/{index-CZeyzgj-.js → index-DAf-iI_f.js} +3 -3
- package/dist/assets/{index-Csg8wVIe.js → index-DDknB2BQ.js} +5 -5
- package/dist/assets/{index-eLfUdELN.js → index-DMUuXkl-.js} +4 -4
- package/dist/assets/{index-CNLT3Byh.js → index-DPATNeV7.js} +1 -1
- package/dist/assets/{index-Don7IqNm.js → index-DRrTj2G2.js} +1 -1
- package/dist/assets/{index-D5QEcVRM.js → index-DZdK0rK2.js} +1 -1
- package/dist/assets/index-DerOS-xf.js +155 -0
- package/dist/assets/index-Dhf9-L3G.js +1 -0
- package/dist/assets/{index-po-3yvwP.js → index-DtQKM-2h.js} +1 -1
- package/dist/assets/{index-CIF0Gh0t.js → index-Dw2CfFb3.js} +1 -1
- package/dist/assets/{index-BjmLysO9.js → index-Dymg9lqV.js} +1 -1
- package/dist/assets/{index-Hpi3ZYHE.js → index-IyfTJp8i.js} +1 -1
- package/dist/assets/{index-wWirgvea.js → index-MHcWBGOV.js} +1 -1
- package/dist/assets/{index-DfJ_-35A.js → index-Myd8Qh5l.js} +1 -1
- package/dist/assets/{index-RRSzDDKO.js → index-OGZG8xfM.js} +1 -1
- package/dist/assets/{index-LJwDNnEV.js → index-Z8_Ea0J-.js} +1 -1
- package/dist/assets/{index-DAxdABYr.js → index-e8rMD6ce.js} +1 -1
- package/dist/assets/{index-rOyQ4oq0.js → index-nWbwSxF7.js} +3 -3
- package/dist/assets/{index-i3F5skqc.js → index-qDvx2LXA.js} +1 -1
- package/dist/assets/{index.esm-CyA4TSTB.js → index.esm-CBxLPn81.js} +1 -1
- package/dist/assets/{info-addon.es-DYDUbMc0.js → info-addon.es-BuNfOlP_.js} +1 -1
- package/dist/assets/{info.es-SnfQfB84.js → info.es-BT9LKStO.js} +1 -1
- package/dist/assets/{install-from-url-B_tn4zT0.js → install-from-url-BjMqGDXD.js} +1 -1
- package/dist/assets/{invitation-DGj_iHMa.js → invitation-OOnB1MnQ.js} +1 -1
- package/dist/assets/is-path-prefix-equal-DWu51fPZ.js +1 -0
- package/dist/assets/{item-W0sW0e2J.js → item-D_npg1xG.js} +1 -1
- package/dist/assets/{ja-zaAhH8mE.js → ja-DePe5vMS.js} +1 -1
- package/dist/assets/{javascript.es-FaWFEwiB.js → javascript.es-DoVgWSqA.js} +1 -1
- package/dist/assets/{jump-to-line.es-DhOjo0qe.js → jump-to-line.es-Ki36SaHt.js} +1 -1
- package/dist/assets/{jump.es-CbK7sUVy.js → jump.es-BQrn6url.js} +1 -1
- package/dist/assets/{ko-CoZQ7a7T.js → ko-BKnl7Jtq.js} +1 -1
- package/dist/assets/{lint.es-CPxhlsdI.js → lint.es-DuK-tdYT.js} +1 -1
- package/dist/assets/{lint.es2-CajKeHM1.js → lint.es2-BqlbRgHH.js} +1 -1
- package/dist/assets/{lint.es3-DncWZVuk.js → lint.es3-BSjWl5oo.js} +1 -1
- package/dist/assets/{list-header-BwiAnrHh.js → list-header-I7ATqJra.js} +1 -1
- package/dist/assets/{log-DC5woQxD.js → log-CQlLgXdp.js} +1 -1
- package/dist/assets/{lottie-react.esm-CiVS9iF1.js → lottie-react.esm-CbT2RfxS.js} +1 -1
- package/dist/assets/{matchbrackets.es-3u1E0SjP.js → matchbrackets.es-Bjw4wGxG.js} +1 -1
- package/dist/assets/{memory-BG-8wVy5.js → memory-tq4C79oI.js} +1 -1
- package/dist/assets/{metric-DLRnt0HL.js → metric-x46WB9O0.js} +1 -1
- package/dist/assets/{mode.es-y9n6K8Wh.js → mode.es-mTcaUWXB.js} +1 -1
- package/dist/assets/{mode.es2-DzPRH9Dr.js → mode.es2-jKnc5kyz.js} +1 -1
- package/dist/assets/{mode.es3-DesMEGf5.js → mode.es3-N6hg3bf1.js} +1 -1
- package/dist/assets/omit-DEm0zn3R.js +1 -0
- package/dist/assets/{onlineParser.es-DqXm5fI3.js → onlineParser.es-B1S8nTp7.js} +1 -1
- package/dist/assets/{overview-CVGZvFnz.js → overview-YkRHSame.js} +1 -1
- package/dist/assets/{permission-DMmPrvTU.js → permission-BrGI8BrM.js} +1 -1
- package/dist/assets/{preference-FLLBxRmn.js → preference-C3tBNpJ3.js} +4 -4
- package/dist/assets/{pt-D4wJ-rZD.js → pt-BoWjQJrr.js} +1 -1
- package/dist/assets/{raf-schd.esm-DATKMJvw.js → raf-schd.esm-BlF__8ph.js} +1 -1
- package/dist/assets/refType-BK4ojMi7.js +1 -0
- package/dist/assets/{resource-dialog-BA4pjpzF.js → resource-dialog-CroWtX8l.js} +4 -4
- package/dist/assets/{ru-CmWrzb7M.js → ru-C8y980Xl.js} +1 -1
- package/dist/assets/{runtime-qkvvlzxp.js → runtime-BfH0pVsh.js} +1 -1
- package/dist/assets/sdk-B0fHGxCR.js +1 -0
- package/dist/assets/{search.es-BF28CwLe.js → search.es-DPfw_MLi.js} +1 -1
- package/dist/assets/{searchcursor.es-BrcoUXZs.js → searchcursor.es-BeD7-C_W.js} +1 -1
- package/dist/assets/{service-BN0pdzsl.js → service-BUPvoyUe.js} +1 -1
- package/dist/assets/{shorten-label-Bb8Ef88h.js → shorten-label-Dkc-R7Pf.js} +1 -1
- package/dist/assets/{show-hint.es-Uh6-hazt.js → show-hint.es-BY6EKf_p.js} +1 -1
- package/dist/assets/{simple-select-Dt_avuAZ.js → simple-select-oRYcfFfP.js} +1 -1
- package/dist/assets/{spaces-BAC7141S.js → spaces-B_XtvGWM.js} +1 -1
- package/dist/assets/{status-CGAf0ln2.js → status-BYq6QPRF.js} +1 -1
- package/dist/assets/{status-Bbke970Q.js → status-FCdb54YV.js} +1 -1
- package/dist/assets/{sublime.es-Dzbai708.js → sublime.es-CaTcUGtb.js} +1 -1
- package/dist/assets/{switch-control-BcUld3eb.js → switch-control-BkMzTiNZ.js} +1 -1
- package/dist/assets/{table-icons-DssnPJ3-.js → table-icons-BWE8DLba.js} +1 -1
- package/dist/assets/{team-C-5j3X8Z.js → team-DXOr-ygw.js} +1 -1
- package/dist/assets/{th-DkqBkRH_.js → th-DfDBrUtW.js} +1 -1
- package/dist/assets/{toLower-Br-47zMX.js → toLower-lEcIAc-C.js} +1 -1
- package/dist/assets/toUpper-Z-pEvLY8.js +1 -0
- package/dist/assets/{traffic-BYGx66ZI.js → traffic-Baaukshm.js} +1 -1
- package/dist/assets/{url-evaluation-B5D3amtB.js → url-evaluation-D2uxzb5w.js} +1 -1
- package/dist/assets/{url-join-ZuF96vgy.js → url-join-DU6UdRf1.js} +1 -1
- package/dist/assets/{use-mobile-BCdpyHTg.js → use-mobile-BknAfbf7.js} +1 -1
- package/dist/assets/{use-mobile-C5Ab5U18.js → use-mobile-hZxK6-uz.js} +1 -1
- package/dist/assets/{useAsync-C2S2Uzjt.js → useAsync-CbClB-AN.js} +1 -1
- package/dist/assets/{useAsyncRetry-DqY2ZlcJ.js → useAsyncRetry-foiApHTO.js} +1 -1
- package/dist/assets/{useLocalStorage-BtSS0rMI.js → useLocalStorage-rbap7GBn.js} +1 -1
- package/dist/assets/{useThemeProps-Cg4_LVK8.js → useThemeProps-CWjJ-DWG.js} +1 -1
- package/dist/assets/{util-Cwo8Y390.js → util-DMr4hgRJ.js} +1 -1
- package/dist/assets/{vi-D4Y0EZ10.js → vi-oQ5RKDUh.js} +1 -1
- package/dist/assets/{wait-container-DS9bARf7.js → wait-container-5RrJBT1J.js} +1 -1
- package/dist/assets/{withStyles-aTWZwqC1.js → withStyles-DD62sUmT.js} +1 -1
- package/dist/assets/{without-wallet-DuCaXACL.js → without-wallet-MfTWOoXr.js} +1 -1
- package/dist/assets/wrap-locale-Cm4YHFCT.js +1 -0
- package/dist/assets/{zh-CXbCDXZ8.js → zh-APHGpH_q.js} +1 -1
- package/dist/assets/{zh-tw-DaTNZcVC.js → zh-tw-BHBaATnw.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-DNdeNTPy.js +0 -1
- package/dist/assets/cloneDeep-cRbxO7zx.js +0 -1
- package/dist/assets/emotion-react.browser.esm-DdBaOgtK.js +0 -1
- package/dist/assets/getValidReactChildren-CTJ99Du6.js +0 -1
- package/dist/assets/index-DkKy0xHs.js +0 -1
- package/dist/assets/index-n8eW2eUk.js +0 -155
- package/dist/assets/is-path-prefix-equal-BdZ-5GQE.js +0 -1
- package/dist/assets/omit-B1nPtgSw.js +0 -1
- package/dist/assets/refType-CP2EoBf5.js +0 -1
- package/dist/assets/sdk-mtatgQHh.js +0 -1
- package/dist/assets/toUpper-DIsk8TJ0.js +0 -1
- package/dist/assets/wrap-locale-NF8Ck1Ih.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{br as St,r as x,bD as X,bj as U,A as V,F as L,j as e,P as d,T as Ct,aQ as Je,aR as Ze,ax as Nt,h as ne,aC as wt,k as G,N as v,m as J,ej as _e,Q as Be,kJ as et,bo as Ee,aZ as De,X as Ae,ep as we,b8 as Ge,b6 as Oe,C as tt,n as re,f as st,dB as nt,aU as Le,W as Tt,aw as at,kK as it,B as ke,kL as ot,g3 as Se,gk as rt,aj as fe,ff as Rt,ay as It,G as Ye,kM as Et,kN as Dt,D as lt,kO as At,kP as Ot,kQ as Lt,kR as kt,R as Pt,bx as ct,S as Ft,U as _t,V as Qe,M as Bt,kS as zt,a5 as Wt}from"./index-eLfUdELN.js";import{l as Mt,D as dt,g as qt}from"./index-po-3yvwP.js";import{a as ze,c as Kt}from"./actions-CLAOJycQ.js";import{B as Ut}from"./index-Cful1BDq.js";import{S as xe}from"./shorten-label-Bb8Ef88h.js";import{I as ut}from"./index-Hpi3ZYHE.js";import{T as $t}from"./index-DyR416TT.js";import{d as Ht}from"./Refresh-BAgv0sMT.js";import{D as Vt,g as Gt}from"./traffic-BYGx66ZI.js";import{u as Yt}from"./use-mobile-C5Ab5U18.js";import"./TableRow-Cc4t6Du4.js";import"./useThemeProps-Cg4_LVK8.js";import"./emotion-react.browser.esm-DdBaOgtK.js";import"./ViewColumn-DPG1LzJR.js";import"./Search-DVnChAqf.js";import"./Clear-tcJv2g6U.js";import"./Delete-vq0xV4m5.js";import"./index-LJwDNnEV.js";import"./MoreVert-CEjQfu0K.js";import"./TableSearch-BLF8cfXo.js";import"./useLocalStorage-BtSS0rMI.js";import"./get-safe-url-CtuFSgMF.js";import"./ButtonGroup-BrCuoPMx.js";import"./getValidReactChildren-CTJ99Du6.js";import"./url-evaluation-B5D3amtB.js";import"./permission-DMmPrvTU.js";import"./index.esm-CyA4TSTB.js";import"./collapse-CR_PBgme.js";import"./blocklet-Cfh-Xrih.js";import"./Switch-CVCvuqvb.js";import"./iframe-D7RblVkl.js";import"./ChevronLeft-C_FjrhWT.js";import"./ChevronRight-C3Djwe6Q.js";import"./index-D5QEcVRM.js";import"./base-chart-ekFash8m.js";import"./index-DiPveja-.js";import"./AdapterDayjs-WnXfrwG8.js";import"./CSSTransition-DyO7mCpS.js";import"./refType-CP2EoBf5.js";const pt=x.createContext({}),{Provider:Qt,Consumer:pn}=pt;function Xt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),Q=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:$,componentDids:C,getReceivers:Q,inService:o,teamDid:f};return e.jsx(Qt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Jt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Jt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Je()),ts=e;ft=Me.default=(0,es.default)((0,ts.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Je()),as=e;mt=qe.default=(0,ns.default)((0,as.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ve=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=J();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=J(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=J(),o=U().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if(U(f.startDate).isAfter(f.endDate)||!U(f.startDate).isValid()||!U(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var r;const{t:n}=J();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];He.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};He.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function He({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=J(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=J(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,$]=x.useState(null),[Q,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Q.page-1,rowsPerPage:Q.pageSize,count:Q.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,$(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}$({channel:c});try{const q=await le(c,i.receiver);await ye(1),$({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=X(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),H=[e.jsx(Ue,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ht,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:H,components:{TableFilterList:a=>e.jsx($e,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(He,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
|
|
1
|
+
import{br as St,r as x,bD as X,bj as U,A as V,F as L,j as e,P as d,T as Ct,aQ as Je,aR as Ze,ax as Nt,h as ne,aC as wt,k as G,N as v,m as J,ej as _e,Q as Be,kJ as et,bo as Ee,aZ as De,X as Ae,ep as we,b8 as Ge,b6 as Oe,C as tt,n as re,f as st,dB as nt,aU as Le,W as Tt,aw as at,kK as it,B as ke,kL as ot,g3 as Se,gk as rt,aj as fe,ff as Rt,ay as It,G as Ye,kM as Et,kN as Dt,D as lt,kO as At,kP as Ot,kQ as Lt,kR as kt,R as Pt,bx as ct,S as Ft,U as _t,V as Qe,M as Bt,kS as zt,a5 as Wt}from"./index-DMUuXkl-.js";import{l as Mt,D as dt,g as qt}from"./index-DtQKM-2h.js";import{a as ze,c as Kt}from"./actions-BTcKDonC.js";import{B as Ut}from"./index-CVGZhJsl.js";import{S as xe}from"./shorten-label-Dkc-R7Pf.js";import{I as ut}from"./index-IyfTJp8i.js";import{T as $t}from"./index-BJcQfMN9.js";import{d as Ht}from"./Refresh-CToXYqtZ.js";import{D as Vt,g as Gt}from"./traffic-Baaukshm.js";import{u as Yt}from"./use-mobile-hZxK6-uz.js";import"./TableRow-Cm_wAjgF.js";import"./useThemeProps-CWjJ-DWG.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./ViewColumn-B1nkIYjz.js";import"./Search-BWsSz0TZ.js";import"./Clear-h2RSseCa.js";import"./Delete-DSwbRjGm.js";import"./index-Z8_Ea0J-.js";import"./MoreVert-6SZ5-4Oc.js";import"./TableSearch-CbLOqG0x.js";import"./useLocalStorage-rbap7GBn.js";import"./get-safe-url-DdRvX178.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";import"./url-evaluation-D2uxzb5w.js";import"./permission-BrGI8BrM.js";import"./index.esm-CBxLPn81.js";import"./collapse-Ds1jlCkQ.js";import"./blocklet-DfNwfvjT.js";import"./Switch-B5mZ5gaW.js";import"./iframe-CoA6LAJN.js";import"./ChevronLeft-DlyVdCfr.js";import"./ChevronRight-DoFFwAxz.js";import"./index-DZdK0rK2.js";import"./base-chart-DMVk_dMy.js";import"./index-D0_0NC6P.js";import"./AdapterDayjs-BHlyhiPJ.js";import"./CSSTransition-D_ivveoB.js";import"./refType-BK4ojMi7.js";const pt=x.createContext({}),{Provider:Qt,Consumer:pn}=pt;function Xt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),Q=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:$,componentDids:C,getReceivers:Q,inService:o,teamDid:f};return e.jsx(Qt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Jt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Jt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Je()),ts=e;ft=Me.default=(0,es.default)((0,ts.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Je()),as=e;mt=qe.default=(0,ns.default)((0,as.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ve=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=J();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=J(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=J(),o=U().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if(U(f.startDate).isAfter(f.endDate)||!U(f.startDate).isValid()||!U(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var r;const{t:n}=J();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];He.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};He.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function He({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=J(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=J(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,$]=x.useState(null),[Q,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Q.page-1,rowsPerPage:Q.pageSize,count:Q.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,$(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}$({channel:c});try{const q=await le(c,i.receiver);await ye(1),$({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=X(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),H=[e.jsx(Ue,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ht,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:H,components:{TableFilterList:a=>e.jsx($e,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(He,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dq as E,j as n,N as a,aQ as _,aR as w,am as f,du as z,m as C}from"./index-
|
|
1
|
+
import{dq as E,j as n,N as a,aQ as _,aR as w,am as f,du as z,m as C}from"./index-DMUuXkl-.js";function o({icon:t,title:e="",description:i="",extra:v,...R}){return n.jsxs(I,{...R,children:[t,typeof e=="string"?n.jsx(a,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:e}):e,typeof i=="string"?n.jsx(a,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:i}):i,n.jsx(a,{mt:3,children:v})]})}const I=E("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as g,bq as v,u as y,j as r,Q as f,U as x,V as h}from"./index-
|
|
1
|
+
import{z as g,bq as v,u as y,j as r,Q as f,U as x,V as h}from"./index-DMUuXkl-.js";import{L as j,D as b}from"./download-DhL2-FKU.js";import{_ as L}from"./useLocalStorage-rbap7GBn.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{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(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(j,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(b,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as f,j as s,C as d,z as x,aB as v,cu as C,cv as u,N as j,bA as I,ag as P,F as S}from"./index-
|
|
1
|
+
import{u as f,j as s,C as d,z as x,aB as v,cu as C,cv as u,N as j,bA as I,ag as P,F as S}from"./index-DMUuXkl-.js";import{I as N}from"./invitation-OOnB1MnQ.js";import{g as R}from"./get-safe-url-CIlQ_jPL.js";import"./index-B3guyKGC.js";import"./index-CMclvolP.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./index-CJ2iy25m.js";import"./sdk-B0fHGxCR.js";import"./wrap-locale-Cm4YHFCT.js";function T(n){const{searchParams:i}=new URL(window.location.href),g=x(),{api:a,session:r}=v(),{info:l}=f(),c=i.get("redirect"),p=i.get("id"),e=C(async()=>{if(!p)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return t}),m=u(()=>{if(e.error)throw e.error;return e==null?void 0:e.data}),h=u(async(t,w=o=>o)=>{t&&(t.sessionToken&&P(w(t.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?g(o,{replace:!0}):window.location.href=R(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.loading?s.jsx(d,{}):s.jsx(j,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:s.jsx(N,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:t=>I(t,l),checkFn:a.get,onLoginSuccess:h,passportColor:"default",onLogin:r.login})})}function z(){return f().loading?s.jsx(d,{}):s.jsx(T,{})}export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bm as j,d8 as O}from"./index-
|
|
1
|
+
import{bm as j,d8 as O}from"./index-DMUuXkl-.js";function m(i,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const e in a)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(a,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var d={default:O,call:function(i,t,r){var a="";typeof t=="function"&&(r=t,t={});var e={data:t===void 0?null:t};if(typeof r=="function"){var s="dscb"+window.dscb++;window[s]=r,e._dscbstub=s}return e=JSON.stringify(e),window._dsbridge?a=_dsbridge.call(i,e):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(a=prompt("_dsbridge="+i,e)),JSON.parse(a||"{}").data},register:function(i,t,r){var a=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){d.call("_dsb.dsinit")},0)),typeof t=="object"?a._obs[i]=t:a[i]=t},registerAsyn:function(i,t){this.register(i,t,!0)},hasNativeMethod:function(i,t){return this.call("_dsb.hasNativeMethod",{name:i,type:t||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};(function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:d,close:function(){d.call("_dsb.closePage")},_handleMessageFromNative:function(r){var a=JSON.parse(r.data),e={id:r.callbackId,complete:!0},s=this._dsf[r.method],o=this._dsaf[r.method],p=function(u,_){e.data=u.apply(_,a),d.call("_dsb.returnValue",e)},v=function(u,_){a.push(function(w,y){e.data=w,e.complete=y!==!1,d.call("_dsb.returnValue",e)}),u.apply(_,a)};if(s)p(s,this._dsf);else if(o)v(o,this._dsaf);else{var l=r.method.split(".");if(l.length<2)return;var b=l.pop(),g=l.join("."),c=this._dsf._obs,f=c[g]||{},n=f[b];if(n&&typeof n=="function"){p(n,f);return}if(c=this._dsaf._obs,f=c[g]||{},n=f[b],n&&typeof n=="function"){v(n,f);return}}}};for(var t in i)window[t]=i[t];d.register("_hasJavascriptMethod",function(r,a){var e=r.split(".");if(e.length<2)return!!(_dsf[e]||_dsaf[e]);var r=e.pop(),s=e.join("."),o=_dsf._obs[s]||_dsaf._obs[s];return o&&!!o[r]})}})();var h=d;const J=j(h),S=m({__proto__:null,default:J},[h]);export{S as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c0 as ft,c1 as ht,b9 as A,bY as $t,cf as jt,bZ as f,r as d,c2 as vt,b$ as nt,c4 as N,j as b,c5 as mt,dh as oe,di as Ft,dj as Ht,dk as At,dl as le,dm as re,c3 as rt,am as ne,dn as bt,dp as se,dq as ae}from"./index-eLfUdELN.js";let Y;function Ot(){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 ie(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(Ot()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function ce(t){return ht("MuiTab",t)}const k=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),de=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ue=t=>{const{classes:e,textColor:l,fullWidth:a,wrapped:s,icon:n,label:u,selected:v,disabled:p}=t,x={root:["root",n&&u&&"labelIcon",`textColor${jt(l)}`,a&&"fullWidth",s&&"wrapped",v&&"selected",p&&"disabled"],iconWrapper:["iconWrapper"]};return mt(x,ce,e)},be=A($t,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${jt(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped,{[`& .${k.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},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,[`& > .${k.iconWrapper}`]:f({},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,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${k.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)})),St=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:n=!1,disableFocusRipple:u=!1,fullWidth:v,icon:p,iconPosition:x="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:L,selected:T,selectionFollowsFocus:g,textColor:O="inherit",value:E,wrapped:st=!1}=a,X=nt(a,de),V=f({},a,{disabled:n,disableFocusRipple:u,selected:T,icon:!!p,iconPosition:x,label:!!y,fullWidth:v,textColor:O,wrapped:st}),D=ue(V),$=p&&y&&d.isValidElement(p)?d.cloneElement(p,{className:N(D.iconWrapper,p.props.className)}):p,J=R=>{!T&&m&&m(R,E),w&&w(R)},_=R=>{g&&!T&&m&&m(R,E),L&&L(R)};return b.jsxs(be,f({focusRipple:!u,className:N(D.root,s),ref:l,role:"tab","aria-selected":T,disabled:n,onClick:J,onFocus:_,ownerState:V,tabIndex:T?0:-1},X,{children:[x==="top"||x==="start"?b.jsxs(d.Fragment,{children:[$,y]}):b.jsxs(d.Fragment,{children:[y,$]}),B]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function fe(t,e,l,a={},s=()=>{}){const{ease:n=pe,duration:u=300}=a;let v=null;const p=e[t];let x=!1;const B=()=>{x=!0},y=m=>{if(x){s(new Error("Animation cancelled"));return}v===null&&(v=m);const w=Math.min(1,(m-v)/u);if(e[t]=n(w)*(l-p)+p,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return p===l?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const he=["onChange"],ve={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,l=nt(t,he),a=d.useRef(),s=d.useRef(null),n=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return oe(()=>{const u=Ft(()=>{const p=a.current;n(),p!==a.current&&e(a.current)}),v=Ht(s.current);return v.addEventListener("resize",u),()=>{u.clear(),v.removeEventListener("resize",u)}},[e]),d.useEffect(()=>{n(),e(a.current)},[e]),b.jsx("div",f({style:ve},l,{ref:s}))}function Se(t){return ht("MuiTabScrollButton",t)}const xe=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ge=["className","slots","slotProps","direction","orientation","disabled"],ye=t=>{const{classes:e,orientation:l,disabled:a}=t;return mt({root:["root",l,a&&"disabled"]},Se,e)},Ce=A($t,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${xe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Be=d.forwardRef(function(e,l){var a,s;const n=vt({props:e,name:"MuiTabScrollButton"}),{className:u,slots:v={},slotProps:p={},direction:x}=n,B=nt(n,ge),y=At(),m=f({isRtl:y},n),w=ye(m),L=(a=v.StartScrollButtonIcon)!=null?a:le,T=(s=v.EndScrollButtonIcon)!=null?s:re,g=rt({elementType:L,externalSlotProps:p.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),O=rt({elementType:T,externalSlotProps:p.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return b.jsx(Ce,f({component:"div",className:N(w.root,u),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:x==="left"?b.jsx(L,f({},g)):b.jsx(T,f({},O))}))});function we(t){return ht("MuiTabs",t)}const pt=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Pt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,kt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,lt=(t,e,l)=>{let a=!1,s=l(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const n=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||n)s=l(t,s);else{s.focus();return}}},Me=t=>{const{vertical:e,fixed:l,hideScrollbar:a,scrollableX:s,scrollableY:n,centered:u,scrollButtonsHideMobile:v,classes:p}=t;return mt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",a&&"hideScrollbar",s&&"scrollableX",n&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",u&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",v&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},we,p)},Ie=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${pt.scrollButtons}`]:e.scrollButtons},{[`& .${pt.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${pt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Ee=A("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})=>f({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"})),Re=A("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})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({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})),We=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Nt={},xt=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTabs"}),s=ne(),n=At(),{"aria-label":u,"aria-labelledby":v,action:p,centered:x=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:L="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:O=Be,scrollButtons:E="auto",selectionFollowsFocus:st,slots:X={},slotProps:V={},TabIndicatorProps:D={},TabScrollButtonProps:$={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:at=!1}=a,Xt=nt(a,Te),M=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",tt=C?"bottom":"right",it=C?"clientHeight":"clientWidth",q=C?"height":"width",j=f({},a,{component:m,allowScrollButtonsMobile:w,indicatorColor:L,orientation:g,vertical:C,scrollButtons:E,textColor:J,variant:R,visibleScrollbar:at,fixed:!M,hideScrollbar:M&&!at,scrollableX:M&&!C,scrollableY:M&&C,centered:x&&!M,scrollButtonsHideMobile:!w}),W=Me(j),Dt=rt({elementType:X.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:j}),_t=rt({elementType:X.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:j}),[gt,Yt]=d.useState(!1),[F,yt]=d.useState(Nt),[Ct,Ut]=d.useState(!1),[Bt,Vt]=d.useState(!1),[wt,Kt]=d.useState(!1),[Tt,qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Mt=new Map,z=d.useRef(null),H=d.useRef(null),It=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ie(o,n?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&_!==!1){const i=H.current.children;if(i.length>0){const h=i[Mt.get(_)];c=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},G=bt(()=>{const{tabsMeta:o,tabMeta:r}=It();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=n?"right":"left",r&&o){const S=n?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(n?-1:1)*(r[i]-o[i]+S)}const h={[i]:c,[q]:r?r[q]:0};if(isNaN(F[i])||isNaN(F[q]))yt(h);else{const S=Math.abs(F[i]-h[i]),I=Math.abs(F[q]-h[q]);(S>=1||I>=1)&&yt(h)}}),ct=(o,{animation:r=!0}={})=>{r?fe(K,z.current,o,{duration:s.transitions.duration.standard}):z.current[K]=o},Et=o=>{let r=z.current[K];C?r+=o:(r+=o*(n?-1:1),r*=n&&Ot()==="reverse"?-1:1),ct(r)},Rt=()=>{const o=z.current[it];let r=0;const c=Array.from(H.current.children);for(let i=0;i<c.length;i+=1){const h=c[i];if(r+h[it]>o){i===0&&(r=o);break}r+=h[it]}return r},Gt=()=>{Et(-1*Rt())},Zt=()=>{Et(Rt())},Jt=d.useCallback(o=>{qt({overflow:null,scrollbarWidth:o})},[]),Qt=()=>{const o={};o.scrollbarSizeListener=M?b.jsx(We,{onChange:Jt,className:N(W.scrollableX,W.hideScrollbar)}):null;const c=M&&(E==="auto"&&(Ct||Bt)||E===!0);return o.scrollButtonStart=c?b.jsx(O,f({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Dt},orientation:g,direction:n?"right":"left",onClick:Gt,disabled:!Ct},$,{className:N(W.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?b.jsx(O,f({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:n?"left":"right",onClick:Zt,disabled:!Bt},$,{className:N(W.scrollButtons,$.className)})):null,o},zt=bt(o=>{const{tabsMeta:r,tabMeta:c}=It();if(!(!c||!r)){if(c[Q]<r[Q]){const i=r[K]+(c[Q]-r[Q]);ct(i,{animation:o})}else if(c[tt]>r[tt]){const i=r[K]+(c[tt]-r[tt]);ct(i,{animation:o})}}}),et=bt(()=>{M&&E!==!1&&Kt(!wt)});d.useEffect(()=>{const o=Ft(()=>{z.current&&G()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var P;(P=r)==null||P.unobserve(Z)}),I.addedNodes.forEach(Z=>{var P;(P=r)==null||P.observe(Z)})}),o(),et()},i=Ht(z.current);i.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(H.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(h=new MutationObserver(c),h.observe(H.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=h)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[G,et]),d.useEffect(()=>{const o=Array.from(H.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&E!==!1){const c=o[0],i=o[r-1],h={root:z.current,threshold:.99},S=ut=>{Ut(!ut[0].isIntersecting)},I=new IntersectionObserver(S,h);I.observe(c);const Z=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(Z,h);return P.observe(i),()=>{I.disconnect(),P.disconnect()}}},[M,E,wt,B==null?void 0:B.length]),d.useEffect(()=>{Yt(!0)},[]),d.useEffect(()=>{G()}),d.useEffect(()=>{zt(Nt!==F)},[zt,F]),d.useImperativeHandle(p,()=>({updateIndicator:G,updateScrollButtons:et}),[G,et]);const Wt=b.jsx(ze,f({},D,{className:N(W.indicator,D.className),ownerState:j,style:f({},F,D.style)}));let ot=0;const te=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?ot:o.props.value;Mt.set(r,ot);const c=r===_;return ot+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:c&&!gt&&Wt,selected:c,selectionFollowsFocus:st,onChange:T,textColor:J,value:r},ot===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ee=o=>{const r=H.current,c=se(r).activeElement;if(c.getAttribute("role")!=="tab")return;let h=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&n&&(h="ArrowRight",S="ArrowLeft"),o.key){case h:o.preventDefault(),lt(r,c,kt);break;case S:o.preventDefault(),lt(r,c,Pt);break;case"Home":o.preventDefault(),lt(r,null,Pt);break;case"End":o.preventDefault(),lt(r,null,kt);break}},dt=Qt();return b.jsxs(Ie,f({className:N(W.root,y),ownerState:j,ref:l,as:m},Xt,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,b.jsxs(Ee,{className:W.scroller,ownerState:j,style:{overflow:Tt.overflow,[C?`margin${n?"Left":"Right"}`:"marginBottom"]:at?void 0:-Tt.scrollbarWidth},ref:z,children:[b.jsx(Re,{"aria-label":u,"aria-labelledby":v,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:j,onKeyDown:ee,ref:H,role:"tablist",children:te}),gt&&Wt]}),dt.scrollButtonEnd]}))}),Lt="index",U={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Pe=ae(xt)(({theme:t})=>({[`& .${U.tabs}`]:{},[`& .${U.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function ke({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...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:"grey.100",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:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function Ne({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":s.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".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:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function $e({tabs:t,current:e,onChange:l,variant:a,iconPosition:s,...n}){return a==="card"?b.jsx(ke,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):a==="line"?b.jsx(Ne,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):b.jsx(Pe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(u,v)=>l(v),indicatorColor:"primary",...n,className:[U.tabs,n.className||""].join(" "),children:t.map(u=>b.jsx(St,{className:U.tab,value:u.value,label:u.label,icon:u.icon,iconPosition:s},u.value))})}export{$e as T,xt as a,St as b,Ot as d,ie as g,pt as t};
|
|
1
|
+
import{c0 as ft,c1 as ht,b9 as A,bY as $t,cf as jt,bZ as f,r as d,c2 as vt,b$ as nt,c4 as N,j as b,c5 as mt,dh as oe,di as Ft,dj as Ht,dk as At,dl as le,dm as re,c3 as rt,am as ne,dn as bt,dp as se,dq as ae}from"./index-DMUuXkl-.js";let Y;function Ot(){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 ie(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(Ot()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function ce(t){return ht("MuiTab",t)}const k=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),de=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ue=t=>{const{classes:e,textColor:l,fullWidth:a,wrapped:s,icon:n,label:u,selected:v,disabled:p}=t,x={root:["root",n&&u&&"labelIcon",`textColor${jt(l)}`,a&&"fullWidth",s&&"wrapped",v&&"selected",p&&"disabled"],iconWrapper:["iconWrapper"]};return mt(x,ce,e)},be=A($t,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${jt(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped,{[`& .${k.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},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,[`& > .${k.iconWrapper}`]:f({},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,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${k.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)})),St=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:n=!1,disableFocusRipple:u=!1,fullWidth:v,icon:p,iconPosition:x="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:L,selected:T,selectionFollowsFocus:g,textColor:O="inherit",value:E,wrapped:st=!1}=a,X=nt(a,de),V=f({},a,{disabled:n,disableFocusRipple:u,selected:T,icon:!!p,iconPosition:x,label:!!y,fullWidth:v,textColor:O,wrapped:st}),D=ue(V),$=p&&y&&d.isValidElement(p)?d.cloneElement(p,{className:N(D.iconWrapper,p.props.className)}):p,J=R=>{!T&&m&&m(R,E),w&&w(R)},_=R=>{g&&!T&&m&&m(R,E),L&&L(R)};return b.jsxs(be,f({focusRipple:!u,className:N(D.root,s),ref:l,role:"tab","aria-selected":T,disabled:n,onClick:J,onFocus:_,ownerState:V,tabIndex:T?0:-1},X,{children:[x==="top"||x==="start"?b.jsxs(d.Fragment,{children:[$,y]}):b.jsxs(d.Fragment,{children:[y,$]}),B]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function fe(t,e,l,a={},s=()=>{}){const{ease:n=pe,duration:u=300}=a;let v=null;const p=e[t];let x=!1;const B=()=>{x=!0},y=m=>{if(x){s(new Error("Animation cancelled"));return}v===null&&(v=m);const w=Math.min(1,(m-v)/u);if(e[t]=n(w)*(l-p)+p,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return p===l?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const he=["onChange"],ve={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,l=nt(t,he),a=d.useRef(),s=d.useRef(null),n=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return oe(()=>{const u=Ft(()=>{const p=a.current;n(),p!==a.current&&e(a.current)}),v=Ht(s.current);return v.addEventListener("resize",u),()=>{u.clear(),v.removeEventListener("resize",u)}},[e]),d.useEffect(()=>{n(),e(a.current)},[e]),b.jsx("div",f({style:ve},l,{ref:s}))}function Se(t){return ht("MuiTabScrollButton",t)}const xe=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ge=["className","slots","slotProps","direction","orientation","disabled"],ye=t=>{const{classes:e,orientation:l,disabled:a}=t;return mt({root:["root",l,a&&"disabled"]},Se,e)},Ce=A($t,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${xe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Be=d.forwardRef(function(e,l){var a,s;const n=vt({props:e,name:"MuiTabScrollButton"}),{className:u,slots:v={},slotProps:p={},direction:x}=n,B=nt(n,ge),y=At(),m=f({isRtl:y},n),w=ye(m),L=(a=v.StartScrollButtonIcon)!=null?a:le,T=(s=v.EndScrollButtonIcon)!=null?s:re,g=rt({elementType:L,externalSlotProps:p.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),O=rt({elementType:T,externalSlotProps:p.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return b.jsx(Ce,f({component:"div",className:N(w.root,u),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:x==="left"?b.jsx(L,f({},g)):b.jsx(T,f({},O))}))});function we(t){return ht("MuiTabs",t)}const pt=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Pt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,kt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,lt=(t,e,l)=>{let a=!1,s=l(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const n=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||n)s=l(t,s);else{s.focus();return}}},Me=t=>{const{vertical:e,fixed:l,hideScrollbar:a,scrollableX:s,scrollableY:n,centered:u,scrollButtonsHideMobile:v,classes:p}=t;return mt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",a&&"hideScrollbar",s&&"scrollableX",n&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",u&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",v&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},we,p)},Ie=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${pt.scrollButtons}`]:e.scrollButtons},{[`& .${pt.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${pt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Ee=A("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})=>f({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"})),Re=A("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})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({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})),We=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Nt={},xt=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTabs"}),s=ne(),n=At(),{"aria-label":u,"aria-labelledby":v,action:p,centered:x=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:L="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:O=Be,scrollButtons:E="auto",selectionFollowsFocus:st,slots:X={},slotProps:V={},TabIndicatorProps:D={},TabScrollButtonProps:$={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:at=!1}=a,Xt=nt(a,Te),M=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",tt=C?"bottom":"right",it=C?"clientHeight":"clientWidth",q=C?"height":"width",j=f({},a,{component:m,allowScrollButtonsMobile:w,indicatorColor:L,orientation:g,vertical:C,scrollButtons:E,textColor:J,variant:R,visibleScrollbar:at,fixed:!M,hideScrollbar:M&&!at,scrollableX:M&&!C,scrollableY:M&&C,centered:x&&!M,scrollButtonsHideMobile:!w}),W=Me(j),Dt=rt({elementType:X.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:j}),_t=rt({elementType:X.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:j}),[gt,Yt]=d.useState(!1),[F,yt]=d.useState(Nt),[Ct,Ut]=d.useState(!1),[Bt,Vt]=d.useState(!1),[wt,Kt]=d.useState(!1),[Tt,qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Mt=new Map,z=d.useRef(null),H=d.useRef(null),It=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ie(o,n?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&_!==!1){const i=H.current.children;if(i.length>0){const h=i[Mt.get(_)];c=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},G=bt(()=>{const{tabsMeta:o,tabMeta:r}=It();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=n?"right":"left",r&&o){const S=n?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(n?-1:1)*(r[i]-o[i]+S)}const h={[i]:c,[q]:r?r[q]:0};if(isNaN(F[i])||isNaN(F[q]))yt(h);else{const S=Math.abs(F[i]-h[i]),I=Math.abs(F[q]-h[q]);(S>=1||I>=1)&&yt(h)}}),ct=(o,{animation:r=!0}={})=>{r?fe(K,z.current,o,{duration:s.transitions.duration.standard}):z.current[K]=o},Et=o=>{let r=z.current[K];C?r+=o:(r+=o*(n?-1:1),r*=n&&Ot()==="reverse"?-1:1),ct(r)},Rt=()=>{const o=z.current[it];let r=0;const c=Array.from(H.current.children);for(let i=0;i<c.length;i+=1){const h=c[i];if(r+h[it]>o){i===0&&(r=o);break}r+=h[it]}return r},Gt=()=>{Et(-1*Rt())},Zt=()=>{Et(Rt())},Jt=d.useCallback(o=>{qt({overflow:null,scrollbarWidth:o})},[]),Qt=()=>{const o={};o.scrollbarSizeListener=M?b.jsx(We,{onChange:Jt,className:N(W.scrollableX,W.hideScrollbar)}):null;const c=M&&(E==="auto"&&(Ct||Bt)||E===!0);return o.scrollButtonStart=c?b.jsx(O,f({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Dt},orientation:g,direction:n?"right":"left",onClick:Gt,disabled:!Ct},$,{className:N(W.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?b.jsx(O,f({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:n?"left":"right",onClick:Zt,disabled:!Bt},$,{className:N(W.scrollButtons,$.className)})):null,o},zt=bt(o=>{const{tabsMeta:r,tabMeta:c}=It();if(!(!c||!r)){if(c[Q]<r[Q]){const i=r[K]+(c[Q]-r[Q]);ct(i,{animation:o})}else if(c[tt]>r[tt]){const i=r[K]+(c[tt]-r[tt]);ct(i,{animation:o})}}}),et=bt(()=>{M&&E!==!1&&Kt(!wt)});d.useEffect(()=>{const o=Ft(()=>{z.current&&G()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var P;(P=r)==null||P.unobserve(Z)}),I.addedNodes.forEach(Z=>{var P;(P=r)==null||P.observe(Z)})}),o(),et()},i=Ht(z.current);i.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(H.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(h=new MutationObserver(c),h.observe(H.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=h)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[G,et]),d.useEffect(()=>{const o=Array.from(H.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&E!==!1){const c=o[0],i=o[r-1],h={root:z.current,threshold:.99},S=ut=>{Ut(!ut[0].isIntersecting)},I=new IntersectionObserver(S,h);I.observe(c);const Z=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(Z,h);return P.observe(i),()=>{I.disconnect(),P.disconnect()}}},[M,E,wt,B==null?void 0:B.length]),d.useEffect(()=>{Yt(!0)},[]),d.useEffect(()=>{G()}),d.useEffect(()=>{zt(Nt!==F)},[zt,F]),d.useImperativeHandle(p,()=>({updateIndicator:G,updateScrollButtons:et}),[G,et]);const Wt=b.jsx(ze,f({},D,{className:N(W.indicator,D.className),ownerState:j,style:f({},F,D.style)}));let ot=0;const te=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?ot:o.props.value;Mt.set(r,ot);const c=r===_;return ot+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:c&&!gt&&Wt,selected:c,selectionFollowsFocus:st,onChange:T,textColor:J,value:r},ot===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ee=o=>{const r=H.current,c=se(r).activeElement;if(c.getAttribute("role")!=="tab")return;let h=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&n&&(h="ArrowRight",S="ArrowLeft"),o.key){case h:o.preventDefault(),lt(r,c,kt);break;case S:o.preventDefault(),lt(r,c,Pt);break;case"Home":o.preventDefault(),lt(r,null,Pt);break;case"End":o.preventDefault(),lt(r,null,kt);break}},dt=Qt();return b.jsxs(Ie,f({className:N(W.root,y),ownerState:j,ref:l,as:m},Xt,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,b.jsxs(Ee,{className:W.scroller,ownerState:j,style:{overflow:Tt.overflow,[C?`margin${n?"Left":"Right"}`:"marginBottom"]:at?void 0:-Tt.scrollbarWidth},ref:z,children:[b.jsx(Re,{"aria-label":u,"aria-labelledby":v,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:j,onKeyDown:ee,ref:H,role:"tablist",children:te}),gt&&Wt]}),dt.scrollButtonEnd]}))}),Lt="index",U={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Pe=ae(xt)(({theme:t})=>({[`& .${U.tabs}`]:{},[`& .${U.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function ke({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...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:"grey.100",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:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function Ne({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":s.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".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:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function $e({tabs:t,current:e,onChange:l,variant:a,iconPosition:s,...n}){return a==="card"?b.jsx(ke,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):a==="line"?b.jsx(Ne,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):b.jsx(Pe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(u,v)=>l(v),indicatorColor:"primary",...n,className:[U.tabs,n.className||""].join(" "),children:t.map(u=>b.jsx(St,{className:U.tab,value:u.value,label:u.label,icon:u.icon,iconPosition:s},u.value))})}export{$e as T,xt as a,St as b,Ot as d,ie as g,pt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as R,j as e,R as B,P as y,r as C,Q as Z,S as J,U as Y,V as ee,N as h,F as E,br as I,bs as Ke,a_ as te,t as H,B as O,C as Ae,af as xe,e as we,x as L,D as fe,aZ as De,X as Re,n as $,A as Ie,ax as V,l as Pe,bt as U,W as Be,bu as he,bv as ge,bw as ye,bx as $e,J as _e,k as P,by as Le,aC as W,a5 as me,aW as ue,bz as Ne,Y as ze,Z as Ee,z as We,u as qe,bq as Ue,d as Me,bA as Fe}from"./index-
|
|
1
|
+
import{m as R,j as e,R as B,P as y,r as C,Q as Z,S as J,U as Y,V as ee,N as h,F as E,br as I,bs as Ke,a_ as te,t as H,B as O,C as Ae,af as xe,e as we,x as L,D as fe,aZ as De,X as Re,n as $,A as Ie,ax as V,l as Pe,bt as U,W as Be,bu as he,bv as ge,bw as ye,bx as $e,J as _e,k as P,by as Le,aC as W,a5 as me,aW as ue,bz as Ne,Y as ze,Z as Ee,z as We,u as qe,bq as Ue,d as Me,bA as Fe}from"./index-DMUuXkl-.js";import{T as He}from"./index-BJcQfMN9.js";import Oe from"./audit-logs-vOsLrHtf.js";import{T as be,M as Ve}from"./index-CIbq35qJ.js";import{r as je,P as Xe}from"./index-C_tSdokL.js";import{u as N,T as Ge}from"./team-DXOr-ygw.js";import{g as Qe,D as Ze}from"./index-DtQKM-2h.js";import{d as Je}from"./Delete-DSwbRjGm.js";import{d as Ye}from"./Edit-B7OHuMt8.js";import{E as et}from"./index-Z8_Ea0J-.js";import{d as tt}from"./Add-CKZvwomV.js";import{C as X}from"./index-C5kA3CHn.js";import{C as G}from"./click-to-copy-Bx0WCh-p.js";import{f as st}from"./index-BojVbZw0.js";import{D as nt}from"./delete-confirm-BbG1Njy7.js";import{P as ot}from"./permission-BrGI8BrM.js";import{u as it}from"./blocklet-DfNwfvjT.js";import{A as at}from"./actions-Bvcwob0t.js";import{u as Ce}from"./use-mobile-hZxK6-uz.js";import{u as rt}from"./useAsyncRetry-foiApHTO.js";import"./TableSearch-CbLOqG0x.js";import"./Search-BWsSz0TZ.js";import"./Clear-h2RSseCa.js";import"./useLocalStorage-rbap7GBn.js";import"./index-qDvx2LXA.js";import"./shorten-label-Dkc-R7Pf.js";import"./ViewList-COZmXWce.js";import"./resource-dialog-CroWtX8l.js";import"./index-B3guyKGC.js";import"./use-mobile-BknAfbf7.js";import"./ListItemButton-D3dXwiba.js";import"./index-CMclvolP.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./index-BVFznPvg.js";import"./Switch-B5mZ5gaW.js";import"./url-evaluation-D2uxzb5w.js";import"./index-Myd8Qh5l.js";import"./OpenInNew-DJezkARI.js";import"./index-BJHGOv7L.js";import"./HelpOutline-BFcbReM4.js";import"./index-CKzGu37_.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";import"./AdapterDayjs-BHlyhiPJ.js";import"./useThemeProps-CWjJ-DWG.js";import"./CSSTransition-D_ivveoB.js";import"./refType-BK4ojMi7.js";import"./index-IyfTJp8i.js";import"./Verified-FiZjuwhy.js";import"./DeleteOutline-BbkjMdAN.js";import"./ErrorOutline-Dj5RjmYU.js";import"./sdk-B0fHGxCR.js";import"./LockIcon-tb1yw67V.js";import"./cloneDeep-CvMji3zz.js";import"./chain-DaWBsVEZ.js";import"./list-header-I7ATqJra.js";import"./ToggleButtonGroup-BsAN6BnK.js";import"./TableRow-Cm_wAjgF.js";import"./ViewColumn-B1nkIYjz.js";import"./MoreVert-6SZ5-4Oc.js";import"./MoreHoriz-BREqCusY.js";import"./useAsync-CbClB-AN.js";function se({value:t}){const{t:s,locale:l}=R(),a=new Date;return new Date(t)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:t,locale:l}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{value:t,locale:l,type:"all"})}se.propTypes={value:y.string.isRequired};function ne({value:t,onChange:s,...l}){const{t:a}=R(),r=C.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(Z,{style:{width:"100%"},variant:"outlined",...l,children:[e.jsx(J,{children:a("setting.accessKey.authType")}),e.jsx(Y,{value:t,onChange:s,fullWidth:!0,label:a("setting.accessKey.authType"),children:r.map(i=>e.jsx(ee,{value:i.value,children:e.jsxs(h,{children:[e.jsx("span",{children:i.title}),e.jsx(h,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:i.description})]})},i.value))})]})}ne.propTypes={value:y.string.isRequired,onChange:y.func.isRequired};const q=()=>{const t=E.RBAC_CONFIG.roles.filter(r=>r.passport),{inService:s}=I(),{roles:l}=N(),a=[...t,...s?l:[]];return Ke(a,"name").filter(r=>r.name!==E.ROLES.OWNER)};function oe(t){const{remark:s,onCreate:l}=t,{api:a}=I(),{teamDid:r}=N(),{t:i}=R(),[b,j]=C.useState(!1),[x,k]=C.useState(null),d=q(),S=()=>{j(!1),k(null)},v=async n=>{const{remark:p,passport:f,authType:o}=n;j(!0);const m=await a.createAccessKey({input:{teamDid:r,remark:p.trim(),passport:f,expireAt:n.expireAt?new Date(n.expireAt).getTime():null,authType:o}}),{data:K}=m;l(K),k(null),j(!1)},g={title:`${i("common.create")} ${i("accessKey")}`,description:(n,p,f)=>e.jsxs(te,{gap:3,children:[e.jsx(H,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:n.remark,onChange:o=>{p({...n,remark:o.target.value,__disableConfirm:!n.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))}}),e.jsxs(Z,{style:{width:"100%"},variant:"outlined",children:[e.jsx(J,{children:i("setting.accessKey.passport")}),e.jsx(Y,{"data-cy":"create-access-key-select-passport",value:n.passport,onChange:o=>{const m=o.target.value;f(null),p({...n,passport:m,__disableConfirm:!n.remark||!m})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:b,children:d.map(o=>e.jsx(ee,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(h,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(h,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(ne,{value:n.authType,onChange:o=>{p({...n,authType:o.target.value})}}),e.jsx(be,{placeholder:i("setting.accessKey.expireTime"),value:n.expireAt,onChange:o=>{p({...n,expireAt:o,__disableConfirm:!n.passport||!n.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:v,onCancel:S};return e.jsxs(e.Fragment,{children:[e.jsxs(O,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>k(g),className:"rule-action",children:[b?e.jsx(Ae,{size:16}):e.jsx(tt,{style:{fontSize:16}}),i("common.create")]}),x&&e.jsx(xe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}oe.propTypes={remark:y.string,onCreate:y.func};oe.defaultProps={onCreate:()=>{},remark:""};function ie(t){var f,o;const{onConfirm:s,accessKeyId:l,accessKeySecret:a,hideSecret:r}=t,{t:i}=C.useContext(we),[b,j]=C.useState(!1),[x,k]=C.useState(()=>r),d=I(),S=()=>{k(!x)},v=m=>{j(m.target.checked)},g=L(window.location.origin,(o=(f=d==null?void 0:d.info)==null?void 0:f.routing)==null?void 0:o.adminPath),n=C.useMemo(()=>{var m,K,u,D;return r?`const Client = require('@abtnode/client');
|
|
2
2
|
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
3
|
const { joinURL } = require('ufo');
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dq as s,P as c,j as t,aZ as e}from"./index-
|
|
1
|
+
import{dq as s,P as c,j as t,aZ as e}from"./index-DMUuXkl-.js";import{S as l}from"./Switch-B5mZ5gaW.js";const r=s(i=>t.jsx(l,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...i}))(({theme:i})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:i.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:i.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:i.palette.mode==="light"?i.palette.grey[100]:i.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:i.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:i.palette.grey[200],opacity:1,transition:i.transitions.create(["background-color"],{duration:500})}}));function a({labelProps:i,...o}){return i?t.jsx(e,{control:t.jsx(r,{...o}),...i}):t.jsx(r,{...o})}a.propTypes={labelProps:c.object};a.defaultProps={labelProps:null};export{a as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bm as getDefaultExportFromCjs,n as newStyled,H as useMediaQuery,dx as Skeleton,cS as Img,a1 as default_1$1,aC as Tooltip,ep as Button,k as Typography,C as CircularProgress,b9 as styled,am as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fH as ThemeProvider$1,fI as HeaderAddons,fJ as Hidden,$ as Center,aQ as requireCreateSvgIcon,aR as interopRequireDefaultExports,fK as Check,d8 as commonjsGlobal,cG as Buffer,bi as React,fj as noop,bC as __vitePreload,dq as styled$1}from"./index-
|
|
1
|
+
import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bm as getDefaultExportFromCjs,n as newStyled,H as useMediaQuery,dx as Skeleton,cS as Img,a1 as default_1$1,aC as Tooltip,ep as Button,k as Typography,C as CircularProgress,b9 as styled,am as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fH as ThemeProvider$1,fI as HeaderAddons,fJ as Hidden,$ as Center,aQ as requireCreateSvgIcon,aR as interopRequireDefaultExports,fK as Check,d8 as commonjsGlobal,cG as Buffer,bi as React,fj as noop,bC as __vitePreload,dq as styled$1}from"./index-DMUuXkl-.js";import{j as joinUrl}from"./url-join-DU6UdRf1.js";import{C as CloseIcon}from"./Close-L6Q6a3RE.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const S=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),P=S.filter(T=>!T.hasChild),C=T=>{let O;const D=S.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=S.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(P.findIndex(D=>D.key===o));u(P[O].key)}else u(P[T].key)}const I=P.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:P.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:S}){const P=useMediaQuery(j=>j.breakpoints.down("md")),C=P?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[P?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[S&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:P}),!S&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[P&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!P&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:P,blockletMeta:i,blockletSize:C,loading:S})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const S=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:S,children:S})}const MobileTitleStyle=newStyled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c1 as Ge,c0 as et,b9 as te,cf as ee,r as y,c2 as tt,b$ as ot,bZ as Oe,j as e,c4 as st,c5 as nt,O as Q,br as M,cu as rt,A as w,Z as X,bj as T,gh as Me,aV as Ue,b as _,lf as at,m as E,P as g,hH as it,w as ct,aA as Ne,x as ge,ao as lt,n as dt,k as C,e as ut,C as z,i as pt,am as mt,lg as J,h6 as G,lh as ft,N as j,a_ as W,aC as ye,F as R,g as ht,T as V,du as gt,aQ as je,aR as be,V as q,aJ as Y,ab as H,a6 as xt,ep as St,b4 as yt,B as me,v as jt,G as Le,$ as We,bD as xe,E as bt}from"./index-eLfUdELN.js";import{T as Ct}from"./index-DyR416TT.js";import{u as A}from"./blocklet-Cfh-Xrih.js";import{u as kt}from"./use-mobile-C5Ab5U18.js";import{b as Dt,u as wt,D as Bt,c as fe,a as Tt}from"./index-DfJ_-35A.js";import"./index-DWdh-5Vi.js";import"./index-BojVbZw0.js";import"./api-DNdeNTPy.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-Bmy3u_bk.js";import{d as At,a as Ot,g as Lt,i as Pt,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-BAC7141S.js";import{I as Nt}from"./index-Hpi3ZYHE.js";import{R as Wt}from"./index-DiPveja-.js";import{d as $t}from"./HelpOutline-D7cgnTBl.js";import{D as Ft}from"./index-po-3yvwP.js";import{x as Kt}from"./index-BJHGOv7L.js";import{d as qt}from"./MoreHoriz-DAtcBD-9.js";import{f as Yt}from"./actions-CLAOJycQ.js";import{d as Ht}from"./DeleteOutline-uICQncS-.js";import{g as Pe}from"./get-safe-url-CtuFSgMF.js";import{S as Vt}from"./switch-control-BcUld3eb.js";import{L as _e}from"./list-header-BwiAnrHh.js";import"./OpenInNew-2n62FKFZ.js";import"./ButtonGroup-BrCuoPMx.js";import"./getValidReactChildren-CTJ99Du6.js";import"./TableRow-Cc4t6Du4.js";import"./useThemeProps-Cg4_LVK8.js";import"./emotion-react.browser.esm-DdBaOgtK.js";import"./ViewColumn-DPG1LzJR.js";import"./Search-DVnChAqf.js";import"./Clear-tcJv2g6U.js";import"./Delete-vq0xV4m5.js";import"./index-LJwDNnEV.js";import"./MoreVert-CEjQfu0K.js";import"./TableSearch-BLF8cfXo.js";import"./useLocalStorage-BtSS0rMI.js";import"./url-evaluation-B5D3amtB.js";import"./permission-DMmPrvTU.js";import"./index-Bt5kVv-q.js";import"./Switch-CVCvuqvb.js";function Qt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Qt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Oe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Oe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!Q(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),w.error(X(r)))}})}function Fe({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),w.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Fe(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),w.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Ke=y.createContext({}),{Provider:so,Consumer:is}=Ke;function ke({children:t}){var F;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Ot(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Fe({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(F=o==null?void 0:o.settings)==null?void 0:F.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(B=>{const P=[...B];return P.push({...m,loading:!0}),P}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(B){throw console.error(B),f(P=>[...P].filter(pe=>pe.did!==m.did)),B}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const B=[...N];return B.splice(B.indexOf(m),1),B}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function O(){return y.useContext(Ke)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=O(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Pt(b)){w.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){w.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),w.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function qe({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=O(),o=wt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
|
|
1
|
+
import{c1 as Ge,c0 as et,b9 as te,cf as ee,r as y,c2 as tt,b$ as ot,bZ as Oe,j as e,c4 as st,c5 as nt,O as Q,br as M,cu as rt,A as w,Z as X,bj as T,gh as Me,aV as Ue,b as _,lf as at,m as E,P as g,hH as it,w as ct,aA as Ne,x as ge,ao as lt,n as dt,k as C,e as ut,C as z,i as pt,am as mt,lg as J,h6 as G,lh as ft,N as j,a_ as W,aC as ye,F as R,g as ht,T as V,du as gt,aQ as je,aR as be,V as q,aJ as Y,ab as H,a6 as xt,ep as St,b4 as yt,B as me,v as jt,G as Le,$ as We,bD as xe,E as bt}from"./index-DMUuXkl-.js";import{T as Ct}from"./index-BJcQfMN9.js";import{u as A}from"./blocklet-DfNwfvjT.js";import{u as kt}from"./use-mobile-hZxK6-uz.js";import{b as Dt,u as wt,D as Bt,c as fe,a as Tt}from"./index-Myd8Qh5l.js";import"./index-CKzGu37_.js";import"./index-BojVbZw0.js";import"./api-BJ-yIghe.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-8NfHLbgD.js";import{d as At,a as Ot,g as Lt,i as Pt,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-B_XtvGWM.js";import{I as Nt}from"./index-IyfTJp8i.js";import{R as Wt}from"./index-D0_0NC6P.js";import{d as $t}from"./HelpOutline-BFcbReM4.js";import{D as Ft}from"./index-DtQKM-2h.js";import{x as Kt}from"./index-BJHGOv7L.js";import{d as qt}from"./MoreHoriz-BREqCusY.js";import{f as Yt}from"./actions-BTcKDonC.js";import{d as Ht}from"./DeleteOutline-BbkjMdAN.js";import{g as Pe}from"./get-safe-url-DdRvX178.js";import{S as Vt}from"./switch-control-BkMzTiNZ.js";import{L as _e}from"./list-header-I7ATqJra.js";import"./OpenInNew-DJezkARI.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";import"./TableRow-Cm_wAjgF.js";import"./useThemeProps-CWjJ-DWG.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./ViewColumn-B1nkIYjz.js";import"./Search-BWsSz0TZ.js";import"./Clear-h2RSseCa.js";import"./Delete-DSwbRjGm.js";import"./index-Z8_Ea0J-.js";import"./MoreVert-6SZ5-4Oc.js";import"./TableSearch-CbLOqG0x.js";import"./useLocalStorage-rbap7GBn.js";import"./url-evaluation-D2uxzb5w.js";import"./permission-BrGI8BrM.js";import"./index-BVFznPvg.js";import"./Switch-B5mZ5gaW.js";function Qt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Qt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Oe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Oe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!Q(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),w.error(X(r)))}})}function Fe({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),w.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Fe(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),w.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Ke=y.createContext({}),{Provider:so,Consumer:is}=Ke;function ke({children:t}){var F;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Ot(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Fe({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(F=o==null?void 0:o.settings)==null?void 0:F.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(B=>{const P=[...B];return P.push({...m,loading:!0}),P}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(B){throw console.error(B),f(P=>[...P].filter(pe=>pe.did!==m.did)),B}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const B=[...N];return B.splice(B.indexOf(m),1),B}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function O(){return y.useContext(Ke)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=O(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Pt(b)){w.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){w.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),w.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function qe({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=O(),o=wt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:r.palette.background.paper,borderColor:r.palette.divider,textStyle:{color:r.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${r.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:r.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:r.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,color:r.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:r.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:r.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[T().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),T().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:l.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ft[200],color:"inherit"}}}}),[l,t,r]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:a,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Wt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&i(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2,children:e.jsxs(W,{direction:o?"column":"row",spacing:o?2:1,width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}De.propTypes={};const ro=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function we({status:t,message:s,createdAt:n}){const{t:o}=E(),a=t===R.BACKUPS.STATUS.PROGRESS&&T().diff(n,"hours")>=R.BACKUPS.TIMEOUT_HOURS,r=a&&o("common.timeoutError"),i=t===R.BACKUPS.STATUS.PROGRESS&&!a,l=t===R.BACKUPS.STATUS.SUCCEEDED&&!a;return i?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):l?e.jsx(V,{type:"success",children:o("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"error",children:o("common.failed")})," ",e.jsx(ye,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||r,children:e.jsx(Ce,{children:e.jsx($t,{style:{width:"24px",height:"24px"},color:"error"})})})]})}we.propTypes={status:g.string.isRequired,message:g.string,createdAt:g.string.isRequired};we.defaultProps={message:""};function Be({metadata:t}){const{t:s}=E();if(Q(t))return e.jsx(V,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,a=Kt(o,{iec:!0}),r=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(C,{variant:"body2",children:[s("common.fileSize"),": ",a]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"success",children:s("common.succeeded")})," ",e.jsx(ro,{title:r,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Ce,{children:e.jsx(gt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Be.propTypes={metadata:g.object};Be.defaultProps={metadata:{}};function Te(){const{t,locale:s}=E(),{spaceGateways:n,backups:o,backupsLoading:a}=O(),r=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var D;const{targetUrl:u,targetName:c,status:f,createdAt:p}=o[l],x=f===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,h=f===R.BACKUPS.STATUS.SUCCEEDED&&!x,b=c||((D=n.find(S=>u==null?void 0:u.includes(Se(S==null?void 0:S.endpoint))))==null?void 0:D.name)||"Unknown DID Space";return h?e.jsx(ht,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const u=t(l===0?"common.auto":"common.manual");return e.jsx(V,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:l=>T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>Q(l)?"":T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:l=>{const u=(o==null?void 0:o[l])??{},{status:c,message:f,createdAt:p,metadata:x}=u,h=c===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!h,D=c===R.BACKUPS.STATUS.SUCCEEDED&&!h;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):D?e.jsx(Be,{metadata:x}):e.jsx(we,{status:c,message:f,createdAt:p})}}}],[o,n,t]),i=y.useMemo(()=>!(o!=null&&o.length),[o]);return e.jsx(e.Fragment,{children:i?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(Ft,{title:"",loading:a,data:o,columns:r,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Te.propTypes={};function Ye(){const{t}=E();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(Bt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(oe,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(De,{})]})]}),e.jsx(Te,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(qe,{})]})}Ye.propTypes={};var Ee={},ao=be;Object.defineProperty(Ee,"__esModule",{value:!0});var He=Ee.default=void 0,io=ao(je()),co=e;He=Ee.default=(0,io.default)((0,co.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ie={},lo=be;Object.defineProperty(Ie,"__esModule",{value:!0});var Ve=Ie.default=void 0,uo=lo(je()),po=e;Ve=Ie.default=(0,uo.default)((0,po.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},mo=be;Object.defineProperty(Re,"__esModule",{value:!0});var Qe=Re.default=void 0,fo=mo(je()),ho=e;Qe=Re.default=(0,fo.default)((0,ho.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function ve({spaceGateway:t,onConfirm:s,onCancel:n}){const{t:o}=E(),[a,r]=y.useState(!1),[i,l]=y.useState(!1),u=(p,x)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),r(x)},c=async p=>{try{p==null||p.stopPropagation(),l(!0),await(s==null?void 0:s(t)),r(!1)}catch(x){console.error(x),w.error(`${o("storage.space.gateway.delete.failed")}: ${X(x)}`)}finally{r(!1),l(!1)}},f=p=>{u(p,!1),n==null||n(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(q,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ht,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(xt,{title:o("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:c,onCancel:f,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}ve.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool}).isRequired,onConfirm:g.func,onCancel:g.func};ve.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function ze({spaceGateway:t,selected:s,onDelete:n,onConnect:o,enableSwitchToSpace:a,backupInProgress:r,...i}){const{abortBlockletBackup:l}=O(),[u,c]=y.useState(null),{t:f}=E(),[p,x]=y.useState(!1),h=(S,d)=>{S.stopPropagation(),S.preventDefault(),c(d&&S.currentTarget)},b=async S=>{try{x(!0),h(S,!1),await o(t)}catch(d){console.error(d),w.error(d.message)}finally{x(!1)}},D=async S=>{try{x(!0),h(S,!1),await l()}catch(d){console.error(d),w.error(d.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(St,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>h(S,!0),...i,children:e.jsx(qt,{})}),e.jsxs(yt,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>h(S,!1),children:[e.jsxs(q,{onClick:S=>{h(S,!1),window.open(Pe(t.endpoint?_t(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:f("common.open")})]}),e.jsxs(q,{onClick:S=>{h(S,!1),window.open(Pe(Mt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Qe,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.strategy.viewBackupFiles")})]}),!s&&a&&e.jsxs(q,{onClick:b,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.switchToSpace")})]}),r&&e.jsxs(q,{onClick:D,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Yt,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.abortBlockletBackup")})]}),!r&&e.jsx(ve,{spaceGateway:t,onConfirm:async()=>{c(null),await(n==null?void 0:n(t))},onCancel:()=>c(null)})]})]})}ze.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool,endpoint:g.string.isRequired,loading:g.bool}).isRequired,selected:g.bool.isRequired,enableSwitchToSpace:g.bool,onDelete:g.func,onConnect:g.func,backupInProgress:g.bool};ze.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const go=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o,onDeleted:a,onBackedUp:r}){const{t:i,locale:l}=E(),{blocklet:u}=A(),{api:c,info:{did:f}}=M(),{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S}=$e({blocklet:u}),{backupProgress:d,updateSpaceGateway:se,deleteSpaceGateway:ne,refreshBackupSummary:re,refreshBackups:ae}=O(),[U,L]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:x},l),scan:i("storage.spaces.authorize.scan",{appName:x},l),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),ie=n&&!U&&s===fe.DISCONNECTED,ce=n&&!U&&!t.loading&&s===fe.CONNECTED,$=n&&U&&s===fe.CONNECTED&&(d==null?void 0:d.progress)>=0,Z=async()=>{try{if(await Ut(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),w.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o==null||o(null,t);return}}catch(k){console.error(k),o==null||o(k,t);return}v(k=>({...k,open:!0,prefix:ge(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ne.create({baseURL:ge(t.url,"space")}).get,extraParams:{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S,nodeDid:f,spaceDid:t.did}}))},le=async(k,F)=>{const m=F(k.endpoint),N=Se(m),B=k.space?F(k.space):{};if(t.did&&N!==t.did){v(pe=>({...pe,open:!1}));const K=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:B!=null&&B.name?B.name:""});w.error(K),o==null||o(new Error(K),t);return}const P={...t,name:B.name??"DID Space",did:B.did??Se(m),endpoint:m};await se(P),v(K=>({...K,open:!1})),o==null||o(null,P)},de=async()=>{try{if(U)return;L(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),w.error(k.message),r==null||r(k,t)}finally{L(!0)}},ue=async()=>{try{await ne(t),w.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),a==null||a(null,t)}catch(k){console.error(k),a==null||a(k,t)}};return y.useEffect(()=>{d!=null&&d.completed?(n&&((d==null?void 0:d.progress)===100?(w.success(i("storage.spaces.backupSuccessfully")),r==null||r(null,t)):d.message&&(r==null||r(new Error(d==null?void 0:d.message),t)),d.progress=0,d.message=""),L(!1),setTimeout(()=>{re(),ae()},1e3)):d.progress&&L(!0)},[d]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ce&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:de,children:i("storage.spaces.strategy.backupNow")}),ie&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:Z,children:i("storage.spaces.disconnected.reconnectNow")}),$&&e.jsx(go,{title:(d==null?void 0:d.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:d.message})}),children:e.jsxs(me,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:d==null?void 0:d.progress,size:14,sx:{mr:1}}),d==null?void 0:d.progress,"%"]})}),e.jsx(jt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:le,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:l},"get-endpoint")]}),e.jsx(ze,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:ue,onConnect:Z,enableSwitchToSpace:(d==null?void 0:d.completed)||Q(d==null?void 0:d.message),backupInProgress:$})]})}Ae.propTypes={spaceGateway:g.shape({did:g.string.isRequired,name:g.string.isRequired,url:g.string.isRequired,endpoint:g.string.isRequired,protected:g.bool,loading:g.bool}).isRequired,spaceStatus:g.string.isRequired,selected:g.bool.isRequired,onConnected:g.func,onDeleted:g.func,onBackedUp:g.func};Ae.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Xe({...t}){const{t:s}=E();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),e.jsx(De,{}),e.jsx(Te,{})]})}Xe.propTypes={};function Ze({...t}){const{t:s}=E(),{autoBackup:n,updateAutoBackup:o}=O(),a=async()=>{try{const r=!(n!=null&&n.enabled);await o({enabled:r}),w.success(s(r?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(r){w.error(r.message)}};return e.jsx(Vt,{checked:!!(n!=null&&n.enabled),onChange:a,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Ze.propTypes={};function xo(){const{t}=E(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),a=n&&!(s!=null&&s.length),r=({spaceGateway:i,spaceStatus:l,selected:u,refresh:c})=>e.jsx(Ae,{spaceGateway:i,spaceStatus:l,selected:u,onConnected:()=>c(),onBackedUp:f=>f&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Ze,{}),e.jsx(oe,{})]}),e.jsx(j,{mt:2,children:a?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(z,{})}):e.jsx(Le,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(Le,{item:!0,xs:12,md:6,children:e.jsx(Tt,{endpoint:i.endpoint,selected:o(i),action:r},i.endpoint)},i.endpoint))})})}),e.jsx(Xe,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(qe,{})]})}function So(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):Q(s)?e.jsx(Ye,{}):e.jsx(xo,{})}function yo(){return e.jsx(ke,{children:e.jsx(So,{})})}function jo(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:a,storageEndpoint:r}=It(),i=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return a?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(Rt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(vt,{}),e.jsx(j,{sx:i,children:e.jsx(zt,{onConnect:n,storageEndpoint:r})})]})}function bo(){const{t}=E();return e.jsxs(Et,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(jo,{})]})}function Je({navOrientation:t,...s}){const{t:n,locale:o}=E(),{blocklet:a}=A(),r=kt({key:"md"}),[i,l]=bt(),u=i.get("tab")||"backup",c=r?"horizontal":t,f=xe(()=>{var d;const D=[{label:n("common.backup"),value:"backup"}],S=(d=a==null?void 0:a.capabilities)==null?void 0:d.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&D.push({label:n("common.storage"),value:"storage"}),D},[o,c]),x=xe(()=>({backup:e.jsx(yo,{}),storage:e.jsx(bo,{})}))[u],h=D=>{l(S=>(D==="backup"?S.delete("tab"):S.set("tab",D),S))};if(f.length<=1)return e.jsx(he,{children:x});const b=e.jsx(Ct,{tabs:f,current:u,orientation:c,onChange:h,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...s,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(_e,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(he,{sx:{mt:1},children:x})})]})});if(c==="horizontal")return e.jsxs(j,{...s,children:[e.jsx(_e,{left:b}),e.jsx(he,{sx:{mt:2},children:x})]})}Je.propTypes={navOrientation:g.oneOf(["vertical","horizontal"])};Je.defaultProps={navOrientation:"vertical"};const he=te(j)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|