@abtnode/webapp 1.17.3-beta-20251119-102907-28b69b76 → 1.17.3-beta-20251121-135300-8e451e6e
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-Cy3Hzt37.js → AdapterDayjs-GSjt4DIz.js} +1 -1
- package/dist/assets/{Add-DSf1t7qs.js → Add-bw7LExYi.js} +1 -1
- package/dist/assets/ArrowDropDown-DFxrtTfG.js +1 -0
- package/dist/assets/{Autocomplete-BKjWOwf1.js → Autocomplete-C7pwOgja.js} +1 -1
- package/dist/assets/{Breadcrumbs-Cpe_HHsb.js → Breadcrumbs-01Zoyowa.js} +1 -1
- package/dist/assets/{ButtonGroup-BSFORhpK.js → ButtonGroup-CvkZLM_A.js} +1 -1
- package/dist/assets/{CSSTransition-CGA2AY2u.js → CSSTransition-CUGJUBZa.js} +1 -1
- package/dist/assets/{CallMerge-CNeLh8cr.js → CallMerge-1Wa1naTP.js} +1 -1
- package/dist/assets/{CardContent-BCVoa7Qa.js → CardContent-Bp9dBuHI.js} +1 -1
- package/dist/assets/{ChevronLeft-CNhAQqe-.js → ChevronLeft-iV8RZK9l.js} +1 -1
- package/dist/assets/{ChevronRight-oYcjZdAq.js → ChevronRight-rhEdYh7r.js} +1 -1
- package/dist/assets/{Clear-CF-6zHB9.js → Clear-TsHHhjv8.js} +1 -1
- package/dist/assets/{DeleteOutline-g4zuZlHR.js → DeleteOutline-CutnF8U7.js} +1 -1
- package/dist/assets/{Done-CBAVwhSp.js → Done-8bsZuZu5.js} +1 -1
- package/dist/assets/{Edit-mc-tpwHe.js → Edit-CW607hdk.js} +1 -1
- package/dist/assets/{ErrorOutline-DuVruU1N.js → ErrorOutline-BVlSjT51.js} +1 -1
- package/dist/assets/{FilterList-JTWXeilG.js → FilterList-BVOOp-qX.js} +1 -1
- package/dist/assets/{Google-Dqde6gCf.js → Google-D0deGelc.js} +1 -1
- package/dist/assets/{HelpOutline-VrUo4CgY.js → HelpOutline-B2x2uyvQ.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-DIekUaoF.js → KeyboardArrowDown-BDLR_mDt.js} +1 -1
- package/dist/assets/{Launch-D376Z95z.js → Launch-BhpfIjR4.js} +1 -1
- package/dist/assets/{Link-gpv9tp1O.js → Link-D6g1Xkkg.js} +1 -1
- package/dist/assets/{ListItemButton-DyxJOX3V.js → ListItemButton-DBhd8Se9.js} +1 -1
- package/dist/assets/{ListSubheader-B3vBwmdL.js → ListSubheader-U4UKs_5o.js} +1 -1
- package/dist/assets/{LoadingButton-BO0r-C3q.js → LoadingButton-Bg4ihiHh.js} +1 -1
- package/dist/assets/{MoreVert-CbdbA6tX.js → MoreVert-LlVBp8Yl.js} +1 -1
- package/dist/assets/{OpenInNew-DbAbXudy.js → OpenInNew-BBMfbtyT.js} +1 -1
- package/dist/assets/{Refresh-C1bc820N.js → Refresh-DwCMTrBg.js} +1 -1
- package/dist/assets/{Search-BjWLlrI4.js → Search-DV0DmDJh.js} +1 -1
- package/dist/assets/{Stepper-DCV_n6eg.js → Stepper-DHEo1TwM.js} +1 -1
- package/dist/assets/{Switch-CpbIVDmQ.js → Switch-BV_bJmtO.js} +1 -1
- package/dist/assets/{TableSearch-CDiGFd6z.js → TableSearch-Dw0n59eL.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-ncnnXxDh.js → ToggleButtonGroup-DsgagStl.js} +1 -1
- package/dist/assets/{UnfoldMore-B3Llwq1j.js → UnfoldMore-OHiBiV6d.js} +1 -1
- package/dist/assets/{Verified-CTr-W6a8.js → Verified-8SqBajcm.js} +1 -1
- package/dist/assets/{VerifiedUser-pNI2eRO7.js → VerifiedUser-Yl48fJHl.js} +1 -1
- package/dist/assets/{ViewList-kcd1uumx.js → ViewList-Dlfa9YjE.js} +1 -1
- package/dist/assets/{_createAggregator-BxbOaLHI.js → _createAggregator-C9kdvL4F.js} +1 -1
- package/dist/assets/{actions-tObn7zJ6.js → actions-B8C-PCI5.js} +1 -1
- package/dist/assets/{actions-zVWmuYor.js → actions-Cd1V0QXL.js} +1 -1
- package/dist/assets/{agreement-Cvin2k-0.js → agreement-BUveUzQO.js} +1 -1
- package/dist/assets/api-q4yep6BX.js +1 -0
- package/dist/assets/{appearance-CewTQR7K.js → appearance-DJ340BPT.js} +1 -1
- package/dist/assets/ar-Dz5bxvSE.js +7 -0
- package/dist/assets/{audit-logs-CwextQ-4.js → audit-logs-Budxmero.js} +1 -1
- package/dist/assets/{base-chart-DiTtpkEe.js → base-chart-B0G5PbEt.js} +1 -1
- package/dist/assets/{blocklet-C2b0Krau.js → blocklet-B_gm4lmi.js} +1 -1
- package/dist/assets/{chain-CGBkjwPv.js → chain-Cq8v0ndB.js} +1 -1
- package/dist/assets/{click-to-copy-ai22kDmM.js → click-to-copy-C9rtZDLS.js} +1 -1
- package/dist/assets/cloneDeep-B_sIbdyU.js +1 -0
- package/dist/assets/{collapse-D3FTM4dY.js → collapse-CXW4uktq.js} +1 -1
- package/dist/assets/{config-navigation-C984ipMc.js → config-navigation-XP4WQgYo.js} +3 -3
- package/dist/assets/{connect-to-NpHWKOdT.js → connect-to-CyrO6atx.js} +1 -1
- package/dist/assets/{cssMode-B_7wzvNF.js → cssMode--X9ZnCcB.js} +1 -1
- package/dist/assets/de-Ztxy5vEB.js +7 -0
- package/dist/assets/{delete-confirm-Cs8HZU3F.js → delete-confirm-H64HwgQW.js} +1 -1
- package/dist/assets/{depsEqual-nOFq575f.js → depsEqual-DnLesJI5.js} +1 -1
- package/dist/assets/{detail-rmDvZlQs.js → detail-BJu2Du0C.js} +3 -3
- package/dist/assets/{domains-Cl3BoDQM.js → domains-dlolWlOv.js} +1 -1
- package/dist/assets/{download-CKeDZtxQ.js → download-BfgyvMjJ.js} +1 -1
- package/dist/assets/{edit.svg-CwXv9YiH.js → edit.svg-MioFY6RL.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-F-H2n_Vz.js +1 -0
- package/dist/assets/engine-DeV5utCO.js +1 -0
- package/dist/assets/es-Cd-spoK_.js +9 -0
- package/dist/assets/fr-k8jXteN1.js +7 -0
- package/dist/assets/{freemarker2-DMGQ1X3o.js → freemarker2-DaUACayH.js} +1 -1
- package/dist/assets/{get-safe-url-Du-oHj2l.js → get-safe-url-BdtvVcQw.js} +1 -1
- package/dist/assets/getValidReactChildren-BMWRE_Nn.js +1 -0
- package/dist/assets/{graphqlMode-CBm6Y_s8.js → graphqlMode-Cs4xUrf4.js} +2 -2
- package/dist/assets/{handlebars-k1LzSovD.js → handlebars-TT0L6RLX.js} +1 -1
- package/dist/assets/hi-CvpI1-tn.js +5 -0
- package/dist/assets/{html-BiUD3Qx-.js → html-lavZKcN0.js} +1 -1
- package/dist/assets/{html-title-CdL2MMMZ.js → html-title-BPny9upB.js} +1 -1
- package/dist/assets/{htmlMode-CormEaWC.js → htmlMode-DMFwjMOD.js} +1 -1
- package/dist/assets/id-D8coHs1U.js +7 -0
- package/dist/assets/{iframe-D0uDdMLE.js → iframe-1S7jkX6i.js} +1 -1
- package/dist/assets/{index-2mfLtqU5.js → index-0KDfyThN.js} +1 -1
- package/dist/assets/{index-DEbyt4GA.js → index-B5g8M7OB.js} +2 -2
- package/dist/assets/{index-BW3izKQN.js → index-B6RQPS53.js} +1 -1
- package/dist/assets/{index-CQS9RyzL.js → index-BAFeziwg.js} +1 -1
- package/dist/assets/{index-D27ho1qR.js → index-BHJmOQ7h.js} +1 -1
- package/dist/assets/{index-D52Hbw7t.js → index-BMTfpek5.js} +1 -1
- package/dist/assets/{index-COd1PLDA.js → index-Br_vN976.js} +1 -1
- package/dist/assets/{index-C5Y0kFva.js → index-C4c7H09E.js} +1 -1
- package/dist/assets/{index-BN3hC0u8.js → index-CAeA1Cvc.js} +1 -1
- package/dist/assets/{index-CErdGTA8.js → index-CAy_ntFG.js} +1 -1
- package/dist/assets/{index-CVBSPfdt.js → index-CDH7LNvM.js} +1 -1
- package/dist/assets/{index-CJKWQgQO.js → index-COSOS45R.js} +1 -1
- package/dist/assets/{index-CchlalEl.js → index-CW1fjR9h.js} +1 -1
- package/dist/assets/{index-CKkmKemN.js → index-CZoo5V2P.js} +1 -1
- package/dist/assets/{index-B59_W4_Q.js → index-CapJ9GZ2.js} +1 -1
- package/dist/assets/{index-CsbKyC6R.js → index-Cel7tx4n.js} +37 -37
- package/dist/assets/{index-M9ovmVRk.js → index-ClxFOl_D.js} +3 -3
- package/dist/assets/index-CnRp8oF4.js +1 -0
- package/dist/assets/{index-CDWGwo0s.js → index-CvjKujEe.js} +1 -1
- package/dist/assets/{index-BY-qbpk9.js → index-CxOhjmog.js} +1 -1
- package/dist/assets/{index-CMbyDY1K.js → index-D2OqQrAZ.js} +1 -1
- package/dist/assets/{index-D72zDkRT.js → index-DBElf0v4.js} +1 -1
- package/dist/assets/{index-Co0yPTjX.js → index-DEi5xwZC.js} +3 -3
- package/dist/assets/{index-B3s3akL5.js → index-DMIRBD0M.js} +1 -1
- package/dist/assets/{index-DJWr_mi8.js → index-DRoFAJB5.js} +1 -1
- package/dist/assets/{index-ClAtd3q-.js → index-DTKSzDFU.js} +1 -1
- package/dist/assets/{index-CY8yk2lA.js → index-DV2yUsDM.js} +1 -1
- package/dist/assets/{index-Bh2o55wc.js → index-DaZkwaiO.js} +1 -1
- package/dist/assets/{index-C4reCTEy.js → index-Dahvz4_C.js} +1 -1
- package/dist/assets/{index-DRCzT2Db.js → index-Dc9GzuOJ.js} +1 -1
- package/dist/assets/{index-De0dWrg5.js → index-Dgm8R3_G.js} +1 -1
- package/dist/assets/{index-tU2oYzz9.js → index-DtM0eWbB.js} +1 -1
- package/dist/assets/{index-Bcl79xYg.js → index-DymefoL_.js} +1 -1
- package/dist/assets/{index-BN6AkRH_.js → index-Fv7F4t_Q.js} +1 -1
- package/dist/assets/{index-CScKPpp0.js → index-G3qQEhRl.js} +1 -1
- package/dist/assets/index-GpQ_N20f.js +1 -0
- package/dist/assets/{index-B9fzt2fZ.js → index-H_wq9PgB.js} +1 -1
- package/dist/assets/{index-BtyOtjWm.js → index-QV6ZlHUk.js} +1 -1
- package/dist/assets/{index-Djc6CFE1.js → index-UKgFVupi.js} +4 -4
- package/dist/assets/{index-FsKIi3X_.js → index-aiNsIJH9.js} +1 -1
- package/dist/assets/{index-DBMn56u_.js → index-cO6bb6Pk.js} +1 -1
- package/dist/assets/{index-DQi2WE4V.js → index-cfZQGoxy.js} +3 -3
- package/dist/assets/{index-DqDobMjo.js → index-kPygeO6n.js} +1 -1
- package/dist/assets/{index-_dNc3tdC.js → index-ndtAmeV1.js} +9 -9
- package/dist/assets/{index-BNQbfnna.js → index-qaEYO3ku.js} +1 -1
- package/dist/assets/{index-Bp_0X-_E.js → index-tjFbkwkg.js} +1 -1
- package/dist/assets/{index.esm-BvWd-uW1.js → index.esm-C1D-vjtU.js} +1 -1
- package/dist/assets/{install-from-url-CvgxEUmo.js → install-from-url-DsCL99L1.js} +1 -1
- package/dist/assets/{invitation-w6xVOwku.js → invitation-tfEd0Lsr.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-CZBBioRh.js → is-path-prefix-equal-Bvg8FYDR.js} +1 -1
- package/dist/assets/{item-7JTwbpcy.js → item-8U44hoCJ.js} +1 -1
- package/dist/assets/ja-Dkn5OA2r.js +9 -0
- package/dist/assets/{javascript-BjWBCV3C.js → javascript-Be40gNv5.js} +1 -1
- package/dist/assets/{jsonMode-B-rllw4B.js → jsonMode-kLgPrjXr.js} +1 -1
- package/dist/assets/ko-DXfRo0NY.js +9 -0
- package/dist/assets/{liquid-MHM6e0hb.js → liquid-HxAxWFbN.js} +1 -1
- package/dist/assets/{list-header-wazLprRA.js → list-header-CRu61Gzq.js} +1 -1
- package/dist/assets/{lock.svg-HQqY2ru5.js → lock.svg-B1POA68X.js} +1 -1
- package/dist/assets/{log-SDlEOFax.js → log-C2U5MC50.js} +1 -1
- package/dist/assets/{lottie-react.esm-CA7_QXFJ.js → lottie-react.esm-C_wSYvC1.js} +1 -1
- package/dist/assets/{mdx-Bhq6EuNZ.js → mdx-BMPssTWP.js} +1 -1
- package/dist/assets/{memory-Dxfx8V-Y.js → memory-CucrqTb6.js} +1 -1
- package/dist/assets/{metric-BgfAyBLx.js → metric-CB5i39mr.js} +1 -1
- package/dist/assets/omit-Dmt7cKLM.js +1 -0
- package/dist/assets/{overview-CtQdThmx.js → overview-BXVI29QP.js} +1 -1
- package/dist/assets/{permission-DH1ztUx1.js → permission-rweAJL4g.js} +1 -1
- package/dist/assets/{preference-x3WcuRpO.js → preference-gJ6ZF2Q4.js} +3 -3
- package/dist/assets/pt-CNQsUMCu.js +5 -0
- package/dist/assets/{python-CluXdJ59.js → python-BkToxfo1.js} +1 -1
- package/dist/assets/{raf-schd.esm-CWje2Tte.js → raf-schd.esm-B9wpp0Qh.js} +1 -1
- package/dist/assets/{razor-Bbi5yxyu.js → razor-wuUYkLrt.js} +1 -1
- package/dist/assets/{rotate-session-key-CxnTM7fy.js → rotate-session-key-C8ucpOl_.js} +1 -1
- package/dist/assets/ru-CjyCft4V.js +5 -0
- package/dist/assets/{runtime-CoN-JKhX.js → runtime-i_b0U5XU.js} +1 -1
- package/dist/assets/schema-C8k5AIF2.js +1 -0
- package/dist/assets/sdk-CXtYA3ry.js +1 -0
- package/dist/assets/{service-QgJgO-lJ.js → service-CUx_uRl4.js} +1 -1
- package/dist/assets/{shorten-label-GkvuGgFI.js → shorten-label-jgxOPsCZ.js} +1 -1
- package/dist/assets/{simple-select-BvKxAoeb.js → simple-select-UnH3V90L.js} +1 -1
- package/dist/assets/{spaces-BpX_nBm3.js → spaces-C6mZH1kT.js} +1 -1
- package/dist/assets/{status-CniDNp9U.js → status-DDW9dFZ_.js} +1 -1
- package/dist/assets/{status-C7WqVRQu.js → status-DL1Ex6i2.js} +2 -2
- package/dist/assets/{switch-control-W9_Ziz3_.js → switch-control-BIC-Nwu_.js} +1 -1
- package/dist/assets/{table-icons-C2veDaqC.js → table-icons-B9tXAbnj.js} +1 -1
- package/dist/assets/{team-CIo6hjLu.js → team-BpXTeXX3.js} +1 -1
- package/dist/assets/th-WQWRMKAv.js +5 -0
- package/dist/assets/{toLower-SH4M6kcx.js → toLower-C-8MuvP9.js} +1 -1
- package/dist/assets/toUpper-DqUeOG5c.js +1 -0
- package/dist/assets/{traffic-B7c7SEiM.js → traffic-BEQzO7xQ.js} +1 -1
- package/dist/assets/{tsMode-D6vYRIBs.js → tsMode-Dzl7y3L0.js} +1 -1
- package/dist/assets/{typescript-Ch0qWVP7.js → typescript-B_dz3gG0.js} +1 -1
- package/dist/assets/{url-evaluation-D369MGtZ.js → url-evaluation-DuQYeVhL.js} +1 -1
- package/dist/assets/{url-join-CXAOw82l.js → url-join-cDXJRDHX.js} +1 -1
- package/dist/assets/{use-mobile-DhX8_ar0.js → use-mobile-CMTzn3M3.js} +1 -1
- package/dist/assets/{use-mobile-C0eq8HK2.js → use-mobile-HM6iZFZe.js} +1 -1
- package/dist/assets/{useAsync-D01rxZEY.js → useAsync-C6Eg4w89.js} +1 -1
- package/dist/assets/{useAsyncRetry-BvmFcYCT.js → useAsyncRetry-DAHR7IMw.js} +1 -1
- package/dist/assets/{useLocalStorage-c6bwoFO6.js → useLocalStorage-1RvhLwwW.js} +1 -1
- package/dist/assets/{useThemeProps-BekBmxVD.js → useThemeProps-SIspLYj0.js} +1 -1
- package/dist/assets/{util-YaFSbpre.js → util-CQwua2ce.js} +1 -1
- package/dist/assets/vi-Br98wbNi.js +5 -0
- package/dist/assets/{wait-container-BS2F28XW.js → wait-container-DH8upE6T.js} +1 -1
- package/dist/assets/{without-wallet-Cu7ySxrW.js → without-wallet-BW1Rplxh.js} +1 -1
- package/dist/assets/wrap-locale-BOO0hut3.js +1 -0
- package/dist/assets/{xml-P6Vt1vS_.js → xml-Bw3uqPST.js} +1 -1
- package/dist/assets/{yaml-DWlrp1ta.js → yaml-Bs3RMjTY.js} +1 -1
- package/dist/assets/{zh-Daif36Hm.js → zh-DB1zAstv.js} +1 -1
- package/dist/assets/zh-tw-DVMVT9am.js +9 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-DjyHa70Q.js +0 -1
- package/dist/assets/api-DrDWu9Cd.js +0 -1
- package/dist/assets/ar-CCM7LUa7.js +0 -7
- package/dist/assets/cloneDeep-C2YyfaU5.js +0 -1
- package/dist/assets/de-STCToRpb.js +0 -7
- package/dist/assets/emotion-cache.browser.esm--L_AUfJr.js +0 -1
- package/dist/assets/engine-CSYqY4x2.js +0 -1
- package/dist/assets/es-CrUw-8oc.js +0 -9
- package/dist/assets/fr-B6GuZu9m.js +0 -7
- package/dist/assets/getValidReactChildren-DJDN9kNi.js +0 -1
- package/dist/assets/hi-Cw_VH7M3.js +0 -5
- package/dist/assets/id-ErxRX4DU.js +0 -7
- package/dist/assets/index-BxsjXqXa.js +0 -1
- package/dist/assets/index-DXXzlrFO.js +0 -1
- package/dist/assets/ja-CvssCilG.js +0 -9
- package/dist/assets/ko-CwfYSSYs.js +0 -9
- package/dist/assets/omit-CKd1pZfu.js +0 -1
- package/dist/assets/pt-DiKRyIZy.js +0 -5
- package/dist/assets/ru-5wNmeEUO.js +0 -5
- package/dist/assets/schema-BE8WCVjx.js +0 -1
- package/dist/assets/sdk-B10Zgjv7.js +0 -1
- package/dist/assets/th-B6ebKspD.js +0 -5
- package/dist/assets/toUpper-Dn7sb7ix.js +0 -1
- package/dist/assets/vi-PpVWvm1I.js +0 -5
- package/dist/assets/wrap-locale-DkSTGk2E.js +0 -1
- package/dist/assets/zh-tw-C3Px30Ps.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as X,eO as Fe,O as Pe,ik as Ye,bj as Te,aU as Ie,R as Ee,dI as Ne,b3 as qe,b1 as Ae,C as Qe,f as Xe,f0 as Je,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,bq as je,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,it as kt,a3 as Ft}from"./index-Djc6CFE1.js";import{d as Pt,H as at,g as _t}from"./index-BtyOtjWm.js";import{R as _e,S as Bt}from"./actions-tObn7zJ6.js";import{B as zt}from"./index-CVBSPfdt.js";import{S as me}from"./shorten-label-GkvuGgFI.js";import{v as ot}from"./index-D52Hbw7t.js";import{T as Wt}from"./html-title-CdL2MMMZ.js";import{R as Mt}from"./Refresh-C1bc820N.js";import{D as Kt,g as Ht}from"./traffic-B7c7SEiM.js";import{u as qt}from"./use-mobile-DhX8_ar0.js";import"./FilterList-JTWXeilG.js";import"./CSSTransition-CGA2AY2u.js";import"./emotion-cache.browser.esm--L_AUfJr.js";import"./index-CDWGwo0s.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-nOFq575f.js";import"./index-Bh2o55wc.js";import"./TableSearch-CDiGFd6z.js";import"./Search-BjWLlrI4.js";import"./Clear-CF-6zHB9.js";import"./MoreVert-CbdbA6tX.js";import"./useLocalStorage-c6bwoFO6.js";import"./url-evaluation-D369MGtZ.js";import"./get-safe-url-Du-oHj2l.js";import"./ButtonGroup-BSFORhpK.js";import"./getValidReactChildren-DJDN9kNi.js";import"./permission-DH1ztUx1.js";import"./index.esm-BvWd-uW1.js";import"./collapse-D3FTM4dY.js";import"./blocklet-C2b0Krau.js";import"./Switch-CpbIVDmQ.js";import"./iframe-D0uDdMLE.js";import"./ChevronLeft-CNhAQqe-.js";import"./ChevronRight-oYcjZdAq.js";import"./index-DBii9-f-.js";import"./base-chart-DiTtpkEe.js";import"./index-CErdGTA8.js";import"./AdapterDayjs-Cy3Hzt37.js";import"./useThemeProps-BekBmxVD.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=Q(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const J={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:J},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Qt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Jt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=X();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=X(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=X(),l=Xe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,J]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),J(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Xt(S,c):i==="pushKit"?Jt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Qe,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as X,eO as Fe,O as Pe,ik as Ye,bj as Te,aU as Ie,R as Ee,dI as Ne,b3 as qe,b1 as Ae,C as Qe,f as Xe,f0 as Je,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,bq as je,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,it as kt,a3 as Ft}from"./index-UKgFVupi.js";import{d as Pt,H as at,g as _t}from"./index-QV6ZlHUk.js";import{R as _e,S as Bt}from"./actions-B8C-PCI5.js";import{B as zt}from"./index-CDH7LNvM.js";import{S as me}from"./shorten-label-jgxOPsCZ.js";import{v as ot}from"./index-BMTfpek5.js";import{T as Wt}from"./html-title-BPny9upB.js";import{R as Mt}from"./Refresh-DwCMTrBg.js";import{D as Kt,g as Ht}from"./traffic-BEQzO7xQ.js";import{u as qt}from"./use-mobile-CMTzn3M3.js";import"./FilterList-BVOOp-qX.js";import"./CSSTransition-CUGJUBZa.js";import"./emotion-cache.browser.esm-F-H2n_Vz.js";import"./index-CvjKujEe.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DnLesJI5.js";import"./index-DaZkwaiO.js";import"./TableSearch-Dw0n59eL.js";import"./Search-DV0DmDJh.js";import"./Clear-TsHHhjv8.js";import"./MoreVert-LlVBp8Yl.js";import"./useLocalStorage-1RvhLwwW.js";import"./url-evaluation-DuQYeVhL.js";import"./get-safe-url-BdtvVcQw.js";import"./ButtonGroup-CvkZLM_A.js";import"./getValidReactChildren-BMWRE_Nn.js";import"./permission-rweAJL4g.js";import"./index.esm-C1D-vjtU.js";import"./collapse-CXW4uktq.js";import"./blocklet-B_gm4lmi.js";import"./Switch-BV_bJmtO.js";import"./iframe-1S7jkX6i.js";import"./ChevronLeft-iV8RZK9l.js";import"./ChevronRight-rhEdYh7r.js";import"./index-DBii9-f-.js";import"./base-chart-B0G5PbEt.js";import"./index-CAy_ntFG.js";import"./AdapterDayjs-GSjt4DIz.js";import"./useThemeProps-SIspLYj0.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=Q(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const J={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:J},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Qt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Jt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=X();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=X(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=X(),l=Xe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,J]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),J(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Xt(S,c):i==="pushKit"?Jt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Qe,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cI as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cV as qm,be as JL,r as QL}from"./index-
|
|
1
|
+
import{cI as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cV as qm,be as JL,r as QL}from"./index-UKgFVupi.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as le,j as e,hw as ce,bd as ue,bn as Z,V as G,gj as ee,f9 as te,aP as re,cv as u,H as S,hx as M,K as R,t as x,hy as V,aU as H,O as p,ay as de,v as N,s as ie,aV as ne,z as me,y as fe,aH as he,r as U,p as xe,bC as pe}from"./index-Djc6CFE1.js";import{T as ve}from"./html-title-CdL2MMMZ.js";import{u as se,C as m}from"./index.esm-BvWd-uW1.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-D3FTM4dY.js";import{u as ae}from"./blocklet-C2b0Krau.js";import{S as $}from"./Switch-CpbIVDmQ.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=E;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function E(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Se=Te();const Ee=ue(Se),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),T&&S.success(t("oauth.saveSuccess"))}catch(y){if(T)S.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),S.success(t("notification.email.testSuccess"))}catch(y){S.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Ee(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},w?.settings?.notification?.pushKit||{});q(I),v&&S.success(t("oauth.saveSuccess"))}catch(w){if(v)S.error(w.message||t("oauth.saveFailed"));else throw w}}),W=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),S.success(t("notification.pushKit.testSuccess"))}catch(v){S.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(Y[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
1
|
+
import{aF as le,j as e,hw as ce,bd as ue,bn as Z,V as G,gj as ee,f9 as te,aP as re,cv as u,H as S,hx as M,K as R,t as x,hy as V,aU as H,O as p,ay as de,v as N,s as ie,aV as ne,z as me,y as fe,aH as he,r as U,p as xe,bC as pe}from"./index-UKgFVupi.js";import{T as ve}from"./html-title-BPny9upB.js";import{u as se,C as m}from"./index.esm-C1D-vjtU.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-CXW4uktq.js";import{u as ae}from"./blocklet-B_gm4lmi.js";import{S as $}from"./Switch-BV_bJmtO.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=E;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function E(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Se=Te();const Ee=ue(Se),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),T&&S.success(t("oauth.saveSuccess"))}catch(y){if(T)S.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),S.success(t("notification.email.testSuccess"))}catch(y){S.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Ee(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},w?.settings?.notification?.pushKit||{});q(I),v&&S.success(t("oauth.saveSuccess"))}catch(w){if(v)S.error(w.message||t("oauth.saveFailed"));else throw w}}),W=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),S.success(t("notification.pushKit.testSuccess"))}catch(v){S.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(Y[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ez as k}from"./index-
|
|
1
|
+
import{ez as k}from"./index-UKgFVupi.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as ee,A as T,r as f,a as te,b as se,V as j,u as S,x as re,av as A,i as F,j as t,w as q,aw as oe,T as C,y as k,$,o as m,ax as ne,ay as ae,v as _,C as N,az as ie,H as W,X as M,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,a9 as he,s as O,a6 as fe,a7 as me,aE as ge,a8 as xe}from"./index-
|
|
1
|
+
import{aj as ee,A as T,r as f,a as te,b as se,V as j,u as S,x as re,av as A,i as F,j as t,w as q,aw as oe,T as C,y as k,$,o as m,ax as ne,ay as ae,v as _,C as N,az as ie,H as W,X as M,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,a9 as he,s as O,a6 as fe,a7 as me,aE as ge,a8 as xe}from"./index-UKgFVupi.js";import{u as L}from"./useLocalStorage-1RvhLwwW.js";import{C as be,c as ke,e as ye,_ as je,a as Se,d as we,s as ve,S as V,b as Pe,A as Ce}from"./item-8U44hoCJ.js";import{e as D}from"./engine-DeV5utCO.js";import{g as U}from"./get-safe-url-BdtvVcQw.js";import{P as z}from"./permission-rweAJL4g.js";import{A as Re}from"./ArrowDropDown-DFxrtTfG.js";import{B as Le}from"./Breadcrumbs-01Zoyowa.js";import"./index-Br_vN976.js";import"./KeyboardArrowDown-BDLR_mDt.js";import"./ChevronLeft-iV8RZK9l.js";import"./ChevronRight-rhEdYh7r.js";import"./Search-DV0DmDJh.js";import"./index-DaZkwaiO.js";import"./blocklet-B_gm4lmi.js";import"./Autocomplete-C7pwOgja.js";import"./ListSubheader-U4UKs_5o.js";import"./Verified-8SqBajcm.js";import"./VerifiedUser-Yl48fJHl.js";import"./Add-bw7LExYi.js";import"./Launch-BhpfIjR4.js";import"./Done-8bsZuZu5.js";import"./DeleteOutline-CutnF8U7.js";import"./delete-confirm-H64HwgQW.js";import"./click-to-copy-C9rtZDLS.js";import"./MoreVert-LlVBp8Yl.js";import"./ButtonGroup-CvkZLM_A.js";import"./getValidReactChildren-BMWRE_Nn.js";function Be(e){const r=ee(),c=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[l,u]=f.useState(!1),[d,a]=f.useState(null),p=()=>{const{pathname:n,searchParams:b}=new URL(window.location.href),g=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";b.get("sid")&&(o(""),c(n.replace(g,"/"),{replace:!0}))},i=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(a(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(p,2e3)))}),f.useEffect(()=>{d&&d.id!==s&&o(d.id)},[d]),{hasCompleted:l,hasPurchased:i,session:d,setSession:a,doRedirect:p}}function De(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function K({meta:e,onCancel:r,handlePaySuccess:c=De,storeUrl:s}){const{t:o}=j(),{info:l}=S(),[u,d]=f.useState("both"),[a,p]=f.useState(1),i=re(l),n=A(e,l,s),b=P=>{P!==u&&d(P)},g=()=>{u&&(p(2),u==="verify"&&(window.location.href=U(n)))},w=(P,B)=>{B!=="backdropClick"&&r()},x=()=>{c(n)},h=F.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:x,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(C,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(C,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(be,{action:u,onNext:g,onSelect:b})})})}K.propTypes={...ke,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function H({meta:e,buttonText:r,storeUrl:c,isResource:s=!1}){const{t:o}=j(),l=T(),{info:u}=S(),{api:d}=ne(),a=F.isFreeBlocklet(e)===!1,[p,i]=f.useState(!1),{hasPurchased:n}=Be(e.did),[b,g]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[x,h]=f.useState(!1),v=f.useMemo(()=>p?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[p,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?r.purchase:r.launch,[a,r,s]),B=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){g(!0);return}if(w){h(!0);return}if(!a){const R=A(e,u,c);window.location.href=U(R)}}catch(R){W.error(M(R),{autoHideDuration:5e3}),console.error("Blocklet installed failed",R)}finally{i(!1)}},Y=()=>{i(!1),g(!1)},J=y=>{i(!1),h(!1),l(`/blocklets/${y.appDid}/components`)},Z=()=>{i(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(z,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(n||b)&&t.jsx(K,{method:"launch",meta:e,mode:"both",onCancel:Y,storeUrl:c}),x&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:J,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}H.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ee=(e,r,c)=>{const s=he(r);return k(c,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return k(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function G({blocklet:e,endpoint:r="",serverVersion:c=""}){const{t:s}=j(),o=S();let l=k(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)l=k(u,ue(e.did,e.logo,e.version));else{let n=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");n&&(n=`/${n}`),l=k(n,`/blocklet/logo/${e.did}`)}try{const i=new URL(l);i.searchParams.set("v",e.version||+new Date),l=i.href}catch{}const d=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u},p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Se,{serverVersion:c,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(H,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...a})})});return t.jsx(de,{href:Ee(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:d,target:"_blank",children:t.jsx(Ie,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?l:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(E,{sx:{display:"flex",color:"primary.main"},children:t.jsx(pe,{icon:we})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Q({storeUrl:e,handleSearchSelect:r=null,extraFilter:c=void 0,...s}){const{locale:o}=j(),l=S(),[u,d]=f.useState({}),a=n=>{d(n)},p=e,i=l?.info?.version;return f.useEffect(()=>{d({})},[p]),t.jsx(le,{FallbackComponent:ce,resetKeys:[p],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:n=>t.jsx(G,{...n,endpoint:p}),baseSearch:!0,endpoint:p,locale:o,onFilterChange:a,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:i})})})}Q.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Ie=O(ve)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as je,j as e,u as Q,r as h,e as Oe,aG as Ur,aH as k,aI as zr,aJ as an,aK as Gn,aL as sn,aM as et,V as z,ac as le,s as ne,aN as ln,o as p,aO as Br,aP as cn,aQ as Mr,H as re,M as dn,T as A,t as q,ay as fe,aR as _e,C as K,U as be,v as Y,aS as Kn,X as pe,K as W,p as Mt,N as tt,aT as Wr,d as Wt,aU as Ie,aV as me,a9 as qr,aW as Hr,aX as Gr,y as Kr,A as Vn,W as un,g as mn,h as te,aY as qt,a as Et,Q as X,b as ct,aZ as Yn,a_ as Xn,R as Qn,a3 as Pt,a$ as Vr,b0 as Yr,b1 as Xr,b2 as Qr,b3 as nt,i as fn,b4 as Zr,aE as Ge,b5 as Jr,a8 as jt,a5 as wt,b6 as ei,a6 as _t,L as Ht,I as ti,b7 as ni,b8 as Zn,a7 as ri,b9 as Jn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as er,D as At,f as tr,bf as ai,bg as pn,aj as si,bh as li,bi as ee,bj as ci,S as gn,l as hn,m as xn,bk as di,bl as ui,bm as mi}from"./index-
|
|
1
|
+
import{aF as je,j as e,u as Q,r as h,e as Oe,aG as Ur,aH as k,aI as zr,aJ as an,aK as Gn,aL as sn,aM as et,V as z,ac as le,s as ne,aN as ln,o as p,aO as Br,aP as cn,aQ as Mr,H as re,M as dn,T as A,t as q,ay as fe,aR as _e,C as K,U as be,v as Y,aS as Kn,X as pe,K as W,p as Mt,N as tt,aT as Wr,d as Wt,aU as Ie,aV as me,a9 as qr,aW as Hr,aX as Gr,y as Kr,A as Vn,W as un,g as mn,h as te,aY as qt,a as Et,Q as X,b as ct,aZ as Yn,a_ as Xn,R as Qn,a3 as Pt,a$ as Vr,b0 as Yr,b1 as Xr,b2 as Qr,b3 as nt,i as fn,b4 as Zr,aE as Ge,b5 as Jr,a8 as jt,a5 as wt,b6 as ei,a6 as _t,L as Ht,I as ti,b7 as ni,b8 as Zn,a7 as ri,b9 as Jn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as er,D as At,f as tr,bf as ai,bg as pn,aj as si,bh as li,bi as ee,bj as ci,S as gn,l as hn,m as xn,bk as di,bl as ui,bm as mi}from"./index-UKgFVupi.js";import{u as fi,T as pi}from"./html-title-BPny9upB.js";import{A as gi}from"./ArrowDropDown-DFxrtTfG.js";import{u as Kt,C as B,a as yn}from"./index.esm-C1D-vjtU.js";import{S as ae}from"./switch-control-BIC-Nwu_.js";import{P as ie}from"./permission-rweAJL4g.js";import{H as nr,g as hi}from"./index-QV6ZlHUk.js";import{A as rr}from"./Link-D6g1Xkkg.js";import{D as ve,R as ir,a as It,b as xi}from"./url-evaluation-DuQYeVhL.js";import{D as dt}from"./delete-confirm-H64HwgQW.js";import{v as rt}from"./index-BMTfpek5.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-1RvhLwwW.js";import{R as vi}from"./Refresh-DwCMTrBg.js";import{L as ji}from"./LoadingButton-Bg4ihiHh.js";import{C as wi,R as Ci,P as or,S as Si}from"./rotate-session-key-C8ucpOl_.js";import{A as Le}from"./Add-bw7LExYi.js";import{B as ar,D as bn,W as Ke}from"./status-DL1Ex6i2.js";import{i as Di}from"./is-path-prefix-equal-Bvg8FYDR.js";import{N as ki}from"./ChevronRight-rhEdYh7r.js";import{I as Ri}from"./MoreVert-LlVBp8Yl.js";import{E as sr}from"./Edit-CW607hdk.js";import{A as Ti}from"./CallMerge-1Wa1naTP.js";import{C as Ei}from"./CardContent-Bp9dBuHI.js";import"./Switch-BV_bJmtO.js";import"./FilterList-BVOOp-qX.js";import"./CSSTransition-CUGJUBZa.js";import"./emotion-cache.browser.esm-F-H2n_Vz.js";import"./index-CvjKujEe.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DnLesJI5.js";import"./index-DaZkwaiO.js";import"./TableSearch-Dw0n59eL.js";import"./Search-DV0DmDJh.js";import"./Clear-TsHHhjv8.js";import"./click-to-copy-C9rtZDLS.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),lr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Fi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",cr=h.createContext({}),{Provider:Oi,Consumer:as}=cr,vn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=vn.includes(t.name),i=vn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Gn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function jn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Oe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await Ur(g.domainAliases,{getIP:zr}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Oi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(cr);return t}function Vt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function dr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}dr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as v,j as n,K as a,br as w,V as z,f as p,dl as F}from"./index-
|
|
1
|
+
import{aF as v,j as n,K as a,br as w,V as z,f as p,dl as F}from"./index-UKgFVupi.js";const k=v(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.996.996 0 0 1 0-1.41L10.59 12 7.7 9.11a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41"}));function r({icon:e=null,title:t="",description:o="",extra:b=null,...y}){return n.jsxs(E,{...y,children:[e,typeof t=="string"?n.jsx(a,{sx:{mt:3,fontSize:22,fontWeight:400,color:"text.primary",textAlign:"center"},children:t}):t,typeof o=="string"?n.jsx(a,{sx:{mt:1,fontSize:14,color:"text.secondary",textAlign:"center"},children:o}):o,n.jsx(a,{sx:{mt:3},children:b})]})}const E=w("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|