@abtnode/blocklet-services 1.16.49-beta-20250828-094758-93e69d1f → 1.16.49-beta-20250828-131156-98768a61

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 (123) hide show
  1. package/api/cache.js +2 -6
  2. package/api/index.js +15 -16
  3. package/api/routes/blocklet.js +2 -0
  4. package/api/util/attach-shared-utils.js +1 -1
  5. package/dist/assets/{access-control-sVJ3CDsk.js → access-control-CFUJo9SZ.js} +1 -1
  6. package/dist/assets/{add-component-core-C-lS-f2s.js → add-component-core-BRCZLX80.js} +1 -1
  7. package/dist/assets/{add-resource-BO5CaS7z.js → add-resource-B8kTq1JK.js} +1 -1
  8. package/dist/assets/{addon-BbUmhDrg.js → addon-a3bVvHB_.js} +1 -1
  9. package/dist/assets/{advanced-yos-VoDO.js → advanced-DBTZU9jA.js} +1 -1
  10. package/dist/assets/{aigne-BFaiITB3.js → aigne-S8QPukF5.js} +1 -1
  11. package/dist/assets/{appearance-CVPCj_g7.js → appearance-D55LDO3x.js} +1 -1
  12. package/dist/assets/{arrow-down.svg-D4RAc36g.js → arrow-down.svg-BsLCIpof.js} +1 -1
  13. package/dist/assets/{audit-logs-DB3qhQg4.js → audit-logs-D_rS8la_.js} +1 -1
  14. package/dist/assets/{authorize-B9eAVgLd.js → authorize-B5Pg5U5F.js} +1 -1
  15. package/dist/assets/{base32-BfYXZjht.js → base32-DdC-hHKv.js} +1 -1
  16. package/dist/assets/{bind-account-CZsXV4Ww.js → bind-account-CiWOtyN-.js} +1 -1
  17. package/dist/assets/{branding-4PyVgsm-.js → branding-B1uZXGcO.js} +2 -2
  18. package/dist/assets/{branding-BRbN1Bkg.js → branding-BykC3ovD.js} +1 -1
  19. package/dist/assets/{branding-4AKasu0p.js → branding-CMNIVPA2.js} +1 -1
  20. package/dist/assets/{bundle-avatar-DQcnLf3o.js → bundle-avatar-DlNLRGgl.js} +1 -1
  21. package/dist/assets/{complete-EQPcfiZv.js → complete-nankqYf8.js} +1 -1
  22. package/dist/assets/{component-BhUI-d0d.js → component-DKqhqllZ.js} +3 -3
  23. package/dist/assets/{config-Le6WeCol.js → config-CYedNfNW.js} +1 -1
  24. package/dist/assets/{config-DJJS3dIe.js → config-CtAl4JIO.js} +1 -1
  25. package/dist/assets/{config-OBLXnYuT.js → config-DtYs3J_p.js} +1 -1
  26. package/dist/assets/{config-navigation-avFj7dYF.js → config-navigation-uoSDnxwT.js} +3 -3
  27. package/dist/assets/{config-space-BbpgeOnW.js → config-space-CZuoOQx7.js} +1 -1
  28. package/dist/assets/{confirm-dtnPbiJU.js → confirm-DurOqGYo.js} +1 -1
  29. package/dist/assets/{connect-OCT-OS7Y.js → connect-C62PqOzi.js} +1 -1
  30. package/dist/assets/{connect-H6B42tsr.js → connect-Ch5R--f1.js} +1 -1
  31. package/dist/assets/{connect-to-rTDj0z18.js → connect-to-CEaVtZQz.js} +1 -1
  32. package/dist/assets/{dashboard-BvIj00oy.js → dashboard-BM4SSGyn.js} +3 -3
  33. package/dist/assets/{delete-confirm-o1zts8U4.js → delete-confirm-vUc5HzsM.js} +1 -1
  34. package/dist/assets/{domain-BtX17din.js → domain-Ch0sdmXA.js} +1 -1
  35. package/dist/assets/{domain-action-card-qxxmLU3c.js → domain-action-card-pM6k5ro1.js} +1 -1
  36. package/dist/assets/{domains-DxA8mkxh.js → domains-BefqQNYv.js} +1 -1
  37. package/dist/assets/{email-AcFKXEOo.js → email-ByWBx5NY.js} +1 -1
  38. package/dist/assets/engine-D3wi1lII.js +1 -0
  39. package/dist/assets/{exchange-passport-Bq0t5R-b.js → exchange-passport-a0Ou2pe0.js} +1 -1
  40. package/dist/assets/{form-D8WxwcUb.js → form-CXY83y8t.js} +1 -1
  41. package/dist/assets/{fuel-BmHBUS5K.js → fuel-C9WsZghJ.js} +1 -1
  42. package/dist/assets/{gen-access-key-lWNMSsTk.js → gen-access-key-BFeRcBwJ.js} +1 -1
  43. package/dist/assets/{gen-simple-access-key-BDUwC53R.js → gen-simple-access-key-CVYUyfyF.js} +1 -1
  44. package/dist/assets/{get-safe-url-BQ6d4MgK.js → get-safe-url-D1YxFF8o.js} +1 -1
  45. package/dist/assets/{hdkey-DSMaex4r.js → hdkey-BqvwBBa7.js} +1 -1
  46. package/dist/assets/{home-BFQjMOv3.js → home-B8H6h2py.js} +1 -1
  47. package/dist/assets/{iframe-Rfnl7VOX.js → iframe-CSREjYQ3.js} +1 -1
  48. package/dist/assets/{index-I2pdu38s.js → index-9m3z4K1I.js} +1 -1
  49. package/dist/assets/{index-BPi7kqxm.js → index-B-b474mN.js} +1 -1
  50. package/dist/assets/{index-C-ScWNDm.js → index-B10tsGIC.js} +1 -1
  51. package/dist/assets/{index-CRLXC3_Y.js → index-B4v27cfj.js} +1 -1
  52. package/dist/assets/{index-CuvhlXtp.js → index-BDRBnmHj.js} +1 -1
  53. package/dist/assets/{index-M1n8940k.js → index-BTQrGZDp.js} +4 -4
  54. package/dist/assets/{index-BWTQhZ4U.js → index-Baz_CCjB.js} +5 -5
  55. package/dist/assets/{index-DpkWkxvh.js → index-BciLTzej.js} +1 -1
  56. package/dist/assets/{index-FcG9efoK.js → index-BuD6Pr1I.js} +1 -1
  57. package/dist/assets/{index-DWUa0yxY.js → index-BusyZKXV.js} +1 -1
  58. package/dist/assets/{index-Djqtu3nK.js → index-BxM1L5Zw.js} +1 -1
  59. package/dist/assets/{index-R9xEgWqx.js → index-CUfsu_Db.js} +1 -1
  60. package/dist/assets/{index-D8KcYxzV.js → index-CZ-vXBaQ.js} +1 -1
  61. package/dist/assets/{index-B6vMF9Hk.js → index-Cc96zZmY.js} +1 -1
  62. package/dist/assets/{index-DzFhCctN.js → index-CiDy7g5f.js} +1 -1
  63. package/dist/assets/{index-CrBAth7d.js → index-CppqXar0.js} +1 -1
  64. package/dist/assets/{index-ooq0mqFx.js → index-Cs1WH7yu.js} +1 -1
  65. package/dist/assets/{index-B5xugf-_.js → index-D7XHnfrW.js} +1 -1
  66. package/dist/assets/{index-D1unLlb1.js → index-DP8yAtyI.js} +1 -1
  67. package/dist/assets/{index-CUQ2UhNw.js → index-DYI7V0tg.js} +3 -3
  68. package/dist/assets/{index-BAz4_gi3.js → index-TM9bCzif.js} +1 -1
  69. package/dist/assets/{index-B19K9uJe.js → index-ec4xzzZ3.js} +1 -1
  70. package/dist/assets/{index-C43c4laP.js → index-jZELiabs.js} +1 -1
  71. package/dist/assets/{invitation-CcLaY9mC.js → invitation-DmVQoyZc.js} +1 -1
  72. package/dist/assets/{invite-DJCMRtEr.js → invite-Bs5Y8Hyi.js} +1 -1
  73. package/dist/assets/{isURL-DFvT0vCW.js → isURL-mWyKW7qg.js} +1 -1
  74. package/dist/assets/{issue-passport-CkIJRolL.js → issue-passport-B1glSBQE.js} +1 -1
  75. package/dist/assets/{item-C2hII4fE.js → item-C3y9xHfs.js} +1 -1
  76. package/dist/assets/{landing-page-Co2xmYHL.js → landing-page-JQC0R8kE.js} +1 -1
  77. package/dist/assets/{layout-C3tvXFgk.js → layout-Bv3gvyOT.js} +1 -1
  78. package/dist/assets/{list-CfoGe8c8.js → list-Avc9wwvx.js} +1 -1
  79. package/dist/assets/{list-BPUjG_QR.js → list-DFkaeQM4.js} +3 -3
  80. package/dist/assets/{localization-D43nyvZk.js → localization-CiX9G53C.js} +1 -1
  81. package/dist/assets/{log-B9lGtGiW.js → log-D39Pqk_Q.js} +1 -1
  82. package/dist/assets/{login-CzFKzWTR.js → login-EJNba04D.js} +1 -1
  83. package/dist/assets/{login-oauth-callback-X95PJ2qp.js → login-oauth-callback-9fji-spx.js} +1 -1
  84. package/dist/assets/{logo-uploader-8ln-60_3.js → logo-uploader-B2cJ-4vT.js} +2 -2
  85. package/dist/assets/{lost-passport-DKWbWBzi.js → lost-passport-CSYINJiN.js} +1 -1
  86. package/dist/assets/{open-window-DzVl2k4x.js → open-window-r0Tx11_O.js} +1 -1
  87. package/dist/assets/{over-due-invoice-payment-BPVLaNw4.js → over-due-invoice-payment-C6-Cdkeu.js} +1 -1
  88. package/dist/assets/{overview-DSyEFumj.js → overview-Cni5u6n7.js} +1 -1
  89. package/dist/assets/{passport-item-DCZlw8VZ.js → passport-item-CnsevrGz.js} +1 -1
  90. package/dist/assets/{permission-CwauIzov.js → permission-Dy5C-cpb.js} +1 -1
  91. package/dist/assets/{preferences-CnB-T7sM.js → preferences-CsAX6Kzq.js} +1 -1
  92. package/dist/assets/{profile-embed-Cje1NBan.js → profile-embed-551h0uSp.js} +1 -1
  93. package/dist/assets/{publish-resource-CfsKbVhC.js → publish-resource-DLw3Wx6M.js} +1 -1
  94. package/dist/assets/{runtime-C1a1bdul.js → runtime-BgTZFdGY.js} +1 -1
  95. package/dist/assets/sdk-BE4JwRhr.js +1 -0
  96. package/dist/assets/{security-BbgwNqVc.js → security-DK7VRttS.js} +1 -1
  97. package/dist/assets/{session-U-hEcJ3m.js → session-mWMzzPvi.js} +1 -1
  98. package/dist/assets/{setup-CwuOKBim.js → setup-EGDbOiE0.js} +1 -1
  99. package/dist/assets/{spaces-D0iulZZE.js → spaces-CceEMwLK.js} +1 -1
  100. package/dist/assets/{start-DuZ3YiJZ.js → start-DWddnDI2.js} +1 -1
  101. package/dist/assets/{status-cH_88o_O.js → status-DxOHG0OK.js} +1 -1
  102. package/dist/assets/{step-actions-9LK_rPuF.js → step-actions-ByWtqro_.js} +1 -1
  103. package/dist/assets/{studio-BtJ8IG1e.js → studio-w16PZR5E.js} +1 -1
  104. package/dist/assets/{team-BqbXtbtA.js → team-H9xoKbfO.js} +1 -1
  105. package/dist/assets/{traffic-B01d9dTv.js → traffic-D6WghyOX.js} +1 -1
  106. package/dist/assets/{transfer-Bzsb7K-h.js → transfer-7pVftCgj.js} +1 -1
  107. package/dist/assets/{unsubscribe-DLiekCH0.js → unsubscribe-D9AWcm14.js} +1 -1
  108. package/dist/assets/{use-app-logo-1g85gLSt.js → use-app-logo-C9El-hde.js} +1 -1
  109. package/dist/assets/{user-center-Bp-3sWFi.js → user-center-GMMBWkE7.js} +3 -3
  110. package/dist/assets/{user-follower-CkIxC3f3.js → user-follower-CpaF7BzC.js} +1 -1
  111. package/dist/assets/{user-sessions-Cbiat2FW.js → user-sessions-C5ipjBV2.js} +1 -1
  112. package/dist/assets/{util-jhRcmTca.js → util-BaQFVP_p.js} +1 -1
  113. package/dist/assets/{util-PKueOfaS.js → util-CO3YggT7.js} +1 -1
  114. package/dist/assets/{wait-connect-CZc79arT.js → wait-connect-DVvZCD3S.js} +1 -1
  115. package/dist/assets/{wizard-BJB_eh3v.js → wizard-BWk7q4K2.js} +1 -1
  116. package/dist/assets/{wizard-components-DLjvO_g6.js → wizard-components-DltE6yWk.js} +2 -2
  117. package/dist/assets/{wrap-locale-DSvJTIUK.js → wrap-locale-Vm7_mFGk.js} +1 -1
  118. package/dist/assets/{zh-D7F3wDQu.js → zh-Bf-LpfxT.js} +1 -1
  119. package/dist/index.html +1 -1
  120. package/dist/service-worker.js +1 -1
  121. package/package.json +23 -23
  122. package/dist/assets/engine-Dn2eu8pq.js +0 -1
  123. package/dist/assets/sdk-BVLD2Hdt.js +0 -1
