@abtnode/webapp 1.16.51-beta-20250904-031834-c611f059 → 1.16.51-beta-20250905-023351-70af144b
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-B454wUKi.js → AdapterDayjs-V7RXKqyP.js} +1 -1
- package/dist/assets/{Add-CobzoIKJ.js → Add-7-eXJOKT.js} +1 -1
- package/dist/assets/ArrowDropDown-B9aDIKPi.js +1 -0
- package/dist/assets/{Autocomplete-C06SKe4H.js → Autocomplete-CWbaCMBc.js} +1 -1
- package/dist/assets/{Breadcrumbs-BWQdjcIC.js → Breadcrumbs-BeUS9EzN.js} +1 -1
- package/dist/assets/{ButtonGroup-D2nbA04k.js → ButtonGroup-88wnT1Nl.js} +1 -1
- package/dist/assets/{CSSTransition-BIUxaspZ.js → CSSTransition-BhKCAa_k.js} +1 -1
- package/dist/assets/{CallMerge-Dkt7zPa_.js → CallMerge-DyslC22y.js} +1 -1
- package/dist/assets/{CardContent-B-jtI1ie.js → CardContent-CWjONtVx.js} +1 -1
- package/dist/assets/{ChevronLeft-T8dPGT4o.js → ChevronLeft-DsCa_2Hj.js} +1 -1
- package/dist/assets/{ChevronRight-BmNY6NuE.js → ChevronRight-Dh1NhSQh.js} +1 -1
- package/dist/assets/{Clear-DSDAa0M4.js → Clear-vz3__EK4.js} +1 -1
- package/dist/assets/{DeleteOutline-BRh_jEgm.js → DeleteOutline-BQz9po9Q.js} +1 -1
- package/dist/assets/{Done-DQFntFgi.js → Done-Bk5S0dZ-.js} +1 -1
- package/dist/assets/{Edit-CvtjYyT4.js → Edit-ZWYQTIT_.js} +1 -1
- package/dist/assets/{ErrorOutline-jpwCi-bt.js → ErrorOutline-CWTup7vD.js} +1 -1
- package/dist/assets/{FilterList-DcOJVDM2.js → FilterList-DOLZBYMl.js} +1 -1
- package/dist/assets/{Google-DEgZE56h.js → Google-DjCWLWBZ.js} +1 -1
- package/dist/assets/{HelpOutline-RoslCWCH.js → HelpOutline-BIIJduw6.js} +1 -1
- package/dist/assets/{Launch-L3zM7z2U.js → Launch-DOQcWt9h.js} +1 -1
- package/dist/assets/{Link-DHlqc6YG.js → Link-D0HMFRxo.js} +1 -1
- package/dist/assets/{ListItemButton-D_ncPLiT.js → ListItemButton-hdq-8LOD.js} +1 -1
- package/dist/assets/{ListSubheader-CtIfn5EF.js → ListSubheader-OXmzqw9E.js} +1 -1
- package/dist/assets/{LoadingButton-Dw3__mtY.js → LoadingButton-Dd30R6FK.js} +1 -1
- package/dist/assets/{MoreVert-DH4Y2k9h.js → MoreVert-CRSB-gtE.js} +1 -1
- package/dist/assets/{OpenInNew-MxPsaq-U.js → OpenInNew-nb9brzvh.js} +1 -1
- package/dist/assets/{Refresh-DMoyFjzc.js → Refresh-DpCUQ-hQ.js} +1 -1
- package/dist/assets/{Search-BvWmcM2k.js → Search-Caj8zEyB.js} +1 -1
- package/dist/assets/{Stepper-DNM_ADcd.js → Stepper-xU4PwGHV.js} +1 -1
- package/dist/assets/{Switch-CAccGI-e.js → Switch-Cr0eK23s.js} +1 -1
- package/dist/assets/{TableSearch-BuzsZxHI.js → TableSearch-BVy-Zwre.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-DuGWJmyI.js → ToggleButtonGroup-DfdLS7WR.js} +1 -1
- package/dist/assets/{Verified-CfeEGfMV.js → Verified-QBG89RkJ.js} +1 -1
- package/dist/assets/{VerifiedUser-BBYo9Pc2.js → VerifiedUser-DRV2TIup.js} +1 -1
- package/dist/assets/{ViewList-CPmudwlq.js → ViewList-D3SEslCd.js} +1 -1
- package/dist/assets/{_createAggregator-DeRGH35v.js → _createAggregator-C1jyyLx1.js} +1 -1
- package/dist/assets/{actions-DkMO_r4a.js → actions-BhT4KCkB.js} +1 -1
- package/dist/assets/{actions-N_sfYn6F.js → actions-PgvlZmiV.js} +1 -1
- package/dist/assets/{agreement-DJUZzBc6.js → agreement-DA33xTFi.js} +1 -1
- package/dist/assets/api-BMlRo0OB.js +1 -0
- package/dist/assets/{appearance-BHLySBfx.js → appearance-BPq1UJTg.js} +1 -1
- package/dist/assets/{audit-logs-D-nTmyPS.js → audit-logs-Ctg35AJy.js} +2 -2
- package/dist/assets/{base-chart-DQ401Lk6.js → base-chart-Dx4PwDO4.js} +1 -1
- package/dist/assets/bedrock-yFRPpe__.png +0 -0
- package/dist/assets/{blocklet-DISJHp6B.js → blocklet-CdI4-ak7.js} +1 -1
- package/dist/assets/chain-CXX76TQL.js +6 -0
- package/dist/assets/{click-to-copy-DX5jjk2s.js → click-to-copy-C8Sc78ZH.js} +1 -1
- package/dist/assets/client-ChcYsV1G.js +1 -0
- package/dist/assets/cloneDeep-CQZK-s_V.js +1 -0
- package/dist/assets/{collapse-D0TcL3yf.js → collapse-BmNnb9sz.js} +1 -1
- package/dist/assets/config-navigation-8rTODeF1.js +457 -0
- package/dist/assets/{connect-to-2qqraFvt.js → connect-to-DfZIDYiw.js} +5 -5
- package/dist/assets/{cssMode-Cgd7qVp_.js → cssMode-BF4q4okU.js} +1 -1
- package/dist/assets/deepseek-C3x42pq3.png +0 -0
- package/dist/assets/{delete-confirm-B_vil0gb.js → delete-confirm-D-z4OiCT.js} +1 -1
- package/dist/assets/{depsEqual-D6ZeS2iD.js → depsEqual-Cr14y622.js} +1 -1
- package/dist/assets/{detail-BHQbwbfp.js → detail-DST4nwih.js} +3 -3
- package/dist/assets/{domains-BLJOV5Qw.js → domains-DrwaxbvS.js} +1 -1
- package/dist/assets/doubao-yPqHSkLx.png +0 -0
- package/dist/assets/{download-C8Jsk4ZH.js → download-OPjh7Dhu.js} +1 -1
- package/dist/assets/{edit.svg-C6CO_uuX.js → edit.svg-BhoBkiKe.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-JDbaITlA.js +1 -0
- package/dist/assets/engine-siiM_CrH.js +1 -0
- package/dist/assets/{freemarker2-C40Z2ucU.js → freemarker2-CsYcx0mG.js} +1 -1
- package/dist/assets/gemini-DffKpc81.png +0 -0
- package/dist/assets/{get-safe-url-CMpu7B-v.js → get-safe-url-D4QANS7R.js} +1 -1
- package/dist/assets/getValidReactChildren-BK9M6ULL.js +1 -0
- package/dist/assets/google-DT1VSJ0m.png +0 -0
- package/dist/assets/{graphqlMode-3TdkToR6.js → graphqlMode-CEuXGwU0.js} +2 -2
- package/dist/assets/{handlebars-CsECaVWw.js → handlebars-UHGxvaSD.js} +1 -1
- package/dist/assets/{html-CSc4ZJZE.js → html-C1vTBkRn.js} +1 -1
- package/dist/assets/{html-title-Cx_lv4tS.js → html-title-CMu--CLy.js} +1 -1
- package/dist/assets/{htmlMode-BeKAEeTT.js → htmlMode-BggN4Rb6.js} +1 -1
- package/dist/assets/ideogram-REIjy0Er.png +0 -0
- package/dist/assets/{iframe-DYiNwxlH.js → iframe-CvI--k7K.js} +1 -1
- package/dist/assets/{index-BGD5220j.js → index-6cB3i_74.js} +1 -1
- package/dist/assets/{index-CNz77lZT.js → index-B1mp7zTp.js} +1 -1
- package/dist/assets/{index-aJIykGoH.js → index-B8SKOyVZ.js} +1 -1
- package/dist/assets/{index-BvAtsQd5.js → index-BCjznEDD.js} +103 -103
- package/dist/assets/{index-5KlKCCpC.js → index-BEUFNuBP.js} +1 -1
- package/dist/assets/{index-CB69gPUu.js → index-BNMMf79b.js} +1 -1
- package/dist/assets/{index-CxDumZ3y.js → index-BVkuT-iA.js} +9 -9
- package/dist/assets/{index-f3wFrDOj.js → index-BcCAYOEg.js} +1 -1
- package/dist/assets/{index-BW4Ntw6W.js → index-BcZW_Njr.js} +1 -1
- package/dist/assets/{index-DBip_c5f.js → index-BrouHktD.js} +5 -5
- package/dist/assets/{index-CYZ78qFI.js → index-BwjlL2Kh.js} +1 -1
- package/dist/assets/{index-Cn-6wztm.js → index-C5Qu9Vfw.js} +1 -1
- package/dist/assets/{index-DyeX_qg7.js → index-CIUJRz-P.js} +1 -1
- package/dist/assets/{index-S7znBZmC.js → index-CIYlTEmt.js} +7 -7
- package/dist/assets/{index-C1LQFMVr.js → index-CJBx_cpm.js} +1 -1
- package/dist/assets/{index-Bi0nnFEo.js → index-COelK26a.js} +1 -1
- package/dist/assets/{index-BitxghdI.js → index-CXFs83DK.js} +18 -18
- package/dist/assets/index-CaVHeI69.js +363 -0
- package/dist/assets/{index-B4sphWdh.js → index-Cbv8PaaQ.js} +1 -1
- package/dist/assets/{index-bvnJ1qfi.js → index-CcPSAXJC.js} +1 -1
- package/dist/assets/{index-CqgcvSrI.js → index-Cfv8rye0.js} +1 -1
- package/dist/assets/{index-Cg9PrZFL.js → index-Cjda8MxV.js} +1 -1
- package/dist/assets/{index-CDf35iqn.js → index-CwJTlpdS.js} +2 -2
- package/dist/assets/index-D2gjCQvJ.js +177 -0
- package/dist/assets/{index-CvPFmloQ.js → index-DFNWDU08.js} +1 -1
- package/dist/assets/{index-KMm33XHL.js → index-DJt0P9UZ.js} +1 -1
- package/dist/assets/{index-hrs7Mhjt.js → index-DN15vW-d.js} +1 -1
- package/dist/assets/{index-JGiTsamG.js → index-DVP4mis5.js} +1 -1
- package/dist/assets/{index-DPRVx4ek.js → index-DWNLuD8k.js} +3 -3
- package/dist/assets/{index-Dsoqycrd.js → index-D_HvYLZX.js} +2 -2
- package/dist/assets/{index-BynKznHT.js → index-DlumR6-r.js} +1 -1
- package/dist/assets/{index-CKY6mjuF.js → index-DxswKF4l.js} +1 -1
- package/dist/assets/{index-Pr52m2qZ.js → index-JPRaNDiB.js} +1 -1
- package/dist/assets/{index-BpFBX3ml.js → index-KlyXfxtH.js} +1 -1
- package/dist/assets/{index-Dv-ACCVn.js → index-PupDr-tS.js} +1 -1
- package/dist/assets/{index-CZ8jsJu9.js → index-TD9tpMf3.js} +1 -1
- package/dist/assets/{index-Dqnz6VXa.js → index-UUvY9lTK.js} +1 -1
- package/dist/assets/{index-CKv8PhTc.js → index-e4cQdlVT.js} +1 -1
- package/dist/assets/index-ee21MdrR.js +1 -0
- package/dist/assets/{index-BSljJZ1V.js → index-fVX8tL-Q.js} +3 -3
- package/dist/assets/{index-BmTUrmH1.js → index-gFJpaRWb.js} +1 -1
- package/dist/assets/{index-Bo967wkH.js → index-gXZxZJIx.js} +1 -1
- package/dist/assets/{index-BIgUqZXA.js → index-hwjSVkr9.js} +1 -1
- package/dist/assets/{index-BWDsxii_.js → index-oN0VLX7B.js} +1 -1
- package/dist/assets/{index-C2JKqeAe.js → index-zmLURVwA.js} +1 -1
- package/dist/assets/{index.esm-LjN1Hm60.js → index.esm-BMMBbvkk.js} +1 -1
- package/dist/assets/{install-from-url-CCmRaPIQ.js → install-from-url-BVVKjfjP.js} +1 -1
- package/dist/assets/{invitation-DNn6S4p1.js → invitation-COAlxja2.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-DceJmX9J.js → is-path-prefix-equal-DXaCbZpO.js} +1 -1
- package/dist/assets/{item-Bg87F2Pj.js → item-C-IQVzix.js} +9 -9
- package/dist/assets/{javascript-CImnwSoz.js → javascript-Bgq9DttZ.js} +1 -1
- package/dist/assets/{jsonMode-Bj5PmjjW.js → jsonMode-gicj4lsZ.js} +1 -1
- package/dist/assets/{liquid-CmLkJX3a.js → liquid-Ci2GleTa.js} +1 -1
- package/dist/assets/{list-header-C3WTZrdD.js → list-header-Bimu_qjE.js} +1 -1
- package/dist/assets/{log-Dy47Mxwd.js → log-Do7yF-hd.js} +1 -1
- package/dist/assets/{lottie-react.esm-DxER1I_l.js → lottie-react.esm-DfMKPb7z.js} +1 -1
- package/dist/assets/{mdx-BtCUya4x.js → mdx-eB0FmO6P.js} +1 -1
- package/dist/assets/{memory-Ca4JR3KI.js → memory-BCE6QiNB.js} +1 -1
- package/dist/assets/{metric-CDR_xfqd.js → metric-Bk0iXTai.js} +1 -1
- package/dist/assets/ollama-C7MZn2d_.png +0 -0
- package/dist/assets/omit-DZngMfUZ.js +1 -0
- package/dist/assets/openai-DlpqJdrb.png +0 -0
- package/dist/assets/{overview-Bvtmyxun.js → overview-DltjzkWj.js} +1 -1
- package/dist/assets/{permission-EJYXw2v1.js → permission-nS6Be9Zz.js} +1 -1
- package/dist/assets/poe-B588TgZu.png +0 -0
- package/dist/assets/{preference-CXe14Osu.js → preference-BcV3F-Xa.js} +3 -3
- package/dist/assets/{python-CLcFjgec.js → python-EI0UxD3D.js} +1 -1
- package/dist/assets/{raf-schd.esm-9isuMxk8.js → raf-schd.esm-D8Xvrzgn.js} +1 -1
- package/dist/assets/{razor-BgYyruii.js → razor-BSy3NnVc.js} +1 -1
- package/dist/assets/rotate-session-key-6xIXKXc3.js +1 -0
- package/dist/assets/{runtime-B6StkUNa.js → runtime-Dxydq6o1.js} +1 -1
- package/dist/assets/schema-BYsNslfD.js +1 -0
- package/dist/assets/sdk-BLZzaYH6.js +1 -0
- package/dist/assets/{service-BAFeuouA.js → service-BiVWc9jf.js} +1 -1
- package/dist/assets/{shorten-label-B0m7WWm_.js → shorten-label-1yenXb9Y.js} +1 -1
- package/dist/assets/{simple-select-D5DhspLn.js → simple-select-Bt3Ltwm7.js} +1 -1
- package/dist/assets/{spaces-BkLlvJlV.js → spaces-BnSCxjeY.js} +1 -1
- package/dist/assets/{status-D7zoO7lM.js → status-BYLk6wlC.js} +1 -1
- package/dist/assets/{status-5TKR4Tl2.js → status-CXAtxXK1.js} +1 -1
- package/dist/assets/{switch-control-BJ9fbw3I.js → switch-control-D5SPzkUx.js} +1 -1
- package/dist/assets/{table-icons-DLsn7GMI.js → table-icons-BGs1mthN.js} +1 -1
- package/dist/assets/{team-16Ujfno4.js → team-BlgLSbQd.js} +1 -1
- package/dist/assets/{toLower-CS_hmd2O.js → toLower-BiqFoOo1.js} +1 -1
- package/dist/assets/toUpper-BMdlX8ly.js +1 -0
- package/dist/assets/{traffic-BxsvLDRQ.js → traffic-d8ue0hO5.js} +1 -1
- package/dist/assets/{tsMode-CN8rErtn.js → tsMode-DFSmR0ZD.js} +1 -1
- package/dist/assets/{typescript-DSffZA-5.js → typescript-Dvh-IrHb.js} +1 -1
- package/dist/assets/{url-evaluation-DFMzofgY.js → url-evaluation-DFEEqTh-.js} +1 -1
- package/dist/assets/{url-join-D3PSxY2b.js → url-join-Dra-Zi4G.js} +1 -1
- package/dist/assets/{use-mobile-fMZ70tR1.js → use-mobile-BOq_qktK.js} +1 -1
- package/dist/assets/{use-mobile-DNj1DdUP.js → use-mobile-FV0M1ZqW.js} +1 -1
- package/dist/assets/{useAsync-BD45gcWH.js → useAsync-B7FuCRJD.js} +1 -1
- package/dist/assets/{useAsyncRetry-D0_e0qFz.js → useAsyncRetry-C1rqgcS3.js} +1 -1
- package/dist/assets/{useLocalStorage-bjVpdIUp.js → useLocalStorage-BjyUhOL-.js} +1 -1
- package/dist/assets/{useThemeProps-BqbmQYZm.js → useThemeProps-BZz8f5dF.js} +1 -1
- package/dist/assets/{util-DwHVn3ka.js → util-vH7l3iJe.js} +1 -1
- package/dist/assets/{wait-container-BI50IOrN.js → wait-container-4i1AkyPx.js} +1 -1
- package/dist/assets/{without-wallet-CmBFe6LE.js → without-wallet-CG4TWMeN.js} +1 -1
- package/dist/assets/{wrap-locale-C-kUviiw.js → wrap-locale-CCw957fx.js} +1 -1
- package/dist/assets/{xml-DlNxIUrd.js → xml-7zq5MXwn.js} +1 -1
- package/dist/assets/{yaml-kJOY6oFY.js → yaml-DdyDZl-6.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-wCDjkm6N.js +0 -1
- package/dist/assets/Slider-CaQ4_HVa.js +0 -1
- package/dist/assets/api-BmtVyz86.js +0 -1
- package/dist/assets/chain-H_ZkBTRb.js +0 -6
- package/dist/assets/client-mu06Cy2w.js +0 -1
- package/dist/assets/cloneDeep-DuTUFwXr.js +0 -1
- package/dist/assets/config-navigation-BUN_bn5b.js +0 -457
- package/dist/assets/emotion-cache.browser.esm-Cm-YvbUu.js +0 -1
- package/dist/assets/engine-0m3b2g2H.js +0 -1
- package/dist/assets/getValidReactChildren-CFOO2Xyb.js +0 -1
- package/dist/assets/index-CPqsIwYV.js +0 -161
- package/dist/assets/index-CmKeQSLC.js +0 -1
- package/dist/assets/index-Cst_GbVp.js +0 -363
- package/dist/assets/omit-Cwb_YFfu.js +0 -1
- package/dist/assets/rotate-session-key-CQB3pXN4.js +0 -1
- package/dist/assets/schema-Wv54HyG9.js +0 -1
- package/dist/assets/sdk-B2qcFc0E.js +0 -1
- package/dist/assets/toUpper-BiLpQm9G.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-
|
|
1
|
+
import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-BCjznEDD.js";import{u as L}from"./useLocalStorage-BjyUhOL-.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-C-IQVzix.js";import{e as D}from"./engine-siiM_CrH.js";import{g as U}from"./get-safe-url-D4QANS7R.js";import{P as V}from"./permission-nS6Be9Zz.js";import{A as Le}from"./ArrowDropDown-B9aDIKPi.js";import{B as Ee}from"./Breadcrumbs-BeUS9EzN.js";import"./Verified-QBG89RkJ.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./Search-Caj8zEyB.js";import"./index-BNMMf79b.js";import"./blocklet-CdI4-ak7.js";import"./Autocomplete-CWbaCMBc.js";import"./ListSubheader-OXmzqw9E.js";import"./VerifiedUser-DRV2TIup.js";import"./Add-7-eXJOKT.js";import"./Launch-DOQcWt9h.js";import"./Done-Bk5S0dZ-.js";import"./DeleteOutline-BQz9po9Q.js";import"./delete-confirm-D-z4OiCT.js";import"./click-to-copy-C8Sc78ZH.js";import"./MoreVert-CRSB-gtE.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,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)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.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 Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{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?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ig as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ih as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ii as Ct,ij as Nt,$ as nt,ik as wt,il as Rt,im as Tt,io as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,ip as Lt,a4 as kt}from"./index-BvAtsQd5.js";import{d as Ft,H as at,g as Pt}from"./index-C2JKqeAe.js";import{R as _e,S as _t}from"./actions-DkMO_r4a.js";import{B as Bt}from"./index-BynKznHT.js";import{S as me}from"./shorten-label-B0m7WWm_.js";import{v as ot}from"./index-bvnJ1qfi.js";import{T as zt}from"./html-title-Cx_lv4tS.js";import{R as Wt}from"./Refresh-DMoyFjzc.js";import{D as Mt,g as Ht}from"./traffic-BxsvLDRQ.js";import{u as Kt}from"./use-mobile-DNj1DdUP.js";import"./FilterList-DcOJVDM2.js";import"./CSSTransition-BIUxaspZ.js";import"./emotion-cache.browser.esm-Cm-YvbUu.js";import"./index-JGiTsamG.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D6ZeS2iD.js";import"./index-CB69gPUu.js";import"./TableSearch-BuzsZxHI.js";import"./Search-BvWmcM2k.js";import"./Clear-DSDAa0M4.js";import"./MoreVert-DH4Y2k9h.js";import"./useLocalStorage-bjVpdIUp.js";import"./url-evaluation-DFMzofgY.js";import"./get-safe-url-CMpu7B-v.js";import"./ButtonGroup-D2nbA04k.js";import"./getValidReactChildren-CFOO2Xyb.js";import"./permission-EJYXw2v1.js";import"./index.esm-LjN1Hm60.js";import"./collapse-D0TcL3yf.js";import"./blocklet-DISJHp6B.js";import"./Switch-CAccGI-e.js";import"./iframe-DYiNwxlH.js";import"./ChevronLeft-T8dPGT4o.js";import"./ChevronRight-BmNY6NuE.js";import"./index-DBii9-f-.js";import"./base-chart-DQ401Lk6.js";import"./index-Pr52m2qZ.js";import"./AdapterDayjs-B454wUKi.js";import"./useThemeProps-BqbmQYZm.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"})),qt=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:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},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 Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(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:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}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=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,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:a,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:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{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:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=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",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{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:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{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:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.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:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
1
|
+
import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ie as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ig as et,v as Oe,f1 as tt,fo as ye,fI as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ih as Ct,ii as Nt,$ as nt,ij as wt,ik as Rt,il as Tt,im as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,io as Lt,a4 as kt}from"./index-BCjznEDD.js";import{d as Ft,H as at,g as Pt}from"./index-zmLURVwA.js";import{R as _e,S as _t}from"./actions-BhT4KCkB.js";import{B as Bt}from"./index-DlumR6-r.js";import{S as me}from"./shorten-label-1yenXb9Y.js";import{v as ot}from"./index-CcPSAXJC.js";import{T as zt}from"./html-title-CMu--CLy.js";import{R as Wt}from"./Refresh-DpCUQ-hQ.js";import{D as Mt,g as Ht}from"./traffic-d8ue0hO5.js";import{u as Kt}from"./use-mobile-FV0M1ZqW.js";import"./FilterList-DOLZBYMl.js";import"./CSSTransition-BhKCAa_k.js";import"./emotion-cache.browser.esm-JDbaITlA.js";import"./index-DVP4mis5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Cr14y622.js";import"./index-BNMMf79b.js";import"./TableSearch-BVy-Zwre.js";import"./Search-Caj8zEyB.js";import"./Clear-vz3__EK4.js";import"./MoreVert-CRSB-gtE.js";import"./useLocalStorage-BjyUhOL-.js";import"./url-evaluation-DFEEqTh-.js";import"./get-safe-url-D4QANS7R.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";import"./permission-nS6Be9Zz.js";import"./index.esm-BMMBbvkk.js";import"./collapse-BmNnb9sz.js";import"./blocklet-CdI4-ak7.js";import"./Switch-Cr0eK23s.js";import"./iframe-CvI--k7K.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./index-DBii9-f-.js";import"./base-chart-Dx4PwDO4.js";import"./index-JPRaNDiB.js";import"./AdapterDayjs-V7RXKqyP.js";import"./useThemeProps-BZz8f5dF.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"})),qt=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:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},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 Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(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:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}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=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,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:a,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:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{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:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=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",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{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:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{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:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.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:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|