@abtnode/blocklet-services 1.17.3-beta-20251125-042047-1bcefd39 → 1.17.3-beta-20251126-121502-d0926972
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/api/libs/connect/session.js +9 -3
- package/api/middlewares/verify-sig.js +5 -2
- package/api/routes/user-session.js +17 -3
- package/api/services/auth/session.js +65 -6
- package/dist/assets/{AdapterDayjs-BlYfODzx.js → AdapterDayjs-B2uxdBcK.js} +1 -1
- package/dist/assets/{Google-BOjQI1aW.js → Google-mmkrFmA4.js} +1 -1
- package/dist/assets/{access-control-BYpTK1Jx.js → access-control-BsrYt8sR.js} +1 -1
- package/dist/assets/{actions-DlChK31K.js → actions-BQZmpgjH.js} +1 -1
- package/dist/assets/{add-component-core-D0oHC7fD.js → add-component-core-DdA5-pKs.js} +35 -35
- package/dist/assets/add-resource-BwJJ0aia.js +1 -0
- package/dist/assets/{addon-BqtpB9zm.js → addon-DMnO8VZk.js} +2 -2
- package/dist/assets/{advanced-DOG5xuC6.js → advanced-D4bpKYrU.js} +2 -2
- package/dist/assets/{aigne-Riqgm3Lb.js → aigne-BKYy4lDi.js} +1 -1
- package/dist/assets/api-C1vNuLNj.js +1 -0
- package/dist/assets/{appearance-CXwP8Jne.js → appearance-CoZeiSDb.js} +1 -1
- package/dist/assets/{arrow-down.svg-HIktmc0V.js → arrow-down.svg-arX2hS9A.js} +1 -1
- package/dist/assets/{audit-logs-CW2G54hG.js → audit-logs-Tol8dkkk.js} +2 -2
- package/dist/assets/{authorize-BhLJa4gf.js → authorize-Bma44S9y.js} +1 -1
- package/dist/assets/{base-chart-DkkGeB5D.js → base-chart-Gh7OtL-d.js} +1 -1
- package/dist/assets/{base32-DJEJY-PH.js → base32-HmSqZ9zU.js} +1 -1
- package/dist/assets/bind-account-BHZb-y1l.js +1 -0
- package/dist/assets/{branding-DTSiDrBa.js → branding-CnmWjFbu.js} +1 -1
- package/dist/assets/branding-DhsDum88.js +1 -0
- package/dist/assets/{branding-DBSJc5kU.js → branding-Fj3LseIw.js} +5 -5
- package/dist/assets/{bundle-avatar-BDafezYn.js → bundle-avatar-CeDsDt5-.js} +1 -1
- package/dist/assets/button-M1tE0EM6.js +1 -0
- package/dist/assets/click-to-copy-COEss4SB.js +1 -0
- package/dist/assets/{cloneDeep-C11iVb3m.js → cloneDeep-D_9o-MDF.js} +1 -1
- package/dist/assets/{collapse-Cqxx6nMG.js → collapse-BlkBpbz3.js} +1 -1
- package/dist/assets/{complete-CXzJOrTx.js → complete-DetpIm2X.js} +2 -2
- package/dist/assets/{component-BULea2QE.js → component-Br_A0gxQ.js} +2 -2
- package/dist/assets/{config-DCtQn6vd.js → config-BZ68qemi.js} +5 -5
- package/dist/assets/{config-DZ1Y7Xq7.js → config-DaTqZM7S.js} +1 -1
- package/dist/assets/{config-BcSJ1q1-.js → config-hHQ1dQ0r.js} +1 -1
- package/dist/assets/{config-navigation-ByBnHQHM.js → config-navigation-CIiX_S1E.js} +2 -2
- package/dist/assets/{config-space-C_mTIBZt.js → config-space-DcxPvrsQ.js} +1 -1
- package/dist/assets/{confirm-Dbm1_K3V.js → confirm-CQifLVQz.js} +1 -1
- package/dist/assets/connect-BYne4RoU.js +1 -0
- package/dist/assets/{connect-CXsVfMPz.js → connect-DCXdY6aM.js} +1 -1
- package/dist/assets/connect-to-Dp0mJeqn.js +1 -0
- package/dist/assets/{content-layout-DpoiOm37.js → content-layout-CpbYUNJ8.js} +1 -1
- package/dist/assets/{create-passport-svg-k1mCsufD.js → create-passport-svg-hAgKE5uX.js} +1 -1
- package/dist/assets/createClass-D1NoiqdO.js +1 -0
- package/dist/assets/{dashboard-d3oO4-H7.js → dashboard-PCrwcW_N.js} +2 -2
- package/dist/assets/{delete-confirm-B7aTZIom.js → delete-confirm-DP77Lldw.js} +1 -1
- package/dist/assets/{did-address-BKqL0vbP.js → did-address-CLsSdiw3.js} +1 -1
- package/dist/assets/domain-DptzkTFQ.js +9 -0
- package/dist/assets/domain-action-card-DmLVoK6X.js +28 -0
- package/dist/assets/domains-Cj55weM5.js +1 -0
- package/dist/assets/{email-BePrl9bL.js → email-zUlL8Ooc.js} +1 -1
- package/dist/assets/{empty-spinner-CveVktQP.js → empty-spinner-DiVQXbse.js} +1 -1
- package/dist/assets/engine-Br5kqWzP.js +1 -0
- package/dist/assets/{exchange-passport-BDqV_u7J.js → exchange-passport-4jMKVLBc.js} +1 -1
- package/dist/assets/{form-B9hkpxrU.js → form-BhkklUts.js} +3 -3
- package/dist/assets/{form-text-input-gTokKFc6.js → form-text-input-BFhD3mCK.js} +1 -1
- package/dist/assets/{form-wrapper-BxqO_YSO.js → form-wrapper-B9XdbV9a.js} +1 -1
- package/dist/assets/{fuel-C6dmw1cw.js → fuel-_LHEMXNX.js} +1 -1
- package/dist/assets/{gen-access-key-Cjv8m7fR.js → gen-access-key-Cuu-iyxE.js} +1 -1
- package/dist/assets/{gen-simple-access-key-eehxq854.js → gen-simple-access-key-ud5DXiqY.js} +1 -1
- package/dist/assets/get-safe-url-baxNHkAA.js +1 -0
- package/dist/assets/{home-CwhAaIFo.js → home-D-jA_4Lm.js} +1 -1
- package/dist/assets/{iframe-DEV2d5VF.js → iframe-DwMwGxmX.js} +1 -1
- package/dist/assets/{index-DDc9u4Rr.js → index-B1hEtoFm.js} +1 -1
- package/dist/assets/{index-C4kgQ8sF.js → index-B3nY7xOz.js} +13 -13
- package/dist/assets/{index-CrVvptJv.js → index-B65qJcbt.js} +1 -1
- package/dist/assets/{index-Bqc4K0v7.js → index-BLT40lDy.js} +8 -8
- package/dist/assets/{index-BnfMaesI.js → index-BNBVWXSX.js} +2 -2
- package/dist/assets/{index-CqaM-EOG.js → index-BO3UQZPi.js} +1 -1
- package/dist/assets/{index-DwkwZleK.js → index-BQyVf1E3.js} +1 -1
- package/dist/assets/{index-B7KG9373.js → index-BWgjTPxl.js} +1 -1
- package/dist/assets/{index-Bm3mNpuQ.js → index-BcssdfWc.js} +1 -1
- package/dist/assets/{index-hlBFhmKM.js → index-ByEQy1Lz.js} +11 -11
- package/dist/assets/index-C3PPGtfI.js +6 -0
- package/dist/assets/{index-BojWO9M6.js → index-CR-yimk0.js} +4 -4
- package/dist/assets/index-ClXqfbDZ.js +1 -0
- package/dist/assets/{index-BjgDA6OD.js → index-CoJqP_N2.js} +1 -1
- package/dist/assets/index-CozzYt0Z.js +7 -0
- package/dist/assets/{index-CM_wIB2i.js → index-Cpsil-_J.js} +5 -5
- package/dist/assets/{index-JqMHvzVF.js → index-Cvr1OSm0.js} +1 -1
- package/dist/assets/{index-0wVxGFHL.js → index-D0XVz0dc.js} +1 -1
- package/dist/assets/{index-BNrs0qJE.js → index-D45cjNSM.js} +1 -1
- package/dist/assets/{index-B0rTBLoN.js → index-DBBPnrYI.js} +1 -1
- package/dist/assets/{index-BQCe_Idq.js → index-DDNvzM4M.js} +7 -7
- package/dist/assets/{index-BDvewqjE.js → index-DYMBrhSA.js} +1 -1
- package/dist/assets/{index-BHAa27yd.js → index-D_l_jjH3.js} +2 -2
- package/dist/assets/{index-D_y60Y0w.js → index-DjE2GQIM.js} +2 -2
- package/dist/assets/index-Dr1AOLd_.js +30 -0
- package/dist/assets/index-DxlME7t_.js +120 -0
- package/dist/assets/{index-C3X2Qt8p.js → index-KzZiqY9D.js} +5 -5
- package/dist/assets/index-N6YyFqDu.js +1 -0
- package/dist/assets/{index-DO0bEcmC.js → index-auhzedGi.js} +1 -1
- package/dist/assets/index-kD1YmpMU.js +55 -0
- package/dist/assets/{index-CnqI9e6Y.js → index-kzb9GjyJ.js} +1 -1
- package/dist/assets/{index-4y23Ltxs.js → index-s6v6fZUe.js} +4 -4
- package/dist/assets/{index-BIur1cqW.js → index-xERuGIw0.js} +133 -131
- package/dist/assets/{invitation-kL0fwsbQ.js → invitation-gK2vIEsH.js} +2 -2
- package/dist/assets/{invitations-BvSEdJgK.js → invitations-lfws_T2N.js} +1 -1
- package/dist/assets/{invite--GT60aaK.js → invite-CGloPprm.js} +1 -1
- package/dist/assets/{isURL-BxH0AREx.js → isURL-CDvz38EO.js} +2 -2
- package/dist/assets/{issue-passport-CTdhlhaA.js → issue-passport-Dl3X8TTW.js} +1 -1
- package/dist/assets/{item-Dc6RMbfp.js → item-CTQ1F-Dd.js} +1 -1
- package/dist/assets/{landing-page-DhS1Z20a.js → landing-page-DKcKat1r.js} +1 -1
- package/dist/assets/{launch-result-message-5HOBRYMn.js → launch-result-message--rgseiAA.js} +1 -1
- package/dist/assets/{layout-DHRHQ6Ja.js → layout-D1wjW1Oy.js} +1 -1
- package/dist/assets/list-DPsX8TMn.js +103 -0
- package/dist/assets/{list-Ck77b7zr.js → list-MeDKce8j.js} +1 -1
- package/dist/assets/{list-header-Q-5QUSB8.js → list-header-DOS7AnGs.js} +1 -1
- package/dist/assets/localization-CASCfNj1.js +1 -0
- package/dist/assets/{log-CItlTDaI.js → log-B9KcwZD3.js} +1 -1
- package/dist/assets/logger-6-51jSsQ.js +1 -0
- package/dist/assets/login-Cbb7F6Mu.js +1 -0
- package/dist/assets/{login-oauth-callback-2FXYOU0v.js → login-oauth-callback-f64z-iJf.js} +1 -1
- package/dist/assets/{logo-uploader-ePo6dEBe.js → logo-uploader-D6c2iUqg.js} +1 -1
- package/dist/assets/{lost-passport-ByGQpAao.js → lost-passport-CSoln1QB.js} +2 -2
- package/dist/assets/{observability-BrLAcYkS.js → observability-D1A-1uvj.js} +1 -1
- package/dist/assets/{omit-CPVfFmp-.js → omit-BSwpPhgW.js} +1 -1
- package/dist/assets/{open-window-B9a2n1ab.js → open-window-7JDNMA9V.js} +1 -1
- package/dist/assets/over-due-invoice-payment-CljuJ4kk.js +1 -0
- package/dist/assets/{overview-Bz-93aQu.js → overview-CI-TDe1L.js} +2 -2
- package/dist/assets/{page-header-bY0dwe6y.js → page-header-Dh_UA7fa.js} +1 -1
- package/dist/assets/passport-0dxK_pTH.js +1 -0
- package/dist/assets/{passport-item-02XietY5.js → passport-item-DwumTPQv.js} +1 -1
- package/dist/assets/{permission-DonMH4GO.js → permission-Blt9Onuq.js} +1 -1
- package/dist/assets/{playground-QvTAmNqS.js → playground-kZ9J2CEx.js} +1 -1
- package/dist/assets/preferences-OylPiHSa.js +1 -0
- package/dist/assets/profile-embed-CCdzwTKi.js +1 -0
- package/dist/assets/publish-resource-Adc4901F.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DQ9oGom7.js → react-beautiful-dnd.esm-CbCp5m8Z.js} +1 -1
- package/dist/assets/{react-stripe.esm-CT6ZhpE7.js → react-stripe.esm-C8Keba5n.js} +1 -1
- package/dist/assets/{required-BuZo1JHj.js → required-CgSsIuqu.js} +1 -1
- package/dist/assets/runtime-OGDYw4nO.js +1 -0
- package/dist/assets/{sanitize-C43KM91h.js → sanitize-aIE75FMz.js} +1 -1
- package/dist/assets/sdk-CxQIQdbk.js +1 -0
- package/dist/assets/{section-DDyoFT-o.js → section-tQK-hwwW.js} +1 -1
- package/dist/assets/{security-FyECMbS9.js → security-DEVrQWpZ.js} +3 -3
- package/dist/assets/{session-BTb8wl7v.js → session-CAj-TcUY.js} +1 -1
- package/dist/assets/{setup-ypEbm4Eq.js → setup-BT6-74rK.js} +1 -1
- package/dist/assets/{shorten-label-BiZLRE-N.js → shorten-label-JstixX67.js} +1 -1
- package/dist/assets/{simple-select-DtG1nFIX.js → simple-select-_qsehgaA.js} +1 -1
- package/dist/assets/{spaces-DYs0OAYx.js → spaces-B6flHcN-.js} +1 -1
- package/dist/assets/{start-C4TxbQLy.js → start-BMKAy5mb.js} +1 -1
- package/dist/assets/{starting-progress-Chj0CxY0.js → starting-progress-SNgrsu02.js} +1 -1
- package/dist/assets/status-GY7lihPg.js +1 -0
- package/dist/assets/{step-actions-DH38z3VU.js → step-actions-BcFE8m2n.js} +1 -1
- package/dist/assets/{studio-Bp0H4t0T.js → studio-BkTwhFSX.js} +1 -1
- package/dist/assets/{switch-control-DwAlFBVc.js → switch-control-DVE8MCqI.js} +1 -1
- package/dist/assets/{table-tips-Ccm9jBpV.js → table-tips-DMkRZoRQ.js} +1 -1
- package/dist/assets/team-DANl8A6y.js +146 -0
- package/dist/assets/traffic-D_pUHfvx.js +1 -0
- package/dist/assets/{transfer-BG7xWrub.js → transfer-3jaJ_59b.js} +1 -1
- package/dist/assets/{unsubscribe-DSkyz2VM.js → unsubscribe-zGPKbsNi.js} +1 -1
- package/dist/assets/{use-app-logo-BFST6ES5.js → use-app-logo-mH-ZWGvv.js} +1 -1
- package/dist/assets/{use-mobile-BGG7EyYb.js → use-mobile-BdZU3Qy2.js} +1 -1
- package/dist/assets/{use-mobile-yOnqxyr6.js → use-mobile-nqweJXIG.js} +1 -1
- package/dist/assets/{use-server-logo-CTR2UZFf.js → use-server-logo-YhCrW0Nr.js} +1 -1
- package/dist/assets/{use-window-close-dG-tZxWF.js → use-window-close-B1fcc1UV.js} +1 -1
- package/dist/assets/{useAsync-5gLXHIip.js → useAsync-CuuTq_2R.js} +1 -1
- package/dist/assets/{useAsync-tRHUJQgE.js → useAsync-Di_jotad.js} +1 -1
- package/dist/assets/{useAsyncRetry-MDM8jCoS.js → useAsyncRetry-DhVFzdPo.js} +1 -1
- package/dist/assets/{useLocalStorage-CbmitI3m.js → useLocalStorage-BCYIznDQ.js} +1 -1
- package/dist/assets/user-center-gH0CVETg.js +126 -0
- package/dist/assets/{user-follower-C1piDLU7.js → user-follower-DYsXrJ7n.js} +1 -1
- package/dist/assets/{util-f7MvL9Y1.js → util-BN6NLUU2.js} +1 -1
- package/dist/assets/{util-DnwVtCGM.js → util-wCHwyw_F.js} +1 -1
- package/dist/assets/{vendor-arcblock-DBEMYjVA.js → vendor-arcblock-BRRIrPlW.js} +115 -114
- package/dist/assets/{vendor-hooks-L8kZVRUL.js → vendor-hooks-BeI8hpF9.js} +1 -1
- package/dist/assets/{vendor-mui-core-___CiWHn.js → vendor-mui-core-B62p29u8.js} +1 -1
- package/dist/assets/{vendor-mui-x-CYSdP1E1.js → vendor-mui-x-vSVDqxyB.js} +1 -1
- package/dist/assets/vendor-utils-DZwtp8ph.js +213 -0
- package/dist/assets/vendor-ux-k_TkMNDV.js +1563 -0
- package/dist/assets/{wait-connect-DZgpTTEq.js → wait-connect-Df9uvB6x.js} +1 -1
- package/dist/assets/{wizard-CJ7BZCtb.js → wizard-GCfJ08HB.js} +1 -1
- package/dist/assets/{wizard-components-B76v6J06.js → wizard-components-D_w2hIhz.js} +1 -1
- package/dist/assets/wrap-locale-Dgf6KVHX.js +1 -0
- package/dist/assets/{zh-DKry4WX-.js → zh-QBR-GmxX.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +49 -49
- package/dist/assets/add-resource-B2xSNzcX.js +0 -1
- package/dist/assets/api-DcGGeMWE.js +0 -1
- package/dist/assets/bind-account-D4LwpF_n.js +0 -1
- package/dist/assets/branding-9cA3lKG-.js +0 -1
- package/dist/assets/button-CjoOMC5b.js +0 -1
- package/dist/assets/click-to-copy-BiDS_MtA.js +0 -1
- package/dist/assets/connect-C-r3BWeJ.js +0 -1
- package/dist/assets/connect-to-CCVzHwv5.js +0 -1
- package/dist/assets/createClass-Bp8GWzB3.js +0 -1
- package/dist/assets/domain-action-card-EkcmMw2k.js +0 -28
- package/dist/assets/domain-m8Huj4md.js +0 -9
- package/dist/assets/domains-CAsFW9_K.js +0 -1
- package/dist/assets/engine-gKAOz9e-.js +0 -1
- package/dist/assets/get-safe-url-Co2dWyCH.js +0 -1
- package/dist/assets/index-B0WqCWI-.js +0 -120
- package/dist/assets/index-B6xBjnTX.js +0 -7
- package/dist/assets/index-BBwCodqz.js +0 -29
- package/dist/assets/index-B_fIpHt1.js +0 -1
- package/dist/assets/index-DQzM4GY2.js +0 -1
- package/dist/assets/index-DqFnyJKg.js +0 -6
- package/dist/assets/index-dtMLN8cM.js +0 -55
- package/dist/assets/list-T1fFhSa4.js +0 -103
- package/dist/assets/localization-CAOwdbCu.js +0 -1
- package/dist/assets/logger-QD2VS2Mb.js +0 -1
- package/dist/assets/login-D1WURf8R.js +0 -1
- package/dist/assets/over-due-invoice-payment-jpkjPsJv.js +0 -1
- package/dist/assets/passport-07OMj8Ls.js +0 -1
- package/dist/assets/preferences-BmgCps_-.js +0 -1
- package/dist/assets/profile-embed-CPAhwziI.js +0 -1
- package/dist/assets/publish-resource-Dh5_JPm1.js +0 -1
- package/dist/assets/runtime-DUjTUa1p.js +0 -1
- package/dist/assets/sdk-CsmOR8Bd.js +0 -1
- package/dist/assets/status-Cui710vU.js +0 -1
- package/dist/assets/team-CHzBr-zx.js +0 -146
- package/dist/assets/traffic-Bqz8iC_Z.js +0 -1
- package/dist/assets/user-center-B8WTEd4Q.js +0 -126
- package/dist/assets/vendor-utils-Doa0RxLS.js +0 -213
- package/dist/assets/vendor-ux-pxYpYMxD.js +0 -1563
- package/dist/assets/wrap-locale-Dhik76XD.js +0 -1
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import{r as o}from"./vendor-react-CUXIiAnY.js";import{j as t,b4 as _,W as n,D as F,n as xe,b0 as ye,co as be,cu as ve,cv as je,cw as we,ak as g,T as q,Q as ke,a$ as te,a3 as Ie,s as Me,J as Re,I as Ce,at as Ae}from"./vendor-mui-core-___CiWHn.js";import{a as D,b as O,h as Te}from"./vendor-hooks-L8kZVRUL.js";import{V as Q,z as Ne,U as ne,p as re,S as $e}from"./vendor-ux-pxYpYMxD.js";import{t as Se}from"./server-logo-notext.svg-DHxZ1bRk.js";import{B as ze}from"./bundle-avatar-BDafezYn.js";import{a as Le,g as se,i as ie,b as oe,c as V,M as ae,d as Ee,m as De,e as Be,f as Pe,h as qe,j as Ve,k as _e,l as Fe,n as Oe,N as Ue}from"./team-CHzBr-zx.js";import{R as He,J as We,C as J,a as U}from"./vendor-utils-Doa0RxLS.js";import{ar as Qe,as as Je,at as Ke,c as Xe,_ as Ge}from"./index-BIur1cqW.js";import{p as Ye}from"./util-f7MvL9Y1.js";function le({blocklet:e,style:r={},size:s=40,...i}){const l=Le({blocklet:e,square:!0}),{variant:u}=i;return t.jsx(_,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},r),...i,children:t.jsx("img",{src:l,alt:"",style:{width:s}})})}le.propTypes={blocklet:n.object.isRequired,style:n.object,size:n.oneOfType([n.number,n.string])};function Ze(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function K({value:e="",shouldUpdate:r=!1,...s}){const{locale:i}=Q(),[l,u]=o.useState(0);if(o.useEffect(()=>{let d;if(r){const p=new Date(e).getTime(),y=Date.now(),v=Math.abs(Math.floor((p-y)/1e3)),b=()=>{u(k=>{const C=Math.random()*1e3;return parseFloat((k+C).toFixed(4))})};v<60?d=setInterval(b,1e3):v<60*60?d=setInterval(b,6e4):d=setInterval(b,36e5)}return()=>{clearInterval(d)}},[e,l,r]),!e)return"-";const m=Ze(e);return t.jsx(Ne,{value:m,locale:i,...s})}K.propTypes={value:n.any,shouldUpdate:n.bool};const et={error:je,warning:ve,info:be,success:ye};ce.propTypes={severity:n.oneOf(["error","warning","info","success"]).isRequired,size:n.number};function ce({severity:e="info",size:r=32}){const s=F(),l=D(()=>({error:s.palette.error.main,warning:s.palette.warning.main,info:s.palette.info.main,success:s.palette.success.main}))[e],u=et[e],m=xe(l,.1);return t.jsx(_,{sx:{width:r,height:r,bgcolor:m,color:l},children:t.jsx(u,{fontSize:"small"})})}const tt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},rt={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},st={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},Z={comment:{icon:tt,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nt,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:rt,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:st,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:it,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};de.propTypes={activity:n.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:n.number};function de({activity:e,size:r=32}){const s=Z[e]||Z.comment,i=s.icon;return t.jsx(_,{sx:{bgcolor:s.bgColor,color:s.color,width:r,height:r},children:s.renderType==="emoji"?t.jsx("span",{style:{fontSize:"14px"},children:i}):t.jsx(ne,{icon:i})})}const H={avatar:n.string,fullName:n.string,did:n.string};function W({actor:e,size:r,teamDid:s="",inService:i=!1,showName:l=!1}){const u=D(()=>({...e,avatar:e?.avatar?Ye(e.avatar,s,i):null}),[e,s,i]),m=d=>{e&&(d.stopPropagation(),window.open(We(J(Xe.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),d.customPreventRedirect=!0)};return t.jsxs(g,{onClick:m,role:"button",style:{cursor:"pointer"},title:e?.fullName||"",sx:{display:"flex",alignItems:"center",gap:1},children:[u.avatar?t.jsx(Qe,{user:u,showDid:!0,cardType:Ke.AvatarOnly,infoType:Je.Minimal,avatarSize:r,shape:"circle",sx:{width:r,height:r,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):t.jsx(_,{sx:{width:r,height:r}}),l&&t.jsx("span",{children:e?.fullName})]})}W.propTypes={actor:n.shape(H).isRequired,size:n.number.isRequired,teamDid:n.string,inService:n.bool,showName:n.bool};X.propTypes={actors:n.oneOfType([n.shape(H),n.arrayOf(n.shape(H))]).isRequired,size:n.number,maxDisplay:n.number,teamDid:n.string,inService:n.bool,showName:n.bool,avatarFallback:n.node};function X({actors:e,size:r=32,maxDisplay:s=9,teamDid:i="",inService:l=!0,showName:u=!1,avatarFallback:m=null}){const d=D(()=>{const p=Array.isArray(e)?e:[e];return He(p,"did").filter(Boolean)},[e]);return d.length===1||!d.length?t.jsx(W,{actor:d[0],size:r,teamDid:i,inService:l,showName:u}):t.jsx(we,{total:d.length,renderSurplus:p=>p<100?t.jsxs("span",{children:["+",p]}):t.jsx("span",{children:"99+"}),max:s,sx:{justifyContent:"flex-end",height:`${r}px`,".MuiAvatar-root":{width:`${r}px`,height:`${r}px`,fontSize:`${r/2.5}px`,border:0,zIndex:2}},children:d.map((p,y)=>p?.avatar?t.jsx(W,{actor:p,size:r,teamDid:i,inService:l},p?.did||y):m)})}const ee=3;pe.propTypes={notification:n.object.isRequired,isMultiple:n.bool,blocklet:n.object,mountPoint:n.string,avatarFallback:n.node};ue.propTypes={notification:n.object.isRequired,mountPoint:n.string};he.propTypes={items:n.array.isRequired,activity:n.object.isRequired,blocklet:n.object,mountPoint:n.string,viewMoreLink:n.string,avatarFallback:n.node};function ue({notification:e,mountPoint:r=""}){const{activity:s}=e,{type:i,meta:l={}}=s||{},u=oe({activity:s,users:[e?.actorInfo],actors:[e?.activity?.actor],mountPoint:r});return U(s)||!s.type||!s.actor||U(s.target)?null:t.jsxs(g,{children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:.5,wordBreak:"break-all"},children:u}),l?t.jsx(ae,{meta:l,type:i}):null]})}function he({items:e,activity:r,blocklet:s,mountPoint:i="",viewMoreLink:l="",avatarFallback:u=null}){const m=F(),{t:d}=Q(),p=D(()=>s?.did||s?.meta?.did||"",[s]),{locale:y}=o.useContext(re),v=D(()=>!U(r.meta)&&Object.values(r.meta).some(a=>a!=null),[r]),b=oe({activity:r,users:e.map(a=>a?.actorInfo),actors:e.map(a=>a?.activity?.actor),mountPoint:i}),k=O(a=>{if(!a.activity)return null;const x=se(a.activity);return x?.metaLink?ie(x?.metaLink)?x?.metaLink:J(i,x.metaLink):null}),C=O((a,x)=>{if(!x)return;const h=k(x);h&&(window.open(h,"_blank"),a.customPreventRedirect=!0)}),$=e.length>ee,w=e.slice(0,ee);return t.jsxs(g,{sx:{width:"100%"},children:[t.jsx(q,{variant:"body1",sx:{color:"text.secondary",mb:3},children:b}),v?t.jsxs(g,{className:"sub-content",sx:{display:"flex",flexDirection:"column",gap:3},children:[w.map(a=>t.jsxs(g,{onClick:x=>C(x,a),sx:{display:"flex",flexDirection:"column",gap:1},children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[V(a)?t.jsx(X,{actors:a.actorInfo,size:32,teamDid:p}):u,t.jsx(q,{variant:"subtitle1",sx:{color:"text.primary"},children:V(a)?a?.actorInfo?.fullName:"System"})," ","·",t.jsx(K,{value:a.createdAt,locale:y,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),a.activity.meta?t.jsx(g,{sx:{pl:5},children:t.jsx(ae,{meta:a.activity.meta,type:a.activity.type})}):null]},a.id)),$&&l?t.jsx(g,{sx:{mt:1,display:"flex",justifyContent:"center"},children:t.jsxs(ke,{size:"large",variant:"text",component:te,href:l,target:"_blank",rel:"noopener noreferrer",onClick:a=>{a.customPreventRedirect=!0},children:[d("notification.viewMore")," ",t.jsx(ne,{icon:Ee,style:{marginLeft:4}})]})}):null]}):null]})}function pe({notification:e,isMultiple:r=!1,blocklet:s,mountPoint:i="",avatarFallback:l}){const u=D(()=>{if(!e.activity)return null;const m=se(e.activity);return m?.targetLink?ie(m?.targetLink)?m?.targetLink:J(i,m.targetLink):null},[e.activity,i]);return r?t.jsx(he,{items:e.items,activity:e.activity,blocklet:s,mountPoint:i,viewMoreLink:u,avatarFallback:l}):t.jsx(ue,{notification:e,mountPoint:i})}function me({notification:e}){const r=o.useMemo(()=>{const{actions:s,action:i}=e;let l=s??[];return!l.length&&i&&(l=[{name:"Visit",link:i}]),l},[e]);return r.length?t.jsx(g,{sx:{display:"flex",justifyContent:"start",flexWrap:"wrap",alignItems:"center",gap:1},children:r.map((s,i)=>t.jsxs(o.Fragment,{children:[t.jsx(te,{href:s.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:l=>{l.customPreventRedirect=!0},children:s.name},s.link),i<r.length-1?t.jsx(Ie,{orientation:"vertical",sx:{height:12,borderWidth:"1px"}}):null]},s.link))}):null}me.propTypes={notification:n.object.isRequired};const ot=Me(g)`
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
height: 100%;
|
|
7
|
-
min-height: 500px;
|
|
8
|
-
color: #999;
|
|
9
|
-
.empty-icon {
|
|
10
|
-
margin: 10px 0;
|
|
11
|
-
}
|
|
12
|
-
`;function fe({children:e=null,...r}){const s=Ge(),l=F().palette.mode==="dark";return t.jsxs(ot,{...r,children:[t.jsx("img",{src:`${s.imgPrefix}/${l?"all-done-dark":"all-done-light"}.svg`,alt:"All Done",width:120,height:120,style:{maxHeight:"100%",maxWidth:"100%"},onError:u=>{u.target.style.display="none"}}),t.jsx(g,{className:"empty-content",children:e})]})}fe.propTypes={color:n.string,children:n.any};at.propTypes={data:n.array,blockletMap:n.object,onReadBatch:n.func,inDialog:n.bool,highlightId:n.string,highlight:n.bool,type:n.oneOf(["server","service"])};ge.propTypes={notification:n.object,blocklet:n.object,onReadBatch:n.func,inDialog:n.bool,highlight:n.bool};P.propTypes={blocklet:n.object,size:n.number,showName:n.bool,hideDot:n.bool};function P({blocklet:e,size:r=40,showName:s=!1,hideDot:i=!1}){const l=e?.did||e?.meta?.did||"",u=(e?.alsoKnownAs||[]).concat(e?.appId||e?.appDid||e?.appPid||"");return t.jsxs(g,{className:"component-avatar",sx:{display:"flex",alignItems:"center",gap:i?"8px":"4px"},children:[!i&&t.jsx("span",{className:"dot"}),e?t.jsx(g,{children:u.includes(l)?t.jsx(le,{blocklet:e,size:r,style:{borderRadius:8}}):t.jsx(ze,{blocklet:e,ancestors:e.ancestors??[],size:r,style:{borderRadius:8}})}):t.jsx(Se,{width:r,height:r}),s&&t.jsx("span",{className:"component-name",children:e?.meta?.title})]})}function ge({notification:e,blocklet:r,onReadBatch:s=()=>{},inDialog:i=!1,highlight:l}){const{locale:u}=o.useContext(re),m=F(),d=Re(h=>h.breakpoints.down("md")),p=o.useRef(null),y=o.useMemo(()=>qe(e),[e]),v=o.useMemo(()=>Ve(e),[e]),b=o.useMemo(()=>V(e),[e]),k=o.useMemo(()=>e.items||[],[e]),C=o.useMemo(()=>k.length>0,[k]),$=o.useMemo(()=>v?C?k.map(h=>V(h)?h.actorInfo:{did:h.activity?.actor}).filter(Boolean):e.actorInfo??[]:[],[k,e.actorInfo,C,v]),w=o.useMemo(()=>r?.did||r?.meta?.did||"",[r]),a=o.useMemo(()=>_e(w,window.blocklet),[w]),x=O((h,S)=>{const A=Fe(h);if(A.length&&s(A.map(R=>R.id)),S&&!S.customPreventRedirect){const R=Oe(h,a);R&&typeof R=="string"&&window.open(R,"_blank","noopener,noreferrer")}});return t.jsxs(lt,{ref:p,className:"notification-row",id:e.id,isRead:y,inDialog:i,highlight:l,isMd:d,onClick:h=>x(e,h),children:[v?t.jsx(de,{activity:e.activity.type,size:d?24:32}):t.jsx(ce,{severity:e.severity,size:d?24:32}),t.jsxs(g,{className:"notification",sx:{display:"flex",flexDirection:"column",alignItems:"start"},children:[t.jsxs(g,{className:"header",sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,mb:1.5},children:[v&&b?t.jsx(X,{actors:$,teamDid:w,size:d?24:32,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32}),t.jsx(K,{value:e.createdAt,locale:u,shouldUpdate:!0,style:{color:m.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),v?t.jsx(pe,{notification:e,isMultiple:C,blocklet:r,mountPoint:a,avatarFallback:t.jsx(P,{blocklet:r,hideDot:!0,size:d?24:32})}):t.jsxs(t.Fragment,{children:[t.jsx(q,{variant:"body1",className:"title",sx:{color:"rgba(24, 24, 27, 1)",mt:0,mb:.5},children:e.title}),t.jsx(Ue,{notification:e,rows:i?0:2})]}),t.jsx(me,{notification:e})]}),e?.description&&e.severity==="error"&&t.jsx(g,{className:"copy-button",children:t.jsx(Ce,{size:"small",children:t.jsx($e,{sx:{fontSize:22},content:e?.description||""})})})]})}function at({data:e,blockletMap:r,onReadBatch:s=()=>{},inDialog:i=!1,highlightId:l,highlight:u=!1,type:m="service"}){const{t:d}=Q(),p=o.useRef(null),[y,v]=o.useState(!1),[b,k]=o.useState(!0),[C,$]=o.useState(!1),w=o.useRef(new Set),a=o.useRef(new Set),x=o.useRef(null),h=o.useRef(null),S=o.useRef(!1),A=o.useRef(null),R=o.useMemo(()=>i?e?.slice(0,5):e,[i,e]),z=o.useMemo(()=>De(R),[R]),L=o.useMemo(()=>{const c=new Map;return z&&z.length&&z.forEach(f=>{c.set(f.id,f)}),c},[z]);o.useEffect(()=>{const c=()=>{k(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",c),()=>{document.removeEventListener("visibilitychange",c)}},[]);const B=o.useCallback(()=>{if(!i&&w.current.size>0){const c=[];w.current.forEach(f=>{if(a.current.has(f))return;const I=L.get(f);if(I){const{receivers:T=[],items:N=[]}=I;if(T.length&&!T[0].read&&(c.push(f),a.current.add(f),N.length>0&&N.forEach(j=>{const M=j.id;M&&!a.current.has(M)&&(c.push(M),a.current.add(M))}),h.current)){const j=document.getElementById(f);j&&h.current.unobserve(j)}}}),c.length>0&&(s(c),setTimeout(()=>{v(!1)},300)),w.current.clear()}},[i,L,s]),G=o.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{B()},50)},[B]),E=o.useCallback(()=>{if(i||!p.current||!b)return;h.current&&h.current.disconnect();const c={root:null,rootMargin:"0px",threshold:.5},f=new IntersectionObserver(T=>{y&&T.forEach(N=>{const j=N.target.id;if(a.current.has(j))return;const M=L.get(j);if(M){const{receivers:Y=[]}=M;Y.length&&!Y[0].read&&(N.isIntersecting?(w.current.add(j),G()):w.current.delete(j))}})},c);h.current=f,Array.from(p.current.querySelectorAll(".notification-row")).filter(T=>{const N=T.id;if(a.current.has(N))return!1;const j=L.get(N);if(j){const{receivers:M=[]}=j;return M.length&&!M[0].read}return!1}).forEach(T=>{f.observe(T)}),S.current=!1},[y,i,b,L,G]);return o.useEffect(()=>{i||(S.current=!0,h.current&&b&&y&&setTimeout(()=>{E()},0))},[R,y,b,E,i]),o.useEffect(()=>{if(i||!p.current||!b)return;let c=window;if(m==="server"&&(c=document.getElementById("arc__dashboard-main")),!c){const I=document.getElementsByClassName("dashboard-main")[0];I&&(c=I)}if(!c)return;const f=I=>{I.isTrusted&&(y||v(!0),$(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{$(!1),B(),S.current&&E()},300))};return c.addEventListener("scroll",f,{passive:!0}),()=>{c.removeEventListener("scroll",f),x.current&&clearTimeout(x.current),A.current&&clearTimeout(A.current)}},[i,y,b,B,E,m]),o.useEffect(()=>(i||E(),()=>{h.current&&h.current.disconnect()}),[E,i]),Te(()=>{setTimeout(()=>{const c=Be(p.current),f=Pe(L,c);s(f.map(I=>I.id))},100)}),z?.length?t.jsx(g,{ref:p,sx:{display:"flex",flexDirection:"column",...i?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:z?.map(c=>{const f=c.source==="system"?r.get(c.entityId||c.sender):r.get(c.componentDid||c.sender);return c?.type?.toLowerCase()==="passthrough"?null:t.jsx(ge,{highlight:u&&l===c.id,inDialog:i,notification:c,blocklet:f,onReadBatch:s},c.id)})}):t.jsx(fe,{children:d("notification.allDone")})}const lt=Ae(g)`
|
|
13
|
-
@keyframes flash-bg {
|
|
14
|
-
0% {
|
|
15
|
-
background-color: ${e=>e.theme.palette.warning.light};
|
|
16
|
-
}
|
|
17
|
-
100% {
|
|
18
|
-
background-color: unset;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
position: relative;
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
gap: ${e=>e.isMd?e.theme.spacing(1):e.theme.spacing(1.5)};
|
|
25
|
-
padding: ${e=>e.isMd?`${e.theme.spacing(2)} 0`:e.theme.spacing(3)};
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
animation: ${e=>e.highlight?"flash-bg 3s ease-out 0s 1 normal none running":"none"};
|
|
28
|
-
background-color: ${e=>e.isRead?"transparent":e.theme.palette.grey[100]};
|
|
29
|
-
border-bottom: 1px solid;
|
|
30
|
-
border-color: ${({theme:e})=>e.palette.grey[200]};
|
|
31
|
-
&:last-child {
|
|
32
|
-
border-bottom: none;
|
|
33
|
-
}
|
|
34
|
-
&:hover {
|
|
35
|
-
background-color: ${e=>e.theme.palette.action.hover};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.copy-button {
|
|
39
|
-
position: absolute;
|
|
40
|
-
right: ${e=>e.inDialog?e.theme.spacing(2):"0"};
|
|
41
|
-
top: ${e=>e.inDialog?e.theme.spacing(5):e.theme.spacing(4)};
|
|
42
|
-
display: none;
|
|
43
|
-
background: ${e=>e.theme.palette.action.disabledBackground};
|
|
44
|
-
border-radius: 50%;
|
|
45
|
-
svg {
|
|
46
|
-
width: ${e=>e.theme.spacing(2.25)};
|
|
47
|
-
height: ${e=>e.theme.spacing(2.25)};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
&:hover {
|
|
51
|
-
.copy-button {
|
|
52
|
-
display: block;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.component-avatar {
|
|
57
|
-
.dot {
|
|
58
|
-
width: ${e=>e.theme.spacing(1)};
|
|
59
|
-
height: ${e=>e.theme.spacing(1)};
|
|
60
|
-
border-radius: 50%;
|
|
61
|
-
background-color: ${e=>e.theme.palette.primary.main};
|
|
62
|
-
visibility: ${e=>e.isRead?"hidden":"visible"};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.notification {
|
|
67
|
-
width: calc(100% - ${e=>e.theme.spacing(6.25)});
|
|
68
|
-
|
|
69
|
-
> .header {
|
|
70
|
-
width: 100%;
|
|
71
|
-
@media (min-width: 900px) {
|
|
72
|
-
.title {
|
|
73
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(50)});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
@media (min-width: 1200px) {
|
|
77
|
-
.title {
|
|
78
|
-
max-width: ${e=>e.theme.spacing(102.5)};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
@media (max-width: 900px) {
|
|
82
|
-
.title {
|
|
83
|
-
max-width: calc(100vw - ${e=>e.theme.spacing(25)});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.title {
|
|
89
|
-
min-width: 0;
|
|
90
|
-
max-width: 100%;
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
text-overflow: ellipsis;
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
color: ${e=>e.theme.palette.text.primary};
|
|
95
|
-
font-size: ${e=>e.theme.typography.fontSize*1.15}px;
|
|
96
|
-
}
|
|
97
|
-
.link {
|
|
98
|
-
color: ${e=>e.theme.palette.primary.main};
|
|
99
|
-
font-size: ${e=>e.theme.typography.fontSize}px;
|
|
100
|
-
text-decoration: none;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
`;export{X as A,le as B,at as N,K as R,P as S,pe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-___CiWHn.js";import"./vendor-react-CUXIiAnY.js";import{S as t}from"./studio-Bp0H4t0T.js";import"./vendor-ux-pxYpYMxD.js";import"./vendor-utils-Doa0RxLS.js";import"./vendor-hooks-L8kZVRUL.js";import"./lottie-web-4koyQiv_.js";import"./index-hlBFhmKM.js";import"./index-BIur1cqW.js";import"./vendor-arcblock-DBEMYjVA.js";function f(){return o.jsx(t,{children:"Coming soon..."})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,u as c}from"./vendor-ux-pxYpYMxD.js";const s=e("blocklet-services");c("blocklet-services");export{s as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as p,T as I,W as c,am as K,Q as O,bO as de,a6 as pe}from"./vendor-mui-core-___CiWHn.js";import{f as fe,a as ue,b as ge,h as me}from"./vendor-hooks-L8kZVRUL.js";import{r as J,i as he}from"./vendor-react-CUXIiAnY.js";import{a as we,a8 as xe,R as ye,c as L,au as Pe,H as Q,s as ke,b as ve,a2 as $,av as je,aw as be}from"./index-BIur1cqW.js";import{C as W,b as _,J as Ie,c as Ce}from"./vendor-utils-Doa0RxLS.js";import{o as Te}from"./vendor-arcblock-DBEMYjVA.js";import{$ as Le,e as _e,V as X,B,d as Re,C as We,D as Ae,H as M,y as Ee,F as V}from"./vendor-ux-pxYpYMxD.js";import{u as Ne}from"./use-passport-id-B-b-_oYF.js";import{g as z}from"./get-safe-url-Co2dWyCH.js";import{d as R}from"./logger-QD2VS2Mb.js";import"./lottie-web-4koyQiv_.js";function G({blocklet:a=window.blocklet}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(Le,{variant:"rounded",shape:"square",did:a.appPid,src:a.appLogo,size:80}),e.jsx(I,{component:"h2",variant:"h6",children:a.appName}),e.jsx(_e,{did:a.appPid})]})}const Se=J.memo(G);G.propTypes={blocklet:c.shape({appName:c.string,appLogo:c.string,appPid:c.string})};const Ue=()=>window.blocklet?.componentMountPoints?.find(s=>s.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint;function Y({children:a=null,cta:s=null,...i}){return e.jsxs(p,{...i,children:[a?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:a}):null,s?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:s}):null]})}Y.propTypes={children:c.node,cta:c.node};function Z({passports:a=[],onConnect:s=()=>{},redirect:i,...y}){const{t:f}=X(),P=Ue(),k=l=>{const g=l?.payable;return P&&g?W(P,`/api/redirect/checkout/${g}?redirect=${i}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Se,{}),e.jsx(Y,{...y,cta:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:f("login.accessLimit.title")}),e.jsx(I,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:f("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:a?.map(l=>{const g=k(l);return g?e.jsx(K,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"primary",variant:"contained",endIcon:e.jsx(de,{}),href:g,target:"_blank",children:l.title||l.name})},l.name):e.jsx(K,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"inherit",variant:"contained",onClick:s,children:l.title||l.name})},l.name)})}),e.jsxs(I,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:f("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:s,children:f("common.connect")})]})]})})]})}Z.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};function ze(){const a=J.useRef(null),{session:s}=we(),{t:i,locale:y}=X(),{getPassportId:f}=Ne(),P=he(),k=B(),l=Re(),{encryptKey:g,decrypt:ee}=xe(),v=fe(s),{searchParams:o}=new URL(window.location.href),m={passportId:f()},A=o.get("componentId"),E=o.get("authenticated"),ne=o.get("sessionToken"),te=o.get("refreshToken"),oe=o.get("requiredRoles"),u=o.get("redirect"),d=o.get("forceConnected"),j=o.get("sourceAppPid"),C=o.get("origin"),N=o.get("autoConnectWebview"),S=o.get("popup"),U=o.get("showQuickConnect");let h=o.get("inviter");if(!h&&u)try{h=(u.startsWith("http")?new URL(u):new URL(u,window.location.origin)).searchParams.get("inviter")}catch{}h=h||localStorage.getItem("inviter"),A&&(m.componentId=A),k&&(m.visitorId=k),h&&(m.inviter=h),Ce(j)||(j==="null"?m.sourceAppPid=null:j!==null&&(m.sourceAppPid=j));let D=[];try{D=JSON.parse(oe)}catch{}const ie=async n=>{const t=o.get("fromWallet");R("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":l.wallet}),n&&String(t)==="1"&&l.wallet&&await Promise.any([V.asyncCall("arcSetToken",n),$(3e3)])},T=n=>o.get("encrypted")?ee(n):n,q=async n=>{n&&await ie(n),setTimeout(()=>{if(u){const t=decodeURIComponent(u);t.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?P(t,{replace:!0}):window.location.replace(z(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},se=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:B(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};R("bridge callArc: onLogin",t),V.callArc("onLogin",t)},H=async(n,t)=>{const w=t(n.sessionToken),b=t(n.refreshToken),x=t(n.visitorId);R("login page onLogin",{result:n,decodeSessionToken:w,decodeRefreshToken:b,decodeVisitorId:x}),ke(w),ve(b),n.visitorId&&Ee(x),await s.refresh(),await $(100),se(v.current);const r={};o.get("saveConnect")?(r.connected_did=v.current.user.did,r.connected_pk=v.current.user.pk,r.connected_wallet_os=v.current.walletOS,r.connected_app=je()):(r.connected_did=o.get("connected_did"),r.connected_pk=o.get("connected_pk"),r.connected_app=o.get("connected_app"),r.connected_wallet_os=o.get("connected_wallet_os")),be(r,!0),q({sessionToken:w,refreshToken:b,visitorId:x})},re=ue(()=>C==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,C,i]),F=ge(()=>{const n=window?.blocklet,t={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:H,onError:ce,locale:y,messages:re,extraParams:m,baseUrl:window.location.origin,prefix:W(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,ye)};d&&(t.forceConnected=d,t.extraParams.enableSwitchApp=!1,t.extraParams.forceConnected=d),t.options||(t.options={}),C==="switch-did"?t.options.showQuickConnect=!0:_(U)||([!1,"false"].includes(U)?t.options.showQuickConnect=!1:t.options.showQuickConnect=!0);const w=We();Ae()&&(t.extraParams.sourceAppPid=w.appPid);const x=W(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),r={params:Pe(encodeURIComponent(JSON.stringify(t))),appPid:n?.appPid,appName:n?.appName,locale:y,redirect:window.location.href,_ek_:g};_(N)||(r.autoConnectWebview=N),_(S)||(r.popup=S),r.disableClose=!0;const le=z(Ie(x,r),{allowDomains:null});window.location.href=le});me(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){M.error("Unexpected login response from server: visitorId is required");return}H({sessionToken:T(ne),refreshToken:T(te),visitorId:T(n)},t=>t)}else!s.user||d&&s.user.did!==d?F():!E&&!o.get("sessionToken")&&q()});const ce=n=>{M.error(n.message)},ae=o.has("popup");if(s.loading||s.user){if(!E||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(Q,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(Te,{children:ae?null:e.jsx(pe,{})})]});const n=u?new URL(u,window.location.origin).href:window.location.href;return e.jsx(Z,{onConnect:F,passports:D,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(Q,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:a})]})}export{ze as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as be,j as t,b1 as v,aX as se,Q as B,T as S,b0 as ge}from"./vendor-mui-core-___CiWHn.js";import{r as d}from"./vendor-react-CUXIiAnY.js";import{V as Ce,b as je,H as h}from"./vendor-ux-pxYpYMxD.js";import{C as w,d as ke}from"./vendor-utils-Doa0RxLS.js";import{k as Se}from"./vendor-hooks-L8kZVRUL.js";import{w as we,x as M,y as Pe,z as Ee,C as z,D as De,E as $e,F as Te,L as oe,G as Ie}from"./index-BIur1cqW.js";const ie=async n=>{if(!n.subscriptionId&&!n.customerId)throw new Error("Either subscriptionId or customerId must be provided");let y;return n.subscriptionId?y=`/api/subscriptions/${n.subscriptionId}/overdue/invoices`:y=`/api/customers/${n.customerId}/overdue/invoices`,(await De.get(n.authToken?w(y,`?authToken=${n.authToken}`):y)).data};function ze({subscriptionId:n=void 0,customerId:y=void 0,mode:H="default",dialogProps:g={open:!0},children:P=void 0,onPaid:q=()=>{},detailLinkOptions:p={enabled:!0},successToast:O=!0,alertMessage:N="",authToken:U=void 0}){const{t:r,locale:ce}=Ce(),E=be(),{connect:D,session:ae}=we(),[ue,le]=d.useState(""),[V,x]=d.useState(!1),[de,$]=d.useState(g.open||!1),[me,pe]=d.useState({}),[ye,f]=d.useState({}),[T,I]=d.useState({}),W=d.useRef(T),G=n?"subscription":"customer",u=y||ae?.user?.did,K=n||u,C=d.useRef(u);d.useEffect(()=>{W.current=T},[T]);const{data:i={summary:{},invoices:[]},error:L,loading:fe,runAsync:Q}=Se(()=>ie({subscriptionId:n,customerId:u,authToken:U}),{ready:!!n||!!u,onSuccess:e=>{e.customer?.id&&e.customer?.id!==C.current&&(C.current=e.customer?.id)}}),R=d.useMemo(()=>n?w(M(),`/customer/subscription/${n}`):u?w(M(),"/customer/invoice/past-due"):"",[n,u]),a=d.useMemo(()=>i?.summary?Object.values(i.summary):[],[i?.summary]),X=async e=>{if(W.current[e])try{if((await ie({subscriptionId:n,customerId:u,authToken:U})).invoices?.some(l=>l.currency_id===e))return;I(l=>{const m={...l};return delete m[e],m}),f(l=>({...l,[e]:"success"}))}catch(s){console.error("Error checking Stripe payment completion:",s);return}O&&(h.close(),h.success(r("payment.customer.invoice.paySuccess"))),x(!1),(await Q()).invoices?.length===0&&($(!1),q(K,e,G))},ve=ke(e=>X(e),1e3,{leading:!1,trailing:!0,maxWait:5e3}),_=Pe(),j=Ee("events"),he=async()=>{let e=!1;return await Ie(async()=>(e=(await Q()).invoices?.length===0,e),{interval:2e3,timeout:3*60*1e3}),e},J=async(e,o=!1)=>{if(_)try{const s=await he();O&&(h.close(),h.success(r("payment.customer.invoice.paySuccess"))),s&&($(!1),q(K,e,G))}catch(s){console.error("Check payment status failed:",s)}else o&&(I(s=>({...s,[e]:!0})),f(s=>({...s,[e]:"processing"})))};d.useEffect(()=>{if(!j||_)return;const e=({response:o})=>{const c=`${n||o.customer_id}-${o.currency_id}`;(n&&o.subscription_id===n||u&&u===o.customer_id||C.current&&C.current===o.customer_id)&&(me[c]||(pe(l=>({...l,[c]:1})),ve(o.currency_id)))};return j.on("invoice.paid",e),()=>{j.off("invoice.paid",e)}},[j,n,u]);const Y=e=>{const{currency:o,method:s}=e;if(s.type==="stripe"){h.error(r("payment.subscription.overdue.notSupport"));return}if(!V&&(le(o.id),x(!0),f(c=>({...c,[o.id]:"idle"})),["arcblock","ethereum","base"].includes(s.type))){const c={currencyId:o.id};n?c.subscriptionId=n:u&&(c.customerId=u),D.open({locale:ce,containerEl:void 0,saveConnect:!1,action:"collect-batch",prefix:w(M(),"/api/did"),useSocket:!_,extraParams:c,messages:{scan:r("common.connect.defaultScan"),title:r("payment.customer.invoice.payBatch"),confirm:r("common.connect.confirm")},onSuccess:()=>{D.close(),J(o.id),x(!1),f(l=>({...l,[o.id]:"success"}))},onClose:()=>{D.close(),x(!1)},onError:l=>{h.error($e(l)),f(m=>({...m,[o.id]:"error"})),x(!1)}})}},k=()=>{$(!1),g.onClose?.()},Z=e=>{p.onClick?(e.preventDefault(),p.onClick(e)):p.enabled||(e.preventDefault(),k())};if(fe)return null;const ee=()=>p.title?p.title:r(n?"payment.subscription.overdue.view":"payment.customer.pastDue.view"),te=(e,o=!0,s={variant:"contained"})=>{const{currency:c}=e,l=V&&ue===c.id,m=ye[c.id]||"idle";if(m==="success")return t.jsx(B,{variant:s?.variant||"contained",size:"small",onClick:()=>X(c.id),...o?{}:{color:"success",startIcon:t.jsx(ge,{})},children:r("payment.subscription.overdue.paid")});if(e.method.type==="stripe"){let A=r("payment.subscription.overdue.payNow");return m==="error"?A=r("payment.subscription.overdue.retry"):m==="processing"&&(A=r("payment.subscription.overdue.processing")),t.jsx(Te,{subscriptionId:n,customerId:n?void 0:u,currencyId:c.id,paymentMethod:e.method,onSuccess:()=>{J(c.id,!0)},onError:()=>{f(b=>({...b,[c.id]:"error"})),I(b=>({...b,[c.id]:!1}))},children:(b,ne)=>t.jsx(oe,{variant:s?.variant||"contained",size:"small",disabled:ne||m==="processing",loading:ne||m==="processing",onClick:b,sx:s?.sx,children:A})})}return t.jsx(oe,{variant:s?.variant||"contained",size:"small",disabled:l,loading:l,onClick:()=>Y(e),sx:s?.sx,children:r(m==="error"?"payment.subscription.overdue.retry":"payment.subscription.overdue.payNow")})},F=e=>e.name&&e.type!=="arcblock"?` (${e.name})`:"",re=()=>{if(n&&i.subscription)return a.length===1?r("payment.subscription.overdue.title",{name:i.subscription?.description,count:i.invoices?.length,total:z(a[0]?.amount,a[0]?.currency?.decimal),symbol:a[0]?.currency?.symbol,method:F(a[0]?.method)}):r("payment.subscription.overdue.simpleTitle",{name:i.subscription?.description,count:i.invoices?.length});if(u){let e="";return a.length===1?e=r("payment.customer.overdue.title",{subscriptionCount:i.subscriptionCount||0,count:i.invoices?.length,total:z(a[0]?.amount,a[0]?.currency?.decimal),symbol:a[0]?.currency?.symbol,method:F(a[0]?.method)}):e=r("payment.customer.overdue.simpleTitle",{subscriptionCount:i.subscriptionCount||0,count:i.invoices?.length}),N?`${e}${N}`:`${e}${r("payment.customer.overdue.defaultAlert")}`}return""},xe=()=>n&&i.subscription?r("payment.subscription.overdue.empty",{name:i.subscription?.description}):r("payment.customer.overdue.empty");return H==="custom"&&P&&typeof P=="function"?t.jsx(v,{children:P(Y,{subscription:i?.subscription,summary:i?.summary,invoices:i?.invoices,subscriptionCount:i?.subscriptionCount,detailUrl:R})}):t.jsx(je,{PaperProps:{style:{minHeight:"auto"}},...g||{},open:de,title:g?.title||r("payment.subscription.overdue.pastDue"),sx:{"& .MuiDialogContent-root":{pt:0}},onClose:k,children:L?t.jsx(se,{severity:"error",children:L.message}):t.jsxs(v,{sx:{gap:1},children:[a.length===0&&t.jsxs(t.Fragment,{children:[t.jsx(se,{severity:"success",children:xe()}),t.jsx(v,{direction:"row",sx:{justifyContent:"flex-end",mt:2},children:t.jsx(B,{variant:"outlined",color:"primary",onClick:k,sx:{width:"fit-content"},children:r("common.know")})})]}),a.length===1&&t.jsxs(t.Fragment,{children:[t.jsxs(S,{variant:"body1",sx:{color:"text.secondary"},children:[re(),p.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r("payment.subscription.overdue.description"),t.jsx("a",{href:R,target:"_blank",onClick:Z,rel:"noreferrer",style:{color:E.palette.text.link},children:ee()})]})]}),t.jsxs(v,{direction:"row",sx:{justifyContent:"flex-end",gap:2,mt:2},children:[t.jsx(B,{variant:"outlined",color:"primary",onClick:k,children:r("common.cancel")}),te(a[0])]})]}),a.length>1&&t.jsxs(t.Fragment,{children:[t.jsxs(S,{variant:"body1",sx:{color:"text.secondary"},children:[re(),p.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r("payment.subscription.overdue.description"),t.jsx("a",{href:R,target:"_blank",rel:"noreferrer",onClick:Z,style:{color:E.palette.text.link},children:ee()})]})]}),t.jsx(S,{variant:"body1",sx:{color:"text.secondary"},children:r("payment.subscription.overdue.list")}),t.jsx(v,{children:a.map(e=>t.jsxs(v,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",py:1,px:.5,borderBottom:"1px solid",borderColor:"divider","&:hover":{backgroundColor:()=>E.palette.grey[100]},mt:0},children:[t.jsx(S,{children:r("payment.subscription.overdue.total",{total:z(e?.amount,e?.currency?.decimal),currency:e?.currency?.symbol,method:F(e?.method)})}),te(e,!1,{variant:"text",sx:{color:"text.link"}})]},e?.currency?.id))})]})]})})}export{ze as O};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./create-passport-svg-k1mCsufD.js";import{C as t}from"./vendor-utils-Doa0RxLS.js";import{c as s}from"./index-BIur1cqW.js";const e=o=>r({...o,issuerAvatarUrl:t(window.location.origin,s.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo")});export{e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-___CiWHn.js";import{C as t}from"./vendor-utils-Doa0RxLS.js";import{I as s}from"./iframe-DEV2d5VF.js";import{c as e}from"./index-BIur1cqW.js";import{S as m}from"./studio-Bp0H4t0T.js";import"./vendor-react-CUXIiAnY.js";import"./vendor-ux-pxYpYMxD.js";import"./vendor-hooks-L8kZVRUL.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DBEMYjVA.js";import"./index-hlBFhmKM.js";function L(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(m,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./vendor-mui-core-___CiWHn.js";import{$ as o}from"./user-center-B8WTEd4Q.js";import{H as i}from"./index-BIur1cqW.js";import{V as e}from"./vendor-ux-pxYpYMxD.js";import"./vendor-react-CUXIiAnY.js";import"./vendor-hooks-L8kZVRUL.js";import"./vendor-utils-Doa0RxLS.js";import"./index-BojWO9M6.js";import"./arrow-down.svg-HIktmc0V.js";import"./revoke.svg-CuiCGfVW.js";import"./index-BjgDA6OD.js";import"./index-JqMHvzVF.js";import"./vendor-arcblock-DBEMYjVA.js";import"./index-BBwCodqz.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-DDc9u4Rr.js";import"./lottie-web-4koyQiv_.js";function R(){const{t}=e();return r.jsxs(r.Fragment,{children:[r.jsx(i,{children:r.jsx("title",{children:t("pageTitle.userCenter")})}),r.jsx(o,{onlyProfile:!0,currentTab:"",disableAutoRedirect:!0})]})}export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as n,j as i,ak as l}from"./vendor-mui-core-___CiWHn.js";import{j as d,r as c}from"./vendor-react-CUXIiAnY.js";import{V as u,b as h}from"./vendor-ux-pxYpYMxD.js";import g from"./index-C4kgQ8sF.js";import"./vendor-utils-Doa0RxLS.js";import"./vendor-hooks-L8kZVRUL.js";import"./lottie-web-4koyQiv_.js";import"./index-BIur1cqW.js";import"./vendor-arcblock-DBEMYjVA.js";import"./confirm-Dbm1_K3V.js";import"./index-DBs9Ljax.js";import"./session-BTb8wl7v.js";import"./did-address-BKqL0vbP.js";import"./empty-spinner-CveVktQP.js";import"./bundle-avatar-BDafezYn.js";import"./shorten-label-BiZLRE-N.js";import"./list-header-Q-5QUSB8.js";import"./click-to-copy-BiDS_MtA.js";import"./question-mark-circle.svg-DK9nTUDZ.js";import"./useSetState-cWrp7qoX.js";import"./engine-gKAOz9e-.js";import"./api-DcGGeMWE.js";import"./vendor-mui-x-CYSdP1E1.js";import"./react-beautiful-dnd.esm-DQ9oGom7.js";import"./raf-schd.esm-JNUhxcps.js";import"./wait-connect-DZgpTTEq.js";import"./get-safe-url-Co2dWyCH.js";import"./item-Dc6RMbfp.js";import"./delete-confirm-B7aTZIom.js";import"./index-JqMHvzVF.js";import"./index-DO0bEcmC.js";import"./index-B7KG9373.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function T(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v}from"./vendor-react-CUXIiAnY.js";import{D,n as B,j as t,W as r,ak as h,T as b,c2 as k,at as T,am as $,c3 as O,c4 as _}from"./vendor-mui-core-___CiWHn.js";import{B as q,p as V}from"./dashboard-d3oO4-H7.js";import{V as L,i as J,U as K,h as Q}from"./vendor-ux-pxYpYMxD.js";import{aG as w,aH as C,_ as X,ac as N,e as f,aI as Y}from"./index-BIur1cqW.js";import{W as Z}from"./vendor-utils-Doa0RxLS.js";import{x as P}from"./index-DRYJ0xIl.js";import{B as S}from"./base-chart-DkkGeB5D.js";import{B as ee}from"./bundle-avatar-BDafezYn.js";import"./vendor-arcblock-DBEMYjVA.js";import"./vendor-hooks-L8kZVRUL.js";import"./useLocalStorage-CbmitI3m.js";import"./index-DBs9Ljax.js";import"./confirm-Dbm1_K3V.js";import"./get-safe-url-Co2dWyCH.js";import"./session-BTb8wl7v.js";import"./team-CHzBr-zx.js";import"./isURL-BxH0AREx.js";import"./use-app-logo-BFST6ES5.js";import"./passport-07OMj8Ls.js";import"./create-passport-svg-k1mCsufD.js";import"./useAsyncRetry-MDM8jCoS.js";import"./useAsync-tRHUJQgE.js";import"./useSetState-cWrp7qoX.js";import"./index-hlBFhmKM.js";import"./over-due-invoice-payment-jpkjPsJv.js";import"./use-mobile-yOnqxyr6.js";import"./lottie-web-4koyQiv_.js";import"./index-BDvewqjE.js";function U({title:i="",cpus:y=[],currentLoad:s=0,history:p=[],empty:l=null,onHover:u=()=>{},hoverIndex:a=null}){const{t:d,locale:x}=L(),e=D(),n=`${i||d("common.cpu")} (${Math.floor(s||0)}%)`,o=100,m=80,c=H=>`${H}%`,M=[{max:m,color:B(e.palette.primary.main,e.palette.mode==="dark"?.15:.08)},{min:m,max:100,color:B(e.palette.warning.main,e.palette.mode==="dark"?.18:.12)},{min:100,color:B(e.palette.error.main,e.palette.mode==="dark"?.25:.18)}],j={silent:!0,symbol:["none","none"],data:[{yAxis:100,lineStyle:{color:e.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${c(100)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:m,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${c(m)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}}]},I=t.jsx("span",{children:`${d("system.cores")}: ${y?.length||0}`}),R=H=>w(Number(H),"HH:mm",x);return t.jsx(S,{title:n,total:o,history:p,valueFn:c,xAxisFormat:R,visualMapPieces:M,markLineData:j,extraInfo:I,empty:l,onHover:u,hoverIndex:a})}U.propTypes={title:r.string,cpus:r.array,currentLoad:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function z({instanceCount:i=null,title:y="",total:s=null,used:p=null,history:l=[],empty:u=null,onHover:a=()=>{},hoverIndex:d=null}){const{t:x,locale:e}=L(),n=D(),o=!!s,m=s-p,c=o?`(${C(p)}, ${Math.floor(p/s*100)}%)`:"",M=`${y||x("common.memory")} ${c}`,j=Math.ceil(s*.8),I=g=>P(g,{short:!0,iec:!0}),R=[];i&&R.push({title:x("system.instances"),metric:i}),o&&R.push({title:x("system.free"),metric:I(m)});const H=[{max:j,color:B(n.palette.primary.main,n.palette.mode==="dark"?.15:.08)},{min:j,max:s,color:B(n.palette.warning.main,n.palette.mode==="dark"?.18:.12)},{min:s,color:B(n.palette.error.main,n.palette.mode==="dark"?.25:.18)}],F={silent:!0,symbol:["none","none"],data:[{yAxis:s,lineStyle:{color:n.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${I(s)}`,position:"insideEndTop",color:n.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:j,lineStyle:{color:n.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${I(j)}`,position:"insideEndTop",color:n.palette.text.secondary,padding:[2,4],borderRadius:2}}]},A=t.jsx(t.Fragment,{children:R.map((g,G)=>t.jsxs(h,{sx:{marginLeft:G===0?0:1,display:"inline-flex"},children:[g.title,": ",g.metric]},g.title))}),W=g=>w(Number(g),"HH:mm",e);return t.jsx(S,{title:M,total:s,history:l,valueFn:I,xAxisFormat:W,visualMapPieces:H,markLineData:F,extraInfo:A,empty:u,onHover:a,hoverIndex:d})}z.propTypes={title:r.string,instanceCount:r.number,total:r.number,used:r.number,history:r.array,empty:r.node,onHover:r.func,hoverIndex:r.number};function E({blocklet:i,cpuHistory:y=[],memoryHistory:s=[],...p}){const{t:l}=L(),{info:u}=X(),{runtimeHistory:a}=N(),[d,x]=v.useState(null),e=v.useCallback(o=>i.status!=="running"?t.jsx(b,{children:l("blocklet.runtimeInfo.noRunning")}):o.length?null:t.jsx(J,{children:l("common.empty")}),[i.status,l]),n=v.useCallback(o=>{x(o)},[]);return a.length===0?t.jsx(b,{children:l("blocklet.runtimeInfo.noRunning")}):t.jsxs(te,{component:"div",...p,memoryHistory:s,cpuHistory:y,children:[t.jsxs(k,{className:"page-metrics",container:!0,spacing:5,children:[t.jsx(k,{sx:{pt:"16px !important"},size:12,children:t.jsx(b,{sx:{fontSize:"16px",fontWeight:"bold"},children:"CPU"})}),a?.map(o=>t.jsx(k,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:t.jsx(U,{title:`${o.name} CPU`,empty:e(o.cpu),currentLoad:o.appRuntimeInfo?.cpuUsage||0,cpus:o.appRuntimeInfo?.cpus||[],history:o.cpu,onHover:n,hoverIndex:d,style:{height:150}})},`${o.key}-cpu`))]}),t.jsxs(k,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[t.jsx(k,{sx:{pt:"16px !important"},size:12,children:t.jsx(b,{sx:{fontSize:"16px",fontWeight:"bold"},children:"Memory"})}),a?.map(o=>t.jsx(k,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:t.jsx(z,{title:`${o.name} Memory`,empty:e(o.memory),total:u.runtimeConfig?.blockletMaxMemoryLimit?P.parseSize(`${u.runtimeConfig.blockletMaxMemoryLimit*(o.key===i?.meta?.did?a.length-1:1)}MiB`):0,used:o.appRuntimeInfo?.memoryUsage||0,history:o.memory,onHover:n,hoverIndex:d,style:{height:150}})},`${o.key}-memory`))]})]})}E.propTypes={blocklet:r.object.isRequired,cpuHistory:r.arrayOf(r.shape({date:r.number,value:r.number})),memoryHistory:r.arrayOf(r.shape({date:r.number,value:r.number}))};const te=T(b)``;function we(){const{t:i,locale:y}=L(),[s,p]=v.useState(6),{blocklet:l,actions:{refreshBlocklet:u}}=N(),a=v.useMemo(()=>{const e=[];return f.forEachBlockletSync(l,(n,{ancestors:o,id:m,level:c})=>{n?.meta?.did&&n.meta.did!==l.meta.did&&e.push({type:"blocklet",groupId:l.meta.did,groupName:f.getDisplayName(l),id:m,name:f.getDisplayName(n,!0),blocklet:l,component:n,level:c-1>=0?c-1:0,runtimeInfo:n.runtimeInfo,ancestors:o})}),e},[l]);v.useEffect(()=>{u({hours:s});const e=setInterval(()=>{u({hours:s})},1e3*10);return()=>{clearInterval(e)}},[s]);const d=e=>V(Number(e||0),{locale:Y(y)}),x=[{label:i("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:n,component:o,level:m,ancestors:c}=a[e];return t.jsxs(h,{sx:{display:"flex",alignItems:"center",pl:m*2},children:[t.jsx(ee,{size:20,blocklet:o,ancestors:c}),t.jsx(h,{sx:{ml:1},children:n}),t.jsx(q,{variant:"pin",style:{marginLeft:8},status:f.isBlockletRunning(o)?"running":o.status,source:o.source,progress:o.progress})]})}}},{label:i("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?d(n?.uptime):t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?C(n?.memoryUsage||0):t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?`${(n?.cpuUsage||0).toFixed(1)}%`:t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(e){const{runtimeInfo:n}=a[e];return n?.uptime?t.jsxs(h,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(K,{icon:n?.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),t.jsx(h,{sx:{ml:1},children:n?.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:i("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?n?.pid:t.jsx($,{title:i("common.noData"),children:"--"})}}},{label:i("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(e){const{runtimeInfo:n,component:o}=a[e];return f.isBlockletRunning(o)?n?.port:t.jsx($,{title:i("common.noData"),children:"--"})}}}];return t.jsxs(ne,{component:"div",children:[t.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2},children:[t.jsx(b,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:i("analytics.trend")}),t.jsx(O,{size:"small",exclusive:!0,value:s,onChange:(e,n)=>{Z(n)&&p(n)},children:[1,3,6,12,24].map(e=>t.jsxs(_,{value:e,children:[e,"H"]},e))})]}),t.jsx(h,{children:t.jsx(E,{blocklet:l})}),t.jsx(h,{sx:{mt:3},children:t.jsx(Q,{title:i("analytics.detail"),className:"monitor-table",locale:y,data:a,columns:x,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}const ne=T(b)``;export{we as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as o}from"./index-BIur1cqW.js";const e=o();export{e as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b}from"./vendor-react-CUXIiAnY.js";import{j as p,a6 as P,am as w,bZ as j,b_ as k,W as $}from"./vendor-mui-core-___CiWHn.js";import{l as q}from"./vendor-hooks-L8kZVRUL.js";import{B as d}from"./vendor-utils-Doa0RxLS.js";import{r as x}from"./omit-CPVfFmp-.js";import{aE as V,aF as R}from"./index-BIur1cqW.js";import{O as E,V as D}from"./vendor-ux-pxYpYMxD.js";var s={},h;function K(){if(h)return s;h=1;var u=s&&s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.signResponse=l,s.verifyResponse=_,s.verifyVault=S;const m=u(x),v=u(V()),n=R(),a=E();async function l(e,c){const o=(0,v.default)(e),y=await c.sign(o);return{...e,$signature:y}}function _(e,c){return e.$signature?c.verify((0,v.default)((0,m.default)(e,"$signature")),e.$signature):Promise.resolve(!1)}async function S(e,c,o=!1){if(!Array.isArray(e)||e.length===0){if(o)throw new Error("vaults list is empty");return""}for(let t=1;t<e.length;t++)if(e[t].at<=e[t-1].at){if(o)throw new Error("vaults are not in ascending order");return""}if(new Set(e.map(t=>t.did)).size!==e.length){if(o)throw new Error("vaults list has duplicate vaults");return""}for(let t=0;t<e.length;t++){const r=e[t];if(!(0,a.isFromPublicKey)(r.did,r.pk)){if(o)throw new Error(`vault did and pk mismatch: ${r.did}(${r.pk})`);return""}let f=d.from(`vault:${c}`);for(let i=0;i<=t;i++)f=d.concat([f,d.from(`:${e[i].did}`)]);if(!r.approverSig){if(o)throw new Error(`vault approve signature missing for ${r.did}`);return""}try{let i;if(t>0){const g=e[t-1];i=(0,n.fromPublicKey)(g.pk,(0,a.toTypeInfo)(g.did))}else{if(!r.approverPk||!r.approverDid||!(0,a.isFromPublicKey)(r.approverDid,r.approverPk)){if(o)throw new Error(`approver config missing for ${r.did}`);return""}i=(0,n.fromPublicKey)(r.approverPk,(0,a.toTypeInfo)(r.approverDid))}if(await i.verify(f,r.approverSig)===!1){if(o)throw new Error(`signature verify failed for ${r.did}`);return""}}catch(i){if(console.error(i),o)throw new Error(`vault approve verify failed: ${i.message}`);return""}if(!r.sig){if(o)throw new Error(`vault commit signature missing for ${r.did}`);return""}try{const i=(0,n.fromPublicKey)(r.pk,(0,a.toTypeInfo)(r.did));if(r.approverSig&&(f=d.concat([f,d.from(`:${r.approverSig}`)])),await i.verify(f,r.sig)===!1){if(o)throw new Error(`commit signature verify failed for ${r.did}`);return""}}catch(i){if(console.error(i),o)throw new Error(`vault commit verify failed: ${i.message}`);return""}}return e[e.length-1].did}return s}var T=K();function I({vaults:u,appPid:m}){const{t:v}=D(),[n,a]=q({verified:!1,verifying:!0,error:""});return b.useEffect(()=>{T.verifyVault(u,m,!0).then(l=>{a({verified:!!l,verifying:!1})}).catch(l=>{a({verified:!1,verifying:!1,error:l.message})})},[u,m,a]),n.verifying?p.jsx(P,{}):n.verified?p.jsx(w,{title:v("blocklet.config.vault.verified"),children:p.jsx(j,{fontSize:"small",color:"success"})}):p.jsx(w,{title:n.error,children:p.jsx(k,{color:"error"})})}I.propTypes={vaults:$.array.isRequired,appPid:$.string.isRequired};export{I as V};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import{r as S,a as Fe,d as ze,g as qe}from"./vendor-react-CUXIiAnY.js";import{j as n,a$ as ae,W as m,s as le,T as P,ak as k,Q as Be,P as Ge,D as A,at as F,J as z,a3 as ye,b7 as be,am as Ve,bf as Ke,de as Qe,df as Xe,ar as Ye}from"./vendor-mui-core-___CiWHn.js";import{a as _,b as ue}from"./vendor-hooks-L8kZVRUL.js";import{c as B,bt as Z,bu as ee,bv as ve,bw as Je,am as Ze,l as et,e as tt,Y as X,bx as ne,f as Y,b5 as nt}from"./index-BIur1cqW.js";import{a as O,J as ce,C as G,a7 as rt,a8 as st}from"./vendor-utils-Doa0RxLS.js";import{u as it}from"./session-BTb8wl7v.js";import{U as ot,x as at,a as lt,M as V,e as de,p as ct,V as we,H as dt}from"./vendor-ux-pxYpYMxD.js";import{i as pt}from"./isURL-BxH0AREx.js";import{u as ut}from"./use-app-logo-BFST6ES5.js";const ht={dividerColor:"rgba(239, 241, 245, 1)"},tn=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(i=>{if(!i.activity||!i.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),i.activity&&i.activity.type?(r=i,s=[i]):(t.push(i),r=null,s=[]);return}const p=s[0].activity,o=p.type,h=p.target?.type,x=p.target?.id,v=i.activity.type,g=i.activity.target?.type,T=i.activity.target?.id;if(o&&v&&o===v&&(!p.target&&!i.activity.target||p.target&&i.activity.target&&h===g&&x===T))s.push(i);else{if(s.length===1)t.push(s[0]);else{const b=Object.assign({},r,{items:s});t.push(b)}r=i,s=[i]}}),r)if(s.length===1)t.push(s[0]);else{const i=Object.assign({},r,{items:s});t.push(i)}return t},mt=e=>!O(e.activity)&&!!e.activity.type&&!!e.activity.actor,nn=e=>mt(e)&&!!e.actorInfo&&!!e.actorInfo.did,je=e=>{if(!e)return null;const{meta:t,target:r,actor:s}=e||{};let i=r?.id;return r?.type==="user"&&(i=ce(G(B.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:s})),{metaLink:t?.id,targetLink:i}},ke=e=>pt(e),H={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign",UN_ASSIGN:"un_assign"},ft={[H.COMMENT]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have left ",t," comments on ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["has commented on ",r?"your":"the"," ",e,":"]}),[H.LIKE]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}),[H.FOLLOW]:(e,t)=>t>1?n.jsx(n.Fragment,{children:"have followed you"}):n.jsx(n.Fragment,{children:"has followed you"}),[H.TIPS]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["left tips for ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["left a tip for ",r?"your":"the"," ",e,":"]}),[H.MENTION]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have mentioned you in ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["mentioned you in ",r?"your":"the"," ",e,":"]}),[H.ASSIGN]:()=>n.jsx(n.Fragment,{children:"has assigned you a task: "}),[H.UN_ASSIGN]:()=>n.jsx(n.Fragment,{children:"has revoked your task assignment: "})},$=S.memo(function({user:t,color:r="text.secondary"}){const s=ce(G(B.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return n.jsx(ae,{href:s,color:r,target:"_blank",onClick:i=>{i.customPreventRedirect=!0},sx:{fontWeight:600,textDecoration:"none"},children:t.fullName||"System"})});$.propTypes={user:m.shape({did:m.string.isRequired,fullName:m.string.isRequired}).isRequired,color:m.string};$.displayName="UserLink";function rn({activity:e,users:t,actors:r,extra:s={},mountPoint:i=""}){const{session:p}=it()||{},{type:o,target:h}=e||{},{type:x,author:v}=h||{},{linkColor:g="text.secondary"}=s||{},T=_(()=>v?(p?.user?.did||s?.userDid)===v:!0,[p,v]),L=_(()=>{if(!Array.isArray(t))return new Map;const y=new Map;return t.forEach(C=>{C?.did&&!y.has(C.did)&&y.set(C.did,C)}),y},[t]),b=_(()=>Array.isArray(r)?[...new Set(r)].map(C=>C?L.get(C)||{did:C,fullName:"System"}:null):[],[r,L]),R=ue(()=>{if(!Array.isArray(b)||b.length===0)return null;if(b.length===1)return n.jsx($,{user:b[0],color:g});const y=b.slice(0,-1),C=b[b.length-1];if(b.length===2)return n.jsxs(n.Fragment,{children:[n.jsx($,{user:y[0],color:g})," and ",n.jsx($,{user:C,color:g})]});const a=b.length>3,u=a?b.slice(0,2):y;return n.jsxs(n.Fragment,{children:[u.map((f,c)=>n.jsxs(Fe.Fragment,{children:[n.jsx($,{user:f,color:g}),c<u.length-1?", ":""]},f.did)),a?`, and ${b.length-2} others`:n.jsxs(n.Fragment,{children:[", and ",n.jsx($,{user:C,color:g})]})]})}),M=ue(()=>{const y=ft[o];return y?y(x==="doc"?"document":x,t.length,T):null}),E=_(()=>{const y=R(),C=M();return!y||!C?null:n.jsxs(n.Fragment,{children:[y," ",C]})},[o,x,b,R,M]),w=_(()=>{if(!e)return null;const y=je(e);return y?.targetLink?ke(y?.targetLink)?y?.targetLink:G(i,y.targetLink):null},[e,i]);return!o||O(h)?null:n.jsxs(n.Fragment,{children:[E," ",n.jsx(ae,{href:w,color:"primary",target:"_blank",sx:{textDecoration:"none"},onClick:y=>{y.customPreventRedirect=!0},children:h.name||h.desc})]})}const gt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Te.propTypes={meta:m.object.isRequired};const xt=le(Ge)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${e.palette.divider}`,boxShadow:"none"})),yt=le(k)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),bt=le(k)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Te({meta:e}){const{amount:t,symbol:r,chainId:s}=e,i=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return n.jsxs(xt,{children:[n.jsxs(yt,{children:[n.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),n.jsx(P,{variant:"h5",sx:{color:"text.primary"},children:"ArcBlock"})]}),n.jsxs(bt,{children:[n.jsxs(k,{sx:{display:"flex",alignItems:"baseline",gap:1},children:[n.jsxs(P,{component:"span",variant:"h5",sx:{color:"text.primary",fontWeight:"bold"},children:["+ ",t]}),n.jsx(P,{component:"span",variant:"subtitle2",sx:{color:"text.secondary"},children:r})]}),n.jsx(Be,{variant:"outlined",size:"small",color:"secondary",endIcon:n.jsx(ot,{icon:gt}),onClick:i,sx:{borderRadius:4},children:"View on Chain"})]})]})}vt.propTypes={meta:m.object.isRequired,type:m.string.isRequired,hideTips:m.bool,sx:m.object};function vt({meta:e,type:t,hideTips:r=!1,sx:s={}}){return O(e)?null:t==="tips"&&!r?n.jsx(Te,{meta:e}):n.jsx(P,{variant:"subtitle2",component:"p",sx:[{fontSize:16,color:"text.secondary",wordBreak:"break-all"},...Array.isArray(s)?s:[s]],children:e.content})}var re,he;function wt(){if(he)return re;he=1;var e=ze();function t(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var r=t(e);function s(){return s=Object.assign?Object.assign.bind():function(a){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)({}).hasOwnProperty.call(f,c)&&(a[c]=f[c])}return a},s.apply(null,arguments)}function i(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,o(a,u)}function p(a,u){if(a==null)return{};var f={};for(var c in a)if({}.hasOwnProperty.call(a,c)){if(u.indexOf(c)!==-1)continue;f[c]=a[c]}return f}function o(a,u){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,c){return f.__proto__=c,f},o(a,u)}var h={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},x=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function v(a,u){if(!a||typeof a!="object")return a;var f={};return Object.keys(a).forEach(function(c){u.indexOf(c)>-1||(f[c]=a[c])}),f}var g=["component","className","unsafeHTML"];function T(a,u){if(u!=="letters"&&u!=="words")throw new Error("Unsupported options basedOn: "+u);if(a.nodeType===Node.TEXT_NODE){var f=document.createDocumentFragment(),c;switch(u){case"words":c=a.textContent.split(/\b|(?=\W)/);break;case"letters":c=Array.from(a.textContent);break}c.forEach(function(N){f.appendChild(L(N))}),a.parentNode.replaceChild(f,a)}else if(a.nodeType===Node.ELEMENT_NODE)for(var l=[].slice.call(a.childNodes),d=l.length,j=0;j<d;j++)T(l[j],u)}function L(a){var u=document.createElement("span");return u.className="LinesEllipsis-unit",u.textContent=a,u}function b(a){a.parentNode.replaceChild(document.createTextNode(a.textContent),a)}function R(a,u){if(!(!u.contains(a)||a===u)){for(;a.nextElementSibling;)a.parentNode.removeChild(a.nextElementSibling);R(a.parentNode,u)}}function M(a){for(var u=a;u=u.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(u.tagName.toLowerCase()))return u}function E(a){return!!(a.offsetHeight&&(a.offsetWidth||/\S/.test(a.textContent)))}var w={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},y=Object.keys(w),C=function(a){function u(c){var l;return l=a.call(this,c)||this,l.props=s({},w,c),l.state={html:c.unsafeHTML,clamped:!1},l.canvas=null,l.maxLine=0,l.nlUnits=[],l}i(u,a);var f=u.prototype;return f.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},f.componentDidUpdate=function(l){l.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==l&&this.reflow(this.props)},f.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},f.setState=function(l,d){return typeof l.clamped<"u"&&(this.clamped=l.clamped),a.prototype.setState.call(this,l,d)},f.initCanvas=function(){if(!this.canvas){var l=this.canvas=document.createElement("div");l.className="LinesEllipsis-canvas "+this.props.className,l.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(h).forEach(function(d){l.style[d]=h[d]}),document.body.appendChild(l)}},f.copyStyleToCanvas=function(){var l=this,d=window.getComputedStyle(this.target);x.forEach(function(j){l.canvas.style[j]=d[j]})},f.reflow=function(l){this.maxLine=+l.maxLine||1,this.canvas.innerHTML=l.unsafeHTML;var d=l.basedOn||(/^[\x00-\x7F]+$/.test(l.unsafeHTML)?"words":"letters");T(this.canvas,d);var j=this.putEllipsis(this.calcIndexes()),N={clamped:j,html:this.canvas.innerHTML};this.setState(N,l.onReflow.bind(this,N))},f.calcIndexes=function(){var l=[0],d=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),j=d.length;if(!d.length)return l;var N=d.find(E);if(!N)return l;for(var I=1,Q=N.offsetTop,U=1;U<j&&!(E(d[U])&&d[U].offsetTop-Q>1&&(I++,l.push(U),Q=d[U].offsetTop,I>this.maxLine));U++);return l},f.putEllipsis=function(l){if(l.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,l[this.maxLine]);var d=this.nlUnits.pop(),j=this.makeEllipsisSpan();do R(d,this.canvas),M(d).appendChild(j),d=this.nlUnits.pop();while(d&&(!E(d)||j.offsetHeight>d.offsetHeight||j.offsetTop>d.offsetTop));return d&&b(d),this.nlUnits.forEach(b),!0},f.makeEllipsisSpan=function(){var l=this.props,d=l.ellipsisHTML,j=l.ellipsis,N=document.createElement("span");N.appendChild(document.createElement("wbr"));var I=document.createElement("span");return I.className="LinesEllipsis-ellipsis",d?I.innerHTML=d:I.textContent=j,N.appendChild(I),N},f.isClamped=function(){return this.clamped},f.render=function(){var l=this,d=this.state,j=d.html,N=d.clamped,I=this.props,Q=I.component,U=I.className,$e=I.unsafeHTML,Oe=p(I,g);return r.default.createElement(Q,s({className:"LinesEllipsis "+(N?"LinesEllipsis--clamped":"")+" "+U,ref:function(We){return l.target=We}},v(Oe,y)),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:N?j:$e}}))},u}(r.default.PureComponent);return re=C,re}var jt=wt();const kt=qe(jt),Tt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},St=e=>e.every(t=>t.type==="text"),Ct=e=>e.every(t=>t.type==="image"),Lt=e=>rt(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(r=>r?.data?.text?.trim?.())),Et=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(r=>r.type===t)},Rt=(e,t)=>{try{const r=at.toTypeInfo(e);if(!(r.role!==void 0&&r.role!==lt.types.RoleType.ACCOUNT))return;const i=G(B.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return ce(i,{did:e,locale:t})}catch(r){console.error(r);return}},sn=(e,t)=>t?.componentMountPoints?.find(s=>s.did===e)?.mountPoint,on=(e,t)=>{if(!e)return null;if(e.actions?.length===1)return e.actions[0].link||null;const r=je(e.activity),s=r?.metaLink||r?.targetLink;if(s)return ke(s)?s:G(t,s);if(e.attachments?.length===1){const i=e.attachments[0];if(i.type==="link")return i.data?.url||null}return null},me=e=>{const{receivers:t=[]}=e;return t.length?t.every(r=>r.read):!0};function Nt(e){const t=e.getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,i=t.height,p=t.width;let o=0;t.top>=0&&t.bottom<=s?o=i:t.top<0&&t.bottom>0&&t.bottom<=s?o=t.bottom:t.top>=0&&t.top<s&&t.bottom>s?o=s-t.top:t.top<0&&t.bottom>s&&(o=s);let h=0;return t.left>=0&&t.right<=r?h=p:t.left<0&&t.right>0&&t.right<=r?h=t.right:t.left>=0&&t.left<r&&t.right>r?h=r-t.left:t.left<0&&t.right>r&&(h=r),o*h/(i*p)>=.5}const an=e=>{if(!e)return[];const t=[],r=5,s=Array.from(e.querySelectorAll(".notification-row")),i=s.length;for(let p=0;p<i;p+=r){const o=s.slice(p,p+r);let h=!0;for(const x of o){const v=x.id;if(Nt(x))t.push(v);else{h=!1;break}}if(!h)break}return t},It=e=>{const t=[];return e&&(e.items?.length?e.items.forEach(r=>{me(r)||t.push(r)}):me(e)||t.push(e)),t},ln=(e,t)=>{let r=[];return t.length&&t.forEach(s=>{const i=e.get(s);i&&(r=r.concat(It(i)))}),r},W=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),K=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${B.WELLKNOWN_SERVICE_PATH_PREFIX}/proxy?url=${encodeURIComponent(e)}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function Se({attachment:e}){const{data:t}=e,r=A();let s="";try{s=new URL(t.url).host}catch{s=t.url}return n.jsxs(ae,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:i=>{i.customPreventRedirect=!0},children:[!!s&&n.jsx("span",{className:"url",children:s}),!!t.title&&n.jsx(k,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&n.jsx(k,{className:"description",style:{whiteSpace:"unset",color:r.palette.text.secondary},children:t.description}),!!t.image&&n.jsx(V,{src:Z.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:K(Z.getImagePath(t.image))})]})}Se.propTypes={attachment:m.object.isRequired};function Ce({attachment:e}){const{data:t}=e;return n.jsx(V,{src:Z.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},sx:{".Img-root":{height:256}},fallback:K(Z.getImagePath(t.url))})}Ce.propTypes={attachment:m.object.isRequired};function Le({attachment:e,...t}){const{data:r}=e,s=r.color?.toLowerCase()||t.color,i=r.size||t.size,p=r.fontWeight||t.fontWeight||400;let o="14px";return i==="small"?o="12px":i==="normal"?o="14px":i==="big"?o="16px":i==="large"&&(o="18px"),n.jsx(Pt,{className:"title",style:{fontSize:o,color:s,whiteSpace:"unset",fontWeight:p},children:r.text})}Le.propTypes={attachment:m.object.isRequired};const Pt=F.span`
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: -webkit-box;
|
|
4
|
-
-webkit-box-orient: vertical;
|
|
5
|
-
-webkit-line-clamp: 2;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
text-overflow: ellipsis;
|
|
8
|
-
white-space: normal;
|
|
9
|
-
word-break: break-word;
|
|
10
|
-
`;var se,fe;function Mt(){return fe||(fe=1,se={getChainHost:r=>{const s="explorer.arcblockio.cn";return r&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[r]||s},getUrlHost:r=>{try{return new URL(r).host}catch{return r}}}),se}var q=Mt(),ie,ge;function Dt(){return ge||(ge=1,ie={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}}),ie}var te=Dt();Ee.propTypes={locale:m.string,data:m.object.isRequired};function Ee({locale:e="en",data:t}){const r={zh:"来自",en:"from"}[e]||"from",s={zh:"接收",en:"Received"}[e]||"Received",p=`https://${q.getUrlHost(t.chainHost)||q.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`,o=A(),h=o.palette.mode==="dark";let x=t.amount;t.decimal&&(x=t.amount/10**t.decimal);const v=_(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:g=>{g.customPreventRedirect=!0},children:n.jsxs(k,{sx:{display:"flex",flexDirection:"column"},children:[n.jsxs(k,{sx:v,children:[n.jsx(P,{component:"div",sx:{fontWeight:700,color:o.palette.text.primary},children:s}),n.jsxs(P,{component:"div",align:"right",style:W(te.summaryStyle,h),sx:{flex:1},children:["+",x," ",t.symbol]})]}),n.jsxs(k,{sx:v,children:[n.jsx(P,{component:"div",style:W({...te.remarkStyle,fontSize:14},h),children:r}),n.jsx(k,{sx:{maxWidth:260,fontSize:14},children:n.jsx(de,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}Re.propTypes={locale:m.string,data:m.object.isRequired,type:m.oneOf(["asset","vc"])};function Re({locale:e="en",data:t,type:r="asset"}){const s={zh:"接收",en:"Received"}[e]||"Received",i={zh:"来自",en:"from"}[e]||"from",p=q.getUrlHost(t.chainHost)||q.getChainHost(t.chainId),o=t.did||t?.credential?.issuer?.id||"",h=`https://${p}/explorer/assets/${o}`,v=A().palette.mode==="dark",g=_(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx(k,{sx:{pr:1},children:n.jsx("a",{href:h,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},onClick:T=>{if(r==="vc"){T.preventDefault();return}T.customPreventRedirect=!0},rel:"noreferrer",children:n.jsxs(k,{sx:{display:"flex",flexDirection:"column"},children:[n.jsxs(k,{sx:g,children:[n.jsx(P,{component:"div",sx:{fontWeight:700,color:"text.primary"},children:s}),n.jsx(P,{component:"div",align:"right",style:W(te.summaryStyle,v),children:"+1 Asset"})]}),o?n.jsxs(k,{sx:g,children:[n.jsx(P,{component:"div",style:W({...te.remarkStyle,fontSize:14},v),children:i}),n.jsx(k,{sx:{maxWidth:260,fontSize:14},children:n.jsx(de,{did:o,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}Ne.propTypes={data:m.object.isRequired,locale:m.string};function Ne({data:e,locale:t="en"}){const s=A().palette.mode==="dark";return n.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},onClick:i=>{i.customPreventRedirect=!0},rel:"noreferrer",children:[n.jsx(V,{className:"image",src:e.logo,width:50,height:50,alt:"",fallback:K(e.logo)}),n.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[n.jsx("div",{style:W({marginBottom:"6px"},s),children:e.title}),n.jsx(k,{sx:{maxWidth:260,fontSize:10},children:n.jsx(de,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}Ie.propTypes={locale:m.string,data:m.object.isRequired};function Ie({locale:e="en",data:t}){const r=q.getChainHost(t.chainId),s=`https://${r}/explorer/txs/${t.hash}`,i={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",p={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash",o=A(),h=o.palette.mode==="dark";return n.jsxs("a",{href:s,target:"_blank",style:W({textDecoration:"none",color:"initial",display:"block",fontSize:14},h),onClick:x=>{x.customPreventRedirect=!0},rel:"noreferrer",children:[n.jsx("h6",{style:{color:o.palette.text.secondary,margin:0},children:r}),n.jsx("p",{style:{color:o.palette.warning.main,margin:0},children:i}),n.jsxs("div",{style:{wordBreak:"break-all"},children:[p,": ",t.hash]})]})}function Pe({attachment:e,...t}){const{local:r}=S.useContext(ct),s=z(p=>p.breakpoints.down("md")),i=A();return n.jsxs(Ut,{...t,isMd:s,children:[e.type==="link"&&n.jsx(Se,{attachment:e,...t,isMd:s}),e.type==="image"&&n.jsx(Ce,{attachment:e,isMd:s}),e.type==="text"&&n.jsx(Le,{attachment:e,isMd:s}),e.type==="token"&&n.jsx(Ee,{data:e.data,local:r,isMd:s}),e.type==="asset"||e.type==="vc"?n.jsx(Re,{data:e.data,local:r,isMd:s,type:e.type}):null,e.type==="dapp"&&n.jsx(Ne,{data:e.data,local:r,isMd:s}),e.type==="transaction"&&n.jsx(Ie,{data:e.data,local:r,...t,isMd:s}),e.type==="divider"&&n.jsx(ye,{sx:{mb:1,mt:1},style:{color:i.palette.divider}})]})}const Ut=F.div`
|
|
11
|
-
display: ${({sx:e={}})=>e.display||"flex"};
|
|
12
|
-
flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
|
|
13
|
-
gap: ${({sx:e={}})=>e.gap||1};
|
|
14
|
-
width: ${({isMd:e=!1})=>e?"100%":"auto"};
|
|
15
|
-
&:last-child {
|
|
16
|
-
margin-bottom: 0;
|
|
17
|
-
}
|
|
18
|
-
`;Pe.propTypes={attachment:m.object.isRequired};function Me({data:e,...t}){const{items:r}=e;return n.jsx(At,{...t,children:r.map(s=>n.jsxs(be,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[n.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.icon?n.jsx(V,{src:s.icon,alt:s.title,style:{width:16,height:16},fallback:K(s.icon)}):null,n.jsxs(k,{className:"metric-name",sx:{display:"flex",alignItems:"center"},children:[s.title,s.subtitle?n.jsx(Ve,{title:s.subtitle,arrow:!0,placement:"top",children:n.jsx(Ke,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),n.jsxs(k,{className:"metric-number",sx:{color:s.content_color||"rgba(3, 7, 18, 1)"},children:[s.content,s.sub_content?n.jsxs("span",{className:"sub-content",style:{color:s.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",s.sub_content,")"]}):null]})]},s.title))})}const At=F(k)`
|
|
19
|
-
display: flex;
|
|
20
|
-
justify-content: flex-start;
|
|
21
|
-
flex-wrap: wrap;
|
|
22
|
-
gap: 16px;
|
|
23
|
-
.metric-number {
|
|
24
|
-
font-size: 18px;
|
|
25
|
-
font-weight: 600;
|
|
26
|
-
.sub-content {
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
margin-left: 4px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
.metric-name {
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
color: rgba(156, 163, 175, 1);
|
|
35
|
-
}
|
|
36
|
-
`;Me.propTypes={data:m.object.isRequired};function De({data:e}){const{items:t}=e,r=z(o=>o.breakpoints.down("sm")),s=z(o=>o.breakpoints.down("md")),i=z(o=>o.breakpoints.down("lg")),p=()=>r?1:s?3:i?4:6;return n.jsx(Qe,{variant:"quilted",cols:p(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(o=>{const h=o.cover||o.display;return h?n.jsx("a",{href:o.link,target:"_blank",rel:"noopener noreferrer",children:n.jsx(Xe,{children:n.jsx(V,{src:h,alt:o.title||"",style:{borderRadius:"8px"},fallback:K(h)})})},h):null})})}De.propTypes={data:m.object.isRequired};function Ue({data:e,feedType:t="data-tracker",...r}){return n.jsxs(Ht,{...r,children:[t==="data-tracker"&&e.type==="table"&&n.jsx(Me,{data:e}),(t==="graphic"||t==="gallery")&&n.jsx(De,{data:e})]})}const Ht=F.div`
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
width: 100%;
|
|
40
|
-
margin-bottom: 4px;
|
|
41
|
-
&:last-child {
|
|
42
|
-
margin-bottom: 0;
|
|
43
|
-
}
|
|
44
|
-
`;Ue.propTypes={data:m.object.isRequired,feedType:m.string};J.propTypes={data:m.object.isRequired,style:m.object};function J({data:e,style:t={}}){const s=A().palette.mode==="dark";return n.jsx(P,{style:W({color:s&&e.darkModeColor?e.darkModeColor:e.color||"initial",margin:0,whiteSpace:"pre-line!important",...t},s),children:e.text})}function Ae({data:e}){const t=[];for(let r=0;r<e?.length;r+=2){const s=e[r],i=e[r+1];s&&i?t.push(n.jsxs(xe,{children:[n.jsx("td",{className:"label-col",children:n.jsx(J,{data:s.data,style:{whiteSpace:"nowrap",fontSize:"14px"}})}),n.jsx("td",{className:"value-col",children:n.jsx(J,{data:i.data,style:{wordBreak:"break-all",textAlign:"right",fontSize:"14px"}})})]},r)):s&&t.push(n.jsx(xe,{children:n.jsx("td",{className:"label-col",children:n.jsx(J,{data:s.data,style:{fontSize:"14px"}})})},r))}return n.jsx("table",{style:{width:"100%"},children:n.jsx("tbody",{children:t})})}Ae.propTypes={data:m.array.isRequired};const xe=F.tr`
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: row;
|
|
47
|
-
justify-content: flex-start;
|
|
48
|
-
align-items: center;
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
gap: ${({theme:e})=>e.spacing(1)};
|
|
51
|
-
padding: ${({theme:e})=>e.spacing(1)} 0;
|
|
52
|
-
border-bottom: 1px solid ${({theme:e})=>e.palette.divider};
|
|
53
|
-
|
|
54
|
-
&:last-child {
|
|
55
|
-
border-bottom: none;
|
|
56
|
-
padding-bottom: 0;
|
|
57
|
-
}
|
|
58
|
-
&:first-child {
|
|
59
|
-
padding-top: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.label-col {
|
|
63
|
-
min-width: 130px;
|
|
64
|
-
flex-shrink: 0;
|
|
65
|
-
}
|
|
66
|
-
.value-col {
|
|
67
|
-
flex: 1;
|
|
68
|
-
}
|
|
69
|
-
`;function He({notification:e,severity:t,showSke:r=!0}){const{attachments:s,data:i,...p}=e,o=z(g=>g.breakpoints.down("md"));if((!s||!s.length)&&O(i))return null;const h=Tt(t),x=(g,T=!1)=>{if(!g&&!Array.isArray(g))return null;let L=g,b={},R="horizontal";T&&St(g)&&(L=Lt(g),R="vertical",b={display:"flex",gap:8,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%",width:o||L.length===1?"100%":"28%"});const M=Et(L);return n.jsx(k,{sx:{width:"100%",display:"flex",gap:1,flexDirection:T?"row":"column",justifyContent:"flex-start",alignItems:T?"center":"unset",flexWrap:"wrap"},children:L.map((E,w)=>E.type==="section"?n.jsx(Ae,{data:E.fields},w):n.jsxs(S.Fragment,{children:[n.jsx(Pe,{attachment:E,style:b,...p}),!(o&&R==="vertical")&&M&&L.length>1&&w!==L.length-1?n.jsx(ye,{orientation:R,style:{color:ht.dividerColor},sx:R==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},w))})},v=Ct(s);return n.jsx(_t,{children:n.jsxs("div",{className:"message-in-list",children:[s.length>0&&n.jsx("div",{className:"message-container",style:o?{width:"100%"}:{},children:v?x(s):n.jsx(be,{variant:"outlined",className:"attachment-card",sx:{px:o?1:2,py:1.5,borderRadius:"8px",minWidth:128,borderColor:h},children:x(s)})}),!O(i)&&n.jsx("div",{className:"message-container",children:n.jsx("div",{className:"data-container",children:n.jsx(Ue,{data:i,feedType:e.feedType})})}),s.length===0&&O(i)&&r&&n.jsx(Ye,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const _t=F.div`
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
.message-in-list {
|
|
73
|
-
padding: ${({theme:e})=>`${e.spacing(1.5)} ${e.spacing(1.5)} ${e.spacing(1.5)} 0`};
|
|
74
|
-
display: flex;
|
|
75
|
-
border-radius: 8px;
|
|
76
|
-
}
|
|
77
|
-
.message-title {
|
|
78
|
-
color: #25292f;
|
|
79
|
-
font-size: 18px;
|
|
80
|
-
font-weight: bold;
|
|
81
|
-
word-break: break-all;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.attach-ske {
|
|
85
|
-
position: relative;
|
|
86
|
-
margin-left: 10px;
|
|
87
|
-
&::after {
|
|
88
|
-
content: '';
|
|
89
|
-
position: absolute;
|
|
90
|
-
left: -10px;
|
|
91
|
-
top: 0;
|
|
92
|
-
height: 100%;
|
|
93
|
-
width: 4px;
|
|
94
|
-
background-color: ${e=>e.leftLineColor};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.message-body {
|
|
99
|
-
color: #25292f;
|
|
100
|
-
font-size: 16px;
|
|
101
|
-
word-break: break-all;
|
|
102
|
-
white-space: pre-line;
|
|
103
|
-
}
|
|
104
|
-
.message-container {
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
justify-content: flex-start;
|
|
108
|
-
.data-container,
|
|
109
|
-
.attachment-container {
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: column;
|
|
112
|
-
width: 100%;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
.actions-container {
|
|
116
|
-
margin-top: 10px;
|
|
117
|
-
.actions-item {
|
|
118
|
-
margin-right: 8px;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
`;He.propTypes={severity:m.string.isRequired,notification:m.object.isRequired,showSke:m.bool};const oe=e=>Je.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),$t=async(e,t)=>{const{type:r,did:s}=e;return ve.isSameAddr(r,"did")?await Rt(s,t)||ee.getLink(e):ee.getLink(e)};function Ot(e){return new TextEncoder().encode(e).length>=1e4}const Wt=async(e,t,r=!0)=>{let s=e;Ot(e)&&(s=e.slice(0,1e4));const i=ee.toTextList(s);return await Promise.all(i.map(async o=>{if(o instanceof ee.Link){if(r){const h=await $t(o,t),{type:x,chainId:v,did:g}=o;return ve.isSameAddr(x,"dapp")?`<em style="font-weight:bold;" data-type="${x}" data-chain-id="${v}" data-did="${g}">${o.text}</em>`:h?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${h}">${o.text}</a>`:`<em style="font-weight:bold;" data-type="${x}" data-chain-id="${v}" data-did="${g}">${o.text}</em>`}return o.text}return o})).then(o=>o.join(""))};_e.propTypes={notification:m.object,rows:m.number,minimal:m.bool};function _e({notification:e,rows:t=2,minimal:r=!1}){const[s,i]=S.useState(!1),[p,o]=S.useState(""),{t:h,locale:x}=we(),{palette:v}=A(),g=S.useMemo(()=>{const{attachments:w}=e||{};if(!w)return!1;try{return w.length>0}catch{return!1}},[e]),T=S.useMemo(()=>{const{blocks:w}=e||{};if(!w)return!1;try{return w.length>0}catch{return!1}},[e]),L=S.useMemo(()=>{const{description:w}=e||{};return!!w},[e]),b=S.useMemo(()=>{const{data:w}=e||{};return!O(w)},[e]),R=S.useMemo(()=>g||T||L||b,[g,T,L,b]);if(S.useEffect(()=>{Wt(e?.description??"",x).then(w=>{o(w)})},[e?.description,x]),!R)return null;const M=()=>t===0?"":s?`<span class='toggle-btn' data-name='toggle-expanded'>${h("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${h("common.expand")}</span>`,E=w=>{const{target:y}=w;y.getAttribute("data-name")==="toggle-expanded"&&(i(!s),w.customPreventRedirect=!0)};return n.jsxs(Ft,{color:r?v.common.white:"",children:[n.jsx(k,{className:"text-container",component:"div",onClick:E,children:p&&(!s&&t>0?n.jsx(kt,{innerRef:()=>{},onReflow:()=>{},basedOn:"letters",component:"article",unsafeHTML:oe(p),maxLine:t,ellipsisHTML:oe(M())}):n.jsx(P,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important"},dangerouslySetInnerHTML:{__html:oe(`${p}${M()}`)}}))}),!r&&(g||b)?n.jsx(He,{severity:e.severity,notification:e}):null]})}const Ft=F(k)`
|
|
122
|
-
width: 100%;
|
|
123
|
-
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
124
|
-
.text-container {
|
|
125
|
-
word-wrap: break-word;
|
|
126
|
-
word-break: break-all;
|
|
127
|
-
color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
|
|
128
|
-
.toggle-btn {
|
|
129
|
-
display: inline-block;
|
|
130
|
-
white-space: nowrap;
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
margin-left: 4px;
|
|
133
|
-
color: ${e=>e.theme.palette.secondary.main};
|
|
134
|
-
}
|
|
135
|
-
.content.ellipsis {
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
text-overflow: ellipsis;
|
|
138
|
-
word-break: break-all;
|
|
139
|
-
display: block;
|
|
140
|
-
display: -webkit-box;
|
|
141
|
-
-webkit-box-orient: vertical;
|
|
142
|
-
-webkit-line-clamp: 2;
|
|
143
|
-
line-height: 1.25;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
`,cn=S.memo(_e);function dn({blocklet:e,square:t}={}){const{logoUrl:r,logoDarkUrl:s,rectLogoUrl:i,rectLogoDarkUrl:p}=ut({blocklet:e}),o=S.useMemo(()=>({appLogo:r,appLogoDark:s,appLogoRect:i,appLogoRectDark:p}),[r,s,i,p]);return Ze({meta:o,square:t})}const pe=S.createContext({}),{Provider:pn,Consumer:un}=pe;function hn(){return S.useContext(pe)}const{Provider:zt,Consumer:mn}=pe,{did:D,appId:qt}=window.env;function fn({children:e,mode:t="dashboard"}){const{t:r,locale:s}=we(),{blocklet:i}=et(),[p,o]=S.useState([]),[h,x]=S.useState([]),[v,g]=S.useState([]),T=tt.getDisplayName(i),L=(i?.environments||[]).find(c=>c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR)?.value||"auto",b=i?.trustedPassports||[],R=i?.trustedFactories||[],M=i?.enablePassportIssuance!==!1,E=async()=>{try{const c=await Y.doBatchQuery({getRoles:{input:{teamDid:D}},getPermissions:{input:{teamDid:D}},getInvitations:{input:{teamDid:D}}}),l=(c.getRoles.roles||[]).filter(d=>!B.RBAC_CONFIG.roles.some(j=>j.name===d.name&&(!j.passport||j.ci))&&!d.orgId).map(d=>(d.hasDescription=!!d.description,d.hasDescription||(d.description=r("team.passport.description",{teamName:T,title:d.title})),d));x(st(l,[d=>nt(d.name)],["desc"])),g(c.getPermissions.permissions||[]),o(c.getInvitations.invitations||[])}catch(c){dt.error(c.message)}},w=({did:c}={})=>{const l={teamDid:D,user:{did:c}};return Y.getUser({input:l})},y=({query:c,paging:l}={})=>{const d={teamDid:D};return l&&(d.paging=l),c&&(d.query=c),d.sort={lastLoginAt:-1},Y.getUsers({input:d})},C=()=>Y.getUsersCountPerRole({input:{teamDid:D}}),a=()=>E();S.useEffect(()=>{i?.meta?.did&&E()},[i?.meta?.did]),S.useEffect(()=>{x(c=>c.map(l=>(l.hasDescription||(l.description=r("team.passport.description",{teamName:T,title:l.title})),{...l})))},[r,s]);const u=c=>{c.teamDid===D&&E()};ne(t==="dashboard"?X.TeamEvents.userAdded:"",u,[D]),ne(t==="dashboard"?X.TeamEvents.userRemoved:"",u,[D]),ne(t==="dashboard"?X.TeamEvents.userUpdated:"",u,[D]);const f={teamDid:D,teamIssuerDid:qt,teamName:T,invitations:p,roles:h,permissions:v,trustedPassports:b,trustedFactories:R,isNodeTeam:!1,enablePassportIssuance:M,refresh:a,passportColor:L,endpoint:window.location.origin,blocklet:i,api:{getUser:w,getUsers:y,getUsersCountPerRole:C}};return n.jsx(zt,{value:f,children:e})}export{vt as M,cn as N,fn as T,dn as a,rn as b,nn as c,gt as d,an as e,ln as f,je as g,me as h,ke as i,mt as j,sn as k,It as l,tn as m,on as n,hn as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n,r as k}from"./vendor-react-CUXIiAnY.js";import{aG as je,a1 as T,_ as Ne,aH as de,c as Oe,aR as me}from"./index-BIur1cqW.js";import{X as Te,C as Pe}from"./vendor-utils-Doa0RxLS.js";import{u as Ie}from"./useAsyncRetry-MDM8jCoS.js";import{I as Ye}from"./iframe-DEV2d5VF.js";import{ak as $,P as ye,c2 as h,a3 as ne,T as Y,c5 as Fe,V as He,S as _e,aP as Le,I as K,c6 as We,y as fe,bc as he,M as pe,c7 as Ae,c8 as Ve,n as ge,j as p,W as P,D as qe,a6 as ze,aX as Be,Q as $e,aN as Ke,bO as Xe}from"./vendor-mui-core-___CiWHn.js";import{r as ie,t as Me,i as O,a as re,e as W,s as A,b as I,c as V,d as q,f as X,g as J,h as F,j as C,k as De,l as le,p as Je,m as Ge,n as ce,o as Ue,q as se,u as L,v as Qe,w as Ze,x as et,y as tt,z as at}from"./index-B_fIpHt1.js";import{X as be,V as ke}from"./vendor-ux-pxYpYMxD.js";import{f as nt}from"./index-DBs9Ljax.js";import{B as rt}from"./base-chart-DkkGeB5D.js";import{L as st,a as ot}from"./vendor-mui-x-CYSdP1E1.js";import{A as it}from"./AdapterDayjs-BlYfODzx.js";function Re(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=Me(r);(a===void 0||a<s||isNaN(Number(s)))&&(a=s)}),a||new Date(NaN)}function Se(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=Me(r);(a===void 0||a>s||isNaN(s.getDate()))&&(a=s)}),a||new Date(NaN)}function lt(e){return ie(1,arguments),O(e,Date.now())}const ct=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(a,r)=>e.slice(r*t,r*t+t)),ut=(e,t)=>{const a=A(q(e),{locale:t}),r=W(V(e),{locale:t}),s=[];for(let o=a;L(o,r);)s.push(o),o=re(o,1);return s},dt=({startDate:e},t)=>e&&O(t,e),mt=({endDate:e},t)=>e&&O(t,e),ft=({startDate:e,endDate:t},a)=>e&&t&&(le(a,{start:e,end:t})||O(a,e)||O(a,t)),ht=({startDate:e,endDate:t})=>e&&t?O(e,t):!1,xe=(e,t)=>{if(e){const a=e instanceof Date?e:Je(e);if(Ge(a))return a}return t},pt=(e,t,a)=>{const{startDate:r,endDate:s}=e;if(r&&s){const o=Re([r,t]),c=Se([s,a]);return[o,ce(o,c)?C(o,1):c]}return[r,s]},gt=(e,t)=>[{label:"Today",startDate:e,endDate:e},{label:"Yesterday",startDate:re(e,-1),endDate:re(e,-1)},{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(I(e,-1),{locale:t}),endDate:W(I(e,-1),{locale:t})},{label:"Last 7 Days",startDate:I(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:V(e)},{label:"Last Month",startDate:q(C(e,-1)),endDate:V(C(e,-1))},{label:"This Year",startDate:J(e),endDate:X(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:X(F(e,-1))}],Dt=(e,t)=>{const a=Math.floor(t/2);return Array(t).fill(0).map((r,s)=>e.getFullYear()-a+s)},xt=({date:e,setDate:t,nextDisabled:a,prevDisabled:r,onClickNext:s,onClickPrevious:o,locale:c})=>{const m=typeof c<"u"?[...Array(12).keys()].map(l=>{var x;return(x=c.localize)===null||x===void 0?void 0:x.month(l,{width:"abbreviated",context:"standalone"})}):["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],g=l=>{t(tt(e,parseInt(l.target.value,10)))},u=l=>{t(at(e,parseInt(l.target.value,10)))};return n.createElement(h,{container:!0,justifyContent:"space-between",alignItems:"center"},n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:r,onClick:o},n.createElement(We,{color:r?"disabled":"action"}))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:Ze(e),onChange:g,MenuProps:{disablePortal:!0}},m.map((l,x)=>n.createElement(pe,{key:l,value:x},l))))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:et(e),onChange:u,MenuProps:{disablePortal:!0}},Dt(e,30).map(l=>n.createElement(pe,{key:l,value:l},l))))),n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:a,onClick:s},n.createElement(Ae,{color:a?"disabled":"action"}))))},vt=({startOfRange:e,endOfRange:t,disabled:a,highlighted:r,outlined:s,filled:o,onClick:c,onHover:m,value:g})=>n.createElement($,{sx:{display:"flex",borderRadius:e?"50% 0 0 50%":t?"0 50% 50% 0":void 0,backgroundColor:u=>!a&&r?u.palette.primary.light:void 0}},n.createElement(K,{sx:Object.assign({height:"36px",width:"36px",padding:0,border:u=>!a&&s?`1px solid ${u.palette.primary.dark}`:void 0},!a&&o?{"&:hover":{backgroundColor:u=>u.palette.primary.dark},backgroundColor:u=>u.palette.primary.dark}:{}),disabled:a,onClick:c,onMouseOver:m},n.createElement(Y,{sx:{lineHeight:1.6,color:u=>a?u.palette.text.secondary:o?u.palette.primary.contrastText:u.palette.text.primary},variant:"body2"},g)));var G;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(G||(G={}));const ve=e=>{var t;const{helpers:a,handlers:r,value:s,dateRange:o,marker:c,setValue:m,minDate:g,maxDate:u,locale:l}=e,x=((t=l?.options)===null||t===void 0?void 0:t.weekStartsOn)||0,w=typeof l<"u"?[...Array(7).keys()].map(D=>{var E;return(E=l.localize)===null||E===void 0?void 0:E.day((D+x)%7,{width:"short",context:"standalone"})}):["Su","Mo","Tu","We","Th","Fr","Sa"],[v,R]=e.navState;return n.createElement(ye,{square:!0,elevation:0,sx:{width:290}},n.createElement(h,{container:!0},n.createElement(xt,{date:s,setDate:m,nextDisabled:!R,prevDisabled:!v,onClickPrevious:()=>r.onMonthNavigate(c,G.Previous),onClickNext:()=>r.onMonthNavigate(c,G.Next),locale:l}),n.createElement(h,{item:!0,container:!0,direction:"row",justifyContent:"space-between",sx:{marginTop:"10px",paddingLeft:"30px",paddingRight:"30px"}},w.map((D,E)=>n.createElement(Y,{color:"textSecondary",key:E,variant:"caption"},D))),n.createElement(h,{item:!0,container:!0,direction:"column",justifyContent:"space-between",sx:{paddingLeft:"15px",paddingRight:"15px",marginTop:"15px",marginBottom:"20px"}},ct(ut(s,l),7).map((D,E)=>n.createElement(h,{key:E,container:!0,direction:"row",justifyContent:"center"},D.map(f=>{const j=dt(o,f),b=mt(o,f),S=ht(o),y=ft(o,f)||a.inHoverRange(f);return n.createElement(vt,{key:se(f,"dd-MM-yyyy"),filled:j||b,outlined:lt(f),highlighted:y&&!S,disabled:!ce(s,f)||!le(f,{start:g,end:u}),startOfRange:j&&!S,endOfRange:b&&!S,onClick:()=>r.onDayClick(f),onHover:()=>r.onDayHover(f),value:Qe(f)})}))))))},Ee=(e,t)=>{const{startDate:a,endDate:r}=e,{startDate:s,endDate:o}=t;return a&&s&&r&&o?O(a,s)&&O(r,o):!1},Et=({ranges:e,setRange:t,selectedRange:a})=>n.createElement(He,null,e.map((r,s)=>n.createElement(_e,{button:!0,key:s,onClick:()=>t(r),sx:[Ee(r,a)&&{backgroundColor:o=>o.palette.primary.dark,color:"primary.contrastText","&:hover":{color:"inherit"}}]},n.createElement(Le,{primaryTypographyProps:{variant:"body2",sx:{fontWeight:Ee(r,a)?"bold":"normal"}}},r.label)))),oe={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},yt=e=>{const{ranges:t,dateRange:a,minDate:r,maxDate:s,firstMonth:o,setFirstMonth:c,secondMonth:m,setSecondMonth:g,setDateRange:u,helpers:l,handlers:x,locale:w}=e,{startDate:v,endDate:R}=a,D=Ue(m,o)>=2,E={dateRange:a,minDate:r,maxDate:s,helpers:l,handlers:x};return n.createElement(ye,{elevation:5,square:!0},n.createElement(h,{container:!0,direction:"row",wrap:"nowrap"},n.createElement(h,null,n.createElement(Et,{selectedRange:a,ranges:t,setRange:u})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(h,null,n.createElement(h,{container:!0,sx:{padding:"20px 70px"},alignItems:"center"},n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},v?se(v,"dd MMMM yyyy",{locale:w}):"Start Date")),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Fe,{color:"action"})),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},R?se(R,"dd MMMM yyyy",{locale:w}):"End Date"))),n.createElement(ne,null),n.createElement(h,{container:!0,direction:"row",justifyContent:"center",wrap:"nowrap"},n.createElement(ve,Object.assign({},E,{value:o,setValue:c,navState:[!0,D],marker:oe.FIRST_MONTH,locale:w})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(ve,Object.assign({},E,{value:m,setValue:g,navState:[D,!0],marker:oe.SECOND_MONTH,locale:w}))))))},Mt=e=>{const t=new Date,{open:a,onChange:r,initialDateRange:s,minDate:o,maxDate:c,definedRanges:m=gt(new Date,e.locale),locale:g}=e,u=xe(o,F(t,-10)),l=xe(c,F(t,10)),[x,w]=pt(s||{},u,l),[v,R]=k.useState(Object.assign({},s)),[D,E]=k.useState(),[f,j]=k.useState(x||t),[b,S]=k.useState(w||C(f,1)),{startDate:y,endDate:H}=v,z=d=>{L(d,b)&&j(d)},_=d=>{De(d,f)&&S(d)},U=d=>{let{startDate:i,endDate:M}=d;if(i&&M)d.startDate=i=Re([i,u]),d.endDate=M=Se([M,l]),R(d),r(d),j(i),S(ce(i,M)?C(i,1):M);else{const ue={};R(ue),r(ue),j(t),S(C(f,1))}},B=d=>{if(y&&!H&&!L(d,y)){const i={startDate:y,endDate:d};r(i),R(i)}else R({startDate:d,endDate:void 0});E(d)},Q=(d,i)=>{if(d===oe.FIRST_MONTH){const M=C(f,i);L(M,b)&&j(M)}else{const M=C(b,i);L(f,M)&&S(M)}},Z=d=>{y&&!H&&(!D||!O(d,D))&&E(d)},te={inHoverRange:d=>y&&!H&&D&&De(D,y)&&le(d,{start:y,end:D})},ae={onDayClick:B,onDayHover:Z,onMonthNavigate:Q};return a?k.createElement(yt,{dateRange:v,minDate:u,maxDate:l,ranges:m,firstMonth:f,secondMonth:b,setFirstMonth:z,setSecondMonth:_,setDateRange:U,helpers:te,handlers:ae,locale:g}):null},bt=e=>{const{closeOnClickOutside:t,wrapperClassName:a,toggle:r,open:s}=e,o=()=>{t!==!1&&r()},c=m=>m?.key==="Escape"&&o();return n.createElement($,{sx:{position:"relative"}},s&&n.createElement($,{sx:{position:"fixed",height:"100vh",width:"100vw",bottom:0,zIndex:0,right:0,left:0,top:0},onKeyPress:c,onClick:o}),n.createElement($,{sx:{position:"relative",zIndex:1},className:a},n.createElement(Mt,Object.assign({},e))))},kt=e=>n.createElement(bt,Object.assign({},e));function we({title:e="",total:t=0,hoverIndex:a=null,onHover:r=()=>{},history:s=[],valueFn:o=c=>c}){const c=Ve(),{locale:m}=ke(),g=[{min:0,max:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)},{min:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)}];return p.jsx(rt,{title:e,total:t,history:s,valueFn:o,onHover:r,hoverIndex:a,xAxisFormat:u=>je(u,"MM-DD",m),visualMapPieces:g,markLineData:void 0,extraInfo:null})}we.propTypes={title:P.string,total:P.number,history:P.array,valueFn:P.func,hoverIndex:P.number,onHover:P.func};const N=Te(0),Ce=(e,t)=>[{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(I(e,-1),{locale:t}),endDate:W(I(e,-1),{locale:t})},{label:"Last 7 Days",startDate:I(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:V(e)},{label:"Last Month",startDate:q(C(e,-1)),endDate:V(C(e,-1))},{label:"This Year",startDate:J(e),endDate:X(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:X(F(e,-1))}],Rt=Array.from({length:7},(e,t)=>({value:0,date:T().subtract(t,"day").format("YYYY-MM-DD")})).reverse();function St({client:e,did:t}){const a=T().subtract(1,"day").toDate(),{info:r,inService:s}=Ne(),{t:o,locale:c}=ke(),[m,g]=k.useState(null),[u,l]=k.useState(!1),[x,w]=k.useState(a),[v,R]=k.useState({startDate:T().subtract(30,"day").toDate(),endDate:a}),D=qe(),[E,f]=k.useState(null),j=k.useCallback(i=>{f(i)},[]),b=Ie(async()=>(await e.getTrafficInsights({input:{did:t,startDate:T(v.startDate).format("YYYY-MM-DD"),endDate:T(v.endDate).format("YYYY-MM-DD")}})).list);k.useEffect(()=>{b.loading||v.startDate&&v.endDate&&b.retry()},[v]);const S=i=>{g(m?null:i.currentTarget)},y=b.value||[],{loading:H,error:z}=b;if(!y.length&&H)return p.jsx(ze,{});if(z)return p.jsx(Be,{severity:"error",children:nt(z)});const _={totalRequests:N,validRequests:N,failedRequests:N,uniqueVisitors:N,uniqueFiles:N,uniqueReferrers:N,uniqueNotFound:N,uniqueStaticFiles:N,logSize:de,bandwidth:de},U=Object.keys(_).map(i=>({id:`${i}_chart`,title:o(`analytics.traffic.${i}`),current:y.length?_[i](y[0][i]):0,data:y.length?y.map(M=>({date:M.date,value:M[i]})).reverse():Rt,dateFn:N,valueFn:_[i],total:0})),B=!!m,Q=B?"date-range-picker-popover":void 0,Z=s?Oe.WELLKNOWN_SERVICE_PATH_PREFIX:r.routing.adminPath,ee=Pe(window.location.origin,Z,`/api/analytics/traffic?date=${T(x).format("YYYY-MM-DD")}&did=${t}&theme=${D.palette.mode}`),te=i=>{R(i),g(null)},ae=i=>{w(i.toDate()),l(!1)},d=()=>{window.open(ee)};return p.jsxs("div",{children:[p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:[o("analytics.trend"),p.jsxs($e,{onClick:S,variant:"outlined",size:"small",color:"inherit",sx:{fontWeight:400},children:[me(v.startDate,c)," - ",me(v.endDate,c)]})]}),p.jsx(Ke,{id:Q,open:B,anchorEl:m,onClose:()=>g(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:p.jsx(kt,{open:!0,toggle:S,maxDate:a,definedRanges:Ce(x),onChange:te})}),p.jsx(h,{container:!0,spacing:4,children:U.map(i=>p.jsx(h,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:p.jsx(we,{title:`${i.title}`,total:i.total,empty:null,history:i.data,style:{height:150},valueFn:i.valueFn,hoverIndex:E,onHover:j})},i.id))}),p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mt:4,mb:1},children:[o("analytics.detail"),p.jsxs("span",{children:[u&&p.jsx(K,{onClick:d,style:{marginRight:32},children:p.jsx(Xe,{})}),p.jsx(st,{dateAdapter:it,children:p.jsx(ot,{disableFuture:!0,format:"ll",value:T(x),onChange:ae,slotProps:{textField:{size:"small"}}})})]})]}),p.jsx(Ye,{url:ee,width:"100%",height:"100%",frameBorder:0,onLoad:()=>l(!0),styles:{border:0,minHeight:"400vh"}})]})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,default:St,getDefaultRanges:Ce},Symbol.toStringTag,{value:"Module"}));export{kt as D,Ce as g,Lt as t};
|