@@ -1 +1 @@
1
- import{r as p}from"./vendor-react-Dvs43sk9.js";import{j as a,y as b,W as t,z as y,M as E,ak as A}from"./vendor-mui-core-BkVXEDpj.js";import{a as j}from"./vendor-hooks-CLY4g97Q.js";import{ap as r}from"./index-BWTQhZ4U.js";import{T as C}from"./vendor-ux-lckoR4gs.js";import{l as I}from"./arrow-down.svg-D4RAc36g.js";import{L as O,D as H}from"./vendor-mui-x-DiiSwpci.js";import{A as R}from"./AdapterDayjs-B7ApPoXD.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:T="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const h=e?r(n).tz(e):r(n);i(new Date(h.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:T,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(I,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:T=!0}){const{t:e}=C(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[h,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),_=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},M=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>T?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>_(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(A,{children:a.jsx(v,{value:m,onChange:M,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:h})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
1
+ import{r as p}from"./vendor-react-Dvs43sk9.js";import{j as a,y as b,W as t,z as y,M as E,ak as A}from"./vendor-mui-core-BkVXEDpj.js";import{a as j}from"./vendor-hooks-CLY4g97Q.js";import{ap as r}from"./index-Baz_CCjB.js";import{T as C}from"./vendor-ux-lckoR4gs.js";import{l as I}from"./arrow-down.svg-BsLCIpof.js";import{L as O,D as H}from"./vendor-mui-x-DiiSwpci.js";import{A as R}from"./AdapterDayjs-B7ApPoXD.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:T="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const h=e?r(n).tz(e):r(n);i(new Date(h.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:T,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(I,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:T=!0}){const{t:e}=C(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[h,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),_=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},M=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>T?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>_(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(A,{children:a.jsx(v,{value:m,onChange:M,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:h})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
@@ -1 +1 @@
1
- import{j as e,ak as u,D as C,P as y}from"./vendor-mui-core-BkVXEDpj.js";import{r as c}from"./vendor-react-Dvs43sk9.js";import{aP as j,aQ as w,aR as b,aS as P,aT as D}from"./index-BWTQhZ4U.js";import{C as m,$ as A}from"./vendor-ux-lckoR4gs.js";var t=(r=>(r.AvatarOnly="AvatarOnly",r.Detailed="Detailed",r))(t||{}),h=(r=>(r.Minimal="Minimal",r.Basic="Basic",r))(h||{});function R(r){const{user:a,infoType:i,avatarSize:s=48,shouldShowHoverCard:n=!1,renderCardContent:o,...p}=r;return e.jsx(j,{user:a,avatarSize:s,shouldShowHoverCard:n,renderCardContent:o,...p})}function T({...r}){const{user:a,avatarSize:i=40,renderCustomContent:s,infoType:n=h.Minimal,renderFields:o,popupRenderFields:p,...l}=r;return e.jsxs(u,{sx:{display:"flex",flexDirection:"column",width:"100%",flex:1,height:"100%"},children:[e.jsx(w,{user:a,avatarSize:i,...l}),n===h.Basic&&e.jsx(b,{user:a,renderFields:o}),e.jsx(u,{className:"user-card__footer",children:s&&e.jsx(u,{sx:{mt:1.5},children:s()})})]})}function v({...r}){return e.jsx(T,{...r})}function z({children:r,sx:a={}}){const i=C();return e.jsx(u,{sx:m({p:2,backgroundColor:i.palette.background.paper,border:"1px solid",borderColor:"divider",borderRadius:1,maxWidth:500,minWidth:320,display:"flex"},a||null),children:r})}function F({children:r,cardType:a=t.Detailed,variant:i="box",containerRef:s=void 0,sx:n={}}){const o={minWidth:320,p:2,borderRadius:1,...a===t.Detailed?{border:"1px solid",borderColor:"divider"}:{}};return i==="paper"?e.jsx(y,{ref:s,elevation:0,sx:o,children:r}):e.jsx(u,{ref:s,sx:m(o,{display:"flex",alignItems:a===t.AvatarOnly?"center":"flex-start",gap:2},n||null),children:r})}function O(r){const{cardType:a=t.Detailed,showHoverCard:i}=r,s=i!==void 0?i:a===t.AvatarOnly,n=c.useRef(null),[o,p]=c.useState(()=>r.user||null);c.useEffect(()=>{let d=!0;return r.user?p(r.user):r.did&&P(r.did)&&!r.user&&D(r.did).then(x=>{d&&p(x||{fullName:"Anonymous",did:r.did,avatar:""})}),()=>{d=!1}},[r.did,r.user]);const l=c.useMemo(()=>{if(!o)return null;const{avatar:d="",...x}=o;if(d){const S=d.split("?")[1]||"";return{...x,avatar:S?d:`${d}?imageFilter=resize&w=48&h=48`}}return o},[o]);if(!l)return e.jsx(A,{did:r.did,size:r.avatarSize,useProxyFallback:!0,...r.avatarProps});const f=()=>e.jsx(z,{sx:r.popupSx,children:e.jsx(v,{...r,shouldShowHoverCard:!1,user:l,avatarProps:r.popupAvatarProps,shortenLabelProps:r.popupShortenLabelProps||r.shortenLabelProps,renderFields:r.popupRenderFields,renderName:r.popupRenderName,infoType:r.popupInfoType||r.infoType,didProps:r.popupDidProps||r.didProps,showDid:r.popupShowDid||r.showDid,showSocialActions:r.popupShowSocialActions===void 0?r.showSocialActions:r.popupShowSocialActions})});return a===t.AvatarOnly?e.jsx(R,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l}):e.jsx(F,{containerRef:n,cardType:a,sx:r.sx,children:e.jsx(v,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l})})}export{O as B,t as l,h as o};
1
+ import{j as e,ak as u,D as C,P as y}from"./vendor-mui-core-BkVXEDpj.js";import{r as c}from"./vendor-react-Dvs43sk9.js";import{aP as j,aQ as w,aR as b,aS as P,aT as D}from"./index-Baz_CCjB.js";import{C as m,$ as A}from"./vendor-ux-lckoR4gs.js";var t=(r=>(r.AvatarOnly="AvatarOnly",r.Detailed="Detailed",r))(t||{}),h=(r=>(r.Minimal="Minimal",r.Basic="Basic",r))(h||{});function R(r){const{user:a,infoType:i,avatarSize:s=48,shouldShowHoverCard:n=!1,renderCardContent:o,...p}=r;return e.jsx(j,{user:a,avatarSize:s,shouldShowHoverCard:n,renderCardContent:o,...p})}function T({...r}){const{user:a,avatarSize:i=40,renderCustomContent:s,infoType:n=h.Minimal,renderFields:o,popupRenderFields:p,...l}=r;return e.jsxs(u,{sx:{display:"flex",flexDirection:"column",width:"100%",flex:1,height:"100%"},children:[e.jsx(w,{user:a,avatarSize:i,...l}),n===h.Basic&&e.jsx(b,{user:a,renderFields:o}),e.jsx(u,{className:"user-card__footer",children:s&&e.jsx(u,{sx:{mt:1.5},children:s()})})]})}function v({...r}){return e.jsx(T,{...r})}function z({children:r,sx:a={}}){const i=C();return e.jsx(u,{sx:m({p:2,backgroundColor:i.palette.background.paper,border:"1px solid",borderColor:"divider",borderRadius:1,maxWidth:500,minWidth:320,display:"flex"},a||null),children:r})}function F({children:r,cardType:a=t.Detailed,variant:i="box",containerRef:s=void 0,sx:n={}}){const o={minWidth:320,p:2,borderRadius:1,...a===t.Detailed?{border:"1px solid",borderColor:"divider"}:{}};return i==="paper"?e.jsx(y,{ref:s,elevation:0,sx:o,children:r}):e.jsx(u,{ref:s,sx:m(o,{display:"flex",alignItems:a===t.AvatarOnly?"center":"flex-start",gap:2},n||null),children:r})}function O(r){const{cardType:a=t.Detailed,showHoverCard:i}=r,s=i!==void 0?i:a===t.AvatarOnly,n=c.useRef(null),[o,p]=c.useState(()=>r.user||null);c.useEffect(()=>{let d=!0;return r.user?p(r.user):r.did&&P(r.did)&&!r.user&&D(r.did).then(x=>{d&&p(x||{fullName:"Anonymous",did:r.did,avatar:""})}),()=>{d=!1}},[r.did,r.user]);const l=c.useMemo(()=>{if(!o)return null;const{avatar:d="",...x}=o;if(d){const S=d.split("?")[1]||"";return{...x,avatar:S?d:`${d}?imageFilter=resize&w=48&h=48`}}return o},[o]);if(!l)return e.jsx(A,{did:r.did,size:r.avatarSize,useProxyFallback:!0,...r.avatarProps});const f=()=>e.jsx(z,{sx:r.popupSx,children:e.jsx(v,{...r,shouldShowHoverCard:!1,user:l,avatarProps:r.popupAvatarProps,shortenLabelProps:r.popupShortenLabelProps||r.shortenLabelProps,renderFields:r.popupRenderFields,renderName:r.popupRenderName,infoType:r.popupInfoType||r.infoType,didProps:r.popupDidProps||r.didProps,showDid:r.popupShowDid||r.showDid,showSocialActions:r.popupShowSocialActions===void 0?r.showSocialActions:r.popupShowSocialActions})});return a===t.AvatarOnly?e.jsx(R,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l}):e.jsx(F,{containerRef:n,cardType:a,sx:r.sx,children:e.jsx(v,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l})})}export{O as B,t as l,h as o};
@@ -1 +1 @@
1
- import{j as t,at as r}from"./vendor-mui-core-BkVXEDpj.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{G as a}from"./vendor-ux-lckoR4gs.js";import{t as n}from"./index-BWTQhZ4U.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
1
+ import{j as t,at as r}from"./vendor-mui-core-BkVXEDpj.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{G as a}from"./vendor-ux-lckoR4gs.js";import{t as n}from"./index-Baz_CCjB.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
@@ -1,4 +1,4 @@
1
- import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-CLY4g97Q.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as Y,cw as ft,U as xt,T as E,a3 as ht,W as w,z as $,M as ae,I as W,cF as $e,ck as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as wt}from"./vendor-mui-core-BkVXEDpj.js";import{T as F,F as H,L as Tt,ac as fe,a6 as le,H as R,D as L,O as xe,aa as Ue,al as Dt,E as Ie,a9 as It,ai as Pt}from"./vendor-ux-lckoR4gs.js";import{Z as k,p as Rt,ap as Ge,c as U,B as J,a8 as kt,aK as At,f as Ft,X as Nt,ar as se,be as Ve,bf as Lt,bi as Ke}from"./index-BWTQhZ4U.js";import{W as he}from"./did-address-jhnZEWZT.js";import{u as _}from"./team-BqbXtbtA.js";import{r as ge,a as ye,b as je,c as Ye,d as ne,e as Bt,u as zt,f as Et}from"./passport-item-DCZlw8VZ.js";import{p as Ze}from"./util-jhRcmTca.js";import{u as Mt}from"./use-mobile-BTugf2DR.js";import{v as Q}from"./index-CNHQRHA5.js";import{w as G,P as Je}from"./permission-CwauIzov.js";import{C as _t}from"./Google-DfN9Rvbc.js";import{A as $t}from"./vendor-arcblock-Q5ECWsoh.js";import{G as Z,a0 as Ot,H as Wt}from"./vendor-utils-DtY42AM-.js";import{e as oe}from"./edit.svg-DycWG9v3.js";import{C as ve}from"./confirm-dtnPbiJU.js";import{L as Qe}from"./list-header-DdgW2mjM.js";import{f as te}from"./index-DBs9Ljax.js";import{u as qt}from"./useSetState-DFuQZPPV.js";import{C as Ht}from"./lock.svg-COUP8tyO.js";import"./lottie-web-4koyQiv_.js";import"./session-U-hEcJ3m.js";import"./isURL-DFvT0vCW.js";import"./use-app-logo-1g85gLSt.js";import"./index-FcG9efoK.js";import"./base32-BfYXZjht.js";import"./cloneDeep-DqaMBldf.js";const ie=u=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},C.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})),Pe="info";function Xe({createPassportSvg:u,passport:o,onCancel:i,onSwitchPassport:p=()=>{}}){const{t:m}=F(),l=mt({tab:Pe}),h={info:{label:m("common.basicInfo"),value:Pe,component:()=>e.jsx(et,{passport:o,createPassportSvg:u})},logs:{label:m("common.logs"),value:"logs",component:()=>e.jsx(rt,{passport:o})},related:{label:m("team.passport.related"),value:"related",component:()=>e.jsx(at,{passport:o,onSwitchPassport:p})}},a=Object.values(h).map(({label:r,value:t})=>({label:r,value:t})).filter(r=>r.value==="related"?o.parentDid:!0),f=h[l.tab]||h.info,s=r=>{l.tab=r};return e.jsx(H,{title:m("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ut,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Tt,{tabs:a,current:l.tab,onChange:s,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(f.component,{})})]})})}Xe.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};const Ut=q(g)`
1
+ import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-CLY4g97Q.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as Y,cw as ft,U as xt,T as E,a3 as ht,W as w,z as $,M as ae,I as W,cF as $e,ck as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as wt}from"./vendor-mui-core-BkVXEDpj.js";import{T as F,F as H,L as Tt,ac as fe,a6 as le,H as R,D as L,O as xe,aa as Ue,al as Dt,E as Ie,a9 as It,ai as Pt}from"./vendor-ux-lckoR4gs.js";import{Z as k,p as Rt,ap as Ge,c as U,B as J,a8 as kt,aK as At,f as Ft,X as Nt,ar as se,be as Ve,bf as Lt,bi as Ke}from"./index-Baz_CCjB.js";import{W as he}from"./did-address-jhnZEWZT.js";import{u as _}from"./team-H9xoKbfO.js";import{r as ge,a as ye,b as je,c as Ye,d as ne,e as Bt,u as zt,f as Et}from"./passport-item-CnsevrGz.js";import{p as Ze}from"./util-BaQFVP_p.js";import{u as Mt}from"./use-mobile-BTugf2DR.js";import{v as Q}from"./index-CNHQRHA5.js";import{w as G,P as Je}from"./permission-Dy5C-cpb.js";import{C as _t}from"./Google-DfN9Rvbc.js";import{A as $t}from"./vendor-arcblock-Q5ECWsoh.js";import{G as Z,a0 as Ot,H as Wt}from"./vendor-utils-DtY42AM-.js";import{e as oe}from"./edit.svg-DycWG9v3.js";import{C as ve}from"./confirm-DurOqGYo.js";import{L as Qe}from"./list-header-DdgW2mjM.js";import{f as te}from"./index-DBs9Ljax.js";import{u as qt}from"./useSetState-DFuQZPPV.js";import{C as Ht}from"./lock.svg-COUP8tyO.js";import"./lottie-web-4koyQiv_.js";import"./session-mWMzzPvi.js";import"./isURL-mWyKW7qg.js";import"./use-app-logo-C9El-hde.js";import"./index-BuD6Pr1I.js";import"./base32-DdC-hHKv.js";import"./cloneDeep-DqaMBldf.js";const ie=u=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},C.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})),Pe="info";function Xe({createPassportSvg:u,passport:o,onCancel:i,onSwitchPassport:p=()=>{}}){const{t:m}=F(),l=mt({tab:Pe}),h={info:{label:m("common.basicInfo"),value:Pe,component:()=>e.jsx(et,{passport:o,createPassportSvg:u})},logs:{label:m("common.logs"),value:"logs",component:()=>e.jsx(rt,{passport:o})},related:{label:m("team.passport.related"),value:"related",component:()=>e.jsx(at,{passport:o,onSwitchPassport:p})}},a=Object.values(h).map(({label:r,value:t})=>({label:r,value:t})).filter(r=>r.value==="related"?o.parentDid:!0),f=h[l.tab]||h.info,s=r=>{l.tab=r};return e.jsx(H,{title:m("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ut,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Tt,{tabs:a,current:l.tab,onChange:s,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(f.component,{})})]})})}Xe.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};const Ut=q(g)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -1 +1 @@
1
- import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BkVXEDpj.js";import{T as f}from"./vendor-ux-lckoR4gs.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-BWTQhZ4U.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
1
+ import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-BkVXEDpj.js";import{T as f}from"./vendor-ux-lckoR4gs.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-Baz_CCjB.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-CLY4g97Q.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function I(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{I as default};
@@ -1,4 +1,4 @@
1
- import{T as M,H as q,ab as N,N as Y,O as ve,ac as Ce,ai as Se}from"./vendor-ux-lckoR4gs.js";import{o as Te,k as le,v as Ie}from"./vendor-hooks-CLY4g97Q.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as A,bd as _,a5 as J,V as Z,S as G,b4 as Oe,U as L,I as B,cm as $e,bf as Ae,a7 as Pe,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Ye,cl as Je,c9 as Qe,ck as Xe}from"./vendor-mui-core-BkVXEDpj.js";import{B as de,o as pe,l as ue}from"./index-FcG9efoK.js";import{Z as K,c as xe,ap as Ze,a8 as Ge,b8 as Q}from"./index-BWTQhZ4U.js";import{u as V}from"./team-BqbXtbtA.js";import{u as et}from"./use-mobile-BTugf2DR.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-DtY42AM-.js";import{C as st}from"./confirm-dtnPbiJU.js";import{A as nt}from"./actions-DAS8NTxZ.js";import{T as ie}from"./table-tips-DaCM8P_z.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./session-U-hEcJ3m.js";import"./isURL-DFvT0vCW.js";import"./use-app-logo-1g85gLSt.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Z,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx($e,{}):e.jsx(Ae,{})})]})]})}),m.length>0&&e.jsx(Pe,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(Z,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ze(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function $({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(A,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ge(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map(P=>P.id===s.id?{...P,...s}:P);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find(P=>P?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(G,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(A,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
1
+ import{T as M,H as q,ab as N,N as Y,O as ve,ac as Ce,ai as Se}from"./vendor-ux-lckoR4gs.js";import{o as Te,k as le,v as Ie}from"./vendor-hooks-CLY4g97Q.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as A,bd as _,a5 as J,V as Z,S as G,b4 as Oe,U as L,I as B,cm as $e,bf as Ae,a7 as Pe,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Ye,cl as Je,c9 as Qe,ck as Xe}from"./vendor-mui-core-BkVXEDpj.js";import{B as de,o as pe,l as ue}from"./index-BuD6Pr1I.js";import{Z as K,c as xe,ap as Ze,a8 as Ge,b8 as Q}from"./index-Baz_CCjB.js";import{u as V}from"./team-H9xoKbfO.js";import{u as et}from"./use-mobile-BTugf2DR.js";import{u as tt,C as X}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-DtY42AM-.js";import{C as st}from"./confirm-DurOqGYo.js";import{A as nt}from"./actions-DAS8NTxZ.js";import{T as ie}from"./table-tips-DaCM8P_z.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./session-mWMzzPvi.js";import"./isURL-mWyKW7qg.js";import"./use-app-logo-C9El-hde.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(J,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Z,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(J,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx($e,{}):e.jsx(Ae,{})})]})]})}),m.length>0&&e.jsx(Pe,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(Z,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(X,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(X,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Ze(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function $({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(A,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ge(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map(P=>P.id===s.id?{...P,...s}:P);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find(P=>P?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(G,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(A,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
2
2
  @keyframes spin {
3
3
  to {
4
4
  transform: rotate(360deg);
@@ -1,4 +1,4 @@
1
- import{r as x,t as mr,g as pr,e as fr}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as L,y as Me,x as _e,bb as We,M as ye,T as G,z as de,bC as Ze,aX as ne,a6 as ie,W as v,at as z,aj as hr,aI as gr,D as xr,ck as ve,bp as yr,b6 as Pt,bq as vr,am as ue,bZ as dt,P as br,Q as It,bW as Cr,ds as jr,c9 as Sr,aO as wr,aP as kr,dt as Pr,I as Ir,dr as Tr,bL as Er,du as Ar,a5 as Rr}from"./vendor-mui-core-BkVXEDpj.js";import{B as qe,e as $e,K as Dr,ad as Lr,n as ut,C as Or,a as Nr}from"./vendor-utils-DtY42AM-.js";import{T as Z,$ as Ur,J as Fr,H as Y,F as te,D as $,G as pe,O as Tt,ab as Br,L as Mr,a6 as ze,ac as Et,ai as _r}from"./vendor-ux-lckoR4gs.js";import{bd as Qe,aA as At,av as Wr,aB as qr,bS as $r,bT as zr,Z as K,bU as be,p as me,ap as He,W as Hr,v as Kr,aM as Vr,B as se,bV as Zr,bW as Qr,a8 as Rt,c as ee,b9 as Yr,a5 as Gr,X as re,bX as Dt,ar as Xr,aZ as Lt,bY as Jr}from"./index-BWTQhZ4U.js";import{B as Ot,o as es,l as Nt}from"./index-FcG9efoK.js";import{x as ts,b as Ye,g as je,c as rs,h as ss,a as ns}from"./vendor-hooks-CLY4g97Q.js";import{C as Ut,P as is}from"./user-sessions-Cbiat2FW.js";import{r as os}from"./hdkey-DSMaex4r.js";import{W as Ft}from"./dashboard-BvIj00oy.js";import{W as Ge}from"./did-address-jhnZEWZT.js";import{u as Q}from"./team-BqbXtbtA.js";import{P as X}from"./permission-CwauIzov.js";import{C as Se}from"./click-to-copy-C6lmeRAF.js";import{T as Bt}from"./index-DpkWkxvh.js";import{f as J}from"./index-DBs9Ljax.js";import{u as as}from"./useAsync-BzDh8_wv.js";import{v as H}from"./index-DZ2X8gFe.js";import{C as fe}from"./confirm-dtnPbiJU.js";import{u as he}from"./session-U-hEcJ3m.js";import{N as ls}from"./index-BPi7kqxm.js";import{i as Mt,a as Ce,p as _t}from"./util-jhRcmTca.js";import{b as cs}from"./sdk-BVLD2Hdt.js";import{U as ds}from"./user-follower-CkIxC3f3.js";import{A as us}from"./actions-DAS8NTxZ.js";import{S as ms}from"./shorten-label-CphpNRtN.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./useLocalStorage-DH_lecPn.js";import"./get-safe-url-BQ6d4MgK.js";import"./useAsyncRetry-XOTAwnFJ.js";import"./useAsync-B3JLhOUX.js";import"./useSetState-DFuQZPPV.js";import"./index-B19K9uJe.js";import"./over-due-invoice-payment-BPVLaNw4.js";import"./use-mobile-BjYFyM2N.js";import"./isURL-DFvT0vCW.js";import"./use-app-logo-1g85gLSt.js";import"./arrow-down.svg-D4RAc36g.js";import"./vendor-mui-x-DiiSwpci.js";import"./AdapterDayjs-B7ApPoXD.js";import"./base32-BfYXZjht.js";const Wt=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),x.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),qt=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("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"}),x.createElement("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"}),x.createElement("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"})),$t=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),ps=t=>x.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("g",{clipPath:"url(#clip0)"},x.createElement("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"})),x.createElement("defs",null,x.createElement("clipPath",{id:"clip0"},x.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"}))));var Ee={},Ae,mt;function fs(){return mt||(mt=1,Ae=t=>encodeURIComponent(t).replace(/[!'()*]/g,u=>`%${u.charCodeAt(0).toString(16).toUpperCase()}`)),Ae}var Re,pt;function hs(){if(pt)return Re;pt=1;var t="%[a-f0-9]{2}",u=new RegExp("("+t+")|([^%]+?)","gi"),p=new RegExp("("+t+")+","gi");function y(a,c){try{return[decodeURIComponent(a.join(""))]}catch{}if(a.length===1)return a;c=c||1;var o=a.slice(0,c),h=a.slice(c);return Array.prototype.concat.call([],y(o),y(h))}function b(a){try{return decodeURIComponent(a)}catch{for(var c=a.match(u)||[],o=1;o<c.length;o++)a=y(c,o).join(""),c=a.match(u)||[];return a}}function f(a){for(var c={"%FE%FF":"��","%FF%FE":"��"},o=p.exec(a);o;){try{c[o[0]]=decodeURIComponent(o[0])}catch{var h=b(o[0]);h!==o[0]&&(c[o[0]]=h)}o=p.exec(a)}c["%C2"]="�";for(var n=Object.keys(c),C=0;C<n.length;C++){var P=n[C];a=a.replace(new RegExp(P,"g"),c[P])}return a}return Re=function(a){if(typeof a!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof a+"`");try{return a=a.replace(/\+/g," "),decodeURIComponent(a)}catch{return f(a)}},Re}var De,ft;function gs(){return ft||(ft=1,De=(t,u)=>{if(!(typeof t=="string"&&typeof u=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(u==="")return[t];const p=t.indexOf(u);return p===-1?[t]:[t.slice(0,p),t.slice(p+u.length)]}),De}var Le,ht;function xs(){return ht||(ht=1,Le=function(t,u){for(var p={},y=Object.keys(t),b=Array.isArray(u),f=0;f<y.length;f++){var a=y[f],c=t[a];(b?u.indexOf(a)!==-1:u(a,c,t))&&(p[a]=c)}return p}),Le}var gt;function ys(){return gt||(gt=1,function(t){const u=fs(),p=hs(),y=gs(),b=xs(),f=r=>r==null;function a(r){switch(r.arrayFormat){case"index":return s=>(l,d)=>{const m=l.length;return d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,[h(s,r),"[",m,"]"].join("")]:[...l,[h(s,r),"[",h(m,r),"]=",h(d,r)].join("")]};case"bracket":return s=>(l,d)=>d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,[h(s,r),"[]"].join("")]:[...l,[h(s,r),"[]=",h(d,r)].join("")];case"comma":case"separator":return s=>(l,d)=>d==null||d.length===0?l:l.length===0?[[h(s,r),"=",h(d,r)].join("")]:[[l,h(d,r)].join(r.arrayFormatSeparator)];default:return s=>(l,d)=>d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,h(s,r)]:[...l,[h(s,r),"=",h(d,r)].join("")]}}function c(r){let s;switch(r.arrayFormat){case"index":return(l,d,m)=>{if(s=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!s){m[l]=d;return}m[l]===void 0&&(m[l]={}),m[l][s[1]]=d};case"bracket":return(l,d,m)=>{if(s=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!s){m[l]=d;return}if(m[l]===void 0){m[l]=[d];return}m[l]=[].concat(m[l],d)};case"comma":case"separator":return(l,d,m)=>{const I=typeof d=="string"&&d.includes(r.arrayFormatSeparator),S=typeof d=="string"&&!I&&n(d,r).includes(r.arrayFormatSeparator);d=S?n(d,r):d;const R=I||S?d.split(r.arrayFormatSeparator).map(W=>n(W,r)):d===null?d:n(d,r);m[l]=R};default:return(l,d,m)=>{if(m[l]===void 0){m[l]=d;return}m[l]=[].concat(m[l],d)}}}function o(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(r,s){return s.encode?s.strict?u(r):encodeURIComponent(r):r}function n(r,s){return s.decode?p(r):r}function C(r){return Array.isArray(r)?r.sort():typeof r=="object"?C(Object.keys(r)).sort((s,l)=>Number(s)-Number(l)).map(s=>r[s]):r}function P(r){const s=r.indexOf("#");return s!==-1&&(r=r.slice(0,s)),r}function g(r){let s="";const l=r.indexOf("#");return l!==-1&&(s=r.slice(l)),s}function w(r){r=P(r);const s=r.indexOf("?");return s===-1?"":r.slice(s+1)}function i(r,s){return s.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):s.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function k(r,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),o(s.arrayFormatSeparator);const l=c(s),d=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return d;for(const m of r.split("&")){if(m==="")continue;let[I,S]=y(s.decode?m.replace(/\+/g," "):m,"=");S=S===void 0?null:["comma","separator"].includes(s.arrayFormat)?S:n(S,s),l(n(I,s),S,d)}for(const m of Object.keys(d)){const I=d[m];if(typeof I=="object"&&I!==null)for(const S of Object.keys(I))I[S]=i(I[S],s);else d[m]=i(I,s)}return s.sort===!1?d:(s.sort===!0?Object.keys(d).sort():Object.keys(d).sort(s.sort)).reduce((m,I)=>{const S=d[I];return S&&typeof S=="object"&&!Array.isArray(S)?m[I]=C(S):m[I]=S,m},Object.create(null))}t.extract=w,t.parse=k,t.stringify=(r,s)=>{if(!r)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),o(s.arrayFormatSeparator);const l=S=>s.skipNull&&f(r[S])||s.skipEmptyString&&r[S]==="",d=a(s),m={};for(const S of Object.keys(r))l(S)||(m[S]=r[S]);const I=Object.keys(m);return s.sort!==!1&&I.sort(s.sort),I.map(S=>{const R=r[S];return R===void 0?"":R===null?h(S,s):Array.isArray(R)?R.reduce(d(S),[]).join("&"):h(S,s)+"="+h(R,s)}).filter(S=>S.length>0).join("&")},t.parseUrl=(r,s)=>{s=Object.assign({decode:!0},s);const[l,d]=y(r,"#");return Object.assign({url:l.split("?")[0]||"",query:k(w(r),s)},s&&s.parseFragmentIdentifier&&d?{fragmentIdentifier:n(d,s)}:{})},t.stringifyUrl=(r,s)=>{s=Object.assign({encode:!0,strict:!0},s);const l=P(r.url).split("?")[0]||"",d=t.extract(r.url),m=t.parse(d,{sort:!1}),I=Object.assign(m,r.query);let S=t.stringify(I,s);S&&(S=`?${S}`);let R=g(r.url);return r.fragmentIdentifier&&(R=`#${h(r.fragmentIdentifier,s)}`),`${l}${S}${R}`},t.pick=(r,s,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:m,fragmentIdentifier:I}=t.parseUrl(r,l);return t.stringifyUrl({url:d,query:b(m,s),fragmentIdentifier:I},l)},t.exclude=(r,s,l)=>{const d=Array.isArray(s)?m=>!s.includes(m):(m,I)=>!s(m,I);return t.pick(r,d,l)}}(Ee)),Ee}var Oe=ys();const ae=mr,vs={parseNumbers:!1,parseBooleans:!1},bs={skipNull:!1,skipEmptyString:!1},Cs=(t,u)=>{var p,y;const{navigateMode:b="push",parseOptions:f,stringifyOptions:a}={},c=Object.assign(Object.assign({},vs),f),o=Object.assign(Object.assign({},bs),a),h=ae.useLocation(),n=(p=ae.useHistory)===null||p===void 0?void 0:p.call(ae),C=(y=ae.useNavigate)===null||y===void 0?void 0:y.call(ae),P=ts(),g=x.useRef(typeof t=="function"?t():t||{}),w=x.useMemo(()=>Oe.parse(h.search,c),[h.search]),i=x.useMemo(()=>Object.assign(Object.assign({},g.current),w),[w]);return[i,Ye(r=>{const s=typeof r=="function"?r(i):r;P(),n&&n[b]({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},w),s),o)||"?"},h.state),C&&C({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},w),s),o)||"?"},{replace:b==="replace",state:h.state})})]};var Ne,xt;function js(){if(xt)return Ne;xt=1;const t=os(),u=Qe(),{fromSecretKey:p,WalletType:y}=At(),{isHexStrict:b,toHex:f,toBuffer:a,stripHexPrefix:c}=Wr(),{types:o}=u;return Ne={fromAppDid:(n,C,P={role:o.RoleType.ROLE_ACCOUNT},g=0)=>{if(!C)throw new Error("Cannot get user wallet with empty root sk");const w=u.Hasher.SHA3.hash256(a(n)),i=c(w).slice(0,16),k=i.slice(0,8),r=i.slice(8,16),s=parseInt(+`0x${k}`,10)&2147483647,l=parseInt(+`0x${r}`,10)&2147483647,d=c(b(C)?C:f(C)),m=t.fromMasterSeed(qe.from(d,"hex")),I=`m/44'/260'/${s}'/${l}'/${g}`,S=m.derive(I),R=y(P),{pk:W=o.KeyType.ED25519}=R;let U;return W===o.KeyType.ED25519?U=u.Signer.Ed25519.genKeyPair("hex",S.privateKey).secretKey:U=f(S.privateKey),W===o.KeyType.ETHEREUM&&(U=U.slice(0,66)),p(U,R)}},Ne}var Ue,yt;function Ss(){if(yt)return Ue;yt=1;const t=Qe(),u=At(),p=qr(),y=js(),b={role:t.types.RoleType.ROLE_APPLICATION};return Ue=(a,c,o,h)=>{let n=o||b;const C=(0,p.isEthereumType)((0,p.DidType)(o));if(C?n=(0,u.WalletType)(o):n=(0,u.WalletType)(b),!(0,p.isValid)(a)){let P="";try{return C?P=a.slice(0,66):P=a,(0,u.fromSecretKey)(P,n)}catch(g){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${g.message}`)}}if(!c)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,y.fromAppDid)(a,c,n,h||0)},Ue}var le,vt;function ws(){if(vt)return le;vt=1;var t=le&&le.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};const u=t($r),p=Qe(),y=t(Ss()),b=zr();return le=(a,c,{returnWallet:o=!0}={})=>{if(!a||typeof a!="object"||!Array.isArray(a.environments)||!(0,u.default)(a,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:h,configs:n=[]}=a,C=[...n,...h],P=C.find(N=>N.key==="BLOCKLET_APP_DESCRIPTION"),g=C.find(N=>N.key==="BLOCKLET_PASSPORT_COLOR"),w=C.find(N=>N.key==="BLOCKLET_APP_URL"),i=C.find(N=>N.key==="BLOCKLET_APP_TENANT_MODE"),{did:k,version:r}=a.meta,s=(0,b.getDisplayName)(a),l=(0,u.default)(P,"value",a.meta.description),d=(0,u.default)(g,"value","auto"),m=(0,u.default)(w,"value",""),I=(0,u.default)(i,"value","");if(!o)return{did:k,version:r,name:s,description:l,passportColor:d,appUrl:m,secret:"",wallet:null,permanentWallet:null,tenantMode:I};const S=C.find(N=>N.key==="BLOCKLET_APP_SK"),R=C.find(N=>N.key==="BLOCKLET_APP_CHAIN_TYPE")||C.find(N=>N.key==="BLOCKLET_WALLET_TYPE"),W=C.find(N=>N.key==="BLOCKLET_APP_PSK");let U;R&&(R.value==="ethereum"||R.value==="eth")&&(U=R.value);let _=null,E=null;if(S&&S.value)_=(0,y.default)(S.value,void 0,U),W&&W.value&&W.value!==S.value&&(E=(0,y.default)(W.value,void 0,U));else{if(!c||typeof c!="string")throw new Error("Node secret key must be a string");R?_=(0,y.default)(a.meta.did,c,U):_=(0,y.default)(a.meta.did,c)}const D=a.settings?.session?.salt||"",F=p.Hasher.SHA3.hash256(qe.concat([_.secretKey,_.address,D].filter(Boolean).map(N=>qe.from(N))));return{did:k,version:r,name:s,description:l,passportColor:d,appUrl:m,secret:F,wallet:_,permanentWallet:E||_,tenantMode:I}},le}var ks=ws();const Ps=pr(ks);var Is={};function zt({teamDid:t,roles:u=[],apps:p=[],onCancel:y,onSuccess:b,onError:f=()=>{},endpoint:a=""}){const{api:c}=K(),{t:o,locale:h}=Z(),n=je({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:p.length>0?p[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),C=async()=>{if(!n.role){n.error=o("team.member.error.passportEmpty");return}if(n.passportExpireTime&&He(n.passportExpireTime).isBefore(He())){n.error=o("team.passport.customExpireTimeIsInvalid");return}const i=n.remark.trim();n.error=null,n.loading=!0;try{let k=n.sourceAppPid??null;k===t&&(k=null);const r={teamDid:t,role:n.role,remark:i,sourceAppPid:k,passportExpireTime:n.passportExpireTime?n.passportExpireTime.toISOString():""};n.display&&(r.display={type:"url",content:n.display});const{inviteInfo:s}=await c.createMemberInvitation({input:r});n.inviteInfo=s,n.activeStep=1}catch(k){const r=J(k);n.error=r,f(k)}finally{n.loading=!1}},P=u.find(i=>i.name===n.role),w=[{body:e.jsxs(L,{sx:{display:"flex",flexDirection:"column",gap:3},children:[p.length>1?e.jsxs(Me,{fullWidth:!0,children:[e.jsx(_e,{children:o("common.sourceApp")}),e.jsx(We,{value:n.sourceAppPid,onChange:i=>{n.error=null,n.sourceAppPid=i.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,children:p.map(i=>e.jsx(ye,{value:i.appPid,children:e.jsxs(L,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(L,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ur,{did:i.appPid,size:28}),i.appName]}),e.jsx(Fr,{did:i.appPid,compact:!0,responsive:!1})]})},i.appPid))})]}):null,e.jsxs(Me,{fullWidth:!0,variant:"outlined",children:[e.jsx(_e,{children:o("common.passport")}),e.jsx(We,{"data-cy":"invite-member-select-role",value:n.role,onChange:i=>{n.error=null,n.role=i.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,onKeyPress:i=>{i.key==="Enter"&&(i.preventDefault(),C())},children:u.filter(i=>i.name!=="owner").map(i=>e.jsx(ye,{value:i.name,"data-cy":`invite-member-select-option-${i.name}`,children:e.jsxs(L,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:i.title||i.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:i.description})]})},i.name))})]}),P?.extra?.display==="custom"&&e.jsx(de,{label:o("common.display"),type:"url",value:n.display,onChange:i=>{n.error=null,n.display=i.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(de,{label:o("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.remark,onChange:i=>{n.error=null,n.remark=i.target.value},disabled:n.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Bt,{value:n.passportExpireTime,onChange:i=>{n.error=null,n.passportExpireTime=i},showError:!1})]}),cancel:o("common.cancel"),confirm:o("team.member.inviteDialog.createInviteLink"),onCancel:y,onConfirm:C},{body:()=>{const i=be({inviteId:n.inviteInfo?.inviteId,endpoint:a});return e.jsxs("div",{children:[e.jsx(L,{sx:{fontSize:16,fontWeight:"bold"},children:o("team.member.inviteDialog.createSuccessTip",{expireDate:me(n.inviteInfo?.expireDate,h)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Se,{children:i})]})},confirm:o("common.copy"),onConfirm:()=>{const i=be({inviteId:n.inviteInfo?.inviteId,endpoint:a});if(["1","true"].includes(Is.IS_E2E)){b();return}rs(i),Y.success(o("common.copied")),b()},cancel:o("common.cancel"),onCancel:y}][n.activeStep];return e.jsxs(te,{title:o("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[w.cancel&&e.jsx($,{onClick:w.onCancel,color:"inherit",children:w.cancel}),e.jsxs($,{onClick:w.onConfirm,color:"primary",disabled:n.loading||!n.role,variant:"contained",autoFocus:!0,children:[n.loading&&e.jsx(ie,{size:16}),w.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof w.body=="function"?w.body():w.body}),!!n.error&&e.jsx(ne,{severity:"error",sx:{mt:2},children:n.error})]})}zt.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};function Ht({teamDid:t,onCancel:u,onSuccess:p,onError:y=()=>{},endpoint:b=""}){const{api:f,info:a}=K(),{api:c}=x.useContext(Hr),[o,h]=x.useState(!1),{t:n,locale:C}=Z(),[P,g]=x.useState(""),[w,i]=x.useState(!1),[k,r]=x.useState(0),[s,l]=x.useState(""),[d,m]=x.useState(""),I=!!$e(a,"ownerNft.did"),S=as(async()=>{if(I){const{state:D}=await f.getDelegationState();return D}return{delegated:!0}});if(S.loading)return e.jsx(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:u,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(S.error)return e.jsx(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:u,children:e.jsx(ne,{severity:"error",children:J(S.error)})});const R=async()=>{g(null),h(!0);try{const{inviteInfo:D}=await f.createTransferInvitation({input:{teamDid:t,role:"owner",remark:d.trim()}});l(D),r(_.length-1)}catch(D){const F=J(D);g(F),y(D)}finally{h(!1)}},W=()=>{i(!0),r(1)},U=()=>{i(!1),r(0)},_=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(ne,{severity:"warning",children:[e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(ne,{severity:"warning",children:e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(de,{label:n("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:d,onChange:D=>{g(null),m(D.target.value)},disabled:o,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:n("common.cancel"),confirm:n("team.transferNode.inviteDialog.createInviteLink"),onCancel:u,onConfirm:I&&!$e(S,"value.delegated")?W:R},{body:()=>e.jsx(Kr,{action:"delegate-transfer-nft",open:w,locale:C,checkFn:c.get,onClose:U,onSuccess:R,checkTimeout:5*60*1e3,webWalletUrl:Vr(a),extraParams:{targetDID:a.did},messages:{title:n("team.transferNode.delegateDialog.title"),scan:n("team.transferNode.delegateDialog.scan"),confirm:n("team.transferNode.delegateDialog.confirm"),success:n("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const D=be({inviteId:s.inviteId,endpoint:b});return e.jsxs("div",{children:[e.jsx(Ts,{children:n("team.transferNode.inviteDialog.createSuccessTip",{expireDate:me(s.expireDate,C)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Se,{children:D})]})},confirm:n("common.confirm"),onConfirm:p}],E=_[k];return e.jsxs(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx($,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs($,{onClick:E.onConfirm,color:"primary",disabled:o,variant:"contained",autoFocus:!0,children:[o&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!P&&e.jsx(ne,{severity:"error",children:P})]})}Ht.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};const Ts=z.div`
1
+ import{r as x,t as mr,g as pr,e as fr}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as L,y as Me,x as _e,bb as We,M as ye,T as G,z as de,bC as Ze,aX as ne,a6 as ie,W as v,at as z,aj as hr,aI as gr,D as xr,ck as ve,bp as yr,b6 as Pt,bq as vr,am as ue,bZ as dt,P as br,Q as It,bW as Cr,ds as jr,c9 as Sr,aO as wr,aP as kr,dt as Pr,I as Ir,dr as Tr,bL as Er,du as Ar,a5 as Rr}from"./vendor-mui-core-BkVXEDpj.js";import{B as qe,e as $e,K as Dr,ad as Lr,n as ut,C as Or,a as Nr}from"./vendor-utils-DtY42AM-.js";import{T as Z,$ as Ur,J as Fr,H as Y,F as te,D as $,G as pe,O as Tt,ab as Br,L as Mr,a6 as ze,ac as Et,ai as _r}from"./vendor-ux-lckoR4gs.js";import{bd as Qe,aA as At,av as Wr,aB as qr,bS as $r,bT as zr,Z as K,bU as be,p as me,ap as He,W as Hr,v as Kr,aM as Vr,B as se,bV as Zr,bW as Qr,a8 as Rt,c as ee,b9 as Yr,a5 as Gr,X as re,bX as Dt,ar as Xr,aZ as Lt,bY as Jr}from"./index-Baz_CCjB.js";import{B as Ot,o as es,l as Nt}from"./index-BuD6Pr1I.js";import{x as ts,b as Ye,g as je,c as rs,h as ss,a as ns}from"./vendor-hooks-CLY4g97Q.js";import{C as Ut,P as is}from"./user-sessions-C5ipjBV2.js";import{r as os}from"./hdkey-BqvwBBa7.js";import{W as Ft}from"./dashboard-BM4SSGyn.js";import{W as Ge}from"./did-address-jhnZEWZT.js";import{u as Q}from"./team-H9xoKbfO.js";import{P as X}from"./permission-Dy5C-cpb.js";import{C as Se}from"./click-to-copy-C6lmeRAF.js";import{T as Bt}from"./index-BciLTzej.js";import{f as J}from"./index-DBs9Ljax.js";import{u as as}from"./useAsync-BzDh8_wv.js";import{v as H}from"./index-DZ2X8gFe.js";import{C as fe}from"./confirm-DurOqGYo.js";import{u as he}from"./session-mWMzzPvi.js";import{N as ls}from"./index-B-b474mN.js";import{i as Mt,a as Ce,p as _t}from"./util-BaQFVP_p.js";import{b as cs}from"./sdk-BE4JwRhr.js";import{U as ds}from"./user-follower-CpaF7BzC.js";import{A as us}from"./actions-DAS8NTxZ.js";import{S as ms}from"./shorten-label-CphpNRtN.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Q5ECWsoh.js";import"./useLocalStorage-DH_lecPn.js";import"./get-safe-url-D1YxFF8o.js";import"./useAsyncRetry-XOTAwnFJ.js";import"./useAsync-B3JLhOUX.js";import"./useSetState-DFuQZPPV.js";import"./index-ec4xzzZ3.js";import"./over-due-invoice-payment-C6-Cdkeu.js";import"./use-mobile-BjYFyM2N.js";import"./isURL-mWyKW7qg.js";import"./use-app-logo-C9El-hde.js";import"./arrow-down.svg-BsLCIpof.js";import"./vendor-mui-x-DiiSwpci.js";import"./AdapterDayjs-B7ApPoXD.js";import"./base32-DdC-hHKv.js";const Wt=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),x.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),qt=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("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"}),x.createElement("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"}),x.createElement("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"})),$t=t=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("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"}),x.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),ps=t=>x.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...t},x.createElement("g",{clipPath:"url(#clip0)"},x.createElement("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"})),x.createElement("defs",null,x.createElement("clipPath",{id:"clip0"},x.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"}))));var Ee={},Ae,mt;function fs(){return mt||(mt=1,Ae=t=>encodeURIComponent(t).replace(/[!'()*]/g,u=>`%${u.charCodeAt(0).toString(16).toUpperCase()}`)),Ae}var Re,pt;function hs(){if(pt)return Re;pt=1;var t="%[a-f0-9]{2}",u=new RegExp("("+t+")|([^%]+?)","gi"),p=new RegExp("("+t+")+","gi");function y(a,c){try{return[decodeURIComponent(a.join(""))]}catch{}if(a.length===1)return a;c=c||1;var o=a.slice(0,c),h=a.slice(c);return Array.prototype.concat.call([],y(o),y(h))}function b(a){try{return decodeURIComponent(a)}catch{for(var c=a.match(u)||[],o=1;o<c.length;o++)a=y(c,o).join(""),c=a.match(u)||[];return a}}function f(a){for(var c={"%FE%FF":"��","%FF%FE":"��"},o=p.exec(a);o;){try{c[o[0]]=decodeURIComponent(o[0])}catch{var h=b(o[0]);h!==o[0]&&(c[o[0]]=h)}o=p.exec(a)}c["%C2"]="�";for(var n=Object.keys(c),C=0;C<n.length;C++){var P=n[C];a=a.replace(new RegExp(P,"g"),c[P])}return a}return Re=function(a){if(typeof a!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof a+"`");try{return a=a.replace(/\+/g," "),decodeURIComponent(a)}catch{return f(a)}},Re}var De,ft;function gs(){return ft||(ft=1,De=(t,u)=>{if(!(typeof t=="string"&&typeof u=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(u==="")return[t];const p=t.indexOf(u);return p===-1?[t]:[t.slice(0,p),t.slice(p+u.length)]}),De}var Le,ht;function xs(){return ht||(ht=1,Le=function(t,u){for(var p={},y=Object.keys(t),b=Array.isArray(u),f=0;f<y.length;f++){var a=y[f],c=t[a];(b?u.indexOf(a)!==-1:u(a,c,t))&&(p[a]=c)}return p}),Le}var gt;function ys(){return gt||(gt=1,function(t){const u=fs(),p=hs(),y=gs(),b=xs(),f=r=>r==null;function a(r){switch(r.arrayFormat){case"index":return s=>(l,d)=>{const m=l.length;return d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,[h(s,r),"[",m,"]"].join("")]:[...l,[h(s,r),"[",h(m,r),"]=",h(d,r)].join("")]};case"bracket":return s=>(l,d)=>d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,[h(s,r),"[]"].join("")]:[...l,[h(s,r),"[]=",h(d,r)].join("")];case"comma":case"separator":return s=>(l,d)=>d==null||d.length===0?l:l.length===0?[[h(s,r),"=",h(d,r)].join("")]:[[l,h(d,r)].join(r.arrayFormatSeparator)];default:return s=>(l,d)=>d===void 0||r.skipNull&&d===null||r.skipEmptyString&&d===""?l:d===null?[...l,h(s,r)]:[...l,[h(s,r),"=",h(d,r)].join("")]}}function c(r){let s;switch(r.arrayFormat){case"index":return(l,d,m)=>{if(s=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!s){m[l]=d;return}m[l]===void 0&&(m[l]={}),m[l][s[1]]=d};case"bracket":return(l,d,m)=>{if(s=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!s){m[l]=d;return}if(m[l]===void 0){m[l]=[d];return}m[l]=[].concat(m[l],d)};case"comma":case"separator":return(l,d,m)=>{const I=typeof d=="string"&&d.includes(r.arrayFormatSeparator),S=typeof d=="string"&&!I&&n(d,r).includes(r.arrayFormatSeparator);d=S?n(d,r):d;const R=I||S?d.split(r.arrayFormatSeparator).map(W=>n(W,r)):d===null?d:n(d,r);m[l]=R};default:return(l,d,m)=>{if(m[l]===void 0){m[l]=d;return}m[l]=[].concat(m[l],d)}}}function o(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(r,s){return s.encode?s.strict?u(r):encodeURIComponent(r):r}function n(r,s){return s.decode?p(r):r}function C(r){return Array.isArray(r)?r.sort():typeof r=="object"?C(Object.keys(r)).sort((s,l)=>Number(s)-Number(l)).map(s=>r[s]):r}function P(r){const s=r.indexOf("#");return s!==-1&&(r=r.slice(0,s)),r}function g(r){let s="";const l=r.indexOf("#");return l!==-1&&(s=r.slice(l)),s}function w(r){r=P(r);const s=r.indexOf("?");return s===-1?"":r.slice(s+1)}function i(r,s){return s.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):s.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function k(r,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),o(s.arrayFormatSeparator);const l=c(s),d=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return d;for(const m of r.split("&")){if(m==="")continue;let[I,S]=y(s.decode?m.replace(/\+/g," "):m,"=");S=S===void 0?null:["comma","separator"].includes(s.arrayFormat)?S:n(S,s),l(n(I,s),S,d)}for(const m of Object.keys(d)){const I=d[m];if(typeof I=="object"&&I!==null)for(const S of Object.keys(I))I[S]=i(I[S],s);else d[m]=i(I,s)}return s.sort===!1?d:(s.sort===!0?Object.keys(d).sort():Object.keys(d).sort(s.sort)).reduce((m,I)=>{const S=d[I];return S&&typeof S=="object"&&!Array.isArray(S)?m[I]=C(S):m[I]=S,m},Object.create(null))}t.extract=w,t.parse=k,t.stringify=(r,s)=>{if(!r)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),o(s.arrayFormatSeparator);const l=S=>s.skipNull&&f(r[S])||s.skipEmptyString&&r[S]==="",d=a(s),m={};for(const S of Object.keys(r))l(S)||(m[S]=r[S]);const I=Object.keys(m);return s.sort!==!1&&I.sort(s.sort),I.map(S=>{const R=r[S];return R===void 0?"":R===null?h(S,s):Array.isArray(R)?R.reduce(d(S),[]).join("&"):h(S,s)+"="+h(R,s)}).filter(S=>S.length>0).join("&")},t.parseUrl=(r,s)=>{s=Object.assign({decode:!0},s);const[l,d]=y(r,"#");return Object.assign({url:l.split("?")[0]||"",query:k(w(r),s)},s&&s.parseFragmentIdentifier&&d?{fragmentIdentifier:n(d,s)}:{})},t.stringifyUrl=(r,s)=>{s=Object.assign({encode:!0,strict:!0},s);const l=P(r.url).split("?")[0]||"",d=t.extract(r.url),m=t.parse(d,{sort:!1}),I=Object.assign(m,r.query);let S=t.stringify(I,s);S&&(S=`?${S}`);let R=g(r.url);return r.fragmentIdentifier&&(R=`#${h(r.fragmentIdentifier,s)}`),`${l}${S}${R}`},t.pick=(r,s,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:m,fragmentIdentifier:I}=t.parseUrl(r,l);return t.stringifyUrl({url:d,query:b(m,s),fragmentIdentifier:I},l)},t.exclude=(r,s,l)=>{const d=Array.isArray(s)?m=>!s.includes(m):(m,I)=>!s(m,I);return t.pick(r,d,l)}}(Ee)),Ee}var Oe=ys();const ae=mr,vs={parseNumbers:!1,parseBooleans:!1},bs={skipNull:!1,skipEmptyString:!1},Cs=(t,u)=>{var p,y;const{navigateMode:b="push",parseOptions:f,stringifyOptions:a}={},c=Object.assign(Object.assign({},vs),f),o=Object.assign(Object.assign({},bs),a),h=ae.useLocation(),n=(p=ae.useHistory)===null||p===void 0?void 0:p.call(ae),C=(y=ae.useNavigate)===null||y===void 0?void 0:y.call(ae),P=ts(),g=x.useRef(typeof t=="function"?t():t||{}),w=x.useMemo(()=>Oe.parse(h.search,c),[h.search]),i=x.useMemo(()=>Object.assign(Object.assign({},g.current),w),[w]);return[i,Ye(r=>{const s=typeof r=="function"?r(i):r;P(),n&&n[b]({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},w),s),o)||"?"},h.state),C&&C({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},w),s),o)||"?"},{replace:b==="replace",state:h.state})})]};var Ne,xt;function js(){if(xt)return Ne;xt=1;const t=os(),u=Qe(),{fromSecretKey:p,WalletType:y}=At(),{isHexStrict:b,toHex:f,toBuffer:a,stripHexPrefix:c}=Wr(),{types:o}=u;return Ne={fromAppDid:(n,C,P={role:o.RoleType.ROLE_ACCOUNT},g=0)=>{if(!C)throw new Error("Cannot get user wallet with empty root sk");const w=u.Hasher.SHA3.hash256(a(n)),i=c(w).slice(0,16),k=i.slice(0,8),r=i.slice(8,16),s=parseInt(+`0x${k}`,10)&2147483647,l=parseInt(+`0x${r}`,10)&2147483647,d=c(b(C)?C:f(C)),m=t.fromMasterSeed(qe.from(d,"hex")),I=`m/44'/260'/${s}'/${l}'/${g}`,S=m.derive(I),R=y(P),{pk:W=o.KeyType.ED25519}=R;let U;return W===o.KeyType.ED25519?U=u.Signer.Ed25519.genKeyPair("hex",S.privateKey).secretKey:U=f(S.privateKey),W===o.KeyType.ETHEREUM&&(U=U.slice(0,66)),p(U,R)}},Ne}var Ue,yt;function Ss(){if(yt)return Ue;yt=1;const t=Qe(),u=At(),p=qr(),y=js(),b={role:t.types.RoleType.ROLE_APPLICATION};return Ue=(a,c,o,h)=>{let n=o||b;const C=(0,p.isEthereumType)((0,p.DidType)(o));if(C?n=(0,u.WalletType)(o):n=(0,u.WalletType)(b),!(0,p.isValid)(a)){let P="";try{return C?P=a.slice(0,66):P=a,(0,u.fromSecretKey)(P,n)}catch(g){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${g.message}`)}}if(!c)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,y.fromAppDid)(a,c,n,h||0)},Ue}var le,vt;function ws(){if(vt)return le;vt=1;var t=le&&le.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};const u=t($r),p=Qe(),y=t(Ss()),b=zr();return le=(a,c,{returnWallet:o=!0}={})=>{if(!a||typeof a!="object"||!Array.isArray(a.environments)||!(0,u.default)(a,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:h,configs:n=[]}=a,C=[...n,...h],P=C.find(N=>N.key==="BLOCKLET_APP_DESCRIPTION"),g=C.find(N=>N.key==="BLOCKLET_PASSPORT_COLOR"),w=C.find(N=>N.key==="BLOCKLET_APP_URL"),i=C.find(N=>N.key==="BLOCKLET_APP_TENANT_MODE"),{did:k,version:r}=a.meta,s=(0,b.getDisplayName)(a),l=(0,u.default)(P,"value",a.meta.description),d=(0,u.default)(g,"value","auto"),m=(0,u.default)(w,"value",""),I=(0,u.default)(i,"value","");if(!o)return{did:k,version:r,name:s,description:l,passportColor:d,appUrl:m,secret:"",wallet:null,permanentWallet:null,tenantMode:I};const S=C.find(N=>N.key==="BLOCKLET_APP_SK"),R=C.find(N=>N.key==="BLOCKLET_APP_CHAIN_TYPE")||C.find(N=>N.key==="BLOCKLET_WALLET_TYPE"),W=C.find(N=>N.key==="BLOCKLET_APP_PSK");let U;R&&(R.value==="ethereum"||R.value==="eth")&&(U=R.value);let _=null,E=null;if(S&&S.value)_=(0,y.default)(S.value,void 0,U),W&&W.value&&W.value!==S.value&&(E=(0,y.default)(W.value,void 0,U));else{if(!c||typeof c!="string")throw new Error("Node secret key must be a string");R?_=(0,y.default)(a.meta.did,c,U):_=(0,y.default)(a.meta.did,c)}const D=a.settings?.session?.salt||"",F=p.Hasher.SHA3.hash256(qe.concat([_.secretKey,_.address,D].filter(Boolean).map(N=>qe.from(N))));return{did:k,version:r,name:s,description:l,passportColor:d,appUrl:m,secret:F,wallet:_,permanentWallet:E||_,tenantMode:I}},le}var ks=ws();const Ps=pr(ks);var Is={};function zt({teamDid:t,roles:u=[],apps:p=[],onCancel:y,onSuccess:b,onError:f=()=>{},endpoint:a=""}){const{api:c}=K(),{t:o,locale:h}=Z(),n=je({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:p.length>0?p[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),C=async()=>{if(!n.role){n.error=o("team.member.error.passportEmpty");return}if(n.passportExpireTime&&He(n.passportExpireTime).isBefore(He())){n.error=o("team.passport.customExpireTimeIsInvalid");return}const i=n.remark.trim();n.error=null,n.loading=!0;try{let k=n.sourceAppPid??null;k===t&&(k=null);const r={teamDid:t,role:n.role,remark:i,sourceAppPid:k,passportExpireTime:n.passportExpireTime?n.passportExpireTime.toISOString():""};n.display&&(r.display={type:"url",content:n.display});const{inviteInfo:s}=await c.createMemberInvitation({input:r});n.inviteInfo=s,n.activeStep=1}catch(k){const r=J(k);n.error=r,f(k)}finally{n.loading=!1}},P=u.find(i=>i.name===n.role),w=[{body:e.jsxs(L,{sx:{display:"flex",flexDirection:"column",gap:3},children:[p.length>1?e.jsxs(Me,{fullWidth:!0,children:[e.jsx(_e,{children:o("common.sourceApp")}),e.jsx(We,{value:n.sourceAppPid,onChange:i=>{n.error=null,n.sourceAppPid=i.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,children:p.map(i=>e.jsx(ye,{value:i.appPid,children:e.jsxs(L,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(L,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ur,{did:i.appPid,size:28}),i.appName]}),e.jsx(Fr,{did:i.appPid,compact:!0,responsive:!1})]})},i.appPid))})]}):null,e.jsxs(Me,{fullWidth:!0,variant:"outlined",children:[e.jsx(_e,{children:o("common.passport")}),e.jsx(We,{"data-cy":"invite-member-select-role",value:n.role,onChange:i=>{n.error=null,n.role=i.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,onKeyPress:i=>{i.key==="Enter"&&(i.preventDefault(),C())},children:u.filter(i=>i.name!=="owner").map(i=>e.jsx(ye,{value:i.name,"data-cy":`invite-member-select-option-${i.name}`,children:e.jsxs(L,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:i.title||i.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:i.description})]})},i.name))})]}),P?.extra?.display==="custom"&&e.jsx(de,{label:o("common.display"),type:"url",value:n.display,onChange:i=>{n.error=null,n.display=i.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(de,{label:o("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.remark,onChange:i=>{n.error=null,n.remark=i.target.value},disabled:n.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Bt,{value:n.passportExpireTime,onChange:i=>{n.error=null,n.passportExpireTime=i},showError:!1})]}),cancel:o("common.cancel"),confirm:o("team.member.inviteDialog.createInviteLink"),onCancel:y,onConfirm:C},{body:()=>{const i=be({inviteId:n.inviteInfo?.inviteId,endpoint:a});return e.jsxs("div",{children:[e.jsx(L,{sx:{fontSize:16,fontWeight:"bold"},children:o("team.member.inviteDialog.createSuccessTip",{expireDate:me(n.inviteInfo?.expireDate,h)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Se,{children:i})]})},confirm:o("common.copy"),onConfirm:()=>{const i=be({inviteId:n.inviteInfo?.inviteId,endpoint:a});if(["1","true"].includes(Is.IS_E2E)){b();return}rs(i),Y.success(o("common.copied")),b()},cancel:o("common.cancel"),onCancel:y}][n.activeStep];return e.jsxs(te,{title:o("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[w.cancel&&e.jsx($,{onClick:w.onCancel,color:"inherit",children:w.cancel}),e.jsxs($,{onClick:w.onConfirm,color:"primary",disabled:n.loading||!n.role,variant:"contained",autoFocus:!0,children:[n.loading&&e.jsx(ie,{size:16}),w.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof w.body=="function"?w.body():w.body}),!!n.error&&e.jsx(ne,{severity:"error",sx:{mt:2},children:n.error})]})}zt.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};function Ht({teamDid:t,onCancel:u,onSuccess:p,onError:y=()=>{},endpoint:b=""}){const{api:f,info:a}=K(),{api:c}=x.useContext(Hr),[o,h]=x.useState(!1),{t:n,locale:C}=Z(),[P,g]=x.useState(""),[w,i]=x.useState(!1),[k,r]=x.useState(0),[s,l]=x.useState(""),[d,m]=x.useState(""),I=!!$e(a,"ownerNft.did"),S=as(async()=>{if(I){const{state:D}=await f.getDelegationState();return D}return{delegated:!0}});if(S.loading)return e.jsx(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:u,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(S.error)return e.jsx(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:u,children:e.jsx(ne,{severity:"error",children:J(S.error)})});const R=async()=>{g(null),h(!0);try{const{inviteInfo:D}=await f.createTransferInvitation({input:{teamDid:t,role:"owner",remark:d.trim()}});l(D),r(_.length-1)}catch(D){const F=J(D);g(F),y(D)}finally{h(!1)}},W=()=>{i(!0),r(1)},U=()=>{i(!1),r(0)},_=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(ne,{severity:"warning",children:[e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(ne,{severity:"warning",children:e.jsx(G,{children:n("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(de,{label:n("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:d,onChange:D=>{g(null),m(D.target.value)},disabled:o,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:n("common.cancel"),confirm:n("team.transferNode.inviteDialog.createInviteLink"),onCancel:u,onConfirm:I&&!$e(S,"value.delegated")?W:R},{body:()=>e.jsx(Kr,{action:"delegate-transfer-nft",open:w,locale:C,checkFn:c.get,onClose:U,onSuccess:R,checkTimeout:5*60*1e3,webWalletUrl:Vr(a),extraParams:{targetDID:a.did},messages:{title:n("team.transferNode.delegateDialog.title"),scan:n("team.transferNode.delegateDialog.scan"),confirm:n("team.transferNode.delegateDialog.confirm"),success:n("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const D=be({inviteId:s.inviteId,endpoint:b});return e.jsxs("div",{children:[e.jsx(Ts,{children:n("team.transferNode.inviteDialog.createSuccessTip",{expireDate:me(s.expireDate,C)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Se,{children:D})]})},confirm:n("common.confirm"),onConfirm:p}],E=_[k];return e.jsxs(te,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx($,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs($,{onClick:E.onConfirm,color:"primary",disabled:o,variant:"contained",autoFocus:!0,children:[o&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!P&&e.jsx(ne,{severity:"error",children:P})]})}Ht.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};const Ts=z.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  `;function Ke({passport:t,onDelete:u=null,...p}){return e.jsxs(Es,{...p,children:[t.title||t.name," ",!!u&&e.jsx(hr,{"data-cy":"delete-issuance",className:"delete",onClick:u})]})}Ke.propTypes={passport:v.object.isRequired,onDelete:v.func};const Es=z.span`
@@ -1,4 +1,4 @@
1
- import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cG as J,ao as V,cH as Ge,ak as h,b1 as G,a$ as Ke,s as fe,cI as be,cw as Fe,am as ge,cs as Ye,M as F,aO as Y,bW as $e,aP as $,Q as qe,bh as He,aR as Qe,cJ as Xe,cK as Je,cL as Ve,cM as Ze,c1 as he}from"./vendor-mui-core-BkVXEDpj.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-CLY4g97Q.js";import{r as b,u as et}from"./vendor-react-Dvs43sk9.js";import{a8 as O,Z as L,ap as E,X as N,aM as tt,aN as st,aD as nt,c as I,v as ot}from"./index-BWTQhZ4U.js";import{H as B,T as D,G as at,al as q,ac as rt,ad as it,D as le,L as ct}from"./vendor-ux-lckoR4gs.js";import{u as lt}from"./use-mobile-BTugf2DR.js";import{a as H,d as Ce,a1 as dt,c as pt,D as we,C as me}from"./vendor-utils-DtY42AM-.js";import{o as Be}from"./vendor-arcblock-Q5ECWsoh.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-CuvhlXtp.js";import"./index-CNHQRHA5.js";import"./index-BojVbZw0.js";import"./api-IUmhrtIY.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-rTDj0z18.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-D0iulZZE.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-DZ2X8gFe.js";import{E as Et}from"./index-EyZ2cODm.js";import{x as Tt}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-BQ6d4MgK.js";import{S as It}from"./switch-control-_r5tnNLs.js";import{C as Rt,u as Pt}from"./config-space-BbpgeOnW.js";import{L as ye}from"./list-header-DdgW2mjM.js";import"./lottie-web-4koyQiv_.js";import"./index-CGLt1oNo.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Te=b.createContext({}),{Provider:Lt,Consumer:bs}=Te;function Ie({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),T=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},K=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:T},children:t})}Ie.propTypes={children:u.any.isRequired};function U(){return b.useContext(Te)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
1
+ import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cG as J,ao as V,cH as Ge,ak as h,b1 as G,a$ as Ke,s as fe,cI as be,cw as Fe,am as ge,cs as Ye,M as F,aO as Y,bW as $e,aP as $,Q as qe,bh as He,aR as Qe,cJ as Xe,cK as Je,cL as Ve,cM as Ze,c1 as he}from"./vendor-mui-core-BkVXEDpj.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-CLY4g97Q.js";import{r as b,u as et}from"./vendor-react-Dvs43sk9.js";import{a8 as O,Z as L,ap as E,X as N,aM as tt,aN as st,aD as nt,c as I,v as ot}from"./index-Baz_CCjB.js";import{H as B,T as D,G as at,al as q,ac as rt,ad as it,D as le,L as ct}from"./vendor-ux-lckoR4gs.js";import{u as lt}from"./use-mobile-BTugf2DR.js";import{a as H,d as Ce,a1 as dt,c as pt,D as we,C as me}from"./vendor-utils-DtY42AM-.js";import{o as Be}from"./vendor-arcblock-Q5ECWsoh.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-BDRBnmHj.js";import"./index-CNHQRHA5.js";import"./index-BojVbZw0.js";import"./api-IUmhrtIY.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-CEaVtZQz.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-CceEMwLK.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-DZ2X8gFe.js";import{E as Et}from"./index-EyZ2cODm.js";import{x as Tt}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-D1YxFF8o.js";import{S as It}from"./switch-control-_r5tnNLs.js";import{C as Rt,u as Pt}from"./config-space-CZuoOQx7.js";import{L as ye}from"./list-header-DdgW2mjM.js";import"./lottie-web-4koyQiv_.js";import"./index-CGLt1oNo.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Te=b.createContext({}),{Provider:Lt,Consumer:bs}=Te;function Ie({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),T=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},K=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:T},children:t})}Ie.propTypes={children:u.any.isRequired};function U(){return b.useContext(Te)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
2
2
  `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:V[300]},{min:3,max:6,color:V[400]},{min:6,max:9,color:V[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:V[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.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:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Et,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(G,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:n="",createdAt:o}){const{t:s}=D(),r=t===I.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=I.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===I.BACKUPS.STATUS.PROGRESS&&!r,i=t===I.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:n||a,children:e.jsx(be,{children:e.jsx(Ye,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:u.string.isRequired,message:u.string,createdAt:u.string.isRequired};function ze({metadata:t={}}){const{t:n}=D();if(H(t))return e.jsx(q,{type:"success",children:n("common.succeeded")});const o=t.count||0,s=t.size||0,r=Tt(s,{iec:!0}),a=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[n("common.fileCount"),": ",o]}),e.jsxs(j,{variant:"body2",children:[n("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:n("common.succeeded")}),e.jsx(Nt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Fe,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ze.propTypes={metadata:u.object};function Oe(){const{t,locale:n}=D(),{spaceGateways:o,backups:s,backupsLoading:r}=U(),a=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:g}=s[i],m=x===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,p=x===I.BACKUPS.STATUS.SUCCEEDED&&!m,k=l||o.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return p?e.jsx(Ke,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:g,metadata:m}=d,p=l===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,k=l===I.BACKUPS.STATUS.PROGRESS&&!p,w=l===I.BACKUPS.STATUS.SUCCEEDED&&!p;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ze,{metadata:m}):e.jsx(Ae,{status:l,message:x,createdAt:g})}}}],[s,o,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",n),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Re,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(ve,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Le({spaceGateway:t,onConfirm:n=()=>{},onCancel:o=()=>{}}){const{t:s}=D(),[r,a]=b.useState(!1),[c,i]=b.useState(!1),d=(g,m)=>{g?.preventDefault(),g?.stopPropagation(),a(m)},l=async g=>{try{g?.stopPropagation(),i(!0),await n?.(t),a(!1)}catch(m){console.error(m),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(m)}`)}finally{a(!1),i(!1)}},x=g=>{d(g,!1),o?.(g)};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{color:"red",onClick:g=>d(g,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx($e,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Le.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool}).isRequired,onConfirm:u.func,onCancel:u.func};function Ue({spaceGateway:t,selected:n,onDelete:o=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=U(),[d,l]=b.useState(null),{t:x}=D(),[g,m]=b.useState(!1),p=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{m(!0),p(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}},w=async S=>{try{m(!0),p(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[g||t?.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>p(S,!0),...c,children:e.jsx(He,{})}),e.jsxs(Qe,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>p(S,!1),children:[e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!n&&r&&e.jsxs(F,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(F,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Le,{spaceGateway:t,onConfirm:async()=>{l(null),await o?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool,endpoint:u.string.isRequired,loading:u.bool}).isRequired,selected:u.bool.isRequired,enableSwitchToSpace:u.bool,onDelete:u.func,onConnect:u.func,backupInProgress:u.bool};const Wt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Me({spaceGateway:t,spaceStatus:n,selected:o,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=O(),{api:l,info:{did:x}}=L(),{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S}=De({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=U(),[_,M]=b.useState(!1),[T,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:m},i),scan:c("storage.spaces.authorize.scan",{appName:m},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=o&&!_&&n===de.DISCONNECTED,oe=o&&!_&&!t.loading&&n===de.CONNECTED,K=o&&_&&n===de.CONNECTED&&y?.progress>=0,X=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:we.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,f)=>{const A=f(C.endpoint),R=xe(A),v=C.space?f(C.space):{};if(t.did&&R!==t.did){P(Ne=>({...Ne,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:v.name??"DID Space",did:v.did??xe(A),endpoint:A};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(o&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):y.message&&a?.(new Error(y?.message),t),y.progress=0,y.message=""),M(!1),te(),se()):y.progress&&M(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:X,children:c("storage.spaces.disconnected.reconnectNow")}),K&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:T.prefix,open:T.open,popup:!0,action:T.action,baseUrl:T.baseUrl,checkFn:T.checkFn,onSuccess:ae,onClose:T.onClose,checkTimeout:T.checkTimeout,extraParams:T.extraParams,messages:T.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:ie,onConnect:X,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:K})]})}Me.propTypes={spaceGateway:u.shape({did:u.string.isRequired,name:u.string.isRequired,url:u.string.isRequired,endpoint:u.string.isRequired,protected:u.bool,loading:u.bool}).isRequired,spaceStatus:u.string.isRequired,selected:u.bool.isRequired,onConnected:u.func,onDeleted:u.func,onBackedUp:u.func};function Gt({...t}){const{t:n}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("storage.spaces.backup.records")})}),e.jsx(ve,{}),e.jsx(Oe,{})]})}function Kt({...t}){const{t:n}=D(),{autoBackup:o,updateAutoBackup:s}=U(),r=async()=>{try{const a=!o?.enabled;await s({enabled:a}),B.success(n(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(It,{checked:!!o?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:n("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Ft(){const{t}=D(),{spaceGateways:n,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=U(),r=o&&!n?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Me,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{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(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Kt,{}),e.jsx(Re,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(z,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:n.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(Gt,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:n}=U();return t?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):H(n)?e.jsx(_t,{}):e.jsx(Ft,{})}function $t(){return e.jsx(Ie,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:n,updateSpaceGateway:o,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=Pt(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:n}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:o,storageEndpoint:a})})]})}function Ht(){const{t}=D();return e.jsxs(Rt,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...n}){const{t:o,locale:s}=D(),{blocklet:r}=O(),a=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=a?"horizontal":t,x=ue(()=>{const w=[{label:o("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:o("common.storage"),value:"storage"}),w},[s,l]),m=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],p=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:m});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:p,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...n,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:m})})]})});if(l==="horizontal")return e.jsxs(h,{...n,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:m})]})}Qt.propTypes={navOrientation:u.oneOf(["vertical","horizontal"])};const pe=fe(h)`
3
3
  position: relative;
4
4
  min-height: 66vh;
@@ -1,4 +1,4 @@
1
- import{W as o,j as n,ak as f,f as y,bf as _,av as j,D as W}from"./vendor-mui-core-BkVXEDpj.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,ak as A,T as B,y as L,a8 as Y}from"./vendor-ux-lckoR4gs.js";import{aY as H,b0 as Z,b1 as P,b2 as C,k as V,b3 as G,b4 as J,b5 as K,ak as Q,b6 as N,b7 as U}from"./index-BWTQhZ4U.js";import{Y as X,I as ee,Z as ne}from"./vendor-utils-DtY42AM-.js";import{a as oe}from"./vendor-hooks-CLY4g97Q.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
1
+ import{W as o,j as n,ak as f,f as y,bf as _,av as j,D as W}from"./vendor-mui-core-BkVXEDpj.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,ak as A,T as B,y as L,a8 as Y}from"./vendor-ux-lckoR4gs.js";import{aY as H,b0 as Z,b1 as P,b2 as C,k as V,b3 as G,b4 as J,b5 as K,ak as Q,b6 as N,b7 as U}from"./index-Baz_CCjB.js";import{Y as X,I as ee,Z as ne}from"./vendor-utils-DtY42AM-.js";import{a as oe}from"./vendor-hooks-CLY4g97Q.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;