@abtnode/blocklet-services 1.17.4-beta-20251202-122551-267b614d → 1.17.4-beta-20251203-225234-75da41dd
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/dist/assets/{access-control-B9EJ5tQF.js → access-control-D1ovo6-o.js} +1 -1
- package/dist/assets/{add-component-core-VVqL08Uq.js → add-component-core-BIhDwpuV.js} +1 -1
- package/dist/assets/{add-resource-DPXu2LFD.js → add-resource-C4TkG7UD.js} +1 -1
- package/dist/assets/{addon-DimuRKXu.js → addon-DAMRKj2r.js} +1 -1
- package/dist/assets/{advanced-C-M8n1zk.js → advanced-BPAoOjLm.js} +1 -1
- package/dist/assets/{aigne-Blnb_Xmg.js → aigne-B6ByRL09.js} +1 -1
- package/dist/assets/{appearance-DcbXeaDh.js → appearance-EkIyryBQ.js} +1 -1
- package/dist/assets/{ar-DW15ct8A.js → ar-oq8oqbkp.js} +1 -1
- package/dist/assets/{arrow-down.svg-CNh-MHKv.js → arrow-down.svg-Cn1jfZom.js} +1 -1
- package/dist/assets/{audit-logs-D0mYj6Ut.js → audit-logs-C9C7P-Sv.js} +1 -1
- package/dist/assets/{authorize-CZdmLVec.js → authorize-DrmC8YuR.js} +1 -1
- package/dist/assets/{bind-account-GnACtKqD.js → bind-account-BBEcbwvl.js} +1 -1
- package/dist/assets/{branding-CFP8OuF1.js → branding-BznRcuN9.js} +1 -1
- package/dist/assets/{branding-DmNLEN0a.js → branding-ChfGbwwx.js} +1 -1
- package/dist/assets/{branding-CihykCDo.js → branding-GuXEK2Lx.js} +1 -1
- package/dist/assets/{bundle-avatar-D3mFZG-3.js → bundle-avatar-DGFHJNB_.js} +1 -1
- package/dist/assets/{complete-BDYaBiHT.js → complete-DGRt8hbz.js} +1 -1
- package/dist/assets/{component-D_iXTtDp.js → component-7HXhlkqA.js} +2 -2
- package/dist/assets/{config--X9TgCMx.js → config-De0LSoek.js} +1 -1
- package/dist/assets/{config-C_UzRk_x.js → config-hYngbDX9.js} +1 -1
- package/dist/assets/{config-xLf7B5vm.js → config-jsIGlbhn.js} +1 -1
- package/dist/assets/{config-navigation-zOEBEK_N.js → config-navigation-Dnu_lIYd.js} +2 -2
- package/dist/assets/{config-space-D1vOxWrR.js → config-space-Cjm8zHqm.js} +1 -1
- package/dist/assets/{confirm-CC1M9sYT.js → confirm-g44rz8hw.js} +1 -1
- package/dist/assets/{connect-4mXUuWwC.js → connect-CdDqD7_5.js} +1 -1
- package/dist/assets/{connect-BpoYmTzp.js → connect-DiOZmi5p.js} +1 -1
- package/dist/assets/{connect-to-YDMOcSyq.js → connect-to-Bi5k3ZXU.js} +1 -1
- package/dist/assets/dashboard-Bcb81CDA.js +106 -0
- package/dist/assets/{de-DomrlJGv.js → de-CvWwatyh.js} +1 -1
- package/dist/assets/{delete-confirm-DF03c_mf.js → delete-confirm-Cw0wPOzJ.js} +1 -1
- package/dist/assets/{domain-DdkBc4bt.js → domain-BpCcezRq.js} +1 -1
- package/dist/assets/{domain-action-card-B8tM4_TO.js → domain-action-card-FG12ETj5.js} +1 -1
- package/dist/assets/{domains-CdpvlDLA.js → domains-Cgl-LcPh.js} +1 -1
- package/dist/assets/{email-DOKW1a_7.js → email-DmAbJJ8K.js} +1 -1
- package/dist/assets/engine-BXpJ8aB3.js +1 -0
- package/dist/assets/{es-BWRncAvl.js → es-DS01ke5n.js} +1 -1
- package/dist/assets/{exchange-passport-Dnbu3e66.js → exchange-passport-C3TLdHrh.js} +1 -1
- package/dist/assets/{form-mmswDYpL.js → form-BGvxztTN.js} +1 -1
- package/dist/assets/{fr-DkEISw5U.js → fr-DzxE_CQq.js} +1 -1
- package/dist/assets/{fuel-CpCUHgkW.js → fuel-BHnBcNst.js} +1 -1
- package/dist/assets/{gen-access-key-OHc0npoi.js → gen-access-key-DMekoh9G.js} +1 -1
- package/dist/assets/{gen-simple-access-key-C6tIufX7.js → gen-simple-access-key-CKo8-San.js} +1 -1
- package/dist/assets/{get-safe-url-DUB5fSqh.js → get-safe-url-DHtEly1m.js} +1 -1
- package/dist/assets/{hi-CNLsAFCp.js → hi-BNIc0EGT.js} +1 -1
- package/dist/assets/{home-BFI-HNBw.js → home-Disgh1zw.js} +1 -1
- package/dist/assets/{id-CiNosIvh.js → id-AeuJFLj9.js} +1 -1
- package/dist/assets/{iframe-DB0OcQ6i.js → iframe-DWt09ONv.js} +1 -1
- package/dist/assets/{index-BuIBrsUM.js → index--6oAMl0L.js} +1 -1
- package/dist/assets/{index-wS_uPsSR.js → index-B87ktLq-.js} +1 -1
- package/dist/assets/{index-D8w8SYuc.js → index-BC_wNmTA.js} +1 -1
- package/dist/assets/{index-3hHmW6B5.js → index-BnfJXuxc.js} +1 -1
- package/dist/assets/{index-Bksy_mMO.js → index-CG-mH6e1.js} +1 -1
- package/dist/assets/{index-DUFdTykg.js → index-CJ1a35hD.js} +1 -1
- package/dist/assets/{index-BphmxdkH.js → index-CPDkpfNV.js} +1 -1
- package/dist/assets/{index-BsP0-mXD.js → index-CSfyeeXh.js} +1 -1
- package/dist/assets/{index-CHbWK92_.js → index-CYxU-iOV.js} +1 -1
- package/dist/assets/{index-DWuLUiY3.js → index-C_W4n3wb.js} +1 -1
- package/dist/assets/{index-WCk612vr.js → index-Cbz9zwoD.js} +1 -1
- package/dist/assets/{index-Xg-It3qI.js → index-Cke5eCl6.js} +1 -1
- package/dist/assets/{index-D0pDhWRx.js → index-CwAM1jrM.js} +1 -1
- package/dist/assets/{index-CeWTwSLE.js → index-Cx5JU0Ln.js} +4 -4
- package/dist/assets/{index-V1TR40-z.js → index-D5tCTUjA.js} +1 -1
- package/dist/assets/{index-Duwa2sz8.js → index-DLvroCDC.js} +1 -1
- package/dist/assets/{index-CtouYMiN.js → index-Dgb4cDcB.js} +1 -1
- package/dist/assets/index-Duu9lR4r.js +281 -0
- package/dist/assets/{index-Bns8G6yV.js → index-DxQFjZlw.js} +2 -2
- package/dist/assets/{index-CDE0c6ul.js → index-DxaRhCwJ.js} +1 -1
- package/dist/assets/{index-CEyMJtzZ.js → index-EH5vv2Ba.js} +3 -3
- package/dist/assets/{index-BMkJtBkv.js → index-Hh69Xj8u.js} +1 -1
- package/dist/assets/{index-Bj8J6jnM.js → index-bb9HF7R1.js} +1 -1
- package/dist/assets/{index-Bw9XS3Zt.js → index-fJzIwqxQ.js} +2 -2
- package/dist/assets/{index-C3BK6ln_.js → index-gy2ZIEt_.js} +1 -1
- package/dist/assets/{index-ohq48KFN.js → index-k8gDRcJR.js} +1 -1
- package/dist/assets/{invitation-BqyhoSaQ.js → invitation-C9uUexLK.js} +1 -1
- package/dist/assets/{invitations-Dmx5LkD1.js → invitations-sELORD_h.js} +1 -1
- package/dist/assets/{invite-E-ZdmNWy.js → invite-CXR3ZLRS.js} +1 -1
- package/dist/assets/{isURL-HS60va5G.js → isURL-CohjRVvR.js} +1 -1
- package/dist/assets/{issue-passport-DhA2Aw2n.js → issue-passport-q8H-mSA2.js} +1 -1
- package/dist/assets/{item-B8ah25gH.js → item-BIqA21iq.js} +1 -1
- package/dist/assets/{ja-D5EfJGvg.js → ja-DVjbOvSw.js} +1 -1
- package/dist/assets/{ko-DIYdQvvz.js → ko-ThcaJAOD.js} +1 -1
- package/dist/assets/{landing-page-DQBBERn_.js → landing-page-DgPDUi6Y.js} +1 -1
- package/dist/assets/{layout-DUsIwJhf.js → layout-Cr6KApqq.js} +1 -1
- package/dist/assets/{list-CLMUEykk.js → list-DZKko9y8.js} +1 -1
- package/dist/assets/{list-C6OYD0M-.js → list-DaqruRvJ.js} +1 -1
- package/dist/assets/{localization-CutEJG9u.js → localization-B72YTR3I.js} +1 -1
- package/dist/assets/{log-CaIfb_mj.js → log-DwPeERno.js} +1 -1
- package/dist/assets/{login-N9lwWO_e.js → login-Fd_qnrRk.js} +1 -1
- package/dist/assets/{login-oauth-callback-U2rdasmV.js → login-oauth-callback-BWKfq40w.js} +1 -1
- package/dist/assets/{logo-uploader-BgXq5jHQ.js → logo-uploader-_reea4L6.js} +1 -1
- package/dist/assets/{lost-passport-CPwExoAp.js → lost-passport-DmkXn2Nz.js} +1 -1
- package/dist/assets/{open-window-BPgl9r9H.js → open-window-DCReXykr.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-Hi-FNl9O.js → over-due-invoice-payment-Bsp5V3AP.js} +1 -1
- package/dist/assets/{overview-DPJo9CyG.js → overview-CXMCgIAo.js} +1 -1
- package/dist/assets/{passport-DMZiwbhL.js → passport-Dsw-sETA.js} +1 -1
- package/dist/assets/{passport-item-yqBy6NcY.js → passport-item-CEM3FQ2i.js} +1 -1
- package/dist/assets/{permission-CiiVpApl.js → permission-G7gi0qR2.js} +1 -1
- package/dist/assets/{preferences-YgFBqLbX.js → preferences-DalbRqbk.js} +1 -1
- package/dist/assets/{profile-embed-C35dSucs.js → profile-embed-CQgwIw3w.js} +1 -1
- package/dist/assets/{pt-aIOBgpHE.js → pt-DKZZkfsB.js} +1 -1
- package/dist/assets/{publish-resource-DUDgKqzf.js → publish-resource-BqB_XJ-d.js} +1 -1
- package/dist/assets/{ru-Bt8-v101.js → ru-DuAqnhp6.js} +1 -1
- package/dist/assets/{runtime-B_yu4wL5.js → runtime-k8xPJwHr.js} +1 -1
- package/dist/assets/sdk-BLKW-lxg.js +1 -0
- package/dist/assets/{security-YhrYNktK.js → security-CnSkbe_3.js} +1 -1
- package/dist/assets/{session-CJQ7HeL8.js → session-CAOgTWka.js} +1 -1
- package/dist/assets/{setup-DVxC6L1D.js → setup-B6xOe2m-.js} +1 -1
- package/dist/assets/{simple-select-BW6-FLlf.js → simple-select-Cg51s1gv.js} +1 -1
- package/dist/assets/{spaces-DB-xtAK9.js → spaces-3bFBxoYi.js} +1 -1
- package/dist/assets/{start-CnOduVio.js → start-CkQJJ_tn.js} +1 -1
- package/dist/assets/{starting-progress-Qp2T3eDZ.js → starting-progress-C1yUqqL2.js} +1 -1
- package/dist/assets/{status-B2iiuI6t.js → status-6KTOVV9E.js} +1 -1
- package/dist/assets/{step-actions-D7ku0W0o.js → step-actions-DHdqImlg.js} +1 -1
- package/dist/assets/{studio-DtnYEBjZ.js → studio-B65PiAI_.js} +1 -1
- package/dist/assets/{team-CKeHAIQC.js → team-CG74iq-4.js} +1 -1
- package/dist/assets/{th-QYkziTlm.js → th-d9fJJu30.js} +1 -1
- package/dist/assets/{traffic-NcU-KhYi.js → traffic-Cyi-eL2B.js} +1 -1
- package/dist/assets/{transfer-CB2s8PFZ.js → transfer-BNHZEvsT.js} +1 -1
- package/dist/assets/{unsubscribe-a8AJuSFd.js → unsubscribe-DmlsM6iA.js} +1 -1
- package/dist/assets/{use-app-logo-D38VoM1R.js → use-app-logo-BAJtA-EN.js} +1 -1
- package/dist/assets/{user-center-BNMJJTvG.js → user-center-CNFpJssw.js} +2 -2
- package/dist/assets/{user-follower-BXm4RUI2.js → user-follower-BsFDOo99.js} +1 -1
- package/dist/assets/{util-DPC-rfKa.js → util-B41ySVcQ.js} +1 -1
- package/dist/assets/{util-MwdZAHoO.js → util-DkhTntVV.js} +1 -1
- package/dist/assets/{vi-BIkODa3n.js → vi-C8B_KLxV.js} +1 -1
- package/dist/assets/{wait-connect-Of13xq9u.js → wait-connect-48vXA6Ey.js} +1 -1
- package/dist/assets/{wizard-BXTkkerl.js → wizard-BwJoQAJL.js} +1 -1
- package/dist/assets/{wizard-components-BZ6jYzgt.js → wizard-components-C4msLQny.js} +1 -1
- package/dist/assets/{wrap-locale-CPp4ppiN.js → wrap-locale-D5uKJYzr.js} +1 -1
- package/dist/assets/{zh-8l1HXCDx.js → zh-BNKpRkuo.js} +1 -1
- package/dist/assets/{zh-CPf0Aw2x.js → zh-qzgEmNi8.js} +1 -1
- package/dist/assets/{zh-tw-CYPf8U5U.js → zh-tw-Bu0-uVuH.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/dashboard-DeaTlS85.js +0 -106
- package/dist/assets/engine-BsqbrwXE.js +0 -1
- package/dist/assets/index-CDFYQ7q2.js +0 -281
- package/dist/assets/sdk-D9qYMy_G.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,y as br,bc as ye,M as ne,ak as m,Q as G,W as u,J as ve,c1 as yr,I as D,aN as vr,T as A,aj as wr,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,cj as jr,bh as Cr,U as Me,cR as kr,cS as Sr,at as Z,cT as Pr,a6 as V,n as oe,D as Ir,cU as Tr,ar as Ae,b1 as we,cV as Rr,aX as Mr,a$ as Ar,cW as Er}from"./vendor-mui-core-BPQ6AEW_.js";import{r as y,a as zr,u as Wr,j as Lr}from"./vendor-react-CUXIiAnY.js";import{t as _e,Z as Dr,a4 as Br,R as Ee,D as $r,C as se,n as H,A as Or}from"./vendor-utils-BSZ4yJws.js";import{a as Nr,G as Ur,bf as Fr,c as je,ad as _r,Z as qr,bc as qe,bg as Hr,aA as He,X as le,bh as Gr,a9 as Kr,aa as Vr,bi as Yr}from"./index-CeWTwSLE.js";import{a as R,h as Zr,k as ce,g as Q,b as M,j as Qr}from"./vendor-hooks-fhL5FJET.js";import{l as Ge}from"./arrow-down.svg-CNh-MHKv.js";import{p as Ce,U as z,V as W,at as Xr,i as Ke,au as Jr,H as O,av as et,aw as rt,ax as ze,e as tt,n as Ve,d as ke,ay as nt,az as T,D as ot,C as st,$ as it,aA as at,aB as lt,o as Ye}from"./vendor-ux-D507n6h6.js";import{N as ct}from"./list-C6OYD0M-.js";import{d as dt}from"./search-4YYphs0l.js";import{B as We}from"./bundle-avatar-D3mFZG-3.js";import{h as Le,T as ut}from"./team-CKeHAIQC.js";import{b as pt,d as ft,a as ht,c as Ze,e as xt,f as mt,h as gt,$ as bt}from"./user-center-BNMJJTvG.js";import{T as ge,O as yt}from"./index-BMkJtBkv.js";import{c as vt}from"./passport-DMZiwbhL.js";import{N as Qe,U as Xe}from"./index-ohq48KFN.js";import{u as de}from"./use-mobile-C5RjvO7g.js";import wt from"./index-D0pDhWRx.js";import{U as jt,a as Ct}from"./user-follower-BXm4RUI2.js";import{f as Y}from"./index-DBs9Ljax.js";import{S as Je}from"./switch-CjOUxynL.js";import{u as De}from"./index-C3cD5fjJ.js";import kt from"./index-V1TR40-z.js";import{o as St}from"./vendor-arcblock-BL_VyzmH.js";import{c as Pt,b as ie,a as It,S as Tt}from"./index-C3BK6ln_.js";import"./index-BIJNkmLb.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./util-DPC-rfKa.js";import"./base32-CnxuWLTI.js";import"./session-CJQ7HeL8.js";import"./isURL-HS60va5G.js";import"./use-app-logo-D38VoM1R.js";import"./index-DUFdTykg.js";import"./revoke.svg-CuiCGfVW.js";import"./use-mobile-ajdJIsoX.js";import"./actions-DhSvOHy-.js";import"./index-Ca4Ccmqm.js";import"./form-text-input-BFJU5Psq.js";import"./required-Btg6mEmX.js";import"./form-wrapper-CU8kJXy5.js";import"./edit.svg-Dz9cVo7r.js";import"./lock.svg-BPCZ0CT3.js";import"./index-Bksy_mMO.js";import"./permission-CiiVpApl.js";import"./confirm-CC1M9sYT.js";import"./click-to-copy-CAd3nEo4.js";import"./invitations-Dmx5LkD1.js";import"./create-passport-svg-BLBQxsEK.js";import"./api-DIucIOLX.js";import"./table-tips-EHWVzPWe.js";import"./ua-parser-DP5omx3I.js";import"./sdk-D9qYMy_G.js";import"./passport-item-yqBy6NcY.js";import"./did-address-BOsJWqi1.js";import"./index-WCk612vr.js";import"./vendor-mui-x-CWNb8fsW.js";import"./AdapterDayjs-BuAhqT20.js";import"./delete-confirm-DF03c_mf.js";import"./index-DRYJ0xIl.js";function Rt(){let r=new Map;function i({root:s,rootMargin:t,threshold:n}){let f=r.get(s);f||(f=new Map,r.set(s,f));let a=JSON.stringify({rootMargin:t,threshold:n}),p=f.get(a);if(!p){let l=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(o=>{l.get(o.target)?.(o)})},{root:s,rootMargin:t,threshold:n}),entryCallbacks:l},f.set(a,p)}return{observe:(l,x)=>{p.entryCallbacks.set(l,x),p.observer.observe(l)},unobserve:l=>{p.entryCallbacks.delete(l),p.observer.unobserve(l)}}}return{getObserver:i}}var Mt="0px",At=[0],Et=Rt();function zt(r){let i=r?.rootMargin??Mt,s=r?.threshold??At,t=y.useRef(null),n=y.useRef(null),f=y.useRef(null),[a,p]=y.useState(),l=y.useCallback(()=>{let C=t.current;if(!C){p(void 0);return}let v=Et.getObserver({root:n.current,rootMargin:i,threshold:s});v.observe(C,d=>{p(d)}),f.current=v},[i,s]),x=y.useCallback(()=>{let C=f.current,v=t.current;v&&C?.unobserve(v),f.current=null},[]),o=y.useCallback(C=>{x(),t.current=C,l()},[l,x]),h=y.useCallback(C=>{x(),n.current=C,l()},[l,x]);return[o,{entry:a,rootRef:h}]}var Wt=zt;function Lt(r){let[i,s]=Wt(r),t=!!s.entry?.isIntersecting,[n,f]=y.useState(t);return t&&!n&&f(!0),[i,{...s,isVisible:t,wasEverVisible:n}]}var Dt=Lt,Bt=100;function $t({loading:r,hasNextPage:i,onLoadMore:s,rootMargin:t,disabled:n,delayInMs:f=Bt}){let a=y.useRef(s),[p,{rootRef:l,isVisible:x}]=Dt({rootMargin:t});y.useEffect(()=>{a.current=s},[s]);let o=!n&&!r&&x&&i;return y.useEffect(()=>{if(o){let h=setTimeout(()=>{a.current()},f);return()=>{clearTimeout(h)}}},[o,f]),[p,{rootRef:l}]}var Ot=$t;const me={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ae({severity:r,size:i=8}){return me[r]?e.jsx(m,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:me[r]||me.info}}):null}er.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function er({theme:r="dark",type:i="button",onSelectType:s,extra:t=void 0,currentTab:n="",loading:f=!1,...a}){const{t:p}=y.useContext(Ce),l=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==n||!f)&&s(g)},o=y.useMemo(()=>{const g={width:"100%",bgcolor:r==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(g,{}):g},[i,r]),h=(g,j,S)=>e.jsx(G,{disabled:f,onClick:()=>x(g.value),className:`profile-button ${j?"active":""}`,...a,children:g.label},g.value||S),C=(g,j,S)=>e.jsx(G,{variant:"text",disabled:f,onClick:()=>x(g.value),className:`profile-line-button ${j?"active":""}`,...a,children:g.label},g.value||S),v=()=>l?.map((g,j)=>{const S=n===g?.value;return i==="line"?e.jsx(y.Fragment,{children:C(g,S,j)},g.value||j):e.jsx(y.Fragment,{children:h(g,S,j)},g.value||j)}),d=g=>{const{value:j}=g.target;x(j==="all"?"":j)};return i==="select"?e.jsx(br,{sx:{maxWidth:300},children:e.jsx(ye,{value:n||"all",onChange:d,size:"small",label:"Severity",IconComponent:g=>e.jsx(Ge,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:l.map((g,j)=>e.jsx(ne,{value:g.value||"all",children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:g.value}),g.label]})},g.value||j))})}):e.jsxs(m,{className:"severity-tabs",sx:o,children:[e.jsx(m,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),t]})}rr.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function rr({loading:r,paging:i,onChange:s}){const{t}=y.useContext(Ce),n=ve(l=>l.breakpoints.down("md"));if(i.pageCount<=0||n)return null;const f=(l,x)=>{s({page:x+1})},a=l=>{const x=Number(l.target.value);s({page:1,pageSize:x})},p=i.page-1<=0?0:i.page-1;return e.jsx(m,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(yr,{component:"div",disabled:r,count:i.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:x,count:o})=>`${l}–${x} / ${o!==-1?o:`${t()}more than ${x}`}`,rowsPerPage:i.pageSize,onPageChange:f,onRowsPerPageChange:a})})}const Nt=y.memo(rr),Ut={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Be=6,$e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Ft={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Ft,width:"calc(50% - 8px)"});tr.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function tr({onFilterChange:r=()=>{},loading:i=!1,type:s="service",blockletMap:t={},filterType:n="component",selectedId:f=[],severity:a=[],enableMarkAllAsRead:p=!0,unReadCount:l=0,onReadFilterChange:x=()=>{},currentReadFilter:o="all"}){const{t:h}=y.useContext(Ce),[C,v]=y.useState(null),d=!!C,[g,j]=y.useState(f),[S,L]=y.useState(a),[b,k]=y.useState(!1),[P,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{j(f),L(a)},[f,a]);const U=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==o||!i)&&x(c)},K=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),k(!1)},pe=()=>{v(null)},ee=c=>{const w=g.includes(c)?g.filter(I=>I!==c):[...g,c];j(w),r({id:w,severity:S})},re=c=>{const w=S.includes(c)?S.filter(I=>I!==c):[...S,c];L(w),r({severity:w,id:g})},fe=c=>{_(c.target.value)},he=()=>{k(!b)},q=zr.useMemo(()=>{if(!t.size)return[];const c=[];return n==="component"&&c.push({label:h("notification.system"),id:"system"}),Array.from(t).forEach(([,w])=>{const I=w.did||w.meta?.did,E=w.title||w.meta?.title||"",$=w.appPid||w.appDid;(n==="component"&&$!==I||n==="entity"&&$===I)&&c.push({label:E,id:I,blocklet:w,ancestors:w.ancestors})}),c},[t,n,h]);y.useEffect(()=>{if(P.trim()==="")N(q);else{const c=P.toLowerCase(),w=q.filter(I=>I.label.toLowerCase().includes(c));N(w)}},[P,q]);const xe=P.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(m,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${o===c.value?"active":""}`,sx:{...s==="service"&&o===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:o===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&l>0&&` (${l})`]},c.value))}),e.jsxs(m,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(z,{icon:Ut,hFlip:!0})}),e.jsx(vr,{open:d,anchorEl:C,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(m,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||S.length>0)&&e.jsx(G,{size:"small",onClick:()=>{j([]),L([]),r({severity:[],id:[]})},startIcon:e.jsx(wr,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(S.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...$e},control:e.jsx(Re,{checked:S.includes(c.value),onChange:()=>re(c.value),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(m,{sx:{mb:2},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(m,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:P,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(z,{icon:dt})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(g.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...$e},control:e.jsx(Re,{checked:g.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(We,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(A,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&P.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(jr,{}):e.jsx(Cr,{})})]})]})})]})]}),g.length>0||S.length>0?e.jsxs(m,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[S.map(c=>{const w=K.find(I=>I.value===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>re(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),g.map(c=>{const w=q.find(I=>I.id===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(We,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const _t=Z(Pr)`
|
|
1
|
+
import{j as e,y as br,bc as ye,M as ne,ak as m,Q as G,W as u,J as ve,c1 as yr,I as D,aN as vr,T as A,aj as wr,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,cj as jr,bh as Cr,U as Me,cR as kr,cS as Sr,at as Z,cT as Pr,a6 as V,n as oe,D as Ir,cU as Tr,ar as Ae,b1 as we,cV as Rr,aX as Mr,a$ as Ar,cW as Er}from"./vendor-mui-core-BPQ6AEW_.js";import{r as y,a as zr,u as Wr,j as Lr}from"./vendor-react-CUXIiAnY.js";import{t as _e,Z as Dr,a4 as Br,R as Ee,D as $r,C as se,n as H,A as Or}from"./vendor-utils-BSZ4yJws.js";import{a as Nr,G as Ur,bf as Fr,c as je,ad as _r,Z as qr,bc as qe,bg as Hr,aA as He,X as le,bh as Gr,a9 as Kr,aa as Vr,bi as Yr}from"./index-Cx5JU0Ln.js";import{a as R,h as Zr,k as ce,g as Q,b as M,j as Qr}from"./vendor-hooks-fhL5FJET.js";import{l as Ge}from"./arrow-down.svg-Cn1jfZom.js";import{p as Ce,U as z,V as W,at as Xr,i as Ke,au as Jr,H as O,av as et,aw as rt,ax as ze,e as tt,n as Ve,d as ke,ay as nt,az as T,D as ot,C as st,$ as it,aA as at,aB as lt,o as Ye}from"./vendor-ux-D507n6h6.js";import{N as ct}from"./list-DaqruRvJ.js";import{d as dt}from"./search-4YYphs0l.js";import{B as We}from"./bundle-avatar-DGFHJNB_.js";import{h as Le,T as ut}from"./team-CG74iq-4.js";import{b as pt,d as ft,a as ht,c as Ze,e as xt,f as mt,h as gt,$ as bt}from"./user-center-CNFpJssw.js";import{T as ge,O as yt}from"./index-Hh69Xj8u.js";import{c as vt}from"./passport-Dsw-sETA.js";import{N as Qe,U as Xe}from"./index-k8gDRcJR.js";import{u as de}from"./use-mobile-C5RjvO7g.js";import wt from"./index-CwAM1jrM.js";import{U as jt,a as Ct}from"./user-follower-BsFDOo99.js";import{f as Y}from"./index-DBs9Ljax.js";import{S as Je}from"./switch-CjOUxynL.js";import{u as De}from"./index-C3cD5fjJ.js";import kt from"./index-D5tCTUjA.js";import{o as St}from"./vendor-arcblock-BL_VyzmH.js";import{c as Pt,b as ie,a as It,S as Tt}from"./index-gy2ZIEt_.js";import"./index-BIJNkmLb.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./util-B41ySVcQ.js";import"./base32-CnxuWLTI.js";import"./session-CAOgTWka.js";import"./isURL-CohjRVvR.js";import"./use-app-logo-BAJtA-EN.js";import"./index-CJ1a35hD.js";import"./revoke.svg-CuiCGfVW.js";import"./use-mobile-ajdJIsoX.js";import"./actions-DhSvOHy-.js";import"./index-Ca4Ccmqm.js";import"./form-text-input-BFJU5Psq.js";import"./required-Btg6mEmX.js";import"./form-wrapper-CU8kJXy5.js";import"./edit.svg-Dz9cVo7r.js";import"./lock.svg-BPCZ0CT3.js";import"./index-CG-mH6e1.js";import"./permission-G7gi0qR2.js";import"./confirm-g44rz8hw.js";import"./click-to-copy-CAd3nEo4.js";import"./invitations-sELORD_h.js";import"./create-passport-svg-BLBQxsEK.js";import"./api-DIucIOLX.js";import"./table-tips-EHWVzPWe.js";import"./ua-parser-DP5omx3I.js";import"./sdk-BLKW-lxg.js";import"./passport-item-CEM3FQ2i.js";import"./did-address-BOsJWqi1.js";import"./index-Cbz9zwoD.js";import"./vendor-mui-x-CWNb8fsW.js";import"./AdapterDayjs-BuAhqT20.js";import"./delete-confirm-Cw0wPOzJ.js";import"./index-DRYJ0xIl.js";function Rt(){let r=new Map;function i({root:s,rootMargin:t,threshold:n}){let f=r.get(s);f||(f=new Map,r.set(s,f));let a=JSON.stringify({rootMargin:t,threshold:n}),p=f.get(a);if(!p){let l=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(o=>{l.get(o.target)?.(o)})},{root:s,rootMargin:t,threshold:n}),entryCallbacks:l},f.set(a,p)}return{observe:(l,x)=>{p.entryCallbacks.set(l,x),p.observer.observe(l)},unobserve:l=>{p.entryCallbacks.delete(l),p.observer.unobserve(l)}}}return{getObserver:i}}var Mt="0px",At=[0],Et=Rt();function zt(r){let i=r?.rootMargin??Mt,s=r?.threshold??At,t=y.useRef(null),n=y.useRef(null),f=y.useRef(null),[a,p]=y.useState(),l=y.useCallback(()=>{let C=t.current;if(!C){p(void 0);return}let v=Et.getObserver({root:n.current,rootMargin:i,threshold:s});v.observe(C,d=>{p(d)}),f.current=v},[i,s]),x=y.useCallback(()=>{let C=f.current,v=t.current;v&&C?.unobserve(v),f.current=null},[]),o=y.useCallback(C=>{x(),t.current=C,l()},[l,x]),h=y.useCallback(C=>{x(),n.current=C,l()},[l,x]);return[o,{entry:a,rootRef:h}]}var Wt=zt;function Lt(r){let[i,s]=Wt(r),t=!!s.entry?.isIntersecting,[n,f]=y.useState(t);return t&&!n&&f(!0),[i,{...s,isVisible:t,wasEverVisible:n}]}var Dt=Lt,Bt=100;function $t({loading:r,hasNextPage:i,onLoadMore:s,rootMargin:t,disabled:n,delayInMs:f=Bt}){let a=y.useRef(s),[p,{rootRef:l,isVisible:x}]=Dt({rootMargin:t});y.useEffect(()=>{a.current=s},[s]);let o=!n&&!r&&x&&i;return y.useEffect(()=>{if(o){let h=setTimeout(()=>{a.current()},f);return()=>{clearTimeout(h)}}},[o,f]),[p,{rootRef:l}]}var Ot=$t;const me={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ae({severity:r,size:i=8}){return me[r]?e.jsx(m,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:me[r]||me.info}}):null}er.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function er({theme:r="dark",type:i="button",onSelectType:s,extra:t=void 0,currentTab:n="",loading:f=!1,...a}){const{t:p}=y.useContext(Ce),l=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==n||!f)&&s(g)},o=y.useMemo(()=>{const g={width:"100%",bgcolor:r==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(g,{}):g},[i,r]),h=(g,j,S)=>e.jsx(G,{disabled:f,onClick:()=>x(g.value),className:`profile-button ${j?"active":""}`,...a,children:g.label},g.value||S),C=(g,j,S)=>e.jsx(G,{variant:"text",disabled:f,onClick:()=>x(g.value),className:`profile-line-button ${j?"active":""}`,...a,children:g.label},g.value||S),v=()=>l?.map((g,j)=>{const S=n===g?.value;return i==="line"?e.jsx(y.Fragment,{children:C(g,S,j)},g.value||j):e.jsx(y.Fragment,{children:h(g,S,j)},g.value||j)}),d=g=>{const{value:j}=g.target;x(j==="all"?"":j)};return i==="select"?e.jsx(br,{sx:{maxWidth:300},children:e.jsx(ye,{value:n||"all",onChange:d,size:"small",label:"Severity",IconComponent:g=>e.jsx(Ge,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:l.map((g,j)=>e.jsx(ne,{value:g.value||"all",children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:g.value}),g.label]})},g.value||j))})}):e.jsxs(m,{className:"severity-tabs",sx:o,children:[e.jsx(m,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),t]})}rr.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function rr({loading:r,paging:i,onChange:s}){const{t}=y.useContext(Ce),n=ve(l=>l.breakpoints.down("md"));if(i.pageCount<=0||n)return null;const f=(l,x)=>{s({page:x+1})},a=l=>{const x=Number(l.target.value);s({page:1,pageSize:x})},p=i.page-1<=0?0:i.page-1;return e.jsx(m,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(yr,{component:"div",disabled:r,count:i.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:x,count:o})=>`${l}–${x} / ${o!==-1?o:`${t()}more than ${x}`}`,rowsPerPage:i.pageSize,onPageChange:f,onRowsPerPageChange:a})})}const Nt=y.memo(rr),Ut={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Be=6,$e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Ft={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Ft,width:"calc(50% - 8px)"});tr.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function tr({onFilterChange:r=()=>{},loading:i=!1,type:s="service",blockletMap:t={},filterType:n="component",selectedId:f=[],severity:a=[],enableMarkAllAsRead:p=!0,unReadCount:l=0,onReadFilterChange:x=()=>{},currentReadFilter:o="all"}){const{t:h}=y.useContext(Ce),[C,v]=y.useState(null),d=!!C,[g,j]=y.useState(f),[S,L]=y.useState(a),[b,k]=y.useState(!1),[P,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{j(f),L(a)},[f,a]);const U=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==o||!i)&&x(c)},K=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),k(!1)},pe=()=>{v(null)},ee=c=>{const w=g.includes(c)?g.filter(I=>I!==c):[...g,c];j(w),r({id:w,severity:S})},re=c=>{const w=S.includes(c)?S.filter(I=>I!==c):[...S,c];L(w),r({severity:w,id:g})},fe=c=>{_(c.target.value)},he=()=>{k(!b)},q=zr.useMemo(()=>{if(!t.size)return[];const c=[];return n==="component"&&c.push({label:h("notification.system"),id:"system"}),Array.from(t).forEach(([,w])=>{const I=w.did||w.meta?.did,E=w.title||w.meta?.title||"",$=w.appPid||w.appDid;(n==="component"&&$!==I||n==="entity"&&$===I)&&c.push({label:E,id:I,blocklet:w,ancestors:w.ancestors})}),c},[t,n,h]);y.useEffect(()=>{if(P.trim()==="")N(q);else{const c=P.toLowerCase(),w=q.filter(I=>I.label.toLowerCase().includes(c));N(w)}},[P,q]);const xe=P.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(m,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${o===c.value?"active":""}`,sx:{...s==="service"&&o===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:o===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&l>0&&` (${l})`]},c.value))}),e.jsxs(m,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(z,{icon:Ut,hFlip:!0})}),e.jsx(vr,{open:d,anchorEl:C,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(m,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||S.length>0)&&e.jsx(G,{size:"small",onClick:()=>{j([]),L([]),r({severity:[],id:[]})},startIcon:e.jsx(wr,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(S.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...$e},control:e.jsx(Re,{checked:S.includes(c.value),onChange:()=>re(c.value),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(m,{sx:{mb:2},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(m,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:P,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(z,{icon:dt})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(g.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...$e},control:e.jsx(Re,{checked:g.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(We,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(A,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&P.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(jr,{}):e.jsx(Cr,{})})]})]})})]})]}),g.length>0||S.length>0?e.jsxs(m,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[S.map(c=>{const w=K.find(I=>I.value===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>re(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),g.map(c=>{const w=q.find(I=>I.id===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(We,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const _t=Z(Pr)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 20px;
|
|
4
4
|
right: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as ee,H as B,U as X,a7 as Ee,a8 as Ue,a9 as We,aa as Ve,p as K,J as je,b as ke,n as z,ab as Me,h as _e,i as Ne,j as Ie}from"./vendor-ux-D507n6h6.js";import{b as u,a as H,g as ie,c as $e}from"./vendor-hooks-fhL5FJET.js";import{r as C}from"./vendor-react-CUXIiAnY.js";import{j as e,ak as r,b6 as R,am as ce,y as O,z as F,Q as V,T as Y,I as le,a3 as oe,W as E,b1 as W,bb as qe,cb as Le,cE as He,at as Fe,D as ye,ah as Oe,cF as Be,a6 as be,cG as Je,a$ as Ze}from"./vendor-mui-core-BPQ6AEW_.js";import{_ as N,ac as M,Y as G,bc as se,c as ve,b7 as Ke,aA as Ge,Z as Ye}from"./index-CeWTwSLE.js";import{A as Z,Q as Qe,b as de,Z as Xe,n as Q,$ as et,C as tt,a as nt}from"./vendor-utils-BSZ4yJws.js";import{u as te,C as k,a as Ce}from"./index.esm-DTmS4tth.js";import{S as re}from"./switch-control-BFsTsyuN.js";import{S as y}from"./section-Cyr0YvGa.js";import{d as st}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{u as ot}from"./index-C3cD5fjJ.js";import{v as it}from"./index-Ca4Ccmqm.js";import{r as rt}from"./base32-CnxuWLTI.js";import{C as at}from"./click-to-copy-CAd3nEo4.js";import{u as lt}from"./use-mobile-ajdJIsoX.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BL_VyzmH.js";import"./required-Btg6mEmX.js";const we={width:24,height:24,body:'<path fill="currentColor" d="M5 4v16V4v5v-5Zm3 10h2.675q.275-.575.638-1.075t.812-.925H8q-.425 0-.713.288T7 13q0 .425.288.713T8 14Zm0 4h2.075Q10 17.5 10 17t.075-1H8q-.425 0-.713.288T7 17q0 .425.288.713T8 18Zm-3 4q-.825 0-1.413-.588T3 20V4q0-.825.588-1.413T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762V10.3q-.475-.15-.975-.225T17 10V9h-4q-.425 0-.713-.288T12 8V4H5v16h5.675q.275.575.638 1.075t.812.925H5Zm12-10q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12Zm0 8q.275 0 .463-.188t.187-.462q0-.275-.187-.463T17 18.7q-.275 0-.463.188t-.187.462q0 .275.188.463T17 20Zm0-6q-.475 0-.875.238t-.65.637q-.1.15-.025.313t.25.237q.15.075.3 0t.275-.2q.125-.175.313-.275t.412-.1q.325 0 .563.213t.237.537q0 .275-.15.463t-.35.387q-.15.15-.313.3t-.287.35q-.075.15-.113.313t-.037.337q0 .225.125.413t.325.187q.2 0 .325-.15t.125-.35q0-.275.15-.488t.35-.412q.3-.275.525-.613t.225-.737q0-.675-.5-1.138T17 14Z"/>'},ue={enabled:!1,domain:"",clientId:"",clientSecret:""};function ct(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...ue},c?.settings?.oauth?.auth0||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(ue))}),l=d("enabled"),j=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({auth0:s})}}),L=Object.assign({...ue},I?.settings?.oauth?.auth0||{});f(L),B.success(t("oauth.saveSuccess"))}catch(I){B.error(I.message||t("oauth.saveFailed"))}}),v=u(s=>s?.trim()?!0:t("oauth.auth0.domainDescription")),S=u(s=>s?.trim()?!0:t("oauth.auth0.clientIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.auth0.clientSecretDescription")),w=u(()=>!0),h=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.auth0.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:h,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:s})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.auth0.domain"),children:e.jsx(k,{name:"domain",control:i,rules:{validate:l?v:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.domain"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?S:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.clientId"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?g:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.auth0.clientSecret"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const he={enabled:!1,clientId:"",clientSecret:""};function dt(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...he},c?.settings?.oauth?.github||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(he))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({github:h})}}),I=Object.assign({...he},s?.settings?.oauth?.github||{});f(I),B.success(t("oauth.saveSuccess"))}catch(s){B.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.github.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.github.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.github.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:i,sx:{alignItems:"center"},render:({field:h})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},size:"small",checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.github.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.github.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.github.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.github.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function ut(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...me},c?.settings?.oauth?.google||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(me))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({google:h})}}),I=Object.assign({...me},s?.settings?.oauth?.google||{});f(I),B.success(t("oauth.saveSuccess"))}catch(s){B.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.google.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.google.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.google.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:h})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.google.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.google.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.google.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.google.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function ht(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...pe},c?.settings?.oauth?.apple||{}),{handleSubmit:a,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(pe))}),f=p("enabled"),l=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({apple:s})}}),L=Object.assign({...pe},I?.settings?.oauth?.apple||{});d(L),B.success(t("oauth.saveSuccess"))}catch(I){B.error(I.message||t("oauth.saveFailed"))}}),j=u(s=>s?.trim()?!0:t("oauth.apple.teamIdDescription")),v=u(s=>s?.trim()?!0:t("oauth.apple.serviceIdDescription")),S=u(s=>s?.trim()?!0:t("oauth.apple.keyIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.apple.authKeyDescription")),w=u(s=>s?.trim()?!0:t("oauth.apple.bundleIdDescription")),h=u(()=>!0);return e.jsx(r,{children:e.jsxs("form",{onSubmit:a(l),disabled:!0,children:[e.jsx(y,{title:t("oauth.apple.enable"),mb:2.5,children:e.jsx(k,{name:"enabled",control:x,render:({field:s})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.apple.teamId"),children:e.jsx(k,{name:"teamId",control:x,rules:{validate:f?j:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.teamId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.bundleId"),children:e.jsx(k,{name:"bundleId",control:x,rules:{validate:f?w:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.bundleId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.serviceId"),children:e.jsx(k,{name:"serviceId",control:x,rules:{validate:f?v:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.serviceId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.keyId"),children:e.jsx(k,{name:"keyId",control:x,rules:{validate:f?S:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.keyId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.authKey"),children:e.jsx(k,{name:"authKey",control:x,rules:{validate:f?g:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.apple.authKey"),multiline:!0,rows:4,error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:a(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const xe={enabled:!1,clientId:"",clientSecret:""};function mt(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...xe},c?.settings?.oauth?.twitter||{}),{handleSubmit:a,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(xe))}),f=p("enabled"),l=u(async g=>{try{const{blocklet:w}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({twitter:g})}}),h=Object.assign({...xe},w?.settings?.oauth?.twitter||{});d(h),B.success(t("oauth.saveSuccess"))}catch(w){B.error(w.message||t("oauth.saveFailed"))}}),j=u(g=>g?.trim()?!0:t("oauth.twitter.clientIdDescription")),v=u(g=>g?.trim()?!0:t("oauth.twitter.clientSecretDescription")),S=u(()=>!0);return e.jsx(r,{children:e.jsxs("form",{onSubmit:a(l),disabled:!0,children:[e.jsx(y,{title:e.jsx(r,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:t("oauth.twitter.enable")})}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:x,sx:{alignItems:"center"},render:({field:g})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},size:"small",checked:g.value,...g})})})}),e.jsx(y,{title:t("oauth.twitter.clientId"),children:e.jsx(k,{name:"clientId",control:x,rules:{validate:f?j:S},render:({field:g})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",label:t("oauth.twitter.clientId"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.twitter.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:x,rules:{validate:f?v:S},render:({field:g})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",type:"password",label:t("oauth.twitter.clientSecret"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:a(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const pt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Re({id:b,title:c,children:t,index:n,onMove:o,defaultExpand:a=!1,onEnd:x,icon:i=null}){const[p,d]=C.useState(a),f=C.useRef(null),l=C.useRef(null),[{handlerId:j},v]=Ee({accept:"dragItem",collect(s){return{handlerId:s.getHandlerId()}},hover(s,I){if(!f.current)return;const L=s.index,m=n;if(L===m)return;const A=f.current?.getBoundingClientRect(),_=l.current?.getBoundingClientRect(),ae=(_.bottom-_.top)/2,$=I.getClientOffset().y-A.top;L<m&&$<ae||L>m&&$>ae||(o(L,m),s.index=m)}}),[{isDragging:S},g]=Ue({item:{index:n,type:"dragItem"},collect:s=>({isDragging:s.isDragging()}),end:x});g(l),v(f);const w=S?.5:1,h=u(s=>{s.preventDefault(),s.stopPropagation(),d(!p)});return e.jsxs(r,{ref:f,children:[e.jsxs(r,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:l,"data-handler-id":j,children:[e.jsxs(r,{sx:{py:2,px:1,opacity:w,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:h,children:[e.jsx(r,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(X,{fontSize:20,icon:pt})}),e.jsx(r,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:i}),e.jsx(Y,{sx:{flex:1},children:c}),e.jsx(le,{size:"small",sx:{pointerEvents:"auto",transform:p?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(X,{icon:st,style:{transform:"scale(1.5)"}})})]}),e.jsx(oe,{})]}),e.jsx(r,{sx:{pl:4,py:2.5,display:p?"block":"none"},children:t})]})}Re.propTypes={title:E.string.isRequired,id:E.string.isRequired,children:E.node.isRequired,index:E.number.isRequired,onMove:E.func.isRequired,onEnd:E.func.isRequired,defaultExpand:E.bool,icon:E.any};const xt=[{name:"github",title:G.PROVIDER_NAME.github,icon:e.jsx(se,{provider:"github",sx:{width:20,height:20}}),component:e.jsx(dt,{})},{name:"google",title:G.PROVIDER_NAME.google,icon:e.jsx(se,{provider:"google",sx:{width:20,height:20}}),component:e.jsx(ut,{})},{name:"apple",title:G.PROVIDER_NAME.apple,icon:e.jsx(se,{provider:"apple",sx:{width:20,height:20}}),component:e.jsx(ht,{})},{name:"twitter",title:G.PROVIDER_NAME.twitter,icon:e.jsx(se,{provider:"twitter",sx:{width:20,height:20}}),component:e.jsx(mt,{})},{name:"auth0",title:G.PROVIDER_NAME.auth0,icon:e.jsx(se,{provider:"auth0",sx:{width:20,height:20}}),component:e.jsx(ct,{})}],ft=["github","google","apple","twitter","auth0"];function gt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=c?.settings?.oauth||{},o=Object.keys(n).sort((l,j)=>n[l]?.order!==void 0&&n[j]?.order!==void 0?n[l].order-n[j].order:n[l]?.order!==void 0?-1:1);for(const l of ft)o.includes(l)||o.push(l);const a=ie(o.reduce((l,j,v)=>Object.assign(l,{[j]:v}),{})),x=H(()=>{const l=[...xt];return l.sort((j,v)=>a[j.name]-a[v.name]),l.map(j=>({...j,enabled:n[j.name]?.enabled??!1}))},[a.auth0,a.github,a.google]),i={};typeof window<"u"&&(i.context=window);const p=u(async l=>{const j={};Object.keys(l).forEach(v=>{j[v]={order:l[v]}}),await b.configOAuth({input:{did:t,oauth:JSON.stringify(j)}})}),d=u((l,j)=>{const v=x[l],S=x[j];a[v.name]=j,a[S.name]=l}),f=u(async()=>{await p(a)});return e.jsx(r,{sx:{".section-left":{width:"180px"}},children:e.jsx(We,{backend:Ve,...i,children:x.map((l,j)=>e.jsx(Re,{index:j,id:l.name,title:l.title,icon:l.icon,onMove:d,onEnd:f,defaultExpand:l.enabled,children:l.component},l.name))})})}const J={ttl:ve.SESSION_TTL,cacheTtl:ve.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function U(b){return e.jsx(ot,{...b,sx:{transform:"scale(0.75)"}})}function fe(b,c=!1){const t=c?b.ttl*86400:b.ttl/86400;return{...b,ttl:t}}function jt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=Qe({},J,c?.settings?.session||{});de(n.ttl)&&(n.ttl=J.ttl),de(n.cacheTtl)&&(n.cacheTtl=J.cacheTtl),n.phone||(n.phone=J.phone),n.email||(n.email=J.email),de(n.enableBlacklist)&&(n.enableBlacklist=J.enableBlacklist);const{handleSubmit:o,control:a,formState:x,reset:i,watch:p}=te({defaultValues:Z(fe(n),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:d}=ee(),f=p("email.enabled"),l=p("phone.enabled"),j=p("email.enableDomainBlackList"),v=p("email.enableDomainWhiteList"),{fields:S,append:g,remove:w}=Ce({control:a,name:"email.domainBlackList"}),{fields:h,append:s,remove:I}=Ce({control:a,name:"email.domainWhiteList"}),L=u(async m=>{try{const{blocklet:A}=await b.updateAppSessionConfig({input:{did:t,config:Xe(fe(m,!0),["phone"])}}),_=Object.assign({},J,Z(A?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));i(fe(_)),B.success(d("common.configSuccess"))}catch(A){B.error(A.message)}});return e.jsx(bt,{onSubmit:o(L),children:e.jsxs(W,{direction:"column",sx:{gap:6},children:[e.jsxs(r,{children:[e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.profile")}),e.jsx(r,{component:oe,sx:{my:3}})]}),e.jsxs(W,{sx:{gap:2},children:[e.jsx(y,{title:d("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enabled",control:a,render:({field:m})=>e.jsx(U,{...m,checked:m.value})})})}),f&&e.jsxs(W,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(y,{title:d("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireVerified",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireUnique",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.trustOauthProviders",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainBlackList",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),j&&e.jsxs(r,{children:[S.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainBlackList.${A}`,control:a,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>w(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>g(""),children:d("blocklet.config.session.addDomain")})]}),e.jsx(y,{title:d("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainWhiteList",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),v&&e.jsxs(r,{children:[h.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainWhiteList.${A}`,control:a,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>I(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>s(""),children:d("blocklet.config.session.addDomain")})]})]}),e.jsxs(r,{sx:{display:"none"},children:[e.jsx(y,{title:d("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.enabled",control:a,disabled:!0,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),l&&e.jsxs(W,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(y,{title:d("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireVerified",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireUnique",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.period")}),e.jsx(r,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(k,{name:"ttl",control:a,rules:{min:1,max:30},render:({field:m})=>e.jsx(O,{fullWidth:!0,sx:{mb:2},children:e.jsx(y,{title:d("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(He,{...m,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.experimentalSettings")}),e.jsx(r,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(y,{title:d("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"enableBlacklist",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})})]}),e.jsx(r,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!x.isDirty,children:d("oauth.save")})})]})})}const bt=Fe.form`
|
|
1
|
+
import{V as ee,H as B,U as X,a7 as Ee,a8 as Ue,a9 as We,aa as Ve,p as K,J as je,b as ke,n as z,ab as Me,h as _e,i as Ne,j as Ie}from"./vendor-ux-D507n6h6.js";import{b as u,a as H,g as ie,c as $e}from"./vendor-hooks-fhL5FJET.js";import{r as C}from"./vendor-react-CUXIiAnY.js";import{j as e,ak as r,b6 as R,am as ce,y as O,z as F,Q as V,T as Y,I as le,a3 as oe,W as E,b1 as W,bb as qe,cb as Le,cE as He,at as Fe,D as ye,ah as Oe,cF as Be,a6 as be,cG as Je,a$ as Ze}from"./vendor-mui-core-BPQ6AEW_.js";import{_ as N,ac as M,Y as G,bc as se,c as ve,b7 as Ke,aA as Ge,Z as Ye}from"./index-Cx5JU0Ln.js";import{A as Z,Q as Qe,b as de,Z as Xe,n as Q,$ as et,C as tt,a as nt}from"./vendor-utils-BSZ4yJws.js";import{u as te,C as k,a as Ce}from"./index.esm-DTmS4tth.js";import{S as re}from"./switch-control-BFsTsyuN.js";import{S as y}from"./section-Cyr0YvGa.js";import{d as st}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{u as ot}from"./index-C3cD5fjJ.js";import{v as it}from"./index-Ca4Ccmqm.js";import{r as rt}from"./base32-CnxuWLTI.js";import{C as at}from"./click-to-copy-CAd3nEo4.js";import{u as lt}from"./use-mobile-ajdJIsoX.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BL_VyzmH.js";import"./required-Btg6mEmX.js";const we={width:24,height:24,body:'<path fill="currentColor" d="M5 4v16V4v5v-5Zm3 10h2.675q.275-.575.638-1.075t.812-.925H8q-.425 0-.713.288T7 13q0 .425.288.713T8 14Zm0 4h2.075Q10 17.5 10 17t.075-1H8q-.425 0-.713.288T7 17q0 .425.288.713T8 18Zm-3 4q-.825 0-1.413-.588T3 20V4q0-.825.588-1.413T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762V10.3q-.475-.15-.975-.225T17 10V9h-4q-.425 0-.713-.288T12 8V4H5v16h5.675q.275.575.638 1.075t.812.925H5Zm12-10q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12Zm0 8q.275 0 .463-.188t.187-.462q0-.275-.187-.463T17 18.7q-.275 0-.463.188t-.187.462q0 .275.188.463T17 20Zm0-6q-.475 0-.875.238t-.65.637q-.1.15-.025.313t.25.237q.15.075.3 0t.275-.2q.125-.175.313-.275t.412-.1q.325 0 .563.213t.237.537q0 .275-.15.463t-.35.387q-.15.15-.313.3t-.287.35q-.075.15-.113.313t-.037.337q0 .225.125.413t.325.187q.2 0 .325-.15t.125-.35q0-.275.15-.488t.35-.412q.3-.275.525-.613t.225-.737q0-.675-.5-1.138T17 14Z"/>'},ue={enabled:!1,domain:"",clientId:"",clientSecret:""};function ct(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...ue},c?.settings?.oauth?.auth0||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(ue))}),l=d("enabled"),j=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({auth0:s})}}),L=Object.assign({...ue},I?.settings?.oauth?.auth0||{});f(L),B.success(t("oauth.saveSuccess"))}catch(I){B.error(I.message||t("oauth.saveFailed"))}}),v=u(s=>s?.trim()?!0:t("oauth.auth0.domainDescription")),S=u(s=>s?.trim()?!0:t("oauth.auth0.clientIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.auth0.clientSecretDescription")),w=u(()=>!0),h=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.auth0.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:h,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:s})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.auth0.domain"),children:e.jsx(k,{name:"domain",control:i,rules:{validate:l?v:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.domain"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?S:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.clientId"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?g:w},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.auth0.clientSecret"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const he={enabled:!1,clientId:"",clientSecret:""};function dt(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...he},c?.settings?.oauth?.github||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(he))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({github:h})}}),I=Object.assign({...he},s?.settings?.oauth?.github||{});f(I),B.success(t("oauth.saveSuccess"))}catch(s){B.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.github.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.github.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.github.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:i,sx:{alignItems:"center"},render:({field:h})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},size:"small",checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.github.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.github.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.github.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.github.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function ut(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,a=Object.assign({...me},c?.settings?.oauth?.google||{}),{handleSubmit:x,control:i,formState:p,watch:d,reset:f}=te({defaultValues:Z(a,Object.keys(me))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({google:h})}}),I=Object.assign({...me},s?.settings?.oauth?.google||{});f(I),B.success(t("oauth.saveSuccess"))}catch(s){B.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.google.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.google.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[n]);return e.jsx(r,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.google.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(r,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:i,render:({field:h})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.google.clientId"),children:e.jsx(k,{name:"clientId",control:i,rules:{validate:l?v:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.google.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.google.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:i,rules:{validate:l?S:g},render:({field:h})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.google.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function ht(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...pe},c?.settings?.oauth?.apple||{}),{handleSubmit:a,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(pe))}),f=p("enabled"),l=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({apple:s})}}),L=Object.assign({...pe},I?.settings?.oauth?.apple||{});d(L),B.success(t("oauth.saveSuccess"))}catch(I){B.error(I.message||t("oauth.saveFailed"))}}),j=u(s=>s?.trim()?!0:t("oauth.apple.teamIdDescription")),v=u(s=>s?.trim()?!0:t("oauth.apple.serviceIdDescription")),S=u(s=>s?.trim()?!0:t("oauth.apple.keyIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.apple.authKeyDescription")),w=u(s=>s?.trim()?!0:t("oauth.apple.bundleIdDescription")),h=u(()=>!0);return e.jsx(r,{children:e.jsxs("form",{onSubmit:a(l),disabled:!0,children:[e.jsx(y,{title:t("oauth.apple.enable"),mb:2.5,children:e.jsx(k,{name:"enabled",control:x,render:({field:s})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.apple.teamId"),children:e.jsx(k,{name:"teamId",control:x,rules:{validate:f?j:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.teamId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.bundleId"),children:e.jsx(k,{name:"bundleId",control:x,rules:{validate:f?w:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.bundleId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.serviceId"),children:e.jsx(k,{name:"serviceId",control:x,rules:{validate:f?v:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.serviceId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.keyId"),children:e.jsx(k,{name:"keyId",control:x,rules:{validate:f?S:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.keyId"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.authKey"),children:e.jsx(k,{name:"authKey",control:x,rules:{validate:f?g:h},render:({field:s})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.apple.authKey"),multiline:!0,rows:4,error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:a(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const xe={enabled:!1,clientId:"",clientSecret:""};function mt(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...xe},c?.settings?.oauth?.twitter||{}),{handleSubmit:a,control:x,formState:i,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(xe))}),f=p("enabled"),l=u(async g=>{try{const{blocklet:w}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({twitter:g})}}),h=Object.assign({...xe},w?.settings?.oauth?.twitter||{});d(h),B.success(t("oauth.saveSuccess"))}catch(w){B.error(w.message||t("oauth.saveFailed"))}}),j=u(g=>g?.trim()?!0:t("oauth.twitter.clientIdDescription")),v=u(g=>g?.trim()?!0:t("oauth.twitter.clientSecretDescription")),S=u(()=>!0);return e.jsx(r,{children:e.jsxs("form",{onSubmit:a(l),disabled:!0,children:[e.jsx(y,{title:e.jsx(r,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:t("oauth.twitter.enable")})}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:x,sx:{alignItems:"center"},render:({field:g})=>e.jsx(R,{control:e.jsx(re,{sx:{ml:1},size:"small",checked:g.value,...g})})})}),e.jsx(y,{title:t("oauth.twitter.clientId"),children:e.jsx(k,{name:"clientId",control:x,rules:{validate:f?j:S},render:({field:g})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",label:t("oauth.twitter.clientId"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.twitter.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:x,rules:{validate:f?v:S},render:({field:g})=>e.jsx(O,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",type:"password",label:t("oauth.twitter.clientSecret"),error:!!i.errors[g.name],helperText:i.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:a(l),disabled:!i.isDirty,children:t("oauth.save")})]})})}const pt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Re({id:b,title:c,children:t,index:n,onMove:o,defaultExpand:a=!1,onEnd:x,icon:i=null}){const[p,d]=C.useState(a),f=C.useRef(null),l=C.useRef(null),[{handlerId:j},v]=Ee({accept:"dragItem",collect(s){return{handlerId:s.getHandlerId()}},hover(s,I){if(!f.current)return;const L=s.index,m=n;if(L===m)return;const A=f.current?.getBoundingClientRect(),_=l.current?.getBoundingClientRect(),ae=(_.bottom-_.top)/2,$=I.getClientOffset().y-A.top;L<m&&$<ae||L>m&&$>ae||(o(L,m),s.index=m)}}),[{isDragging:S},g]=Ue({item:{index:n,type:"dragItem"},collect:s=>({isDragging:s.isDragging()}),end:x});g(l),v(f);const w=S?.5:1,h=u(s=>{s.preventDefault(),s.stopPropagation(),d(!p)});return e.jsxs(r,{ref:f,children:[e.jsxs(r,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:l,"data-handler-id":j,children:[e.jsxs(r,{sx:{py:2,px:1,opacity:w,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:h,children:[e.jsx(r,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(X,{fontSize:20,icon:pt})}),e.jsx(r,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:i}),e.jsx(Y,{sx:{flex:1},children:c}),e.jsx(le,{size:"small",sx:{pointerEvents:"auto",transform:p?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(X,{icon:st,style:{transform:"scale(1.5)"}})})]}),e.jsx(oe,{})]}),e.jsx(r,{sx:{pl:4,py:2.5,display:p?"block":"none"},children:t})]})}Re.propTypes={title:E.string.isRequired,id:E.string.isRequired,children:E.node.isRequired,index:E.number.isRequired,onMove:E.func.isRequired,onEnd:E.func.isRequired,defaultExpand:E.bool,icon:E.any};const xt=[{name:"github",title:G.PROVIDER_NAME.github,icon:e.jsx(se,{provider:"github",sx:{width:20,height:20}}),component:e.jsx(dt,{})},{name:"google",title:G.PROVIDER_NAME.google,icon:e.jsx(se,{provider:"google",sx:{width:20,height:20}}),component:e.jsx(ut,{})},{name:"apple",title:G.PROVIDER_NAME.apple,icon:e.jsx(se,{provider:"apple",sx:{width:20,height:20}}),component:e.jsx(ht,{})},{name:"twitter",title:G.PROVIDER_NAME.twitter,icon:e.jsx(se,{provider:"twitter",sx:{width:20,height:20}}),component:e.jsx(mt,{})},{name:"auth0",title:G.PROVIDER_NAME.auth0,icon:e.jsx(se,{provider:"auth0",sx:{width:20,height:20}}),component:e.jsx(ct,{})}],ft=["github","google","apple","twitter","auth0"];function gt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=c?.settings?.oauth||{},o=Object.keys(n).sort((l,j)=>n[l]?.order!==void 0&&n[j]?.order!==void 0?n[l].order-n[j].order:n[l]?.order!==void 0?-1:1);for(const l of ft)o.includes(l)||o.push(l);const a=ie(o.reduce((l,j,v)=>Object.assign(l,{[j]:v}),{})),x=H(()=>{const l=[...xt];return l.sort((j,v)=>a[j.name]-a[v.name]),l.map(j=>({...j,enabled:n[j.name]?.enabled??!1}))},[a.auth0,a.github,a.google]),i={};typeof window<"u"&&(i.context=window);const p=u(async l=>{const j={};Object.keys(l).forEach(v=>{j[v]={order:l[v]}}),await b.configOAuth({input:{did:t,oauth:JSON.stringify(j)}})}),d=u((l,j)=>{const v=x[l],S=x[j];a[v.name]=j,a[S.name]=l}),f=u(async()=>{await p(a)});return e.jsx(r,{sx:{".section-left":{width:"180px"}},children:e.jsx(We,{backend:Ve,...i,children:x.map((l,j)=>e.jsx(Re,{index:j,id:l.name,title:l.title,icon:l.icon,onMove:d,onEnd:f,defaultExpand:l.enabled,children:l.component},l.name))})})}const J={ttl:ve.SESSION_TTL,cacheTtl:ve.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function U(b){return e.jsx(ot,{...b,sx:{transform:"scale(0.75)"}})}function fe(b,c=!1){const t=c?b.ttl*86400:b.ttl/86400;return{...b,ttl:t}}function jt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=Qe({},J,c?.settings?.session||{});de(n.ttl)&&(n.ttl=J.ttl),de(n.cacheTtl)&&(n.cacheTtl=J.cacheTtl),n.phone||(n.phone=J.phone),n.email||(n.email=J.email),de(n.enableBlacklist)&&(n.enableBlacklist=J.enableBlacklist);const{handleSubmit:o,control:a,formState:x,reset:i,watch:p}=te({defaultValues:Z(fe(n),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:d}=ee(),f=p("email.enabled"),l=p("phone.enabled"),j=p("email.enableDomainBlackList"),v=p("email.enableDomainWhiteList"),{fields:S,append:g,remove:w}=Ce({control:a,name:"email.domainBlackList"}),{fields:h,append:s,remove:I}=Ce({control:a,name:"email.domainWhiteList"}),L=u(async m=>{try{const{blocklet:A}=await b.updateAppSessionConfig({input:{did:t,config:Xe(fe(m,!0),["phone"])}}),_=Object.assign({},J,Z(A?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));i(fe(_)),B.success(d("common.configSuccess"))}catch(A){B.error(A.message)}});return e.jsx(bt,{onSubmit:o(L),children:e.jsxs(W,{direction:"column",sx:{gap:6},children:[e.jsxs(r,{children:[e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.profile")}),e.jsx(r,{component:oe,sx:{my:3}})]}),e.jsxs(W,{sx:{gap:2},children:[e.jsx(y,{title:d("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enabled",control:a,render:({field:m})=>e.jsx(U,{...m,checked:m.value})})})}),f&&e.jsxs(W,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(y,{title:d("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireVerified",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireUnique",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.trustOauthProviders",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainBlackList",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),j&&e.jsxs(r,{children:[S.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainBlackList.${A}`,control:a,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>w(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>g(""),children:d("blocklet.config.session.addDomain")})]}),e.jsx(y,{title:d("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainWhiteList",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),v&&e.jsxs(r,{children:[h.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainWhiteList.${A}`,control:a,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>I(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>s(""),children:d("blocklet.config.session.addDomain")})]})]}),e.jsxs(r,{sx:{display:"none"},children:[e.jsx(y,{title:d("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.enabled",control:a,disabled:!0,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),l&&e.jsxs(W,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(y,{title:d("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireVerified",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireUnique",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.period")}),e.jsx(r,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(k,{name:"ttl",control:a,rules:{min:1,max:30},render:({field:m})=>e.jsx(O,{fullWidth:!0,sx:{mb:2},children:e.jsx(y,{title:d("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(He,{...m,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(r,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.experimentalSettings")}),e.jsx(r,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(y,{title:d("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(r,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"enableBlacklist",control:a,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})})]}),e.jsx(r,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!x.isDirty,children:d("oauth.save")})})]})})}const bt=Fe.form`
|
|
2
2
|
max-width: 1536px;
|
|
3
3
|
|
|
4
4
|
.advanced-config {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BPQ6AEW_.js";import{V as f}from"./vendor-ux-D507n6h6.js";import{L as g,r as k}from"./vendor-react-CUXIiAnY.js";import"./index-
|
|
1
|
+
import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BPQ6AEW_.js";import{V as f}from"./vendor-ux-D507n6h6.js";import{L as g,r as k}from"./vendor-react-CUXIiAnY.js";import"./index-Cx5JU0Ln.js";import"./vendor-utils-BSZ4yJws.js";import"./vendor-hooks-fhL5FJET.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BL_VyzmH.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j=""+window.__toCdnUrl("assets/doc-board-bg-DWZHV9Ng.png");function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./vendor-react-CUXIiAnY.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-BPQ6AEW_.js";import{a as j}from"./vendor-hooks-fhL5FJET.js";import{a1 as r}from"./index-
|
|
1
|
+
import{r as p}from"./vendor-react-CUXIiAnY.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-BPQ6AEW_.js";import{a as j}from"./vendor-hooks-fhL5FJET.js";import{a1 as r}from"./index-Cx5JU0Ln.js";import{V as A}from"./vendor-ux-D507n6h6.js";import{l as C}from"./arrow-down.svg-Cn1jfZom.js";import{L as O,D as H}from"./vendor-mui-x-CWNb8fsW.js";import{A as R}from"./AdapterDayjs-BuAhqT20.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:h="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const T=e?r(n).tz(e):r(n);i(new Date(T.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:h,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:h=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[T,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),M=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},_=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>h?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>M(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:_,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:T})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,D as M,T as _,ce as T,Q as W,cf as q,aV as X,ak as h,cg as Y,aU as Z,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-BPQ6AEW_.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-CUXIiAnY.js";import{H as E,aW as te}from"./index-
|
|
1
|
+
import{j as a,D as M,T as _,ce as T,Q as W,cf as q,aV as X,ak as h,cg as Y,aU as Z,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-BPQ6AEW_.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-CUXIiAnY.js";import{H as E,aW as te}from"./index-Cx5JU0Ln.js";import{e as ie}from"./vendor-hooks-fhL5FJET.js";import{M as re,l as m,a0 as A,a1 as S}from"./vendor-ux-D507n6h6.js";import{z as oe}from"./vendor-arcblock-BL_VyzmH.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l}from"./vendor-react-CUXIiAnY.js";import{V as C,$ as E,j as M,k as P}from"./vendor-ux-D507n6h6.js";import{k as y}from"./vendor-hooks-fhL5FJET.js";import{j as e,ak as s,a6 as S,aX as w,b1 as W,y as L,x as _,bc as B,M as D,T as z,a$ as A,I as K,bd as N,Q as F,W as U}from"./vendor-mui-core-BPQ6AEW_.js";import{c as $,_ as k}from"./index-
|
|
1
|
+
import{r as l}from"./vendor-react-CUXIiAnY.js";import{V as C,$ as E,j as M,k as P}from"./vendor-ux-D507n6h6.js";import{k as y}from"./vendor-hooks-fhL5FJET.js";import{j as e,ak as s,a6 as S,aX as w,b1 as W,y as L,x as _,bc as B,M as D,T as z,a$ as A,I as K,bd as N,Q as F,W as U}from"./vendor-mui-core-BPQ6AEW_.js";import{c as $,_ as k}from"./index-Cx5JU0Ln.js";import{a as V}from"./api-DIucIOLX.js";import{T as q}from"./table-tips-EHWVzPWe.js";import{u as G}from"./team-CG74iq-4.js";import{u as H}from"./session-CAOgTWka.js";import"./vendor-utils-BSZ4yJws.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BL_VyzmH.js";import"./use-mobile-ajdJIsoX.js";import"./isURL-CohjRVvR.js";import"./use-app-logo-BAJtA-EN.js";function T({endpoint:i}){const[t,a]=l.useState("mcp-link"),x=k(),{api:h}=k(),{teamDid:m}=G(),{t:c,locale:p}=C(),{session:r}=H(),{data:u,run:o,loading:g}=y(()=>{const f={owner:$.SERVER_ROLES.ADMIN}[r?.user?.role]||r?.user?.role;return h.createAccessKey({input:{teamDid:m,passport:f,authType:"simple",remark:"Generated by MCP Servers"}})},{manual:!0}),{imgPrefix:n}=x,j=l.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[n]),v=j.find(d=>d.value===t),b=l.useMemo(()=>u?.data?.accessKeySecret,[u]),R=l.useMemo(()=>!b&&t!=="mcp-link",[b,t]),I=d=>{const f=`npx @blocklet/install-mcp@latest i ${i} --client ${d} --streamableHTTP --oauth2Bearer ${b}`;switch(d){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return f;case"mcp-link":default:return i}};return e.jsxs(s,{className:"mcp-servers-container",children:[e.jsx(M,{tabs:j,current:t,onChange:a,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(z,{component:"span",variant:"h6",sx:{fontWeight:"bold",my:2},children:t==="mcp-link"?v?.label:`${v?.label} ${c("installCommand")}`}),t!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${p}/mcp-${t}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(K,{size:"small",children:e.jsx(N,{fontSize:"small"})})})]}),e.jsxs(s,{className:"mcp-servers-codeblock",sx:{position:"relative","& pre":{borderRadius:1},"& .codeblock__inner":{overflow:"auto !important",borderRadius:1}},children:[e.jsx(P,{code:I(t),language:"shell",style:{margin:0},showDefaultText:!1}),R&&e.jsx(s,{sx:{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:g?e.jsx(S,{}):e.jsx(F,{variant:"contained",color:"primary",onClick:o,size:"small",children:`${c("common.generate")} ${c("command")}`})})]})]})]})}T.propTypes={endpoint:U.string.isRequired};function ce(){const[i,t]=l.useState(null),{t:a,locale:x}=C(),h=`${window?.blocklet?.appUrl}${$.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:m,loading:c,error:p}=y(()=>Promise.all([V.get(h)])),r=l.useMemo(()=>m?.[0]?.data?.servers||[],[m]);l.useEffect(()=>{r?.length&&t(r.find(o=>o.did===window?.blocklet?.did)||r[0])},[r]);const u=o=>{const g=o.target.value;t(r.find(n=>n.did===g))};return c?e.jsx(s,{children:e.jsx(S,{})}):p?e.jsx(w,{color:"error",children:p?.message}):r?.length?e.jsxs(W,{sx:{gap:2,maxWidth:1200},children:[e.jsx(q,{title:a("mcp.listTitle"),tooltipTitle:a("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${x}/mcp-server`}),e.jsxs(L,{fullWidth:!0,children:[e.jsx(_,{id:"server-select-label",children:a("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:i?.did||"",label:a("mcp.available"),onChange:u,children:r.map(o=>e.jsx(D,{value:o.did,children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(E,{variant:"rounded",shape:"square",did:o.did,src:o.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:o.name})]})},o.did))})]}),i&&e.jsx(T,{endpoint:i.endpoint})]}):e.jsx(w,{color:"warning",children:a("mcp.noServer")})}export{ce as default};
|