@abtnode/blocklet-services 1.16.45 → 1.16.46-beta-20250703-050038-4ba2582f

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.
Files changed (156) hide show
  1. package/api/routes/user-session.js +2 -1
  2. package/api/state/index.js +1 -1
  3. package/dist/assets/{AdapterDayjs-BRnJ9bMs.js → AdapterDayjs-BIQsjtiT.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-DBJPIOl4.js → ArrowDropDown-C8mwBtnq.js} +1 -1
  5. package/dist/assets/{CheckCircle-DUJmWceY.js → CheckCircle-BMMes-V7.js} +1 -1
  6. package/dist/assets/{ChevronLeft-BBJJJhVi.js → ChevronLeft-B8rsCJhy.js} +1 -1
  7. package/dist/assets/{ChevronRight-BU9I7WD4.js → ChevronRight-CXhRlHKa.js} +1 -1
  8. package/dist/assets/{DeleteOutline-BKSMNwfT.js → DeleteOutline-DtbgduIM.js} +1 -1
  9. package/dist/assets/{Done-ASNftAOL.js → Done-CfxTFgBR.js} +1 -1
  10. package/dist/assets/{Download-D4X39_9V.js → Download-Cz4FAob1.js} +1 -1
  11. package/dist/assets/{Edit-CiTb-w5P.js → Edit-Dh2oBqBB.js} +1 -1
  12. package/dist/assets/{Error-BAEKW7-e.js → Error-BsnYcwiq.js} +1 -1
  13. package/dist/assets/{ExpandLess-CcLTbsdW.js → ExpandLess-B7eaaZaz.js} +1 -1
  14. package/dist/assets/{Google-C28yeMZW.js → Google-BAVYemz7.js} +1 -1
  15. package/dist/assets/{Home-Dujcj083.js → Home-SYcuMunC.js} +1 -1
  16. package/dist/assets/{InfoOutlined-BVWbftGI.js → InfoOutlined-GEKFkezP.js} +1 -1
  17. package/dist/assets/{Launch-DFS3fgjy.js → Launch-BB2NS6gw.js} +1 -1
  18. package/dist/assets/{LaunchOutlined-C1x4Og4u.js → LaunchOutlined-BEsYq9kI.js} +1 -1
  19. package/dist/assets/{MoreHoriz-ChJ3K52h.js → MoreHoriz-BDLlOCqj.js} +1 -1
  20. package/dist/assets/{PlayArrow-BqVYRyLK.js → PlayArrow-hnXK75qN.js} +1 -1
  21. package/dist/assets/{TuneOutlined-CKzi_VZZ.js → TuneOutlined-CjVMXY_7.js} +1 -1
  22. package/dist/assets/{ViewList-BOGcbymi.js → ViewList-CYMKafss.js} +1 -1
  23. package/dist/assets/{access-control-5WGT2JfR.js → access-control-BFze8gPg.js} +1 -1
  24. package/dist/assets/{actions-DnTVXQ_Z.js → actions-D_aAU5uf.js} +1 -1
  25. package/dist/assets/{add-component-core-DehB4lvu.js → add-component-core-CwbGrQav.js} +1 -1
  26. package/dist/assets/{add-resource-DfqBSLDk.js → add-resource-EZWL5Kfm.js} +1 -1
  27. package/dist/assets/{addon-DdjBFoHI.js → addon-CuKQNO-0.js} +1 -1
  28. package/dist/assets/advanced-BR1PWvXD.js +14 -0
  29. package/dist/assets/api-ZzsS0diA.js +1 -0
  30. package/dist/assets/{appearance-DsoglxbB.js → appearance-CHLvy771.js} +1 -1
  31. package/dist/assets/{audit-logs-DKiQkfse.js → audit-logs-HRbs-zR8.js} +1 -1
  32. package/dist/assets/{authorize-IzqEi1HK.js → authorize-BLL3c3nQ.js} +1 -1
  33. package/dist/assets/{base-chart-CoApVzod.js → base-chart-B81_ogPb.js} +1 -1
  34. package/dist/assets/{base32-DUSifB4M.js → base32-BTgHqgXA.js} +1 -1
  35. package/dist/assets/{branding-CwYIeBi1.js → branding-BYCDBHLo.js} +1 -1
  36. package/dist/assets/{branding-B1o_K1XB.js → branding-WyyEnk9U.js} +2 -2
  37. package/dist/assets/{bundle-avatar-UIbxwQif.js → bundle-avatar-DxpUnWc9.js} +1 -1
  38. package/dist/assets/{button-D_ZVjN82.js → button-BxXFhZV_.js} +1 -1
  39. package/dist/assets/{click-to-copy-By4fgGR7.js → click-to-copy-nMjIOe47.js} +1 -1
  40. package/dist/assets/{cloneDeep-CDl5kZTY.js → cloneDeep-Cm_V5yFW.js} +1 -1
  41. package/dist/assets/{collapse-DAaiuAEY.js → collapse-2Uzc-qtU.js} +1 -1
  42. package/dist/assets/{complete-Bi_BaBBl.js → complete-DCJ7Rl4p.js} +1 -1
  43. package/dist/assets/{component-CiFJ1vhL.js → component-BqNp0WH9.js} +3 -3
  44. package/dist/assets/{config-BZuiK8BP.js → config-COcQW2xB.js} +1 -1
  45. package/dist/assets/{config-JUGJKWP_.js → config-DaC-Wq7r.js} +1 -1
  46. package/dist/assets/{config-navigation-DZ54_nVv.js → config-navigation-DOALMOAS.js} +3 -3
  47. package/dist/assets/{config-space-D6ScnWdA.js → config-space-CyCq4fxg.js} +1 -1
  48. package/dist/assets/{confirm-RvA9mFot.js → confirm-CDWcSF88.js} +1 -1
  49. package/dist/assets/connect-Br7I-KPU.js +5 -0
  50. package/dist/assets/{connect-DhuiCF4g.js → connect-CKhBRnXh.js} +1 -1
  51. package/dist/assets/{connect-to-CxoBjkcK.js → connect-to-D_-7CELt.js} +1 -1
  52. package/dist/assets/{dashboard-t9EszOna.js → dashboard-3f3Wapmv.js} +3 -3
  53. package/dist/assets/{delete-confirm-wTMDQFnr.js → delete-confirm-CEtsVP5o.js} +1 -1
  54. package/dist/assets/{did-address-NnOD1W_A.js → did-address-BYc4cym-.js} +1 -1
  55. package/dist/assets/domain-DrB0Xtiq.js +9 -0
  56. package/dist/assets/{domain-action-card-BlPWBOAu.js → domain-action-card-BmFA6T_2.js} +1 -1
  57. package/dist/assets/domains-aM7-R16w.js +1 -0
  58. package/dist/assets/dot-BSvIHcuy.js +7 -0
  59. package/dist/assets/{email-0b_MYxBQ.js → email-NDtfDo4w.js} +1 -1
  60. package/dist/assets/{exchange-passport-BnmyuwIs.js → exchange-passport-dw7T8AUh.js} +1 -1
  61. package/dist/assets/{fuel-DEqW116b.js → fuel-CQnVBL1G.js} +1 -1
  62. package/dist/assets/{gen-access-key-CVpZSjIw.js → gen-access-key-CKRsRWaQ.js} +1 -1
  63. package/dist/assets/{get-safe-url-B0-S5PGZ.js → get-safe-url-D3ggKpT1.js} +1 -1
  64. package/dist/assets/{get-safe-url-D5KSEAKZ.js → get-safe-url-DAFhlwkH.js} +1 -1
  65. package/dist/assets/{home-DfSu-4-a.js → home-A-VRaS1G.js} +1 -1
  66. package/dist/assets/{iframe-DFg8oeD0.js → iframe-GZPTHXNz.js} +1 -1
  67. package/dist/assets/{index-CkwXRCmN.js → index-75Nc_luV.js} +4 -4
  68. package/dist/assets/{index-I1i2Mc1k.js → index-B1I0U81c.js} +1 -1
  69. package/dist/assets/{index-DrTNV3tX.js → index-BEpPMiyb.js} +1 -1
  70. package/dist/assets/{index-Dq1Rmjwf.js → index-BXVUmQnX.js} +1 -1
  71. package/dist/assets/{index-CD07vq9d.js → index-BrMH3hes.js} +1 -1
  72. package/dist/assets/{index-6I6juqjg.js → index-BsIM7oBN.js} +1 -1
  73. package/dist/assets/{index-B70kYOfj.js → index-C0LoLjcL.js} +1 -1
  74. package/dist/assets/{index-YaLWfp9D.js → index-CAHja9to.js} +1 -1
  75. package/dist/assets/{index-BxJZWVOT.js → index-CRPd6bu_.js} +1 -1
  76. package/dist/assets/{index-Cwq0Io0K.js → index-C_iJfkbw.js} +1 -1
  77. package/dist/assets/{index-CwUT0vPy.js → index-Cti-S8sI.js} +4 -4
  78. package/dist/assets/{index-BLfUtUpB.js → index-D1V1OV_1.js} +1 -1
  79. package/dist/assets/{index-DPIWnhb5.js → index-D3Qm_7QJ.js} +1 -1
  80. package/dist/assets/{index-B874LN5A.js → index-D6Kz_Kj2.js} +1 -1
  81. package/dist/assets/{index-2mYUqHxe.js → index-DBnbtCJw.js} +3 -3
  82. package/dist/assets/{index-C0btiQfG.js → index-DDpPyFll.js} +1 -1
  83. package/dist/assets/{index-IeoAQOW8.js → index-DJghIcZg.js} +1 -1
  84. package/dist/assets/{index-w4f-mlFt.js → index-opVatFs5.js} +1 -1
  85. package/dist/assets/{index-ZcD1N43m.js → index-rz1HClDn.js} +1 -1
  86. package/dist/assets/{index-B4fH-l5R.js → index-xEAUvM9N.js} +1 -1
  87. package/dist/assets/{index-aAlnaECr.js → index-zvQQ3C85.js} +1 -1
  88. package/dist/assets/{invitation-B3B-J4fG.js → invitation-lVBY7BRV.js} +1 -1
  89. package/dist/assets/{invite-jaOwIvW9.js → invite-vGAxuB6S.js} +1 -1
  90. package/dist/assets/{issue-passport-DpSBB2L8.js → issue-passport-BJj9S3VH.js} +1 -1
  91. package/dist/assets/{item-D-39k2FC.js → item-Ck1X0EKi.js} +1 -1
  92. package/dist/assets/{layout-DEiEwPzB.js → layout-Iy3Ltu2J.js} +1 -1
  93. package/dist/assets/{list-ZFC0mCy0.js → list-CA-gEd-1.js} +2 -2
  94. package/dist/assets/{list-DDNORnll.js → list-DWx_rlsJ.js} +1 -1
  95. package/dist/assets/localization-BmadHeXm.js +1 -0
  96. package/dist/assets/{log-BBUgs8Rd.js → log-BFUsU5ZV.js} +1 -1
  97. package/dist/assets/{logger-Dqm1UQym.js → logger-9nL4ASn6.js} +1 -1
  98. package/dist/assets/{login-DbSs2lO2.js → login-D_thJ6QB.js} +1 -1
  99. package/dist/assets/{login-oauth-callback-Cpai1yC1.js → login-oauth-callback-D3WJu6Qx.js} +1 -1
  100. package/dist/assets/{logo-uploader-BPSmPaZd.js → logo-uploader-CMlpg5uV.js} +3 -3
  101. package/dist/assets/{lost-passport-Ce_WXcnR.js → lost-passport-C23LgPGO.js} +1 -1
  102. package/dist/assets/{omit-Cao4GLS7.js → omit-rJ-mc6U5.js} +1 -1
  103. package/dist/assets/{open-window-hpzKFxn5.js → open-window-CTBzFUUv.js} +1 -1
  104. package/dist/assets/{overview-C3aIT8Ro.js → overview-Bmi7dmR0.js} +1 -1
  105. package/dist/assets/{page-header-DNvUdNpI.js → page-header-DqtuZOzT.js} +1 -1
  106. package/dist/assets/{passport-item-B3XIp0U4.js → passport-item-BGYRFCwE.js} +1 -1
  107. package/dist/assets/{permission-DQvXGutX.js → permission-BEqDHKfL.js} +1 -1
  108. package/dist/assets/{preferences-C3zaKjfI.js → preferences-D1eIimRF.js} +1 -1
  109. package/dist/assets/{profile-embed-BFjGm3Vt.js → profile-embed-DdACJ_zu.js} +1 -1
  110. package/dist/assets/publish-resource-BnpouxdO.js +1 -0
  111. package/dist/assets/{react-beautiful-dnd.esm-02tdagHZ.js → react-beautiful-dnd.esm-CNuzAjru.js} +1 -1
  112. package/dist/assets/{runtime-Drmh1-cb.js → runtime-6wVftvUx.js} +1 -1
  113. package/dist/assets/{sanitize-e0A8A-yt.js → sanitize-BKnEhEg8.js} +1 -1
  114. package/dist/assets/sdk-Btq1iUPd.js +1 -0
  115. package/dist/assets/{security-BPd4v9z4.js → security-DJRv4_Fx.js} +1 -1
  116. package/dist/assets/{session-BGdAM8zS.js → session-kQ1tvY5U.js} +1 -1
  117. package/dist/assets/setup-CV_F3UHP.js +30 -0
  118. package/dist/assets/{spaces-DUkzPTBd.js → spaces-BTlTdKAI.js} +1 -1
  119. package/dist/assets/{start-C9Hvgbcz.js → start-7Wq6LiTT.js} +1 -1
  120. package/dist/assets/{starting-progress-CYgfPTsE.js → starting-progress-CAkASj-X.js} +1 -1
  121. package/dist/assets/{status-f3Y-NXRP.js → status-CYSvSIaN.js} +1 -1
  122. package/dist/assets/{step-actions-BNbc1l8F.js → step-actions-C4SB9_F2.js} +1 -1
  123. package/dist/assets/{studio-I9lo0Itp.js → studio-BWs_EnV3.js} +1 -1
  124. package/dist/assets/{switch-control-Brwb8ptk.js → switch-control-eCwDP-ME.js} +1 -1
  125. package/dist/assets/{table-tips-BzPqsKYQ.js → table-tips-CCj0tXz1.js} +1 -1
  126. package/dist/assets/{traffic-FNLLya21.js → traffic-Pt9FvcDk.js} +1 -1
  127. package/dist/assets/{transfer-m6229uxg.js → transfer-Cj_zgOWb.js} +1 -1
  128. package/dist/assets/{unsubscribe-BXKQU2c1.js → unsubscribe-CICtmk2r.js} +1 -1
  129. package/dist/assets/{use-blocklet-logo-4UB-MFD3.js → use-blocklet-logo-Bjt6-_x3.js} +1 -1
  130. package/dist/assets/useAsync-CZkpdKtR.js +1 -0
  131. package/dist/assets/useAsync-DmrzeQhI.js +1 -0
  132. package/dist/assets/{useLocalStorage-CaPDqrQ7.js → useLocalStorage-BoYGn-bQ.js} +1 -1
  133. package/dist/assets/{user-center-CNdVbQx6.js → user-center-BVfQDQ91.js} +3 -3
  134. package/dist/assets/{util-BRPRFc9p.js → util-BQvjy4j5.js} +1 -1
  135. package/dist/assets/{util-BQAJqeb4.js → util-TW4lcckB.js} +1 -1
  136. package/dist/assets/{vendor-arcblock-CwufDgLV.js → vendor-arcblock-DzylOsX3.js} +3 -3
  137. package/dist/assets/{vendor-hooks-DqdmWCmo.js → vendor-hooks-B2N8eE_a.js} +1 -1
  138. package/dist/assets/vendor-utils-uPLZO5mM.js +208 -0
  139. package/dist/assets/vendor-ux-did-connect-CQtodyZB.js +2304 -0
  140. package/dist/assets/{wrap-locale-ClbCNOs0.js → wrap-locale-CpZgZaeK.js} +1 -1
  141. package/dist/index.html +5 -5
  142. package/dist/service-worker.js +1 -1
  143. package/package.json +23 -23
  144. package/dist/assets/advanced-CJz1c7Eh.js +0 -14
  145. package/dist/assets/api-C1S8LUld.js +0 -1
  146. package/dist/assets/connect-DGMfp8-Y.js +0 -5
  147. package/dist/assets/domain-BaMcm6r6.js +0 -9
  148. package/dist/assets/domains-CxJF-JF_.js +0 -1
  149. package/dist/assets/dot-4jhL56kz.js +0 -7
  150. package/dist/assets/localization-tyC-vHO5.js +0 -1
  151. package/dist/assets/publish-resource-CAZrBTdz.js +0 -1
  152. package/dist/assets/sdk-BmeKtHic.js +0 -1
  153. package/dist/assets/setup-Bo10IVJ4.js +0 -30
  154. package/dist/assets/useAsync-C62uE2pS.js +0 -1
  155. package/dist/assets/vendor-utils-BfZ4tlod.js +0 -208
  156. package/dist/assets/vendor-ux-did-connect-pzpsrvqx.js +0 -2304
