@abtnode/blocklet-services 1.16.47-beta-20250805-095401-14eb156b → 1.16.47-beta-20250805-140707-3a4df7fd
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-jFR93SsS.js → access-control-BSEf18wl.js} +1 -1
- package/dist/assets/{add-component-core-DfrJCl4a.js → add-component-core-Bi6BoTuW.js} +1 -1
- package/dist/assets/{add-resource-Ch4SZAWK.js → add-resource-DJwbu06V.js} +1 -1
- package/dist/assets/{addon-B-vtdIPn.js → addon-Bdomwmjo.js} +1 -1
- package/dist/assets/{advanced-B92lyz70.js → advanced-CVn4Hcf5.js} +1 -1
- package/dist/assets/{aigne-BDdYezR9.js → aigne-DkujEYax.js} +1 -1
- package/dist/assets/{appearance-C1k2L_bA.js → appearance-BeyMAsY0.js} +1 -1
- package/dist/assets/{arrow-down.svg-BnKvb8st.js → arrow-down.svg-DJGgsS-M.js} +1 -1
- package/dist/assets/{audit-logs-OO0l4GnY.js → audit-logs-BITrjM7H.js} +1 -1
- package/dist/assets/{authorize-BU6KP5W6.js → authorize-DTBqTI9x.js} +1 -1
- package/dist/assets/{branding-D1JmhF3p.js → branding-BGgw8cEJ.js} +2 -2
- package/dist/assets/{branding-CEu-c8uQ.js → branding-CUo9AQgP.js} +1 -1
- package/dist/assets/{bundle-avatar-BZQ_lZxy.js → bundle-avatar-nqQPph1V.js} +1 -1
- package/dist/assets/{complete-DwaBuF4K.js → complete-B0oh9oaL.js} +1 -1
- package/dist/assets/{component-D31UJpJQ.js → component-tmpSeXZN.js} +3 -3
- package/dist/assets/{config-AgncsJiw.js → config-DtGAnIEK.js} +1 -1
- package/dist/assets/{config-Df0dxvZZ.js → config-DzbUoUBj.js} +1 -1
- package/dist/assets/{config-navigation-JJehoQAV.js → config-navigation-XlR3iC8u.js} +3 -3
- package/dist/assets/{config-space-CrH2JnlQ.js → config-space-Dc8fZcHS.js} +1 -1
- package/dist/assets/{config-C6pSSzan.js → config-yZbzEM9S.js} +1 -1
- package/dist/assets/{confirm-Cx2owMMo.js → confirm-BE3P2t7f.js} +1 -1
- package/dist/assets/{connect-C7C7ILA6.js → connect-CN37jxgn.js} +1 -1
- package/dist/assets/{connect-BD9OoHaD.js → connect-DZZ-4AIX.js} +1 -1
- package/dist/assets/{connect-to-nCPxtJH1.js → connect-to-Bkmg684d.js} +1 -1
- package/dist/assets/{dashboard-CDjptZox.js → dashboard-DxuecHqY.js} +3 -3
- package/dist/assets/{delete-confirm-Wa3xVOUM.js → delete-confirm-BxYuZyLa.js} +1 -1
- package/dist/assets/{domain-DV7cdOEy.js → domain-Bfay_KsZ.js} +1 -1
- package/dist/assets/{domain-action-card-CnvZTstr.js → domain-action-card-cQQZnRXd.js} +1 -1
- package/dist/assets/{domains-BpVmxPqY.js → domains-CmO_JEoH.js} +1 -1
- package/dist/assets/{email-DQnz-4Bc.js → email-BQwo1xmz.js} +1 -1
- package/dist/assets/engine-te2i4Xkp.js +1 -0
- package/dist/assets/{exchange-passport-D9HZFZwF.js → exchange-passport-LngoI7mR.js} +1 -1
- package/dist/assets/{form-D52FUB8q.js → form-BBQ9hkWe.js} +1 -1
- package/dist/assets/{fuel-DEa3ECY8.js → fuel-DTDoJVJw.js} +1 -1
- package/dist/assets/{gen-access-key-DrTcGDFb.js → gen-access-key-96g8FE-z.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DiDRmpFf.js → gen-simple-access-key-eAA9bcyC.js} +1 -1
- package/dist/assets/{get-safe-url-DOmcOTEp.js → get-safe-url-CoK26-Ak.js} +1 -1
- package/dist/assets/{home-B7OWEVsn.js → home-D9FcK20t.js} +1 -1
- package/dist/assets/{iframe-CqwYISrF.js → iframe-DhAlOm-t.js} +1 -1
- package/dist/assets/{index-AbdeuSeu.js → index-7viVkiSg.js} +1 -1
- package/dist/assets/{index-BFOTYlfC.js → index-7zXCE3Ua.js} +1 -1
- package/dist/assets/{index-CKesQXQW.js → index-B5vvgnse.js} +1 -1
- package/dist/assets/{index-BDu1k7Fv.js → index-BETqi_AV.js} +1 -1
- package/dist/assets/{index-Cbf4geph.js → index-BGbMta1w.js} +4 -4
- package/dist/assets/{index-Dj0TETp9.js → index-BSWcZ39K.js} +1 -1
- package/dist/assets/{index-78a5Cdpe.js → index-BXQsZlT0.js} +1 -1
- package/dist/assets/{index-LdkiJabL.js → index-Bh3Eqgyw.js} +1 -1
- package/dist/assets/{index-DlaHLSvf.js → index-BsDq3W_j.js} +3 -3
- package/dist/assets/{index-uY6moYTs.js → index-C0rREY1Q.js} +1 -1
- package/dist/assets/{index-CiW-jlCS.js → index-CK7BAVRn.js} +1 -1
- package/dist/assets/{index-B0GLaTiX.js → index-CTur5nk-.js} +1 -1
- package/dist/assets/{index-Nd6gD7eY.js → index-CkAhcTYd.js} +1 -1
- package/dist/assets/{index-BetmKk0p.js → index-ClmgRx8j.js} +1 -1
- package/dist/assets/{index-diQW5vdJ.js → index-CtthKnbV.js} +1 -1
- package/dist/assets/{index-CiL_9BYm.js → index-D9V5Umc7.js} +1 -1
- package/dist/assets/{index-DtuUsb1T.js → index-DQFj-nYH.js} +1 -1
- package/dist/assets/{index-Cylfu8Kg.js → index-DSXRZM65.js} +14 -14
- package/dist/assets/{index-B4OZ6pVW.js → index-DXEP0e1N.js} +1 -1
- package/dist/assets/{index-B-WiXXyt.js → index-IvJAtHzW.js} +1 -1
- package/dist/assets/{index-C0mn0MnL.js → index-LNOwklRT.js} +1 -1
- package/dist/assets/{index-C4hly8RC.js → index-gkPitOyo.js} +1 -1
- package/dist/assets/{index-ChbREcnK.js → index-iEC5ZdMS.js} +1 -1
- package/dist/assets/{index-AK4Fi3I2.js → index-sgUJ1UrA.js} +1 -1
- package/dist/assets/{invitation-D8IFGbTf.js → invitation-US90mCZ0.js} +1 -1
- package/dist/assets/{invite-bBNbkUJu.js → invite-DyIqbjve.js} +1 -1
- package/dist/assets/{isURL-By2TdRfN.js → isURL-Bawv3imX.js} +1 -1
- package/dist/assets/{issue-passport-DaQDVQ7Y.js → issue-passport-C5vD2vwu.js} +1 -1
- package/dist/assets/{item-BhrhnieT.js → item-CicRcRrO.js} +1 -1
- package/dist/assets/{landing-page-k9p91AEv.js → landing-page-CxWEfJb1.js} +1 -1
- package/dist/assets/{layout-zg5WZEdp.js → layout-DE-cz95w.js} +1 -1
- package/dist/assets/{list-C6CNPBAR.js → list-CwpC3pkX.js} +1 -1
- package/dist/assets/{list-CYJEZSon.js → list-DBxh165t.js} +2 -2
- package/dist/assets/{localization-DFWXvHpl.js → localization-DDJ05J06.js} +1 -1
- package/dist/assets/{log-ssfC90VX.js → log-DmRKBFGC.js} +1 -1
- package/dist/assets/{login-aFsf6-QM.js → login-DJCu1xgf.js} +1 -1
- package/dist/assets/{login-oauth-callback-dKBg8IoH.js → login-oauth-callback-DUU4jnz6.js} +1 -1
- package/dist/assets/{logo-uploader-D0Gz6YoY.js → logo-uploader-Dkqno_Ja.js} +2 -2
- package/dist/assets/{lost-passport-Bo6am6th.js → lost-passport-ImDGPXaC.js} +1 -1
- package/dist/assets/{open-window-DBhAlL9B.js → open-window-q1wrayPW.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-D89GCKNm.js → over-due-invoice-payment-JvwfN8wc.js} +1 -1
- package/dist/assets/{overview-Xs3x6yXg.js → overview-BmpIT6Q_.js} +1 -1
- package/dist/assets/{passport-item-D-B7gJms.js → passport-item-C25fvRz1.js} +1 -1
- package/dist/assets/{permission-DqaOkW_Z.js → permission-jA6KoYLs.js} +1 -1
- package/dist/assets/{preferences-5iBfUn8N.js → preferences-DRk6dZEm.js} +1 -1
- package/dist/assets/{profile-embed-MOxF7ggV.js → profile-embed-CWn_g09P.js} +1 -1
- package/dist/assets/{publish-resource-BBnSOgDd.js → publish-resource-vKH4JQbV.js} +1 -1
- package/dist/assets/{runtime-DjILMoeT.js → runtime-CVbnWFXH.js} +1 -1
- package/dist/assets/sdk-BPlpWr_6.js +1 -0
- package/dist/assets/{security-BXhgiheS.js → security-DZamcnzN.js} +1 -1
- package/dist/assets/{session-89Q1nGxB.js → session-DwRV85k4.js} +1 -1
- package/dist/assets/{setup-Da3ReRWd.js → setup-kwTvymfp.js} +3 -3
- package/dist/assets/{spaces-BJeg7L1z.js → spaces-BVGaa6Hu.js} +1 -1
- package/dist/assets/{start-CLueiUKJ.js → start-aPtgs0SV.js} +1 -1
- package/dist/assets/{status-DheLJdlM.js → status-C3kkPu09.js} +1 -1
- package/dist/assets/{step-actions-DmraEWCH.js → step-actions-CAm14q1m.js} +1 -1
- package/dist/assets/{studio-C4flChud.js → studio-BfthGuiI.js} +1 -1
- package/dist/assets/{team-ZJuYy81P.js → team-D7qYznX0.js} +1 -1
- package/dist/assets/{traffic-CMI1Sbrr.js → traffic-DTdSCUkM.js} +1 -1
- package/dist/assets/{transfer-CW4yMg3K.js → transfer-C5DkV4KG.js} +1 -1
- package/dist/assets/{unsubscribe-D3ZXIJIb.js → unsubscribe-CLba7U2w.js} +1 -1
- package/dist/assets/{use-promise-window-open-u0untujg.js → use-promise-window-open-ZxLzFYBo.js} +1 -1
- package/dist/assets/{user-center-D6gs6-WZ.js → user-center-Jy5Iq5_O.js} +3 -3
- package/dist/assets/{user-sessions-B56a-4tA.js → user-sessions-BGnHveoB.js} +1 -1
- package/dist/assets/{util-Dcj6HCP7.js → util-C5cbPYrK.js} +1 -1
- package/dist/assets/{util-DQF9oPrf.js → util-D2_crIYF.js} +1 -1
- package/dist/assets/{wrap-locale-DAzAra4f.js → wrap-locale-COCKCQEf.js} +1 -1
- package/dist/assets/{zh-DxCg9Pae.js → zh-BowysNWx.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/engine-BD3-KjxK.js +0 -1
- package/dist/assets/sdk-B-MwbsI_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BOHKtf8y.js";import{T as f}from"./vendor-ux-Cra9XTth.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-
|
|
1
|
+
import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BOHKtf8y.js";import{T as f}from"./vendor-ux-Cra9XTth.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-BGbMta1w.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.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="/.well-known/service/static/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{j as a,T as j,ak as c,D as S,P as b}from"./vendor-mui-core-BOHKtf8y.js";import{r as x}from"./vendor-react-Dvs43sk9.js";import{aQ as m,aR as T,aS as w,aT as P,aU as D,aV as N}from"./index-
|
|
1
|
+
import{j as a,T as j,ak as c,D as S,P as b}from"./vendor-mui-core-BOHKtf8y.js";import{r as x}from"./vendor-react-Dvs43sk9.js";import{aQ as m,aR as T,aS as w,aT as P,aU as D,aV as N}from"./index-BGbMta1w.js";import{o as y,$ as R}from"./vendor-ux-Cra9XTth.js";var t=(r=>(r.AvatarOnly="AvatarOnly",r.Detailed="Detailed",r))(t||{}),p=(r=>(r.NameOnly="NameOnly",r.Minimal="Minimal",r.Basic="Basic",r))(p||{});function z(r){const{user:e,infoType:o,avatarSize:s=48,shouldShowHoverCard:i=!1,renderCardContent:n,...d}=r;return o===p.NameOnly?a.jsx(m,{user:e,avatarSize:s,shouldShowHoverCard:!1,renderCardContent:n,tooltipTitle:e.fullName||e.email||e.did,...d}):a.jsx(m,{user:e,avatarSize:s,shouldShowHoverCard:i,renderCardContent:n,...d})}function O(r){const{user:e,avatarSize:o=48,onAvatarClick:s}=r;return a.jsxs(a.Fragment,{children:[T(e,o,r.avatarProps,s),a.jsx(j,{variant:"body1",children:e.fullName||e.email||e.did})]})}function g({...r}){const{user:e,avatarSize:o=40,renderCustomContent:s,infoType:i=p.Minimal,renderFields:n,popupRenderFields:d,...l}=r;return a.jsxs(c,{sx:{display:"flex",flexDirection:"column",width:"100%",flex:1,height:"100%"},children:[a.jsx(w,{user:e,avatarSize:o,...l}),i===p.Basic&&a.jsx(P,{user:e,renderFields:n}),a.jsx(c,{className:"user-card__footer",children:s&&a.jsx(c,{sx:{mt:1.5},children:s()})})]})}function v({...r}){const{infoType:e=p.Minimal}=r;switch(e){case p.NameOnly:return a.jsx(O,{...r});default:return a.jsx(g,{...r})}}function A({children:r,sx:e={}}){const o=S();return a.jsx(c,{sx:y({p:2,backgroundColor:o.palette.background.paper,border:"1px solid",borderColor:"divider",borderRadius:1,maxWidth:500,minWidth:320,display:"flex"},e||null),children:r})}function F({children:r,cardType:e=t.Detailed,variant:o="box",containerRef:s=void 0,sx:i={}}){const n={minWidth:320,p:2,borderRadius:1,...e===t.Detailed?{border:"1px solid",borderColor:"divider"}:{}};return o==="paper"?a.jsx(b,{ref:s,elevation:0,sx:n,children:r}):a.jsx(c,{ref:s,sx:y(n,{display:"flex",alignItems:e===t.AvatarOnly?"center":"flex-start",gap:2},i||null),children:r})}function $(r){const{cardType:e=t.Detailed,showHoverCard:o}=r,s=o!==void 0?o:e===t.AvatarOnly,i=x.useRef(null),[n,d]=x.useState(()=>r.user||null);x.useEffect(()=>{let u=!0;return r.user?d(r.user):r.did&&D(r.did)&&!r.user&&N(r.did).then(f=>{u&&d(f||{fullName:"Anonymous",did:r.did,avatar:""})}),()=>{u=!1}},[r.did,r.user]);const l=x.useMemo(()=>{if(!n)return null;const{avatar:u="",...f}=n,C=u.split("?")[1];return u&&!C?{...f,avatar:`${u}?imageFilter=resize&w=48&h=48`}:n},[n]);if(!l)return a.jsx(R,{did:r.did,size:r.avatarSize,useProxyFallback:!0,...r.avatarProps});const h=()=>a.jsx(A,{sx:r.popupSx,children:a.jsx(v,{...r,shouldShowHoverCard:!1,user:l,avatarProps:r.popupAvatarProps,shortenLabelProps:r.popupShortenLabelProps||r.shortenLabelProps,renderFields:r.popupRenderFields,renderName:r.popupRenderName,infoType:r.popupInfoType||r.infoType,didProps:r.popupDidProps||r.didProps,showDid:r.popupShowDid||r.showDid})});return e===t.AvatarOnly?a.jsx(z,{...r,shouldShowHoverCard:s,renderCardContent:h,user:l}):a.jsx(F,{containerRef:i,cardType:e,sx:r.sx,children:a.jsx(v,{...r,shouldShowHoverCard:s,renderCardContent:h,user:l})})}export{$ as B,p as a,t as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-DTeIFVkk.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as K,cw as ft,U as xt,T as E,a3 as ht,W as w,z as $,M as ae,I as W,cF as $e,cg as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as wt}from"./vendor-mui-core-BOHKtf8y.js";import{T as F,a as H,h as Tt,J as fe,B as le,H as R,n as L,G as xe,F as Ue,s as Ge,a0 as Dt,a9 as Ie,S as It,W as Pt}from"./vendor-ux-Cra9XTth.js";import{U as k,p as Rt,ad as Ve,c as U,ap as J,a1 as kt,aE as At,f as Ft,R as Nt,af as se,b6 as Lt,b9 as Ye}from"./index-
|
|
1
|
+
import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-DTeIFVkk.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as K,cw as ft,U as xt,T as E,a3 as ht,W as w,z as $,M as ae,I as W,cF as $e,cg as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as wt}from"./vendor-mui-core-BOHKtf8y.js";import{T as F,a as H,h as Tt,J as fe,B as le,H as R,n as L,G as xe,F as Ue,s as Ge,a0 as Dt,a9 as Ie,S as It,W as Pt}from"./vendor-ux-Cra9XTth.js";import{U as k,p as Rt,ad as Ve,c as U,ap as J,a1 as kt,aE as At,f as Ft,R as Nt,af as se,b6 as Lt,b9 as Ye}from"./index-BGbMta1w.js";import{W as he}from"./did-address-C7IHZs6x.js";import{u as _}from"./team-D7qYznX0.js";import{a as ge,r as ye,b as je,c as Ke,d as ne,e as Bt,u as zt,f as Et}from"./passport-item-C25fvRz1.js";import{p as Ze}from"./util-C5cbPYrK.js";import{u as Mt}from"./use-mobile-BlpLWscF.js";import{v as Q}from"./index-DSNvDaKK.js";import{w as G,P as Je}from"./permission-jA6KoYLs.js";import{C as _t}from"./Google-DxcTyhFe.js";import{A as $t}from"./vendor-arcblock--zSibe1w.js";import{G as Z,a0 as Ot,H as Wt}from"./vendor-utils-BOkrEpKO.js";import{e as oe}from"./edit.svg-DycWG9v3.js";import{C as ve}from"./confirm-BE3P2t7f.js";import{L as Qe}from"./list-header-B8ZTLjYf.js";import{f as te}from"./index-DBs9Ljax.js";import{u as qt}from"./useSetState-DFuQZPPV.js";import{C as Ht}from"./lock.svg-COUP8tyO.js";import"./lottie-web-4koyQiv_.js";import"./session-DwRV85k4.js";import"./isURL-Bawv3imX.js";import"./index-IvJAtHzW.js";import"./base32-BeRPpTcK.js";import"./cloneDeep-DwV-xVQF.js";const ie=u=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},C.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})),Pe="info";function Xe({createPassportSvg:u,passport:o,onCancel:i,onSwitchPassport:p=()=>{}}){const{t:m}=F(),l=mt({tab:Pe}),h={info:{label:m("common.basicInfo"),value:Pe,component:()=>e.jsx(et,{passport:o,createPassportSvg:u})},logs:{label:m("common.logs"),value:"logs",component:()=>e.jsx(rt,{passport:o})},related:{label:m("team.passport.related"),value:"related",component:()=>e.jsx(at,{passport:o,onSwitchPassport:p})}},a=Object.values(h).map(({label:r,value:t})=>({label:r,value:t})).filter(r=>r.value==="related"?o.parentDid:!0),f=h[l.tab]||h.info,s=r=>{l.tab=r};return e.jsx(H,{title:m("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ut,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Tt,{tabs:a,current:l.tab,onChange:s,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(f.component,{})})]})})}Xe.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};const Ut=q(g)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as qr}from"./vendor-utils-BOkrEpKO.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ae as Se,af as jr,ag as xr,ah as Nr,ai as _r,aj as Kr,ak as Sr,al as Tr,am as ke,an as Ur,ao as Br,ap as Dr,aq as Mr,a3 as Lr,r as Cr}from"./vendor-ux-Cra9XTth.js";import{bb as Or,av as Vr}from"./index-
|
|
1
|
+
import{B as qr}from"./vendor-utils-BOkrEpKO.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ae as Se,af as jr,ag as xr,ah as Nr,ai as _r,aj as Kr,ak as Sr,al as Tr,am as ke,an as Ur,ao as Br,ap as Dr,aq as Mr,a3 as Lr,r as Cr}from"./vendor-ux-Cra9XTth.js";import{bb as Or,av as Vr}from"./index-BGbMta1w.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
|
|
2
2
|
`),I=oe(m).split(`
|
|
3
3
|
`),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-BOHKtf8y.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{b as S,n as p}from"./vendor-ux-Cra9XTth.js";import{a as C}from"./page-header-18voA300.js";import{a1 as g}from"./index-
|
|
1
|
+
import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-BOHKtf8y.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{b as S,n as p}from"./vendor-ux-Cra9XTth.js";import{a as C}from"./page-header-18voA300.js";import{a1 as g}from"./index-BGbMta1w.js";import{o as b}from"./vendor-arcblock--zSibe1w.js";import{u as k}from"./config-space-Dc8fZcHS.js";import{C as y,D as v,a as w}from"./connect-to-Bkmg684d.js";import{S as c}from"./step-actions-CAm14q1m.js";import{S as E}from"./layout-DE-cz95w.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BVGaa6Hu.js";import"./api-Rnh95Dt4.js";import"./index-7zXCE3Ua.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-DSNvDaKK.js";import"./index-DBs9Ljax.js";import"./use-mobile-BDciCFXT.js";import"./content-layout-BZKNdb6s.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsx(r,{sx:{width:"100%",maxWidth:"720px"},children:x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{})}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{T as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as M,H as q,I as N,j as J,G as ve,J as Ce,W as Se}from"./vendor-ux-Cra9XTth.js";import{s as Te,k as le,t as Ie}from"./vendor-hooks-DTeIFVkk.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as P,bd as _,a5 as Y,V as X,S as Z,b4 as Oe,U as L,I as B,cm as Ae,bf as Pe,a7 as $e,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Je,ch as Ye,ca as Qe,cg as Ge}from"./vendor-mui-core-BOHKtf8y.js";import{B as de,a as pe,l as ue}from"./index-B-WiXXyt.js";import{U as K,c as xe,ad as Xe,a1 as Ze,b1 as Q}from"./index-Cbf4geph.js";import{u as V}from"./team-ZJuYy81P.js";import{u as et}from"./use-mobile-BlpLWscF.js";import{u as tt,C as G}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-BOkrEpKO.js";import{C as st}from"./confirm-Cx2owMMo.js";import{A as nt}from"./actions-B0rWiAuM.js";import{T as ie}from"./table-tips-73VcKMz1.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./session-89Q1nGxB.js";import"./isURL-By2TdRfN.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(Y,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(X,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(Y,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Ae,{}):e.jsx(Pe,{})})]})]})}),m.length>0&&e.jsx($e,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(X,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Y,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(G,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(G,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(G,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Xe(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function A({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}A.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map($=>$.id===s.id?{...$,...s}:$);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find($=>$?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(X,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(P,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(J,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
1
|
+
import{T as M,H as q,I as N,j as J,G as ve,J as Ce,W as Se}from"./vendor-ux-Cra9XTth.js";import{s as Te,k as le,t as Ie}from"./vendor-hooks-DTeIFVkk.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as P,bd as _,a5 as Y,V as X,S as Z,b4 as Oe,U as L,I as B,cm as Ae,bf as Pe,a7 as $e,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Je,ch as Ye,ca as Qe,cg as Ge}from"./vendor-mui-core-BOHKtf8y.js";import{B as de,a as pe,l as ue}from"./index-IvJAtHzW.js";import{U as K,c as xe,ad as Xe,a1 as Ze,b1 as Q}from"./index-BGbMta1w.js";import{u as V}from"./team-D7qYznX0.js";import{u as et}from"./use-mobile-BlpLWscF.js";import{u as tt,C as G}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-BOkrEpKO.js";import{C as st}from"./confirm-BE3P2t7f.js";import{A as nt}from"./actions-B0rWiAuM.js";import{T as ie}from"./table-tips-73VcKMz1.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./session-DwRV85k4.js";import"./isURL-Bawv3imX.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(Y,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(X,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(Y,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Ae,{}):e.jsx(Pe,{})})]})]})}),m.length>0&&e.jsx($e,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(X,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Y,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(G,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(G,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(G,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Xe(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function A({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}A.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map($=>$.id===s.id?{...$,...s}:$);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find($=>$?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(X,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(P,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(J,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
to {
|
|
4
4
|
transform: rotate(360deg);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i,c4 as $,at as g,W as s,ak as w,b0 as L,a6 as T,s as E}from"./vendor-mui-core-BOHKtf8y.js";import{g as M,h as A,b as y,k as D}from"./vendor-hooks-DTeIFVkk.js";import{ad as q,M as H,c as U,aF as F,aG as j,aH as b,t as O}from"./index-
|
|
1
|
+
import{j as i,c4 as $,at as g,W as s,ak as w,b0 as L,a6 as T,s as E}from"./vendor-mui-core-BOHKtf8y.js";import{g as M,h as A,b as y,k as D}from"./vendor-hooks-DTeIFVkk.js";import{ad as q,M as H,c as U,aF as F,aG as j,aH as b,t as O}from"./index-BGbMta1w.js";import{r as m}from"./vendor-react-Dvs43sk9.js";import{b as Y,a as B,T as h,$ as W}from"./vendor-ux-Cra9XTth.js";import{N as V}from"./index-CkAhcTYd.js";import{a as k}from"./index-Yow2d7gN.js";import{C as G}from"./vendor-utils-BOkrEpKO.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as K}from"./session-DwRV85k4.js";import{b as X}from"./sdk-BPlpWr_6.js";import{w as Q}from"./wrap-locale-COCKCQEf.js";function P({invitation:e,createPassportSvg:c,passportColor:l="auto"}){const[p,n]=m.useState(!1),{t}=m.useContext(Y),o=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),d=m.useMemo(()=>c({title:o,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||l,extra:e.passportExpireTime?{key:"Exp",value:q(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,o]),x=m.useCallback(()=>{n(!0)},[]),a=m.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(Z,{children:i.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&i.jsx(V,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:d}})]})}),i.jsx(B,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(r=>i.jsx("li",{style:{listStyle:"circle"},children:r.description},r.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx($,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:t("invite.emptyPermission")})]})})]})}P.propTypes={invitation:s.object.isRequired,createPassportSvg:s.func.isRequired,passportColor:s.string};const Z=g.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,ak as l}from"./vendor-mui-core-BOHKtf8y.js";import{i as w,r as x}from"./vendor-react-Dvs43sk9.js";import{b as g}from"./vendor-hooks-DTeIFVkk.js";import{I as v}from"./invitation-
|
|
1
|
+
import{j as i,ak as l}from"./vendor-mui-core-BOHKtf8y.js";import{i as w,r as x}from"./vendor-react-Dvs43sk9.js";import{b as g}from"./vendor-hooks-DTeIFVkk.js";import{I as v}from"./invitation-US90mCZ0.js";import{K as u}from"./landing-page-CxWEfJb1.js";import{T as I,w as k}from"./vendor-ux-Cra9XTth.js";import{a as S,e as T,s as E,b as j,c as P,H as R,d as W}from"./index-BGbMta1w.js";import{g as b}from"./get-safe-url-CoK26-Ak.js";import"./vendor-utils-BOkrEpKO.js";import"./index-CkAhcTYd.js";import"./index-Yow2d7gN.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DwRV85k4.js";import"./sdk-BPlpWr_6.js";import"./wrap-locale-COCKCQEf.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";function y(n){const c=w(),{searchParams:s}=new URL(window.location.href),{api:p,session:m}=S(),{t:d}=I(),a=s.get("inviteId"),r=s.get("redirect"),f=x.useCallback(async()=>{const{data:t}=await T.get("invitation",{params:{inviteId:a}});return t},[a]),h=g(async(t,o=e=>e)=>{t&&(E(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await m.refresh(),setTimeout(()=>{if(r){const e=decodeURIComponent(r);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(e,{replace:!0}):window.location.href=b(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(R,{children:i.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),i.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(v,{...n,getDataFn:f,checkFn:p.get,createPassportSvg:t=>W({...t}),onLoginSuccess:h,inService:!0})})]})}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as P}from"./vendor-react-Dvs43sk9.js";import{az as E,aA as F,aB as H,aC as $,aD as N}from"./index-
|
|
1
|
+
import{g as P}from"./vendor-react-Dvs43sk9.js";import{az as E,aA as F,aB as H,aC as $,aD as N}from"./index-BGbMta1w.js";var h={exports:{}},p={exports:{}},I;function Q(){return I||(I=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var v=function(d,y){return d.indexOf(y)!==-1};n.default=v,c.exports=n.default,c.exports.default=n.default}(p,p.exports)),p.exports}var A;function z(){return A||(A=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=D;var v=o(E()),g=o(H()),d=o(Q()),y=o(N()),w=o($()),S=o(F());function o(e){return e&&e.__esModule?e:{default:e}}function R(e,r){return U(e)||O(e,r)||L(e,r)||j()}function j(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(e,r){if(e){if(typeof e=="string")return b(e,r);var l={}.toString.call(e).slice(8,-1);return l==="Object"&&e.constructor&&(l=e.constructor.name),l==="Map"||l==="Set"?Array.from(e):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?b(e,r):void 0}}function b(e,r){(r==null||r>e.length)&&(r=e.length);for(var l=0,u=Array(r);l<r;l++)u[l]=e[l];return u}function O(e,r){var l=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(l!=null){var u,a,_,s,i=[],t=!0,f=!1;try{if(_=(l=l.call(e)).next,r!==0)for(;!(t=(u=_.call(l)).done)&&(i.push(u.value),i.length!==r);t=!0);}catch(m){f=!0,a=m}finally{try{if(!t&&l.return!=null&&(s=l.return(),Object(s)!==s))return}finally{if(f)throw a}}return i}}function U(e){if(Array.isArray(e))return e}var k={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},C=/^\[([^\]]+)\](?::([0-9]+))?$/;function D(e,r){if((0,v.default)(e),!e||/[\s<>]/.test(e)||e.indexOf("mailto:")===0||(r=(0,S.default)(r,k),r.validate_length&&e.length>r.max_allowed_length)||!r.allow_fragments&&(0,d.default)(e,"#")||!r.allow_query_components&&((0,d.default)(e,"?")||(0,d.default)(e,"&")))return!1;var l,u,a,_,s,i,t,f;if(t=e.split("#"),e=t.shift(),t=e.split("?"),e=t.shift(),t=e.split("://"),t.length>1){if(l=t.shift().toLowerCase(),r.require_valid_protocol&&r.protocols.indexOf(l)===-1)return!1}else{if(r.require_protocol)return!1;if(e.slice(0,2)==="//"){if(!r.allow_protocol_relative_urls)return!1;t[0]=e.slice(2)}}if(e=t.join("://"),e==="")return!1;if(t=e.split("/"),e=t.shift(),e===""&&!r.require_host)return!0;if(t=e.split("@"),t.length>1){if(r.disallow_auth||t[0]===""||(u=t.shift(),u.indexOf(":")>=0&&u.split(":").length>2))return!1;var m=u.split(":"),x=R(m,2),M=x[0],T=x[1];if(M===""&&T==="")return!1}_=t.join("@"),i=null,f=null;var q=_.match(C);if(q?(a="",f=q[1],i=q[2]||null):(t=_.split(":"),a=t.shift(),t.length&&(i=t.join(":"))),i!==null&&i.length>0){if(s=parseInt(i,10),!/^[0-9]+$/.test(i)||s<=0||s>65535)return!1}else if(r.require_port)return!1;return r.host_whitelist?(0,g.default)(a,r.host_whitelist):a===""&&!r.require_host?!0:!(!(0,w.default)(a)&&!(0,y.default)(a,r)&&(!f||!(0,w.default)(f,6))||(a=a||f,r.host_blacklist&&(0,g.default)(a,r.host_blacklist)))}c.exports=n.default,c.exports.default=n.default}(h,h.exports)),h.exports}var B=z();const J=P(B);export{J as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,a6 as g,ak as x}from"./vendor-mui-core-BOHKtf8y.js";import{g as v,k,b as p}from"./vendor-hooks-DTeIFVkk.js";import{I as T}from"./invitation-
|
|
1
|
+
import{j as s,a6 as g,ak as x}from"./vendor-mui-core-BOHKtf8y.js";import{g as v,k,b as p}from"./vendor-hooks-DTeIFVkk.js";import{I as T}from"./invitation-US90mCZ0.js";import{K as I}from"./landing-page-CxWEfJb1.js";import{T as P,w as j}from"./vendor-ux-Cra9XTth.js";import{a as R,s as S,b as E,c as N,H as W,d as b}from"./index-BGbMta1w.js";import{g as C}from"./get-safe-url-CoK26-Ak.js";import{i as F}from"./vendor-react-Dvs43sk9.js";import"./vendor-utils-BOkrEpKO.js";import"./index-CkAhcTYd.js";import"./index-Yow2d7gN.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DwRV85k4.js";import"./sdk-BPlpWr_6.js";import"./wrap-locale-COCKCQEf.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";function Q(m){const{searchParams:r}=new URL(window.location.href),{api:a,session:d}=R(),f=F(),{t:h}=P(),n=r.get("id"),c=r.get("redirect"),u=v({state:""}),o=k(async()=>{if(!n)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(o.error)throw o.error;return o?.data}),w=p(async(t,i=e=>e)=>{t&&(t.sessionToken&&S(i(t.sessionToken)),t.refreshToken&&E(i(t.refreshToken)),t.visitorId&&j(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const e=decodeURIComponent(c);e.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?f(e,{replace:!0}):window.location.href=C(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return o.loading?s.jsx(g,{}):s.jsxs(I,{did:window.blocklet?.appPid,children:[s.jsx(W,{children:s.jsxs("title",{children:[h("pageTitle.issuePassport")," | ",window.blocklet?.appName]})}),s.jsx(x,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:s.jsx(T,{...m,action:"issue-passport",getDataFn:l,checkFn:a.get,createPassportSvg:b,onLoginSuccess:w,inService:!0,status:u.state})})]})}export{Q as default};
|