@@ -1,4 +1,4 @@
1
- import{j as e,H as h,ah as Je,T as C,ab as A,e as Ze,cD as Z,ae as G,cE as Ge,aa as j,al as W,s as ge,ad as Se,ap as et,cF as ze,a9 as ye,q,b7 as Y,b8 as H,y as tt,at as st,as as Ae}from"./vendor-mui-core-Bq8gXTan.js";import{l as nt,i as Pe,b as fe}from"./vendor-hooks-DqdmWCmo.js";import{r as y,h as ot}from"./vendor-react-DEoibe3W.js";import{c as _,y as rt,W as at,J as it,X as ct,l as lt,w as dt,Y as ue,x as ut}from"./vendor-arcblock-CwufDgLV.js";import{a3 as B,a as T,bb as pt,k as R,bg as V,ac as mt,r as je,bF as ft,B as pe,at as ht,F as _e,ax as xt}from"./vendor-ux-did-connect-pzpsrvqx.js";import{G as O,D as M,y as E,a3 as gt,af as St,aF as yt}from"./index-CwUT0vPy.js";import{u as jt}from"./use-mobile-CtTQsfXN.js";import{b as Q,d as Me,a8 as bt,I as Ct,E as Ue,A as he}from"./vendor-utils-BfZ4tlod.js";import"./api-C1S8LUld.js";import{u as Ne,C as kt,D as Dt,a as Bt}from"./connect-to-CxoBjkcK.js";import{b as wt,c as Et,d as Tt,i as It,e as xe,f as Rt,h as vt,j as At}from"./spaces-DUkzPTBd.js";import{f as X}from"./index-8eXqqyHQ.js";import{I as Ot}from"./index-DPIWnhb5.js";import{R as Lt}from"./index-w4f-mlFt.js";import{d as zt}from"./MoreHoriz-ChJ3K52h.js";import{c as Pt}from"./dashboard-t9EszOna.js";import{d as _t}from"./DeleteOutline-BKSMNwfT.js";import{g as Oe}from"./get-safe-url-D5KSEAKZ.js";import{S as Mt}from"./switch-control-Brwb8ptk.js";import{C as Ut,u as Nt}from"./config-space-D6ScnWdA.js";import{L as Le}from"./list-header-C7gle0n0.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./confirm-RvA9mFot.js";import"./PlayArrow-BqVYRyLK.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";async function Wt({blockletDid:t,nodeApi:r,spaceGateways:o}){let s=!1;const i=await Promise.all(o.map(async n=>{let{name:a}=n;const d=await wt(n.endpoint);return!Q(d)&&d!==a&&(a=d,s=!0),{...n,name:a}}));return s&&await Promise.all(i.filter(n=>n.did).map(n=>r.updateBlockletSpaceGateway({input:{did:t,where:{did:n.did},spaceGateway:{...n}}}))),i}function Ft({refresh:t}={}){var i;const{blocklet:r}=O(),o=(i=r==null?void 0:r.meta)==null?void 0:i.did,{api:s}=M();return nt(async()=>{if(!o)return[];const{spaceGateways:n}=await s.getBlockletSpaceGateways({input:{did:o}});return await Wt({blockletDid:o,nodeApi:s,spaceGateways:n})??[]},{refreshDeps:[o,t],onError(n){var a;(a=n==null?void 0:n.message)!=null&&a.includes("not logged")?console.warn(n):(console.error(n),B.error(X(n)))}})}function We({deps:t,setLoading:r,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,n]=y.useState([]),{api:a}=M(),[d,u]=y.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),c=Me(async()=>{try{if(r(!0),!s){n([]);return}const{backups:p}=await a.getBlockletBackups({input:{did:s.meta.did,startTime:d,endTime:u}});n(p??[])}catch(p){console.error(p),B.error(X(p))}finally{r(!1)}},1e3);return Pe(async()=>{c()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Kt({appDid:t}){const{backups:r}=We(),[o,s]=y.useState({message:"",progress:0,completed:!1}),i=M(),{ws:{useSubscription:n}}=i;return n(_.BlockletEvents.backupProgress,a=>{t===(a==null?void 0:a.appDid)&&s(()=>({...a}))},[t]),y.useEffect(()=>{var a;if(r!=null&&r.length&&bt((a=r[0])==null?void 0:a.status)){const[d]=r;s(()=>({message:d.message,progress:d.progress,completed:d.progress>=100}))}},[r]),o}function $t({deps:t=[],setLoading:r=()=>{}}={}){var d;const{blocklet:o}=O(),[s,i]=y.useState([]),{api:n}=M(),a=y.useCallback(Me(async()=>{var u;if(!n||!((u=o==null?void 0:o.meta)!=null&&u.did)){i([]);return}try{r(!0);const c=E(),x=c.subtract(1,"year"),{summary:p}=await n.getBlockletBackupSummary({input:{did:o.meta.did,startTime:x.toISOString(),endTime:c.toISOString()}});i(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(X(c)),i([])}finally{r(!1)}},1e3),[]);return Pe(async()=>(await a(),()=>{a.cancel()}),[(d=o==null?void 0:o.meta)==null?void 0:d.did].concat(t)),{backupSummary:s}}const Fe=y.createContext({}),{Provider:qt,Consumer:Ws}=Fe;function be({children:t}){var K;const{t:r}=T(),{api:o}=M(),{blocklet:s}=O(),[i,n]=y.useState(null),[a,d]=y.useState(!1),{data:u,loading:c,mutate:x}=Ft({refresh:a}),p=Ct(u),g=Kt({appDid:s==null?void 0:s.appDid}),f=y.useMemo(()=>Et(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,D]=y.useState(!1),[S,l]=y.useState(!1),{backups:te}=We({deps:[S,i],setLoading:D,backupDate:i}),[se,ne]=y.useState(!1),{backupSummary:oe}=$t({deps:[se]}),[U,z]=y.useState(u==null?void 0:u.find(m=>m.endpoint===f)),I=(K=s==null?void 0:s.settings)==null?void 0:K.autoBackup,v=()=>{d(m=>!m)},re=()=>{ne(m=>!m)},ae=()=>{l(m=>!m)},F=async m=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:m}})},J=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(m,N)=>{try{x(w=>{const P=[...w];return P.push({...m,loading:!0}),P}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:m}}),f!==N&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),z(m),v(),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(w){throw console.error(w),x(P=>[...P].filter(de=>de.did!==m.did)),w}},ce=async m=>{m&&(m.endpoint===f&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await F({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),x(N=>{const w=[...N];return w.splice(w.indexOf(m),1),w}),z(m),v())},le=async m=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:m.did},spaceGateway:m}}),f!==m.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===f;return e.jsx(qt,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:F,abortBlockletBackup:J,backupEndpoint:f,backupProgress:g,backups:te,backupSummary:oe,refreshBackupSummary:re,refreshBackups:ae,setBackupDate:n,backupsLoading:b,autoBackup:I},children:t})}be.propTypes={children:h.any.isRequired};be.defaultProps={};function L(){return y.useContext(Fe)}function ee({...t}){const{blocklet:r}=O(),{info:o}=M(),{t:s}=T(),i=Ne({blocklet:r}),n=gt(o),{spaceGateways:a,addSpaceGateway:d}=L(),u={checkFn:Ue.create({baseURL:he(window.location.origin,St())}).get,webWalletUrl:n,extraParams:{appPid:r.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:o.did}},c=async({endpoint:p,name:g,did:f})=>{const b=await Tt(p);if(!await It(b)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(a.some(l=>l.endpoint===p)){B.error(s("storage.spaces.gateway.add.duplicate",{name:g}));return}await d({name:g,did:f,url:b,endpoint:p},p)},x=async({spaceGateway:p})=>{try{await c(p)}catch(g){console.error(g),B.error(X(g))}};return e.jsx(rt,{...t,connectScope:"app",options:u,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ke({...t}){const{t:r}=y.useContext(pt),{blocklet:o,loadingDiskInfo:s,actions:i}=O();if(y.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const n=(u,c,x)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?yt(c):"empty"})]}),a=o.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),d=[{key:"appDir",name:r("blocklet.diskInfo.appDir"),value:n(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:r("blocklet.diskInfo.dataDir"),value:n(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:r("blocklet.diskInfo.logDir"),value:n(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:r("blocklet.diskInfo.cacheDir"),value:n(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Yt,{component:"div",...t,children:d.map(u=>e.jsx(Ot,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return s?e.jsx(A,{}):e.jsx(C,{children:r("blocklet.diskInfo.empty")})}const Yt=Je(C)``;function Ce(){const{t}=T(),{setBackupDate:r,backupSummary:o}=L(),s=at({key:"lg"}),i=y.useRef(null),n=Ze(),a=y.useCallback(c=>{r(c)},[r]),d=y.useMemo(()=>{const c=E().add(1,"day"),x=E().subtract(11,"month").startOf("month"),p=new Map(o.map(f=>[f.date,{date:f.date,successCount:f.successCount,errorCount:f.errorCount}])),g=[];for(let f=x.clone();E(f).isBefore(c);f=f.add(1,"day")){const b=f.format("YYYY-MM-DD");g.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return g},[o]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:l}=d[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${l}</div>`].join(`
1
+ import{j as e,H as h,ah as Je,T as C,ab as A,e as Ze,cD as Z,ae as G,cE as Ge,aa as j,al as W,s as ge,ad as Se,ap as et,cF as ze,a9 as ye,q,b7 as Y,b8 as H,y as tt,at as st,as as Ae}from"./vendor-mui-core-Bq8gXTan.js";import{l as nt,i as Pe,b as fe}from"./vendor-hooks-B2N8eE_a.js";import{r as y,h as ot}from"./vendor-react-DEoibe3W.js";import{c as _,y as rt,W as at,J as it,X as ct,l as lt,w as dt,Y as ue,x as ut}from"./vendor-arcblock-DzylOsX3.js";import{a3 as B,a as T,bb as pt,k as R,bg as V,ac as mt,r as je,bF as ft,B as pe,at as ht,F as _e,ax as xt}from"./vendor-ux-did-connect-CQtodyZB.js";import{G as O,D as M,y as E,a3 as gt,af as St,aF as yt}from"./index-Cti-S8sI.js";import{u as jt}from"./use-mobile-CtTQsfXN.js";import{b as Q,d as Me,a8 as bt,I as Ct,E as Ue,A as he}from"./vendor-utils-uPLZO5mM.js";import"./api-ZzsS0diA.js";import{u as Ne,C as kt,D as Dt,a as Bt}from"./connect-to-D_-7CELt.js";import{b as wt,c as Et,d as Tt,i as It,e as xe,f as Rt,h as vt,j as At}from"./spaces-BTlTdKAI.js";import{f as X}from"./index-8eXqqyHQ.js";import{I as Ot}from"./index-D3Qm_7QJ.js";import{R as Lt}from"./index-opVatFs5.js";import{d as zt}from"./MoreHoriz-BDLlOCqj.js";import{c as Pt}from"./dashboard-3f3Wapmv.js";import{d as _t}from"./DeleteOutline-DtbgduIM.js";import{g as Oe}from"./get-safe-url-DAFhlwkH.js";import{S as Mt}from"./switch-control-eCwDP-ME.js";import{C as Ut,u as Nt}from"./config-space-CyCq4fxg.js";import{L as Le}from"./list-header-C7gle0n0.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-BoYGn-bQ.js";import"./confirm-CDWcSF88.js";import"./PlayArrow-hnXK75qN.js";import"./session-kQ1tvY5U.js";import"./use-blocklet-logo-Bjt6-_x3.js";import"./InfoOutlined-GEKFkezP.js";import"./dot-BSvIHcuy.js";import"./useAsync-CZkpdKtR.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";async function Wt({blockletDid:t,nodeApi:r,spaceGateways:o}){let s=!1;const i=await Promise.all(o.map(async n=>{let{name:a}=n;const d=await wt(n.endpoint);return!Q(d)&&d!==a&&(a=d,s=!0),{...n,name:a}}));return s&&await Promise.all(i.filter(n=>n.did).map(n=>r.updateBlockletSpaceGateway({input:{did:t,where:{did:n.did},spaceGateway:{...n}}}))),i}function Ft({refresh:t}={}){var i;const{blocklet:r}=O(),o=(i=r==null?void 0:r.meta)==null?void 0:i.did,{api:s}=M();return nt(async()=>{if(!o)return[];const{spaceGateways:n}=await s.getBlockletSpaceGateways({input:{did:o}});return await Wt({blockletDid:o,nodeApi:s,spaceGateways:n})??[]},{refreshDeps:[o,t],onError(n){var a;(a=n==null?void 0:n.message)!=null&&a.includes("not logged")?console.warn(n):(console.error(n),B.error(X(n)))}})}function We({deps:t,setLoading:r,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,n]=y.useState([]),{api:a}=M(),[d,u]=y.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),c=Me(async()=>{try{if(r(!0),!s){n([]);return}const{backups:p}=await a.getBlockletBackups({input:{did:s.meta.did,startTime:d,endTime:u}});n(p??[])}catch(p){console.error(p),B.error(X(p))}finally{r(!1)}},1e3);return Pe(async()=>{c()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Kt({appDid:t}){const{backups:r}=We(),[o,s]=y.useState({message:"",progress:0,completed:!1}),i=M(),{ws:{useSubscription:n}}=i;return n(_.BlockletEvents.backupProgress,a=>{t===(a==null?void 0:a.appDid)&&s(()=>({...a}))},[t]),y.useEffect(()=>{var a;if(r!=null&&r.length&&bt((a=r[0])==null?void 0:a.status)){const[d]=r;s(()=>({message:d.message,progress:d.progress,completed:d.progress>=100}))}},[r]),o}function $t({deps:t=[],setLoading:r=()=>{}}={}){var d;const{blocklet:o}=O(),[s,i]=y.useState([]),{api:n}=M(),a=y.useCallback(Me(async()=>{var u;if(!n||!((u=o==null?void 0:o.meta)!=null&&u.did)){i([]);return}try{r(!0);const c=E(),x=c.subtract(1,"year"),{summary:p}=await n.getBlockletBackupSummary({input:{did:o.meta.did,startTime:x.toISOString(),endTime:c.toISOString()}});i(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),B.error(X(c)),i([])}finally{r(!1)}},1e3),[]);return Pe(async()=>(await a(),()=>{a.cancel()}),[(d=o==null?void 0:o.meta)==null?void 0:d.did].concat(t)),{backupSummary:s}}const Fe=y.createContext({}),{Provider:qt,Consumer:Ws}=Fe;function be({children:t}){var K;const{t:r}=T(),{api:o}=M(),{blocklet:s}=O(),[i,n]=y.useState(null),[a,d]=y.useState(!1),{data:u,loading:c,mutate:x}=Ft({refresh:a}),p=Ct(u),g=Kt({appDid:s==null?void 0:s.appDid}),f=y.useMemo(()=>Et(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,D]=y.useState(!1),[S,l]=y.useState(!1),{backups:te}=We({deps:[S,i],setLoading:D,backupDate:i}),[se,ne]=y.useState(!1),{backupSummary:oe}=$t({deps:[se]}),[U,z]=y.useState(u==null?void 0:u.find(m=>m.endpoint===f)),I=(K=s==null?void 0:s.settings)==null?void 0:K.autoBackup,v=()=>{d(m=>!m)},re=()=>{ne(m=>!m)},ae=()=>{l(m=>!m)},F=async m=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:m}})},J=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(m,N)=>{try{x(w=>{const P=[...w];return P.push({...m,loading:!0}),P}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:m}}),f!==N&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),z(m),v(),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(w){throw console.error(w),x(P=>[...P].filter(de=>de.did!==m.did)),w}},ce=async m=>{m&&(m.endpoint===f&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await F({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),x(N=>{const w=[...N];return w.splice(w.indexOf(m),1),w}),z(m),v())},le=async m=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:m.did},spaceGateway:m}}),f!==m.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),B.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===f;return e.jsx(qt,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:F,abortBlockletBackup:J,backupEndpoint:f,backupProgress:g,backups:te,backupSummary:oe,refreshBackupSummary:re,refreshBackups:ae,setBackupDate:n,backupsLoading:b,autoBackup:I},children:t})}be.propTypes={children:h.any.isRequired};be.defaultProps={};function L(){return y.useContext(Fe)}function ee({...t}){const{blocklet:r}=O(),{info:o}=M(),{t:s}=T(),i=Ne({blocklet:r}),n=gt(o),{spaceGateways:a,addSpaceGateway:d}=L(),u={checkFn:Ue.create({baseURL:he(window.location.origin,St())}).get,webWalletUrl:n,extraParams:{appPid:r.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:o.did}},c=async({endpoint:p,name:g,did:f})=>{const b=await Tt(p);if(!await It(b)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(a.some(l=>l.endpoint===p)){B.error(s("storage.spaces.gateway.add.duplicate",{name:g}));return}await d({name:g,did:f,url:b,endpoint:p},p)},x=async({spaceGateway:p})=>{try{await c(p)}catch(g){console.error(g),B.error(X(g))}};return e.jsx(rt,{...t,connectScope:"app",options:u,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ke({...t}){const{t:r}=y.useContext(pt),{blocklet:o,loadingDiskInfo:s,actions:i}=O();if(y.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const n=(u,c,x)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?yt(c):"empty"})]}),a=o.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),d=[{key:"appDir",name:r("blocklet.diskInfo.appDir"),value:n(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:r("blocklet.diskInfo.dataDir"),value:n(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:r("blocklet.diskInfo.logDir"),value:n(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:r("blocklet.diskInfo.cacheDir"),value:n(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Yt,{component:"div",...t,children:d.map(u=>e.jsx(Ot,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return s?e.jsx(A,{}):e.jsx(C,{children:r("blocklet.diskInfo.empty")})}const Yt=Je(C)``;function Ce(){const{t}=T(),{setBackupDate:r,backupSummary:o}=L(),s=at({key:"lg"}),i=y.useRef(null),n=Ze(),a=y.useCallback(c=>{r(c)},[r]),d=y.useMemo(()=>{const c=E().add(1,"day"),x=E().subtract(11,"month").startOf("month"),p=new Map(o.map(f=>[f.date,{date:f.date,successCount:f.successCount,errorCount:f.errorCount}])),g=[];for(let f=x.clone();E(f).isBefore(c);f=f.add(1,"day")){const b=f.format("YYYY-MM-DD");g.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return g},[o]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:l}=d[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${l}</div>`].join(`
2
2
  `)},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:Z[600]},{min:-9,max:-6,color:Z[500]},{min:-6,max:-3,color:Z[400]},{min:-3,max:-1,color:Z[300]},{min:0,max:0,color:n.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:n.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,color:n.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:n.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:n.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:d.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[d,t,n]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:i,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Lt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&a(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2,children:e.jsxs(W,{direction:s?"column":"row",spacing:s?2:1,width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}Ce.propTypes={};const Ht=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ke({status:t,message:r,createdAt:o}){const{t:s}=T(),i=t===R.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=R.BACKUPS.TIMEOUT_HOURS,n=i&&s("common.timeoutError"),a=t===R.BACKUPS.STATUS.PROGRESS&&!i,d=t===R.BACKUPS.STATUS.SUCCEEDED&&!i;return a?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):d?e.jsx(V,{type:"success",children:s("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"error",children:s("common.failed")}),"  ",e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:r||n,children:e.jsx(ze,{children:e.jsx(it,{style:{width:"24px",height:"24px"},color:"error"})})})]})}ke.propTypes={status:h.string.isRequired,message:h.string,createdAt:h.string.isRequired};ke.defaultProps={message:""};function De({metadata:t}){const{t:r}=T();if(Q(t))return e.jsx(V,{type:"success",children:r("common.succeeded")});const o=t.count||0,s=t.size||0,i=ct(s,{iec:!0}),n=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[r("common.fileCount"),": ",o]}),e.jsxs(C,{variant:"body2",children:[r("common.fileSize"),": ",i]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"success",children:r("common.succeeded")})," ",e.jsx(Ht,{title:n,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ze,{children:e.jsx(lt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}De.propTypes={metadata:h.object};De.defaultProps={metadata:{}};function Be(){const{t,locale:r}=T(),{spaceGateways:o,backups:s,backupsLoading:i}=L(),n=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:d=>{var D;const{targetUrl:u,targetName:c,status:x,createdAt:p}=s[d],g=x===R.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,f=x===R.BACKUPS.STATUS.SUCCEEDED&&!g,b=c||((D=o.find(S=>u==null?void 0:u.includes(xe(S==null?void 0:S.endpoint))))==null?void 0:D.name)||"Unknown DID Space";return f?e.jsx(et,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:d=>{const u=t(d===0?"common.auto":"common.manual");return e.jsx(V,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:d=>E(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:d=>Q(d)?"":E(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:d=>{const u=(s==null?void 0:s[d])??{},{status:c,message:x,createdAt:p,metadata:g}=u,f=c===R.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!f,D=c===R.BACKUPS.STATUS.SUCCEEDED&&!f;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):D?e.jsx(De,{metadata:g}):e.jsx(ke,{status:c,message:x,createdAt:p})}}}],[s,o,t]),a=y.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:a?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(mt,{title:"",loading:i,data:s,columns:n,emptyNode:t("storage.spaces.record.emptyData",r),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Be.propTypes={};function $e(){const{t}=T();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(dt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Ce,{})]})]}),e.jsx(Be,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}$e.propTypes={};var we={},Vt=ye;Object.defineProperty(we,"__esModule",{value:!0});var qe=we.default=void 0,Qt=Vt(je()),Xt=e;qe=we.default=(0,Qt.default)((0,Xt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ee={},Jt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var Ye=Ee.default=void 0,Zt=Jt(je()),Gt=e;Ye=Ee.default=(0,Zt.default)((0,Gt.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Te={},es=ye;Object.defineProperty(Te,"__esModule",{value:!0});var He=Te.default=void 0,ts=es(je()),ss=e;He=Te.default=(0,ts.default)((0,ss.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Ie({spaceGateway:t,onConfirm:r,onCancel:o}){const{t:s}=T(),[i,n]=y.useState(!1),[a,d]=y.useState(!1),u=(p,g)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),n(g)},c=async p=>{try{p==null||p.stopPropagation(),d(!0),await(r==null?void 0:r(t)),n(!1)}catch(g){console.error(g),B.error(`${s("storage.space.gateway.delete.failed")}: ${X(g)}`)}finally{n(!1),d(!1)}},x=p=>{u(p,!1),o==null||o(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(q,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(_t,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(ft,{title:s("storage.spaces.gateway.delete.title"),open:i,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:a}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:a}},onConfirm:c,onCancel:x,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Ie.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool}).isRequired,onConfirm:h.func,onCancel:h.func};Ie.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function Re({spaceGateway:t,selected:r,onDelete:o,onConnect:s,enableSwitchToSpace:i,backupInProgress:n,...a}){const{abortBlockletBackup:d}=L(),[u,c]=y.useState(null),{t:x}=T(),[p,g]=y.useState(!1),f=(S,l)=>{S.stopPropagation(),S.preventDefault(),c(l&&S.currentTarget)},b=async S=>{try{g(!0),f(S,!1),await s(t)}catch(l){console.error(l),B.error(l.message)}finally{g(!1)}},D=async S=>{try{g(!0),f(S,!1),await d()}catch(l){console.error(l),B.error(l.message)}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(A,{sx:{ml:1},size:"24px"}):e.jsx(tt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>f(S,!0),...a,children:e.jsx(zt,{})}),e.jsxs(st,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>f(S,!1),children:[e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(t.endpoint?Rt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(qe,{fontSize:"small"})}),e.jsx(H,{children:x("common.open")})]}),e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(vt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!r&&i&&e.jsxs(q,{onClick:b,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.switchToSpace")})]}),n&&e.jsxs(q,{onClick:D,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Pt,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!n&&e.jsx(Ie,{spaceGateway:t,onConfirm:async()=>{c(null),await(o==null?void 0:o(t))},onCancel:()=>c(null)})]})]})}Re.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool,endpoint:h.string.isRequired,loading:h.bool}).isRequired,selected:h.bool.isRequired,enableSwitchToSpace:h.bool,onDelete:h.func,onConnect:h.func,backupInProgress:h.bool};Re.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const ns=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ve({spaceGateway:t,spaceStatus:r,selected:o,onConnected:s,onDeleted:i,onBackedUp:n}){const{t:a,locale:d}=T(),{blocklet:u}=O(),{api:c,info:{did:x}}=M(),{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:D,referrer:S}=Ne({blocklet:u}),{backupProgress:l,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:ne,refreshBackups:oe}=L(),[U,z]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:a("storage.spaces.authorize.title",{appName:g},d),scan:a("storage.spaces.authorize.scan",{appName:g},d),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),re=o&&!U&&r===ue.DISCONNECTED,ae=o&&!U&&!t.loading&&r===ue.CONNECTED,F=o&&U&&r===ue.CONNECTED&&(l==null?void 0:l.progress)>=0,J=async()=>{try{if(await At(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(a("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(k){console.error(k),s==null||s(k,t);return}v(k=>({...k,open:!0,prefix:he(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ue.create({baseURL:he(t.url,"space")}).get,extraParams:{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:D,referrer:S,nodeDid:x,spaceDid:t.did}}))},ie=async(k,K)=>{const m=K(k.endpoint),N=xe(m),w=k.space?K(k.space):{};if(t.did&&N!==t.did){v(de=>({...de,open:!1}));const $=a("storage.spaces.gateway.switch.failedForMismatchSpace",{name:w!=null&&w.name?w.name:""});B.error($),s==null||s(new Error($),t);return}const P={...t,name:w.name??"DID Space",did:w.did??xe(m),endpoint:m};await te(P),v($=>({...$,open:!1})),s==null||s(null,P)},ce=async()=>{try{if(U)return;z(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),B.error(k.message),n==null||n(k,t)}finally{z(!0)}},le=async()=>{try{await se(t),B.success(a("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),i==null||i(null,t)}catch(k){console.error(k),i==null||i(k,t)}};return y.useEffect(()=>{l!=null&&l.completed?(o&&((l==null?void 0:l.progress)===100?(B.success(a("storage.spaces.backupSuccessfully")),n==null||n(null,t)):l.message&&(n==null||n(new Error(l==null?void 0:l.message),t)),l.progress=0,l.message=""),z(!1),setTimeout(()=>{ne(),oe()},1e3)):l.progress&&z(!0)},[l]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:a("storage.spaces.strategy.backupNow")}),re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:J,children:a("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(ns,{title:(l==null?void 0:l.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:l.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(A,{variant:"determinate",value:l==null?void 0:l.progress,size:14,sx:{mr:1}}),l==null?void 0:l.progress,"%"]})}),e.jsx(ht,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:d},"get-endpoint")]}),e.jsx(Re,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:le,onConnect:J,enableSwitchToSpace:(l==null?void 0:l.completed)||Q(l==null?void 0:l.message),backupInProgress:F})]})}ve.propTypes={spaceGateway:h.shape({did:h.string.isRequired,name:h.string.isRequired,url:h.string.isRequired,endpoint:h.string.isRequired,protected:h.bool,loading:h.bool}).isRequired,spaceStatus:h.string.isRequired,selected:h.bool.isRequired,onConnected:h.func,onDeleted:h.func,onBackedUp:h.func};ve.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ve({...t}){const{t:r}=T();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:r("storage.spaces.backup.records")})}),e.jsx(Ce,{}),e.jsx(Be,{})]})}Ve.propTypes={};function Qe({...t}){const{t:r}=T(),{autoBackup:o,updateAutoBackup:s}=L(),i=async()=>{try{const n=!(o!=null&&o.enabled);await s({enabled:n}),B.success(r(n?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(n){B.error(n.message)}};return e.jsx(Mt,{checked:!!(o!=null&&o.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:r("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Qe.propTypes={};function os(){const{t}=T(),{spaceGateways:r,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=L(),i=o&&!(r!=null&&r.length),n=({spaceGateway:a,spaceStatus:d,selected:u,refresh:c})=>e.jsx(ve,{spaceGateway:a,spaceStatus:d,selected:u,onConnected:()=>c(),onBackedUp:x=>x&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Qe,{}),e.jsx(ee,{})]}),e.jsx(j,{mt:2,children:i?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(A,{})}):e.jsx(Ae,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:r.map(a=>e.jsx(Ae,{item:!0,xs:12,md:6,children:e.jsx(ut,{endpoint:a.endpoint,selected:s(a),action:n},a.endpoint)},a.endpoint))})})}),e.jsx(Ve,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}function rs(){const{spaceGatewaysFirstLoading:t,spaceGateways:r}=L();return t?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):Q(r)?e.jsx($e,{}):e.jsx(os,{})}function as(){return e.jsx(be,{children:e.jsx(rs,{})})}function is(){const{spaceGateway:t,settingStorageEndpoint:r,updateSpaceGateway:o,hasStorageEndpoint:s,loading:i,storageEndpoint:n}=Nt(),a=fe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return i?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:r}):e.jsx(Dt,{}),e.jsx(j,{sx:a,children:e.jsx(Bt,{onConnect:o,storageEndpoint:n})})]})}function cs(){const{t}=T();return e.jsxs(Ut,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(is,{})]})}function Xe({navOrientation:t,...r}){const{t:o,locale:s}=T(),{blocklet:i}=O(),n=jt({key:"md"}),[a,d]=ot(),u=a.get("tab")||"backup",c=n?"horizontal":t,x=fe(()=>{var l;const D=[{label:o("common.backup"),value:"backup"}],S=(l=i==null?void 0:i.capabilities)==null?void 0:l.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&D.push({label:o("common.storage"),value:"storage"}),D},[s,c]),g=fe(()=>({backup:e.jsx(as,{}),storage:e.jsx(cs,{})}))[u],f=D=>{d(S=>(D==="backup"?S.delete("tab"):S.set("tab",D),S))};if(x.length<=1)return e.jsx(me,{children:g});const b=e.jsx(xt,{tabs:x,current:u,orientation:c,onChange:f,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...r,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(Le,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:g})})]})});if(c==="horizontal")return e.jsxs(j,{...r,children:[e.jsx(Le,{left:b}),e.jsx(me,{sx:{mt:2},children:g})]})}Xe.propTypes={navOrientation:h.oneOf(["vertical","horizontal"])};Xe.defaultProps={navOrientation:"vertical"};const me=ge(j)`
3
3
  position: relative;
4
4
  min-height: 66vh;
@@ -1 +1 @@
1
- import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,b$ as R}from"./vendor-ux-did-connect-pzpsrvqx.js";import{l as v}from"./vendor-hooks-DqdmWCmo.js";import{j as e,aa as s,ab as y,ak as j,al as L,bo as M,br as W,bn as B,q as _,ap as A,I as D,y as z,H as F}from"./vendor-mui-core-Bq8gXTan.js";import{d as q}from"./Launch-DFS3fgjy.js";import{a as K}from"./api-C1S8LUld.js";import{T as N}from"./table-tips-BzPqsKYQ.js";import{D as k}from"./index-CwUT0vPy.js";import{u as U}from"./dashboard-t9EszOna.js";import"./vendor-utils-BfZ4tlod.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-BVWbftGI.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-arcblock-CwufDgLV.js";import"./useLocalStorage-CaPDqrQ7.js";import"./index-8eXqqyHQ.js";import"./confirm-RvA9mFot.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";function $({endpoint:n}){const[i,r]=m.useState("mcp-link"),h=k(),{api:g}=k(),{teamDid:p}=U(),{t:u,locale:d}=w(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:C.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,a=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=a.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),S=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),I=c=>{const E=`npx @blocklet/install-mcp@latest i ${n} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return E;case"mcp-link":default:return n}};return e.jsxs(s,{children:[e.jsx(P,{tabs:a,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(q,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(R,{code:I(i),language:"shell",style:{margin:0}}),S&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(y,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}$.propTypes={endpoint:F.string.isRequired};function ge(){var x;const[n,i]=m.useState(null),{t:r,locale:h}=w(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}${C.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([K.get(g)])),o=m.useMemo(()=>{var t,a;return((a=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:a.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var a;return t.did===((a=window==null?void 0:window.blocklet)==null?void 0:a.did)})||o[0])},[o]);const b=t=>{const a=t.target.value;i(o.find(l=>l.did===a))};return u?e.jsx(s,{children:e.jsx(y,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(L,{gap:2,sx:{maxWidth:1200},children:[e.jsx(N,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(W,{id:"server-select-label",children:r("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:(n==null?void 0:n.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(_,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),n&&e.jsx($,{endpoint:n.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
1
+ import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,b$ as R}from"./vendor-ux-did-connect-CQtodyZB.js";import{l as v}from"./vendor-hooks-B2N8eE_a.js";import{j as e,aa as s,ab as y,ak as j,al as L,bo as M,br as W,bn as B,q as _,ap as A,I as D,y as z,H as F}from"./vendor-mui-core-Bq8gXTan.js";import{d as q}from"./Launch-BB2NS6gw.js";import{a as K}from"./api-ZzsS0diA.js";import{T as N}from"./table-tips-CCj0tXz1.js";import{D as k}from"./index-Cti-S8sI.js";import{u as U}from"./dashboard-3f3Wapmv.js";import"./vendor-utils-uPLZO5mM.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-GEKFkezP.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-arcblock-DzylOsX3.js";import"./useLocalStorage-BoYGn-bQ.js";import"./index-8eXqqyHQ.js";import"./confirm-CDWcSF88.js";import"./PlayArrow-hnXK75qN.js";import"./get-safe-url-DAFhlwkH.js";import"./session-kQ1tvY5U.js";import"./use-blocklet-logo-Bjt6-_x3.js";import"./dot-BSvIHcuy.js";import"./useAsync-CZkpdKtR.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";function $({endpoint:n}){const[i,r]=m.useState("mcp-link"),h=k(),{api:g}=k(),{teamDid:p}=U(),{t:u,locale:d}=w(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:C.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,a=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=a.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),S=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),I=c=>{const E=`npx @blocklet/install-mcp@latest i ${n} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return E;case"mcp-link":default:return n}};return e.jsxs(s,{children:[e.jsx(P,{tabs:a,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(q,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(R,{code:I(i),language:"shell",style:{margin:0}}),S&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(y,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}$.propTypes={endpoint:F.string.isRequired};function ge(){var x;const[n,i]=m.useState(null),{t:r,locale:h}=w(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}${C.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([K.get(g)])),o=m.useMemo(()=>{var t,a;return((a=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:a.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var a;return t.did===((a=window==null?void 0:window.blocklet)==null?void 0:a.did)})||o[0])},[o]);const b=t=>{const a=t.target.value;i(o.find(l=>l.did===a))};return u?e.jsx(s,{children:e.jsx(y,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(L,{gap:2,sx:{maxWidth:1200},children:[e.jsx(N,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(W,{id:"server-select-label",children:r("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:(n==null?void 0:n.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(_,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),n&&e.jsx($,{endpoint:n.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{r as P,t as bn,g as Cn,e as wt,a as jn}from"./vendor-react-DEoibe3W.js";import{a9 as Ut,j as e,aa as O,bo as Be,br as Fe,bn as $e,q as je,T as G,O as me,ab as ie,bx as qe,ak as oe,H as v,ah as z,e as Sn,ad as ue,w as wn,y as _t,b7 as Pn,b8 as kn,I as In,bh as Tn,bs as Dn,bR as An}from"./vendor-mui-core-Bq8gXTan.js";import{B as Pt,e as We,a0 as Rn,ay as Ln,n as kt,A as En,b as On}from"./vendor-utils-BfZ4tlod.js";import{r as Bt,aR as Ft,bL as Nn,i as Un,a as K,a2 as _n,a1 as Bn,a3 as Y,ar as ne,B as W,f as Fn,at as $n,d as Wn,bb as fe,bC as zn,k as Q,a5 as $t,an as Mn,br as Wt,bs as zt,bt as qn,I as Hn,ax as Vn,$ as ze,bd as Kn,ac as Mt,ab as qt,bI as Zn}from"./vendor-ux-did-connect-pzpsrvqx.js";import{c as J,a as Yn,G as Ht,v as Se,n as Gn,I as Qn}from"./vendor-arcblock-CwufDgLV.js";import{d as Jn}from"./ViewList-BOGcbymi.js";import{a2 as Xn,f as es,D as H,ay as we,n as pe,a3 as ts,V as se,az as ns,G as Vt,aA as Kt,y as ss,b as rs,aB as os}from"./index-CwUT0vPy.js";import{k as is,u as He,a as Ve,c as as,m as ls,b as cs}from"./vendor-hooks-DqdmWCmo.js";import{l as ds}from"./index-BLfUtUpB.js";import{u as Z,d as It,W as Zt}from"./dashboard-t9EszOna.js";import{W as Ke}from"./did-address-NnOD1W_A.js";import{P as X}from"./permission-DQvXGutX.js";import{C as Te}from"./click-to-copy-By4fgGR7.js";import{T as Yt}from"./index-DrTNV3tX.js";import{f as ee}from"./index-8eXqqyHQ.js";import{_ as ms}from"./useAsync-C62uE2pS.js";import{I as q}from"./index-DPIWnhb5.js";import{d as us}from"./DeleteOutline-BKSMNwfT.js";import{C as ge}from"./confirm-RvA9mFot.js";import{u as he}from"./session-BGdAM8zS.js";import{i as Gt,a as Pe,p as Qt}from"./util-BQAJqeb4.js";import{b as ps}from"./sdk-BmeKtHic.js";import{A as fs}from"./actions-DnTVXQ_Z.js";import{S as gs}from"./shorten-label-BQvbtscf.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./base32-DUSifB4M.js";import"./MoreHoriz-ChJ3K52h.js";var Ze={},hs=Ut;Object.defineProperty(Ze,"__esModule",{value:!0});var Jt=Ze.default=void 0,xs=hs(Bt()),ys=e;Jt=Ze.default=(0,xs.default)((0,ys.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var Ye=function(t){return e.jsxs("svg",{...t,children:[e.jsx("g",{clipPath:"url(#clip0)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0",children:e.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};Ye.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};Ye.displayName="person";const vs=Ye;var Ge=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};Ge.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Ge.displayName="external-issuer";const Xt=Ge;var Ce={},bs=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`),en="%[a-f0-9]{2}",Tt=new RegExp("("+en+")|([^%]+?)","gi"),Dt=new RegExp("("+en+")+","gi");function Me(t,o){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;o=o||1;var l=t.slice(0,o),p=t.slice(o);return Array.prototype.concat.call([],Me(l),Me(p))}function Cs(t){try{return decodeURIComponent(t)}catch{for(var o=t.match(Tt)||[],l=1;l<o.length;l++)t=Me(o,l).join(""),o=t.match(Tt)||[];return t}}function js(t){for(var o={"%FE%FF":"��","%FF%FE":"��"},l=Dt.exec(t);l;){try{o[l[0]]=decodeURIComponent(l[0])}catch{var p=Cs(l[0]);p!==l[0]&&(o[l[0]]=p)}l=Dt.exec(t)}o["%C2"]="�";for(var d=Object.keys(o),h=0;h<d.length;h++){var S=d[h];t=t.replace(new RegExp(S,"g"),o[S])}return t}var Ss=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return js(t)}},ws=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];const l=t.indexOf(o);return l===-1?[t]:[t.slice(0,l),t.slice(l+o.length)]},Ps=function(t,o){for(var l={},p=Object.keys(t),d=Array.isArray(o),h=0;h<p.length;h++){var S=p[h],f=t[S];(d?o.indexOf(S)!==-1:o(S,f,t))&&(l[S]=f)}return l};(function(t){const o=bs,l=Ss,p=ws,d=Ps,h=n=>n==null;function S(n){switch(n.arrayFormat){case"index":return s=>(r,c)=>{const y=r.length;return c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[",y,"]"].join("")]:[...r,[g(s,n),"[",g(y,n),"]=",g(c,n)].join("")]};case"bracket":return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[]"].join("")]:[...r,[g(s,n),"[]=",g(c,n)].join("")];case"comma":case"separator":return s=>(r,c)=>c==null||c.length===0?r:r.length===0?[[g(s,n),"=",g(c,n)].join("")]:[[r,g(c,n)].join(n.arrayFormatSeparator)];default:return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,g(s,n)]:[...r,[g(s,n),"=",g(c,n)].join("")]}}function f(n){let s;switch(n.arrayFormat){case"index":return(r,c,y)=>{if(s=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!s){y[r]=c;return}y[r]===void 0&&(y[r]={}),y[r][s[1]]=c};case"bracket":return(r,c,y)=>{if(s=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!s){y[r]=c;return}if(y[r]===void 0){y[r]=[c];return}y[r]=[].concat(y[r],c)};case"comma":case"separator":return(r,c,y)=>{const x=typeof c=="string"&&c.includes(n.arrayFormatSeparator),w=typeof c=="string"&&!x&&i(c,n).includes(n.arrayFormatSeparator);c=w?i(c,n):c;const U=x||w?c.split(n.arrayFormatSeparator).map(F=>i(F,n)):c===null?c:i(c,n);y[r]=U};default:return(r,c,y)=>{if(y[r]===void 0){y[r]=c;return}y[r]=[].concat(y[r],c)}}}function b(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(n,s){return s.encode?s.strict?o(n):encodeURIComponent(n):n}function i(n,s){return s.decode?l(n):n}function T(n){return Array.isArray(n)?n.sort():typeof n=="object"?T(Object.keys(n)).sort((s,r)=>Number(s)-Number(r)).map(s=>n[s]):n}function C(n){const s=n.indexOf("#");return s!==-1&&(n=n.slice(0,s)),n}function k(n){let s="";const r=n.indexOf("#");return r!==-1&&(s=n.slice(r)),s}function a(n){n=C(n);const s=n.indexOf("?");return s===-1?"":n.slice(s+1)}function I(n,s){return s.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?n=Number(n):s.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")&&(n=n.toLowerCase()==="true"),n}function m(n,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),b(s.arrayFormatSeparator);const r=f(s),c=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return c;for(const y of n.split("&")){if(y==="")continue;let[x,w]=p(s.decode?y.replace(/\+/g," "):y,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:i(w,s),r(i(x,s),w,c)}for(const y of Object.keys(c)){const x=c[y];if(typeof x=="object"&&x!==null)for(const w of Object.keys(x))x[w]=I(x[w],s);else c[y]=I(x,s)}return s.sort===!1?c:(s.sort===!0?Object.keys(c).sort():Object.keys(c).sort(s.sort)).reduce((y,x)=>{const w=c[x];return w&&typeof w=="object"&&!Array.isArray(w)?y[x]=T(w):y[x]=w,y},Object.create(null))}t.extract=a,t.parse=m,t.stringify=(n,s)=>{if(!n)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),b(s.arrayFormatSeparator);const r=w=>s.skipNull&&h(n[w])||s.skipEmptyString&&n[w]==="",c=S(s),y={};for(const w of Object.keys(n))r(w)||(y[w]=n[w]);const x=Object.keys(y);return s.sort!==!1&&x.sort(s.sort),x.map(w=>{const U=n[w];return U===void 0?"":U===null?g(w,s):Array.isArray(U)?U.reduce(c(w),[]).join("&"):g(w,s)+"="+g(U,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(n,s)=>{s=Object.assign({decode:!0},s);const[r,c]=p(n,"#");return Object.assign({url:r.split("?")[0]||"",query:m(a(n),s)},s&&s.parseFragmentIdentifier&&c?{fragmentIdentifier:i(c,s)}:{})},t.stringifyUrl=(n,s)=>{s=Object.assign({encode:!0,strict:!0},s);const r=C(n.url).split("?")[0]||"",c=t.extract(n.url),y=t.parse(c,{sort:!1}),x=Object.assign(y,n.query);let w=t.stringify(x,s);w&&(w=`?${w}`);let U=k(n.url);return n.fragmentIdentifier&&(U=`#${g(n.fragmentIdentifier,s)}`),`${r}${w}${U}`},t.pick=(n,s,r)=>{r=Object.assign({parseFragmentIdentifier:!0},r);const{url:c,query:y,fragmentIdentifier:x}=t.parseUrl(n,r);return t.stringifyUrl({url:c,query:d(y,s),fragmentIdentifier:x},r)},t.exclude=(n,s,r)=>{const c=Array.isArray(s)?y=>!s.includes(y):(y,x)=>!s(y,x);return t.pick(n,c,r)}})(Ce);const le=bn,ks={parseNumbers:!1,parseBooleans:!1},Is={skipNull:!1,skipEmptyString:!1},Ts=(t,o)=>{var l,p;const{navigateMode:d="push",parseOptions:h,stringifyOptions:S}={},f=Object.assign(Object.assign({},ks),h),b=Object.assign(Object.assign({},Is),S),g=le.useLocation(),i=(l=le.useHistory)===null||l===void 0?void 0:l.call(le),T=(p=le.useNavigate)===null||p===void 0?void 0:p.call(le),C=is(),k=P.useRef(typeof t=="function"?t():t||{}),a=P.useMemo(()=>Ce.parse(g.search,f),[g.search]),I=P.useMemo(()=>Object.assign(Object.assign({},k.current),a),[a]);return[I,He(n=>{const s=typeof n=="function"?n(I):n;C(),i&&i[d]({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},g.state),T&&T({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},{replace:d==="replace",state:g.state})})]},Ds=Ts,As=Ft,Ne=Nn,Ue=Un,Rs=ds,At={role:As.types.RoleType.ROLE_APPLICATION},Ls=(t,o,l,p)=>{let d=l||At;const h=(0,Ue.isEthereumType)((0,Ue.DidType)(l));if(h?d=(0,Ne.WalletType)(l):d=(0,Ne.WalletType)(At),!(0,Ue.isValid)(t)){let S="";try{return h?S=t.slice(0,66):S=t,(0,Ne.fromSecretKey)(S,d)}catch(f){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${f.message}`)}}if(!o)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,Rs.fromAppDid)(t,o,d,p||0)};var Es=Ls,tn=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const ce=tn(Xn),Os=Ft,ve=tn(Es),Ns=es,Us=(t,o,{returnWallet:l=!0}={})=>{var F,A;if(!t||typeof t!="object"||!Array.isArray(t.environments)||!(0,ce.default)(t,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:p,configs:d=[]}=t,h=[...d,...p],S=h.find(D=>D.key==="BLOCKLET_APP_DESCRIPTION"),f=h.find(D=>D.key==="BLOCKLET_PASSPORT_COLOR"),b=h.find(D=>D.key==="BLOCKLET_APP_URL"),g=h.find(D=>D.key==="BLOCKLET_APP_TENANT_MODE"),{did:i,version:T}=t.meta,C=(0,Ns.getDisplayName)(t),k=(0,ce.default)(S,"value",t.meta.description),a=(0,ce.default)(f,"value","auto"),I=(0,ce.default)(b,"value",""),m=(0,ce.default)(g,"value","");if(!l)return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:"",wallet:null,permanentWallet:null,tenantMode:m};const n=h.find(D=>D.key==="BLOCKLET_APP_SK"),s=h.find(D=>D.key==="BLOCKLET_APP_CHAIN_TYPE")||h.find(D=>D.key==="BLOCKLET_WALLET_TYPE"),r=h.find(D=>D.key==="BLOCKLET_APP_PSK");let c;s&&(s.value==="ethereum"||s.value==="eth")&&(c=s.value);let y=null,x=null;if(n&&n.value)y=(0,ve.default)(n.value,void 0,c),r&&r.value&&r.value!==n.value&&(x=(0,ve.default)(r.value,void 0,c));else{if(!o||typeof o!="string")throw new Error("Node secret key must be a string");s?y=(0,ve.default)(t.meta.did,o,c):y=(0,ve.default)(t.meta.did,o)}const w=((A=(F=t.settings)==null?void 0:F.session)==null?void 0:A.salt)||"",U=Os.Hasher.SHA3.hash256(Pt.concat([y.secretKey,y.address,w].filter(Boolean).map(D=>Pt.from(D))));return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:U,wallet:y,permanentWallet:x||y,tenantMode:m}};var _s=Us;const Bs=Cn(_s);function Qe({teamDid:t,roles:o,apps:l,onCancel:p,onSuccess:d,onError:h,endpoint:S}){var I;const{api:f}=H(),{t:b,locale:g}=K(),i=Ve({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:l.length>0?l[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),T=async()=>{if(!i.role){i.error=b("team.member.error.passportEmpty");return}const m=i.remark.trim();i.error=null,i.loading=!0;try{let n=i.sourceAppPid??null;n===t&&(n=null);const s={teamDid:t,role:i.role,remark:m,sourceAppPid:n,passportExpireTime:i.passportExpireTime?i.passportExpireTime.toISOString():""};i.display&&(s.display={type:"url",content:i.display});const{inviteInfo:r}=await f.createMemberInvitation({input:s});i.inviteInfo=r,i.activeStep=1}catch(n){const s=ee(n);i.error=s,h(n)}finally{i.loading=!1}},C=o.find(m=>m.name===i.role),a=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[l.length>1?e.jsxs(Be,{fullWidth:!0,children:[e.jsx(Fe,{children:b("common.sourceApp")}),e.jsx($e,{value:i.sourceAppPid,onChange:m=>{i.error=null,i.sourceAppPid=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,children:l.map(m=>e.jsx(je,{value:m.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(_n,{did:m.appPid,size:28}),m.appName]}),e.jsx(Bn,{did:m.appPid,compact:!0,responsive:!1})]})},m.appPid))})]}):null,e.jsxs(Be,{fullWidth:!0,variant:"outlined",children:[e.jsx(Fe,{children:b("common.passport")}),e.jsx($e,{"data-cy":"invite-member-select-role",value:i.role,onChange:m=>{i.error=null,i.role=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),T())},children:o.filter(m=>m.name!=="owner").map(m=>e.jsx(je,{value:m.name,"data-cy":`invite-member-select-option-${m.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:m.title||m.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:m.description})]})},m.name))})]}),((I=C==null?void 0:C.extra)==null?void 0:I.display)==="custom"&&e.jsx(me,{label:b("common.display"),type:"url",value:i.display,onChange:m=>{i.error=null,i.display=m.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(me,{label:b("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.remark,onChange:m=>{i.error=null,i.remark=m.target.value},disabled:i.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Yt,{value:i.passportExpireTime,onChange:m=>{i.passportExpireTime=m}})]}),cancel:b("common.cancel"),confirm:b("team.member.inviteDialog.createInviteLink"),onCancel:p,onConfirm:T},{body:()=>{var n,s;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:b("team.member.inviteDialog.createSuccessTip",{expireDate:pe((s=i.inviteInfo)==null?void 0:s.expireDate,g)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:m})]})},confirm:b("common.copy"),onConfirm:()=>{var n;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});as(m),Y.success(b("common.copied")),d()},cancel:b("common.cancel"),onCancel:p}][i.activeStep];return e.jsxs(ne,{title:b("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[a.cancel&&e.jsx(W,{onClick:a.onCancel,color:"inherit",children:a.cancel}),e.jsxs(W,{onClick:a.onConfirm,color:"primary",disabled:i.loading||!i.role,variant:"contained",autoFocus:!0,children:[i.loading&&e.jsx(ie,{size:16}),a.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof a.body=="function"?a.body():a.body}),!!i.error&&e.jsx(oe,{severity:"error",variant:"icon",children:i.error})]})}Qe.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,roles:v.array,apps:v.array,endpoint:v.string};Qe.defaultProps={onError:()=>{},roles:[],apps:[],endpoint:""};function Je({teamDid:t,onCancel:o,onSuccess:l,onError:p,endpoint:d}){const{api:h,info:S}=H(),{api:f}=P.useContext(Fn),[b,g]=P.useState(!1),{t:i,locale:T}=K(),[C,k]=P.useState(""),[a,I]=P.useState(!1),[m,n]=P.useState(0),[s,r]=P.useState(""),[c,y]=P.useState(""),x=!!We(S,"ownerNft.did"),w=ms(async()=>{if(x){const{state:R}=await h.getDelegationState();return R}return{delegated:!0}});if(w.loading)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(w.error)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx(oe,{severity:"error",variant:"icon",children:ee(w.error)})});const U=async()=>{k(null),g(!0);try{const{inviteInfo:R}=await h.createTransferInvitation({input:{teamDid:t,role:"owner",remark:c.trim()}});r(R),n(D.length-1)}catch(R){const V=ee(R);k(V),p(R)}finally{g(!1)}},F=()=>{I(!0),n(1)},A=()=>{I(!1),n(0)},D=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(oe,{severity:"warning",children:[e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(oe,{severity:"warning",children:e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(me,{label:i("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:c,onChange:R=>{k(null),y(R.target.value)},disabled:b,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:i("common.cancel"),confirm:i("team.transferNode.inviteDialog.createInviteLink"),onCancel:o,onConfirm:x&&!We(w,"value.delegated")?F:U},{body:()=>e.jsx($n,{action:"delegate-transfer-nft",open:a,locale:T,checkFn:f.get,onClose:A,onSuccess:U,checkTimeout:5*60*1e3,webWalletUrl:ts(S),extraParams:{targetDID:S.did},messages:{title:i("team.transferNode.delegateDialog.title"),scan:i("team.transferNode.delegateDialog.scan"),confirm:i("team.transferNode.delegateDialog.confirm"),success:i("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const R=we({inviteId:s.inviteId,endpoint:d});return e.jsxs("div",{children:[e.jsx(Fs,{children:i("team.transferNode.inviteDialog.createSuccessTip",{expireDate:pe(s.expireDate,T)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:R})]})},confirm:i("common.confirm"),onConfirm:l}],E=D[m];return e.jsxs(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx(W,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs(W,{onClick:E.onConfirm,color:"primary",disabled:b,variant:"contained",autoFocus:!0,children:[b&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!C&&e.jsx(oe,{severity:"error",variant:"icon",children:C})]})}Je.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};Je.defaultProps={onError:()=>{},endpoint:""};const Fs=z.div`
1
+ import{r as P,t as bn,g as Cn,e as wt,a as jn}from"./vendor-react-DEoibe3W.js";import{a9 as Ut,j as e,aa as O,bo as Be,br as Fe,bn as $e,q as je,T as G,O as me,ab as ie,bx as qe,ak as oe,H as v,ah as z,e as Sn,ad as ue,w as wn,y as _t,b7 as Pn,b8 as kn,I as In,bh as Tn,bs as Dn,bR as An}from"./vendor-mui-core-Bq8gXTan.js";import{B as Pt,e as We,a0 as Rn,ay as Ln,n as kt,A as En,b as On}from"./vendor-utils-uPLZO5mM.js";import{r as Bt,aR as Ft,bL as Nn,i as Un,a as K,a2 as _n,a1 as Bn,a3 as Y,ar as ne,B as W,f as Fn,at as $n,d as Wn,bb as fe,bC as zn,k as Q,a5 as $t,an as Mn,br as Wt,bs as zt,bt as qn,I as Hn,ax as Vn,$ as ze,bd as Kn,ac as Mt,ab as qt,bI as Zn}from"./vendor-ux-did-connect-CQtodyZB.js";import{c as J,a as Yn,G as Ht,v as Se,n as Gn,I as Qn}from"./vendor-arcblock-DzylOsX3.js";import{d as Jn}from"./ViewList-CYMKafss.js";import{a2 as Xn,f as es,D as H,ay as we,n as pe,a3 as ts,V as se,az as ns,G as Vt,aA as Kt,y as ss,b as rs,aB as os}from"./index-Cti-S8sI.js";import{k as is,u as He,a as Ve,c as as,m as ls,b as cs}from"./vendor-hooks-B2N8eE_a.js";import{l as ds}from"./index-D1V1OV_1.js";import{u as Z,d as It,W as Zt}from"./dashboard-3f3Wapmv.js";import{W as Ke}from"./did-address-BYc4cym-.js";import{P as X}from"./permission-BEqDHKfL.js";import{C as Te}from"./click-to-copy-nMjIOe47.js";import{T as Yt}from"./index-BEpPMiyb.js";import{f as ee}from"./index-8eXqqyHQ.js";import{u as ms}from"./useAsync-DmrzeQhI.js";import{I as q}from"./index-D3Qm_7QJ.js";import{d as us}from"./DeleteOutline-DtbgduIM.js";import{C as ge}from"./confirm-CDWcSF88.js";import{u as he}from"./session-kQ1tvY5U.js";import{i as Gt,a as Pe,p as Qt}from"./util-TW4lcckB.js";import{b as ps}from"./sdk-Btq1iUPd.js";import{A as fs}from"./actions-D_aAU5uf.js";import{S as gs}from"./shorten-label-BQvbtscf.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-BoYGn-bQ.js";import"./PlayArrow-hnXK75qN.js";import"./get-safe-url-DAFhlwkH.js";import"./use-blocklet-logo-Bjt6-_x3.js";import"./InfoOutlined-GEKFkezP.js";import"./dot-BSvIHcuy.js";import"./useAsync-CZkpdKtR.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BIQsjtiT.js";import"./base32-BTgHqgXA.js";import"./MoreHoriz-BDLlOCqj.js";var Ze={},hs=Ut;Object.defineProperty(Ze,"__esModule",{value:!0});var Jt=Ze.default=void 0,xs=hs(Bt()),ys=e;Jt=Ze.default=(0,xs.default)((0,ys.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var Ye=function(t){return e.jsxs("svg",{...t,children:[e.jsx("g",{clipPath:"url(#clip0)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0",children:e.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};Ye.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};Ye.displayName="person";const vs=Ye;var Ge=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};Ge.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Ge.displayName="external-issuer";const Xt=Ge;var Ce={},bs=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`),en="%[a-f0-9]{2}",Tt=new RegExp("("+en+")|([^%]+?)","gi"),Dt=new RegExp("("+en+")+","gi");function Me(t,o){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;o=o||1;var l=t.slice(0,o),p=t.slice(o);return Array.prototype.concat.call([],Me(l),Me(p))}function Cs(t){try{return decodeURIComponent(t)}catch{for(var o=t.match(Tt)||[],l=1;l<o.length;l++)t=Me(o,l).join(""),o=t.match(Tt)||[];return t}}function js(t){for(var o={"%FE%FF":"��","%FF%FE":"��"},l=Dt.exec(t);l;){try{o[l[0]]=decodeURIComponent(l[0])}catch{var p=Cs(l[0]);p!==l[0]&&(o[l[0]]=p)}l=Dt.exec(t)}o["%C2"]="�";for(var d=Object.keys(o),h=0;h<d.length;h++){var S=d[h];t=t.replace(new RegExp(S,"g"),o[S])}return t}var Ss=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return js(t)}},ws=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];const l=t.indexOf(o);return l===-1?[t]:[t.slice(0,l),t.slice(l+o.length)]},Ps=function(t,o){for(var l={},p=Object.keys(t),d=Array.isArray(o),h=0;h<p.length;h++){var S=p[h],f=t[S];(d?o.indexOf(S)!==-1:o(S,f,t))&&(l[S]=f)}return l};(function(t){const o=bs,l=Ss,p=ws,d=Ps,h=n=>n==null;function S(n){switch(n.arrayFormat){case"index":return s=>(r,c)=>{const y=r.length;return c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[",y,"]"].join("")]:[...r,[g(s,n),"[",g(y,n),"]=",g(c,n)].join("")]};case"bracket":return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[]"].join("")]:[...r,[g(s,n),"[]=",g(c,n)].join("")];case"comma":case"separator":return s=>(r,c)=>c==null||c.length===0?r:r.length===0?[[g(s,n),"=",g(c,n)].join("")]:[[r,g(c,n)].join(n.arrayFormatSeparator)];default:return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,g(s,n)]:[...r,[g(s,n),"=",g(c,n)].join("")]}}function f(n){let s;switch(n.arrayFormat){case"index":return(r,c,y)=>{if(s=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!s){y[r]=c;return}y[r]===void 0&&(y[r]={}),y[r][s[1]]=c};case"bracket":return(r,c,y)=>{if(s=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!s){y[r]=c;return}if(y[r]===void 0){y[r]=[c];return}y[r]=[].concat(y[r],c)};case"comma":case"separator":return(r,c,y)=>{const x=typeof c=="string"&&c.includes(n.arrayFormatSeparator),w=typeof c=="string"&&!x&&i(c,n).includes(n.arrayFormatSeparator);c=w?i(c,n):c;const U=x||w?c.split(n.arrayFormatSeparator).map(F=>i(F,n)):c===null?c:i(c,n);y[r]=U};default:return(r,c,y)=>{if(y[r]===void 0){y[r]=c;return}y[r]=[].concat(y[r],c)}}}function b(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(n,s){return s.encode?s.strict?o(n):encodeURIComponent(n):n}function i(n,s){return s.decode?l(n):n}function T(n){return Array.isArray(n)?n.sort():typeof n=="object"?T(Object.keys(n)).sort((s,r)=>Number(s)-Number(r)).map(s=>n[s]):n}function C(n){const s=n.indexOf("#");return s!==-1&&(n=n.slice(0,s)),n}function k(n){let s="";const r=n.indexOf("#");return r!==-1&&(s=n.slice(r)),s}function a(n){n=C(n);const s=n.indexOf("?");return s===-1?"":n.slice(s+1)}function I(n,s){return s.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?n=Number(n):s.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")&&(n=n.toLowerCase()==="true"),n}function m(n,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),b(s.arrayFormatSeparator);const r=f(s),c=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return c;for(const y of n.split("&")){if(y==="")continue;let[x,w]=p(s.decode?y.replace(/\+/g," "):y,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:i(w,s),r(i(x,s),w,c)}for(const y of Object.keys(c)){const x=c[y];if(typeof x=="object"&&x!==null)for(const w of Object.keys(x))x[w]=I(x[w],s);else c[y]=I(x,s)}return s.sort===!1?c:(s.sort===!0?Object.keys(c).sort():Object.keys(c).sort(s.sort)).reduce((y,x)=>{const w=c[x];return w&&typeof w=="object"&&!Array.isArray(w)?y[x]=T(w):y[x]=w,y},Object.create(null))}t.extract=a,t.parse=m,t.stringify=(n,s)=>{if(!n)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),b(s.arrayFormatSeparator);const r=w=>s.skipNull&&h(n[w])||s.skipEmptyString&&n[w]==="",c=S(s),y={};for(const w of Object.keys(n))r(w)||(y[w]=n[w]);const x=Object.keys(y);return s.sort!==!1&&x.sort(s.sort),x.map(w=>{const U=n[w];return U===void 0?"":U===null?g(w,s):Array.isArray(U)?U.reduce(c(w),[]).join("&"):g(w,s)+"="+g(U,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(n,s)=>{s=Object.assign({decode:!0},s);const[r,c]=p(n,"#");return Object.assign({url:r.split("?")[0]||"",query:m(a(n),s)},s&&s.parseFragmentIdentifier&&c?{fragmentIdentifier:i(c,s)}:{})},t.stringifyUrl=(n,s)=>{s=Object.assign({encode:!0,strict:!0},s);const r=C(n.url).split("?")[0]||"",c=t.extract(n.url),y=t.parse(c,{sort:!1}),x=Object.assign(y,n.query);let w=t.stringify(x,s);w&&(w=`?${w}`);let U=k(n.url);return n.fragmentIdentifier&&(U=`#${g(n.fragmentIdentifier,s)}`),`${r}${w}${U}`},t.pick=(n,s,r)=>{r=Object.assign({parseFragmentIdentifier:!0},r);const{url:c,query:y,fragmentIdentifier:x}=t.parseUrl(n,r);return t.stringifyUrl({url:c,query:d(y,s),fragmentIdentifier:x},r)},t.exclude=(n,s,r)=>{const c=Array.isArray(s)?y=>!s.includes(y):(y,x)=>!s(y,x);return t.pick(n,c,r)}})(Ce);const le=bn,ks={parseNumbers:!1,parseBooleans:!1},Is={skipNull:!1,skipEmptyString:!1},Ts=(t,o)=>{var l,p;const{navigateMode:d="push",parseOptions:h,stringifyOptions:S}={},f=Object.assign(Object.assign({},ks),h),b=Object.assign(Object.assign({},Is),S),g=le.useLocation(),i=(l=le.useHistory)===null||l===void 0?void 0:l.call(le),T=(p=le.useNavigate)===null||p===void 0?void 0:p.call(le),C=is(),k=P.useRef(typeof t=="function"?t():t||{}),a=P.useMemo(()=>Ce.parse(g.search,f),[g.search]),I=P.useMemo(()=>Object.assign(Object.assign({},k.current),a),[a]);return[I,He(n=>{const s=typeof n=="function"?n(I):n;C(),i&&i[d]({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},g.state),T&&T({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},{replace:d==="replace",state:g.state})})]},Ds=Ts,As=Ft,Ne=Nn,Ue=Un,Rs=ds,At={role:As.types.RoleType.ROLE_APPLICATION},Ls=(t,o,l,p)=>{let d=l||At;const h=(0,Ue.isEthereumType)((0,Ue.DidType)(l));if(h?d=(0,Ne.WalletType)(l):d=(0,Ne.WalletType)(At),!(0,Ue.isValid)(t)){let S="";try{return h?S=t.slice(0,66):S=t,(0,Ne.fromSecretKey)(S,d)}catch(f){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${f.message}`)}}if(!o)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,Rs.fromAppDid)(t,o,d,p||0)};var Es=Ls,tn=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const ce=tn(Xn),Os=Ft,ve=tn(Es),Ns=es,Us=(t,o,{returnWallet:l=!0}={})=>{var F,A;if(!t||typeof t!="object"||!Array.isArray(t.environments)||!(0,ce.default)(t,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:p,configs:d=[]}=t,h=[...d,...p],S=h.find(D=>D.key==="BLOCKLET_APP_DESCRIPTION"),f=h.find(D=>D.key==="BLOCKLET_PASSPORT_COLOR"),b=h.find(D=>D.key==="BLOCKLET_APP_URL"),g=h.find(D=>D.key==="BLOCKLET_APP_TENANT_MODE"),{did:i,version:T}=t.meta,C=(0,Ns.getDisplayName)(t),k=(0,ce.default)(S,"value",t.meta.description),a=(0,ce.default)(f,"value","auto"),I=(0,ce.default)(b,"value",""),m=(0,ce.default)(g,"value","");if(!l)return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:"",wallet:null,permanentWallet:null,tenantMode:m};const n=h.find(D=>D.key==="BLOCKLET_APP_SK"),s=h.find(D=>D.key==="BLOCKLET_APP_CHAIN_TYPE")||h.find(D=>D.key==="BLOCKLET_WALLET_TYPE"),r=h.find(D=>D.key==="BLOCKLET_APP_PSK");let c;s&&(s.value==="ethereum"||s.value==="eth")&&(c=s.value);let y=null,x=null;if(n&&n.value)y=(0,ve.default)(n.value,void 0,c),r&&r.value&&r.value!==n.value&&(x=(0,ve.default)(r.value,void 0,c));else{if(!o||typeof o!="string")throw new Error("Node secret key must be a string");s?y=(0,ve.default)(t.meta.did,o,c):y=(0,ve.default)(t.meta.did,o)}const w=((A=(F=t.settings)==null?void 0:F.session)==null?void 0:A.salt)||"",U=Os.Hasher.SHA3.hash256(Pt.concat([y.secretKey,y.address,w].filter(Boolean).map(D=>Pt.from(D))));return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:U,wallet:y,permanentWallet:x||y,tenantMode:m}};var _s=Us;const Bs=Cn(_s);function Qe({teamDid:t,roles:o,apps:l,onCancel:p,onSuccess:d,onError:h,endpoint:S}){var I;const{api:f}=H(),{t:b,locale:g}=K(),i=Ve({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:l.length>0?l[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),T=async()=>{if(!i.role){i.error=b("team.member.error.passportEmpty");return}const m=i.remark.trim();i.error=null,i.loading=!0;try{let n=i.sourceAppPid??null;n===t&&(n=null);const s={teamDid:t,role:i.role,remark:m,sourceAppPid:n,passportExpireTime:i.passportExpireTime?i.passportExpireTime.toISOString():""};i.display&&(s.display={type:"url",content:i.display});const{inviteInfo:r}=await f.createMemberInvitation({input:s});i.inviteInfo=r,i.activeStep=1}catch(n){const s=ee(n);i.error=s,h(n)}finally{i.loading=!1}},C=o.find(m=>m.name===i.role),a=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[l.length>1?e.jsxs(Be,{fullWidth:!0,children:[e.jsx(Fe,{children:b("common.sourceApp")}),e.jsx($e,{value:i.sourceAppPid,onChange:m=>{i.error=null,i.sourceAppPid=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,children:l.map(m=>e.jsx(je,{value:m.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(_n,{did:m.appPid,size:28}),m.appName]}),e.jsx(Bn,{did:m.appPid,compact:!0,responsive:!1})]})},m.appPid))})]}):null,e.jsxs(Be,{fullWidth:!0,variant:"outlined",children:[e.jsx(Fe,{children:b("common.passport")}),e.jsx($e,{"data-cy":"invite-member-select-role",value:i.role,onChange:m=>{i.error=null,i.role=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),T())},children:o.filter(m=>m.name!=="owner").map(m=>e.jsx(je,{value:m.name,"data-cy":`invite-member-select-option-${m.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:m.title||m.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:m.description})]})},m.name))})]}),((I=C==null?void 0:C.extra)==null?void 0:I.display)==="custom"&&e.jsx(me,{label:b("common.display"),type:"url",value:i.display,onChange:m=>{i.error=null,i.display=m.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(me,{label:b("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.remark,onChange:m=>{i.error=null,i.remark=m.target.value},disabled:i.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Yt,{value:i.passportExpireTime,onChange:m=>{i.passportExpireTime=m}})]}),cancel:b("common.cancel"),confirm:b("team.member.inviteDialog.createInviteLink"),onCancel:p,onConfirm:T},{body:()=>{var n,s;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:b("team.member.inviteDialog.createSuccessTip",{expireDate:pe((s=i.inviteInfo)==null?void 0:s.expireDate,g)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:m})]})},confirm:b("common.copy"),onConfirm:()=>{var n;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});as(m),Y.success(b("common.copied")),d()},cancel:b("common.cancel"),onCancel:p}][i.activeStep];return e.jsxs(ne,{title:b("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[a.cancel&&e.jsx(W,{onClick:a.onCancel,color:"inherit",children:a.cancel}),e.jsxs(W,{onClick:a.onConfirm,color:"primary",disabled:i.loading||!i.role,variant:"contained",autoFocus:!0,children:[i.loading&&e.jsx(ie,{size:16}),a.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof a.body=="function"?a.body():a.body}),!!i.error&&e.jsx(oe,{severity:"error",variant:"icon",children:i.error})]})}Qe.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,roles:v.array,apps:v.array,endpoint:v.string};Qe.defaultProps={onError:()=>{},roles:[],apps:[],endpoint:""};function Je({teamDid:t,onCancel:o,onSuccess:l,onError:p,endpoint:d}){const{api:h,info:S}=H(),{api:f}=P.useContext(Fn),[b,g]=P.useState(!1),{t:i,locale:T}=K(),[C,k]=P.useState(""),[a,I]=P.useState(!1),[m,n]=P.useState(0),[s,r]=P.useState(""),[c,y]=P.useState(""),x=!!We(S,"ownerNft.did"),w=ms(async()=>{if(x){const{state:R}=await h.getDelegationState();return R}return{delegated:!0}});if(w.loading)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(w.error)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx(oe,{severity:"error",variant:"icon",children:ee(w.error)})});const U=async()=>{k(null),g(!0);try{const{inviteInfo:R}=await h.createTransferInvitation({input:{teamDid:t,role:"owner",remark:c.trim()}});r(R),n(D.length-1)}catch(R){const V=ee(R);k(V),p(R)}finally{g(!1)}},F=()=>{I(!0),n(1)},A=()=>{I(!1),n(0)},D=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(oe,{severity:"warning",children:[e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(oe,{severity:"warning",children:e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(me,{label:i("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:c,onChange:R=>{k(null),y(R.target.value)},disabled:b,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:i("common.cancel"),confirm:i("team.transferNode.inviteDialog.createInviteLink"),onCancel:o,onConfirm:x&&!We(w,"value.delegated")?F:U},{body:()=>e.jsx($n,{action:"delegate-transfer-nft",open:a,locale:T,checkFn:f.get,onClose:A,onSuccess:U,checkTimeout:5*60*1e3,webWalletUrl:ts(S),extraParams:{targetDID:S.did},messages:{title:i("team.transferNode.delegateDialog.title"),scan:i("team.transferNode.delegateDialog.scan"),confirm:i("team.transferNode.delegateDialog.confirm"),success:i("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const R=we({inviteId:s.inviteId,endpoint:d});return e.jsxs("div",{children:[e.jsx(Fs,{children:i("team.transferNode.inviteDialog.createSuccessTip",{expireDate:pe(s.expireDate,T)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:R})]})},confirm:i("common.confirm"),onConfirm:l}],E=D[m];return e.jsxs(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx(W,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs(W,{onClick:E.onConfirm,color:"primary",disabled:b,variant:"contained",autoFocus:!0,children:[b&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!C&&e.jsx(oe,{severity:"error",variant:"icon",children:C})]})}Je.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};Je.defaultProps={onError:()=>{},endpoint:""};const Fs=z.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  `;var Xe=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"})]})};Xe.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Xe.displayName="forbid-login";const nn=Xe;var et=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"}),e.jsx("rect",{x:"15.3125",y:"14.0625",width:"7.5",height:"1.875",rx:"0.9375",transform:"rotate(-90 15.3125 14.0625)"})]})};et.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};et.displayName="allow-login";const sn=et;function ke(t){const{passport:o,onDelete:l,...p}=t;return e.jsxs($s,{...p,children:[o.title||o.name," ",!!l&&e.jsx(Wn,{"data-cy":"delete-issuance",className:"delete",onClick:l})]})}ke.propTypes={passport:v.object.isRequired,onDelete:v.func};ke.defaultProps={onDelete:null};const $s=z.span`
@@ -1 +1 @@
1
- import{v as b}from"./vendor-utils-BfZ4tlod.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
1
+ import{w as b}from"./vendor-utils-uPLZO5mM.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var w=g;export{w as p};
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-DEoibe3W.js";import{H as o,j as e,aa as b,b6 as A,O as K,c0 as B,I as O,ab as M,ah as W}from"./vendor-mui-core-Bq8gXTan.js";import{bb as X,aV as $,d as H}from"./vendor-ux-did-connect-pzpsrvqx.js";import{d as G}from"./Done-ASNftAOL.js";import{A as U,a as Y,d as J,b as Q}from"./collapse-DAaiuAEY.js";import{C as Z}from"./Google-C28yeMZW.js";import{ad as v,f as ee}from"./index-CwUT0vPy.js";import{R as ne,F as te,L as re}from"./logo-uploader-BPSmPaZd.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:i}){const[a,d]=u.useState(!1),f=u.useRef(),m=u.useRef(s);u.useEffect(()=>{let l=null;return n&&(l=setTimeout(()=>{d(!0)},50)),()=>{clearTimeout(l)}},[n]);const x=l=>{m.current=l,i(l)},j=()=>{d(!1),i(m.current)},y=e.jsx(b,{className:"form-item-input slot",px:1,children:e.jsxs(b,{display:"flex",alignItems:"center",children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(b,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:j,children:[e.jsx(b,{display:"flex",alignItems:"center",onClick:()=>d(!0),children:e.jsx("div",{ref:f,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(A,{open:a,anchorEl:f.current,onClose:()=>d(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(Z,{color:s,onChange:l=>x(l.hex)})})]});return n?p:y}T.propTypes=S;function _({editing:n,description:s,value:i,onChange:a,componentProps:d,...f}){const{placeholder:m}=d,x=u.useRef(i),{t:j}=u.useContext(X),y=l=>{l.key==="Enter"&&a(x.current,"confirm")},p=l=>{x.current=l,a(l)};return n?e.jsx(K,{style:{flex:1},fullWidth:!0,value:i,onChange:l=>{l.persist(),p(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||m,onKeyDown:y,...f}):e.jsx(b,{px:1,className:"form-item-input slot",children:i||e.jsx("span",{className:"placeholder",children:j("common.requiredInputPlaceholder",{name:s||m})})})}_.propTypes=S;_.defaultProps={componentProps:{}};function D({editing:n,value:s,onChange:i,componentProps:a,...d}){const{blocklet:f}=a,m=s==="auto"?$.getPassportColorFromDid(f.appDid):s;return e.jsxs(b,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:v({title:"Owner",issuer:ee.getDisplayName(f),issuerDid:f.appDid,ownerName:"Your Name",ownerDid:f.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...d,editing:n,value:n?m:s,onChange:i,componentProps:a})]})}D.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};D.defaultProps={};const oe=B`
1
+ import{r as u}from"./vendor-react-DEoibe3W.js";import{H as o,j as e,aa as b,b6 as A,O as K,c0 as B,I as O,ab as M,ah as W}from"./vendor-mui-core-Bq8gXTan.js";import{bb as X,aV as $,d as H}from"./vendor-ux-did-connect-CQtodyZB.js";import{d as G}from"./Done-CfxTFgBR.js";import{A as U,a as Y,d as J,b as Q}from"./collapse-2Uzc-qtU.js";import{C as Z}from"./Google-BAVYemz7.js";import{ad as v,f as ee}from"./index-Cti-S8sI.js";import{R as ne,F as te,L as re}from"./logo-uploader-CMlpg5uV.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:i}){const[a,d]=u.useState(!1),f=u.useRef(),m=u.useRef(s);u.useEffect(()=>{let l=null;return n&&(l=setTimeout(()=>{d(!0)},50)),()=>{clearTimeout(l)}},[n]);const x=l=>{m.current=l,i(l)},j=()=>{d(!1),i(m.current)},y=e.jsx(b,{className:"form-item-input slot",px:1,children:e.jsxs(b,{display:"flex",alignItems:"center",children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(b,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:j,children:[e.jsx(b,{display:"flex",alignItems:"center",onClick:()=>d(!0),children:e.jsx("div",{ref:f,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(A,{open:a,anchorEl:f.current,onClose:()=>d(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(Z,{color:s,onChange:l=>x(l.hex)})})]});return n?p:y}T.propTypes=S;function _({editing:n,description:s,value:i,onChange:a,componentProps:d,...f}){const{placeholder:m}=d,x=u.useRef(i),{t:j}=u.useContext(X),y=l=>{l.key==="Enter"&&a(x.current,"confirm")},p=l=>{x.current=l,a(l)};return n?e.jsx(K,{style:{flex:1},fullWidth:!0,value:i,onChange:l=>{l.persist(),p(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||m,onKeyDown:y,...f}):e.jsx(b,{px:1,className:"form-item-input slot",children:i||e.jsx("span",{className:"placeholder",children:j("common.requiredInputPlaceholder",{name:s||m})})})}_.propTypes=S;_.defaultProps={componentProps:{}};function D({editing:n,value:s,onChange:i,componentProps:a,...d}){const{blocklet:f}=a,m=s==="auto"?$.getPassportColorFromDid(f.appDid):s;return e.jsxs(b,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:v({title:"Owner",issuer:ee.getDisplayName(f),issuerDid:f.appDid,ownerName:"Your Name",ownerDid:f.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...d,editing:n,value:n?m:s,onChange:i,componentProps:a})]})}D.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};D.defaultProps={};const oe=B`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }