@abtnode/blocklet-services 1.16.43-beta-20250505-062139-b156e7da → 1.16.43-beta-20250507-131727-e3e5be46

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 (167) hide show
  1. package/api/middlewares/check-running.js +5 -3
  2. package/api/routes/oauth/client.js +16 -1
  3. package/api/services/auth/index.js +5 -3
  4. package/api/util/attach-shared-utils.js +5 -3
  5. package/dist/assets/{AdapterDayjs-Bxdv5BBD.js → AdapterDayjs-QizZbjYO.js} +1 -1
  6. package/dist/assets/{ArrowDropDown-CtOiDsfU.js → ArrowDropDown-CDVfAOPe.js} +1 -1
  7. package/dist/assets/{CheckCircle-msbMBqZj.js → CheckCircle-CJmQq3zs.js} +1 -1
  8. package/dist/assets/{ChevronLeft-DmV9D3fU.js → ChevronLeft-BWWdEYiT.js} +1 -1
  9. package/dist/assets/{ChevronRight-Br0ablb7.js → ChevronRight-tpAiXojW.js} +1 -1
  10. package/dist/assets/{Community-DathqRsd.js → Community-CGFOsRKB.js} +1 -1
  11. package/dist/assets/{DeleteOutline-BU7WZ4i1.js → DeleteOutline-DqdSj9ec.js} +1 -1
  12. package/dist/assets/{Done-SwUOq9KC.js → Done-DtZ1RTXT.js} +1 -1
  13. package/dist/assets/{Download-Drp0bexG.js → Download-CC6n4Puh.js} +1 -1
  14. package/dist/assets/{Edit-CFF31Js3.js → Edit-CJyJLpRB.js} +1 -1
  15. package/dist/assets/{EditIcon-DWRQ3fi6.js → EditIcon-KKx_adUe.js} +1 -1
  16. package/dist/assets/{Email-B0n6rLUZ.js → Email-CXOl4bM_.js} +1 -1
  17. package/dist/assets/{Error-2fR4-pmz.js → Error-BfFrp5Y1.js} +1 -1
  18. package/dist/assets/{ExpandLess-C2a4bF6C.js → ExpandLess-Ddif_UHH.js} +1 -1
  19. package/dist/assets/{Google-ZTmw0mlG.js → Google-DMO1DD8q.js} +1 -1
  20. package/dist/assets/{Holiday-BkY6LMfd.js → Holiday-B4FuMZHi.js} +1 -1
  21. package/dist/assets/{InfoOutlined-hS_Bn_IB.js → InfoOutlined-CoMCPk7a.js} +1 -1
  22. package/dist/assets/{Launch-BvpJnrFC.js → Launch-DNHBfbtb.js} +1 -1
  23. package/dist/assets/{LaunchOutlined-DwFeZSV7.js → LaunchOutlined-CypNgDc2.js} +1 -1
  24. package/dist/assets/{Location-BQhEvGNL.js → Location-afhZgOLn.js} +1 -1
  25. package/dist/assets/{LockIcon-Bd69pSJI.js → LockIcon-BlopdQoN.js} +1 -1
  26. package/dist/assets/{Meeting-BW-_XtSL.js → Meeting-Ct6JoGYc.js} +1 -1
  27. package/dist/assets/{MoreHoriz-DrhBbQGZ.js → MoreHoriz-D6Wvugul.js} +1 -1
  28. package/dist/assets/{OffSick-9I8vBA8l.js → OffSick-CT2gezXK.js} +1 -1
  29. package/dist/assets/{Phone-CKzC4712.js → Phone-alkdVkQC.js} +1 -1
  30. package/dist/assets/{PlayArrow-CeIK7-yb.js → PlayArrow-gSxq4eiM.js} +1 -1
  31. package/dist/assets/{QuestionMarkCircle-DpFFQWud.js → QuestionMarkCircle-DK54eXUx.js} +1 -1
  32. package/dist/assets/{ServerLogo-AfxVBRdi.js → ServerLogo-b4GZ-IpN.js} +1 -1
  33. package/dist/assets/{Timezone-C3hiNX6j.js → Timezone-6KelONy7.js} +1 -1
  34. package/dist/assets/{TuneOutlined-B-fSgZvP.js → TuneOutlined-D2mm0fk8.js} +1 -1
  35. package/dist/assets/{ViewList-CAnQTEEQ.js → ViewList-wWyYUeZC.js} +1 -1
  36. package/dist/assets/{WorkingRemotely-CHzRY2CT.js → WorkingRemotely-qYwywlWG.js} +1 -1
  37. package/dist/assets/{access-control-DygMvGXu.js → access-control-DLPO680A.js} +1 -1
  38. package/dist/assets/{actions-BEVLXA8P.js → actions-CHh4ckCh.js} +1 -1
  39. package/dist/assets/{add-component-core-BLsZRe6K.js → add-component-core-DlMKapO7.js} +2 -2
  40. package/dist/assets/{add-resource-uxj6Fg77.js → add-resource-BmnO7e2j.js} +1 -1
  41. package/dist/assets/{addon-DPxkCqqP.js → addon-CxsW-e44.js} +1 -1
  42. package/dist/assets/{advanced-RHwLVN7K.js → advanced-Bo8K0ZsY.js} +1 -1
  43. package/dist/assets/{appearance-BeAcEscd.js → appearance-BHAm7HQy.js} +1 -1
  44. package/dist/assets/{audit-logs-CPqbAeYP.js → audit-logs-CnqfBbxo.js} +1 -1
  45. package/dist/assets/{authorize-DsVtgYBZ.js → authorize-C-NJb9-z.js} +1 -1
  46. package/dist/assets/{base32-CwrkOaA2.js → base32-M2-tdl6O.js} +1 -1
  47. package/dist/assets/{branding-DtA4kERo.js → branding-DoVIYeNq.js} +2 -2
  48. package/dist/assets/{branding-D8yn967G.js → branding-HWsqjMlF.js} +1 -1
  49. package/dist/assets/{bundle-avatar-DB3E7EOv.js → bundle-avatar-Cb1gLIQK.js} +1 -1
  50. package/dist/assets/button-CO4tv2XS.js +1 -0
  51. package/dist/assets/{click-to-copy-j_gx9gFG.js → click-to-copy-BxPDzy5A.js} +1 -1
  52. package/dist/assets/{complete-ByIPtiSe.js → complete-eqvaP3jt.js} +1 -1
  53. package/dist/assets/{component-Cmj8wMD5.js → component-BWOI-XDr.js} +1 -1
  54. package/dist/assets/{config-CQRZ09xB.js → config-B4YxZsKp.js} +1 -1
  55. package/dist/assets/{config-navigation-C1Z6kyB3.js → config-navigation-_YzfelvT.js} +6 -6
  56. package/dist/assets/{config-BNKhoBDx.js → config-quCUUlRH.js} +1 -1
  57. package/dist/assets/{config-space-CcDRmzuH.js → config-space-_Rron-sL.js} +1 -1
  58. package/dist/assets/{confirm-oEG91BF3.js → confirm-BdypMD8p.js} +1 -1
  59. package/dist/assets/{connect-C9XH2QgZ.js → connect-C73ctF7v.js} +1 -1
  60. package/dist/assets/{connect-DB3ixc3c.js → connect-DpdQ5dsJ.js} +1 -1
  61. package/dist/assets/{connect-to-B_yuzVhS.js → connect-to-ClicwRFo.js} +1 -1
  62. package/dist/assets/{content-layout-C3Yd4mK9.js → content-layout-qHJyxPYq.js} +1 -1
  63. package/dist/assets/{dashboard-DyRSlDZ8.js → dashboard-BoKAftfy.js} +17 -17
  64. package/dist/assets/{delete-confirm-4a9iCk5U.js → delete-confirm-DmVgGU7R.js} +1 -1
  65. package/dist/assets/{did-address-DXsoioR-.js → did-address-CaOBKHpX.js} +1 -1
  66. package/dist/assets/{domain-CuSBV4D5.js → domain-C_re69mR.js} +1 -1
  67. package/dist/assets/{domain-action-card-BH2naaFL.js → domain-action-card-DZA2kJ9n.js} +1 -1
  68. package/dist/assets/domains-B1rKs-L0.js +1 -0
  69. package/dist/assets/{dot-WAAJ-O65.js → dot-DNqoPOFy.js} +1 -1
  70. package/dist/assets/{email-BLXsjGCd.js → email-DyqcwVW8.js} +1 -1
  71. package/dist/assets/{empty-spinner-BYUFR95o.js → empty-spinner-Bx6dYuKk.js} +1 -1
  72. package/dist/assets/{exchange-passport-xhqvffW9.js → exchange-passport-CRcpyt2h.js} +1 -1
  73. package/dist/assets/{fuel-kVR_XCvg.js → fuel-Csg8CT7E.js} +1 -1
  74. package/dist/assets/{gen-access-key-C9I6m66S.js → gen-access-key-DravbWWk.js} +1 -1
  75. package/dist/assets/{get-safe-url-DGnHBj8n.js → get-safe-url-BBjUrzRU.js} +1 -1
  76. package/dist/assets/{get-safe-url-R3dJEaue.js → get-safe-url-zHRp3aBu.js} +1 -1
  77. package/dist/assets/{home-BWQuOq0X.js → home-CM-H3jsN.js} +1 -1
  78. package/dist/assets/{iframe-CsfqLmob.js → iframe-BuwO7sH1.js} +1 -1
  79. package/dist/assets/{index-CMFOn8T3.js → index-3mcmABlM.js} +1 -1
  80. package/dist/assets/{index-DYxnn9uv.js → index-AFpdJQlM.js} +2 -2
  81. package/dist/assets/{index-WYf-xVMZ.js → index-BLdu7KNf.js} +1 -1
  82. package/dist/assets/{index-B72n4V2s.js → index-BTqduPxF.js} +1 -1
  83. package/dist/assets/{index-Bf8i5DPA.js → index-BktGjdcJ.js} +1 -1
  84. package/dist/assets/index-BmmSa8OU.js +141 -0
  85. package/dist/assets/{index-Be-8LeGB.js → index-ByRsWkxZ.js} +1 -1
  86. package/dist/assets/index-CFxMWjgx.js +6 -0
  87. package/dist/assets/{index-gw8hsltc.js → index-Cc7IEdxz.js} +1 -1
  88. package/dist/assets/{index-tf7PEogm.js → index-CoQfYWxM.js} +1 -1
  89. package/dist/assets/{index-v90LUntw.js → index-D3xXs49h.js} +4 -4
  90. package/dist/assets/{index-DIe9psLc.js → index-DF637rKa.js} +1 -1
  91. package/dist/assets/{index-DJxPLtmA.js → index-DcAi4AXo.js} +1 -1
  92. package/dist/assets/{index-aGp3zmpA.js → index-DisBCigl.js} +1 -1
  93. package/dist/assets/{index-BUHlfcy3.js → index-Dz5GK-zs.js} +1 -1
  94. package/dist/assets/{index-C2QrzzaU.js → index-PVfL4XCf.js} +1 -1
  95. package/dist/assets/{index-DMRB_27Q.js → index-cTHEQKxV.js} +5 -5
  96. package/dist/assets/{index-Bt7GP-dU.js → index-hOO84dse.js} +1 -1
  97. package/dist/assets/{index-Db1S67Mk.js → index-hv585eyH.js} +18 -18
  98. package/dist/assets/index-l3VL0wBE.js +161 -0
  99. package/dist/assets/{index-DcUWE37M.js → index-qVEdG7jc.js} +4 -4
  100. package/dist/assets/{index-CjjuFvKr.js → index-wd295lFg.js} +1 -1
  101. package/dist/assets/{invitation-UWUoMJEH.js → invitation-D-b5Vxj9.js} +1 -1
  102. package/dist/assets/{invite-CGi_9MV3.js → invite-D4vmIkpa.js} +1 -1
  103. package/dist/assets/{issue-passport-Ca9_iJlv.js → issue-passport-BeRSZdhB.js} +1 -1
  104. package/dist/assets/{item-BA9iP7co.js → item-CcTtyxW8.js} +1 -1
  105. package/dist/assets/{landing-page-Blz2w-aH.js → landing-page-xXstO1rJ.js} +1 -1
  106. package/dist/assets/{launch-result-message-B_fS-f90.js → launch-result-message-DucKBLPI.js} +1 -1
  107. package/dist/assets/{layout-DW9l-R-4.js → layout-D5imX3Tj.js} +1 -1
  108. package/dist/assets/{list-VlrLfNLt.js → list-DjGDmcyZ.js} +2 -2
  109. package/dist/assets/{list-header-8k1_C0K0.js → list-header-jygAFPJa.js} +1 -1
  110. package/dist/assets/localization-DxZ5mhWl.js +1 -0
  111. package/dist/assets/{log-CetSCivl.js → log-KrN0xsfb.js} +1 -1
  112. package/dist/assets/{logger-DXiDU1hr.js → logger-hgBwjvHi.js} +1 -1
  113. package/dist/assets/{login-pGpA2dx5.js → login-DDfBfTMB.js} +1 -1
  114. package/dist/assets/{login-oauth-callback-Cz4HDfxL.js → login-oauth-callback-BdgRJj-p.js} +1 -1
  115. package/dist/assets/{logo-uploader-hb4ghrVp.js → logo-uploader-CthNdiS0.js} +3 -3
  116. package/dist/assets/{lost-passport-BrhFEayy.js → lost-passport-a0O6SjHW.js} +1 -1
  117. package/dist/assets/{open-window-BqTbT6lB.js → open-window-D__BoNEX.js} +1 -1
  118. package/dist/assets/{overview-B3dRi3yE.js → overview-D3PLQpfp.js} +1 -1
  119. package/dist/assets/{page-header-BYtqLM5e.js → page-header-Kn6r_XKH.js} +1 -1
  120. package/dist/assets/{passport-item-FiBabn6e.js → passport-item-BqMiGQDS.js} +1 -1
  121. package/dist/assets/{permission-B0bwGXNp.js → permission-CC2IdTdZ.js} +1 -1
  122. package/dist/assets/{preferences-vpGHHPV1.js → preferences-yjK1dIpN.js} +1 -1
  123. package/dist/assets/{profile-embed-BhW6p4Xz.js → profile-embed-BwWjXkMu.js} +1 -1
  124. package/dist/assets/publish-resource-BB8z3L6t.js +1 -0
  125. package/dist/assets/{react-beautiful-dnd.esm-J_09ZTBJ.js → react-beautiful-dnd.esm-djvJS7-9.js} +1 -1
  126. package/dist/assets/{relative-time-Ca1sd_aF.js → relative-time-DTDqch3x.js} +1 -1
  127. package/dist/assets/{runtime-CS1kGNvF.js → runtime-Hly5WV5m.js} +1 -1
  128. package/dist/assets/sdk-CtDt6ZE4.js +1 -0
  129. package/dist/assets/{security-CgsJIaze.js → security-CFwMMMxT.js} +1 -1
  130. package/dist/assets/{session-B_RsakU4.js → session-C3Z84LF2.js} +1 -1
  131. package/dist/assets/{setup-Bpmp0hS9.js → setup-BCBUXGcI.js} +3 -3
  132. package/dist/assets/{shorten-label-SbKUBkvs.js → shorten-label-BhyIJhRI.js} +1 -1
  133. package/dist/assets/{simple-select-CLc0Q9sm.js → simple-select-CF7l1q3Q.js} +1 -1
  134. package/dist/assets/{slicedToArray-C0YDCVwK.js → slicedToArray-D2u5vDM0.js} +2 -2
  135. package/dist/assets/{spaces-DHRCc5pJ.js → spaces-U3nGmGRa.js} +1 -1
  136. package/dist/assets/{start-b8VtKWzD.js → start-vVDqL4CC.js} +1 -1
  137. package/dist/assets/{starting-progress-Cq6oMvtd.js → starting-progress-BhqlnMjX.js} +1 -1
  138. package/dist/assets/{status-BUWzSxch.js → status-BR44F9iR.js} +1 -1
  139. package/dist/assets/{step-actions-tjbtKF9G.js → step-actions-DZo926Ej.js} +1 -1
  140. package/dist/assets/{studio-Dt-yrfsf.js → studio-DdhbfCKD.js} +1 -1
  141. package/dist/assets/{switch-control-CYExQdC4.js → switch-control-CvOsxpit.js} +1 -1
  142. package/dist/assets/{traffic-cstjgILR.js → traffic-gSZZSuR6.js} +1 -1
  143. package/dist/assets/{transfer-Ceah-H6_.js → transfer-pYU-BKtp.js} +1 -1
  144. package/dist/assets/{unsubscribe-DqbdiPdh.js → unsubscribe-DFl72cqo.js} +1 -1
  145. package/dist/assets/{use-blocklet-logo-ZrVs0Fgp.js → use-blocklet-logo-32yq4Y7I.js} +1 -1
  146. package/dist/assets/{use-mobile-BKvZ6hcv.js → use-mobile-DbhbAmWG.js} +1 -1
  147. package/dist/assets/{use-mobile-BNUwcWCH.js → use-mobile-fdqINXKQ.js} +1 -1
  148. package/dist/assets/{useLocalStorage-B_V0diy4.js → useLocalStorage-vveKfojd.js} +1 -1
  149. package/dist/assets/{user-center-BNt97_Oy.js → user-center-D1PJXvUz.js} +1 -1
  150. package/dist/assets/{util-CxKY-YuQ.js → util-BXETl5KI.js} +1 -1
  151. package/dist/assets/{util-DmIsJ5RI.js → util-sIStv7W9.js} +1 -1
  152. package/dist/assets/{vendor-arcblock-DpCuGvAS.js → vendor-arcblock-TgIfa3ko.js} +4 -4
  153. package/dist/assets/{vendor-mui-core-B6POpIBB.js → vendor-mui-core-BKQDHvL6.js} +17 -17
  154. package/dist/assets/{vendor-mui-x-CATHW1QL.js → vendor-mui-x-Db_Ss6fv.js} +1 -1
  155. package/dist/assets/{vendor-ux-did-connect-CeGz2B7G.js → vendor-ux-did-connect-Dr2W2Pc9.js} +1 -1
  156. package/dist/assets/{wrap-locale-DcoOFDfm.js → wrap-locale-B29V1TgE.js} +1 -1
  157. package/dist/index.html +4 -4
  158. package/dist/service-worker.js +1 -1
  159. package/package.json +36 -36
  160. package/dist/assets/button-Cd9-2VCv.js +0 -1
  161. package/dist/assets/domains-BSI91pSw.js +0 -1
  162. package/dist/assets/index-D10IrMQr.js +0 -137
  163. package/dist/assets/index-DQ5v58Z8.js +0 -192
  164. package/dist/assets/index-bodAuphN.js +0 -6
  165. package/dist/assets/localization-CtfwjqIp.js +0 -1
  166. package/dist/assets/publish-resource-8ginQRUx.js +0 -1
  167. package/dist/assets/sdk-DGCdjl0b.js +0 -1
@@ -1,137 +0,0 @@
1
- import{u as q,a2 as z,bQ as K,I as be,bR as ge,a4 as fe,ab as je,bx as ye}from"./vendor-ux-did-connect-CeGz2B7G.js";import{t as we,m as de,j as ke}from"./vendor-hooks-DXGUREV9.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-hS_Bn_IB.js";import{z as F,E as ve,F as Y,C as ce,t as Ee}from"./index-DMRB_27Q.js";import{u as N}from"./dashboard-DyRSlDZ8.js";import{H as o,j as e,D as Ce,aj as Te,t as Se,aa as g,O as ie,T as S,ab as U,ak as ee,z as Re,y as B,bt as le,bS as V,ad as W,L as Q,A as G,be as Ie,E as A,I as _,C as Me,br as Pe,al as P,ch as De,X as $e,bd as J,bq as ze,b5 as We,ci as Ae,cj as Oe,b6 as qe,an as Le,c1 as Be,s as pe,v as He,ck as Fe,cl as Ne,cm as Ue,cn as _e,co as Ke}from"./vendor-mui-core-B6POpIBB.js";import{q as Ye}from"./vendor-arcblock-DpCuGvAS.js";import{d as Ve}from"./ExpandLess-C2a4bF6C.js";import{b as ue,z as Je,A as Qe}from"./vendor-utils-CjMBJT5V.js";import{C as Ge}from"./confirm-oEG91BF3.js";import{A as Xe}from"./actions-BEVLXA8P.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-B_V0diy4.js";import"./PlayArrow-CeIK7-yb.js";import"./get-safe-url-DGnHBj8n.js";import"./format-error-BrmqJs5a.js";import"./session-B_RsakU4.js";import"./use-blocklet-logo-ZrVs0Fgp.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./MoreHoriz-DrhBbQGZ.js";const Ze=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:s}=ce(),l=(y=(j=s==null?void 0:s.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const x={};return d&&(d.sources.forEach(r=>{x[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{x[r.source]&&(x[r.source].events.push(r),x[r.source].count+=1)})),x},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(x){p(x instanceof Error?x:new Error(String(x)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),s=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:f}])=>{const E=f.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(s).reduce((r,w)=>r+w,0),[s]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(f=>({...f,[w]:!f[w]}))},y=(r,w)=>{const f={};r.forEach(E=>{const u=`${E.type}-${E.source}`;f[u]=!w}),c(E=>({...E,...f}))},x=r=>{const w={};Object.values(t).forEach(({events:f})=>{f.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:x,checked:l>0&&l===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:f,count:E}],u)=>{const M=s[r]>0,i=s[r]===f.length&&f.length>0,h=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:n})=>u<Object.keys(t).length-1?`1px solid ${n.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:n=>{n.target.closest(".MuiFormControlLabel-root")||T(r,n)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:f.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:n=>{n.stopPropagation(),y(f,i)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Ie,{src:w.logo,sx:{width:24,height:24}}),e.jsx(g,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:s[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:n=>`${n.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),f.length>0&&e.jsx(_,{size:"small",edge:"end",children:h?e.jsx(Ve,{}):e.jsx(Ye,{})})]})]})}),f.length>0&&e.jsx(Me,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:f.map(n=>{const m=`${n.type}-${n.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(n),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:n.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:n.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Pe,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var n;const{t:p}=q(),[s,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:x}=Ze(),{control:r,handleSubmit:w,formState:{errors:f},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(s).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[s,u,M]);const i=()=>{l({}),E(),R()},h=async m=>{const k=Object.keys(s).filter(I=>s[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[O,L]=I.split("-");return!O||!L?null:{type:O,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ce,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(h),children:[e.jsx(Te,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Se,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Y,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!f.url,helperText:(k=f.url)==null?void 0:k.message})}}),e.jsx(Y,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!f.description,helperText:(k=f.description)==null?void 0:k.message})}}),e.jsx(Y,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&x&&Object.keys(x).length>0&&e.jsx(te,{eventsBySource:x,selectedEvents:s,setSelectedEvents:l,error:(n=f.selectedEvents)==null?void 0:n.message}),!j&&(!x||Object.keys(x).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Re,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function xe(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const et=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?Ee(t).locale(et(c)).format(d):"-"}function tt(t){return typeof t=="number"?!1:ue(t)}function ot(t){return t>=200&&t<300}function $(t){const d=tt(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(De,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx($e,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};$.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=F(),{t:b}=q(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:s,loadMore:l,loadingMore:v,loading:T}=we(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(s==null?void 0:s.list)||[],[y,x]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,y]);const w=u=>{x(u)};if(T)return e.jsx(U,{});const f=s&&s.list.length<s.paging.total,E=u=>{var M,i,h,n,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((h=u.responseBody)!=null&&h.agentId)){const k=(m=(n=p==null?void 0:p.site)==null?void 0:n.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(O=>{var L;return((L=O==null?void 0:O.meta)==null?void 0:L.name)==="ai-studio"}),I=Je(Qe(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(g,{component:be,icon:ge})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:ot(i.responseStatus)===!1?e.jsx(Ae,{color:"error"}):e.jsx(Oe,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),f&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(g,{children:E(y)})]}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function he({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:s}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=s==null?void 0:s.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(g,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(W,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Be,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:l.status,color:xe(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(x=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:x==null?void 0:x.type},x))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}he.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx(Le,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(he,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:s}=q(),l=He(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:s,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(je)`
2
- .MuiPaper-root {
3
- border-radius: 8px;
4
- overflow: hidden;
5
- }
6
- table.MuiTable-root {
7
- outline: 1px solid ${({theme:t})=>t.palette.divider};
8
- border-radius: var(--radius-m, 8px);
9
- overflow: hidden;
10
- }
11
- [class*='MUIDataTable-responsiveBase'] {
12
- outline: 1px solid ${({theme:t})=>t.palette.divider};
13
- border-radius: var(--radius-m, 8px);
14
- }
15
-
16
- th.MuiTableCell-head {
17
- padding: 8px 16px 8px 16px;
18
- text-transform: inherit;
19
- border-bottom: none;
20
- &:first-of-type {
21
- border-top-left-radius: 8px;
22
- padding-left: 20px;
23
- }
24
- &:last-of-type {
25
- border-top-right-radius: 8px;
26
- }
27
- }
28
-
29
- tr.MuiTableRow-root:not(.MuiTableRow-footer):hover {
30
- background: ${({theme:t})=>t.palette.grey[100]};
31
- }
32
- tr.MuiTableRow-root:last-of-type td:first-of-type {
33
- border-bottom-left-radius: 8px;
34
- }
35
-
36
- tr.MuiTableRow-root:last-of-type td:last-of-type {
37
- border-bottom-right-radius: 8px;
38
- }
39
-
40
- tr.MuiTableRow-root:nth-of-type(even) {
41
- background: ${({theme:t})=>t.palette.grey[50]};
42
- }
43
- td.MuiTableCell-root {
44
- border-bottom: none;
45
- padding-top: 12px;
46
- padding-bottom: 12px;
47
- padding-left: 16px;
48
- padding-right: 16px;
49
- &:first-of-type {
50
- padding-left: 20px;
51
- }
52
- &.MuiTableCell-footer {
53
- border: none;
54
- }
55
- }
56
-
57
- .datatable-footer {
58
- .MuiTableRow-root.MuiTableRow-footer {
59
- border: none;
60
- }
61
- table.MuiTable-root {
62
- outline: none;
63
- overflow: hidden;
64
- }
65
- .MuiTablePagination-input {
66
- background: none;
67
- }
68
- div.MuiSelect-select {
69
- padding: 0 24px 0 0;
70
- }
71
- }
72
-
73
- th a,
74
- td a {
75
- text-decoration: none;
76
- display: block;
77
- color: inherit;
78
- &:first-of-type {
79
- padding-left: 0;
80
- }
81
- }
82
-
83
- > div {
84
- overflow: auto;
85
- }
86
- .custom-toobar-title-inner {
87
- display: flex;
88
- align-items: center;
89
- }
90
- @media (max-width: ${({theme:t})=>t.breakpoints.values.md}px) {
91
- th a,
92
- td a {
93
- text-decoration: none;
94
- display: block;
95
- color: inherit;
96
- padding-top: 0;
97
- padding-bottom: 0;
98
- padding-right: 0;
99
- }
100
- tr.MuiTableRow-root {
101
- border: none;
102
- padding: 20px;
103
- display: block;
104
- }
105
- td.MuiTableCell-root:first-of-type {
106
- padding-left: 0;
107
- margin-top: 0;
108
- }
109
- td.MuiTableCell-root {
110
- margin: 0;
111
- margin-top: 8px;
112
- align-items: center;
113
- padding: 0;
114
- flex-wrap: wrap;
115
- flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
116
- align-items: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"center"};
117
- justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"space-between"};
118
- }
119
- td.MuiTableCell-root > div {
120
- margin-bottom: 4px;
121
- }
122
- .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
123
- display: flex;
124
- flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
125
- align-items: flex-start;
126
- justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"space-between":"flex-start"};
127
- flex-wrap: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"nowrap":"wrap"};
128
- word-break: break-all;
129
- &.datatables-noprint {
130
- justify-content: center;
131
- }
132
- }
133
- [class*='MUIDataTable-responsiveBase'] tr:not([class*='responsiveSimple']) td.MuiTableCell-body > div {
134
- width: inherit;
135
- }
136
- }
137
- `,it=re;function Pt(){const{teamDid:t}=N(),d=`webhook-endpoints-${t}`,c=ye(d),{t:a}=q(),{api:b}=F(),[R,p]=C.useState(""),[s,l]=C.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[v,T]=ke(d,{defaultValue:{pageSize:c.rowsPerPage||20,page:c.page?c.page+1:1}}),{loading:j,error:y,data:x,refresh:r}=de(()=>b.getWebhookEndpoints({input:{teamDid:t,paging:{page:v.page,pageSize:v.pageSize}}}));C.useEffect(()=>{r()},[v,r]);const w=C.useCallback(async(i,h)=>{try{await b.updateWebhookEndpoint({input:{teamDid:t,id:i.id,data:{status:h?"disabled":"enabled"}}}),r(),z.success(`${a(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${a("webhookEndpoint.success")}`)}catch(n){z.error(n==null?void 0:n.message)}},[b,t,r,a]),f=C.useCallback(async i=>{try{await b.deleteWebhookEndpoint({input:{teamDid:t,id:i}}),r(),l(h=>({...h,deleteConfirm:null})),z.success(`${a("common.delete")}${a("webhookEndpoint.success")}`)}catch(h){z.error(h==null?void 0:h.message)}},[b,t,r,a]),E=(i,h)=>{let n=i.page+1;const m=i.searchText||"";if(m!==R){p(m);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(n=1);const k={page:n,pageSize:i.rowsPerPage};p(""),T(k)}};if(y)return e.jsx(ee,{severity:"error",children:y.message});if(j||!x)return e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500,children:e.jsx(U,{})});const u=((x==null?void 0:x.list)||[]).filter(i=>{if(!R)return!0;const h=R.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),M=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(S,{variant:"body2",children:n.description}),e.jsx(g,{sx:{display:"flex"},onClick:m=>{m.stopPropagation()},children:e.jsx(W,{title:n.url,children:e.jsx(Z,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:n.enabledEvents.map(m=>e.jsx(A,{size:"small",variant:"filled",label:m.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${n.source}-${m.type}`))})}}},{label:a("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsx(A,{size:"small",variant:"filled",label:a(`webhookEndpoint.${n==null?void 0:n.status}`),color:xe(n==null?void 0:n.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${n.status}`)}}},{label:a("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:a("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const n=u[h],m=(n==null?void 0:n.status)==="enabled";return e.jsx(Xe,{actions:[{icon:m?e.jsx(Fe,{}):e.jsx(Ne,{}),text:a(m?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:k=>{k.stopPropagation(),w(n,m)}},{icon:e.jsx(Ue,{}),text:a("common.edit"),onClick:k=>{k.stopPropagation(),l(D=>({...D,createEdit:{open:!0,id:n.id,url:n.url,description:n.description,enabledEvents:n.enabledEvents}}))}},{icon:e.jsx(_e,{}),text:a("common.delete"),onClick:k=>{k.stopPropagation(),l(D=>({...D,deleteConfirm:{title:a("webhookEndpoint.deleteWebhook.title"),description:a("webhookEndpoint.deleteWebhook.description"),confirm:a("common.confirm"),cancel:a("common.cancel"),onConfirm:()=>f(n.id),onCancel:()=>l(I=>({...I,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(e.Fragment,{children:[e.jsx(it,{durable:d,durableKeys:["page","rowsPerPage"],data:u,columns:M,options:{count:x.count,page:v.page-1,rowsPerPage:v.pageSize,customToolbar:()=>e.jsx(_,{onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:e.jsx(Ke,{})},"add"),onRowClick:(i,{dataIndex:h})=>{const n=x.list[h];l(m=>({...m,webhookDetail:{open:!0,id:n.id}}))}},loading:j,onChange:E,title:e.jsx(S,{variant:"h6",children:a("webhookEndpoint.title")}),emptyNodeText:e.jsxs(P,{gap:1,children:[a("webhookEndpoint.noWebhooksAdded"),e.jsx(B,{variant:"contained",color:"primary",onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:a("webhookEndpoint.createWebhook")})]})}),s.webhookDetail.open&&e.jsx(me,{open:!0,onClose:()=>l(i=>({...i,webhookDetail:{open:!1,id:null}})),id:s.webhookDetail.id}),s.createEdit.open&&e.jsx(oe,{onSubmit:r,...s.createEdit,onClose:()=>l(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),s.deleteConfirm&&e.jsx(Ge,{title:s.deleteConfirm.title,description:s.deleteConfirm.description,confirm:s.deleteConfirm.confirm,cancel:s.deleteConfirm.cancel,params:s.deleteConfirm.params,onConfirm:s.deleteConfirm.onConfirm,onCancel:s.deleteConfirm.onCancel})]})}export{Pt as default};
@@ -1,192 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-D2t-u0YU.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
2
- import{j as e,aa as n,bd as g,T as S,O as U,bv as q,bt as H,bw as J,cJ as E,y as T,ah as I,ai as M,cn as W,dA as X,dB as K,I as Y,dC as Q,e as Z,c1 as ee}from"./vendor-mui-core-B6POpIBB.js";import{r as b}from"./vendor-react-DEoibe3W.js";import{H as te,a as L,e as re,i as oe,b as ie}from"./vendor-hooks-DXGUREV9.js";import{T as ae,bw as se}from"./vendor-ux-did-connect-CeGz2B7G.js";import{_}from"./vendor-arcblock-DpCuGvAS.js";import{aO as ne}from"./vendor-utils-CjMBJT5V.js";import{getAIKitComponent as le}from"./index-Db1S67Mk.js";import"./lottie-web-jYmAQWuC.js";import"./index-DODYa3Im.js";import"./index-DMRB_27Q.js";import"./index-DVQCgvFb.js";const N=b.createContext({}),B=()=>b.useContext(N);function de({children:t,restrictions:c,i18n:s,theme:i}){const[l,f]=te({loading:!1}),u=a=>f(j=>({...j,loading:a})),x=b.useMemo(()=>({...l,onLoading:u,restrictions:c,i18n:s}),[l]);return e.jsx(ae,{theme:i,children:e.jsx(N.Provider,{value:x,children:t})})}const ce=["1024x1024","1024x1792","1792x1024"],ue=["256x256","512x512","1024x1024"],xe=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function me({onSubmit:t}){const{loading:c,i18n:s}=B(),i=L({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),l=()=>{const a=JSON.parse(JSON.stringify(i));Object.values(i).every(y=>!!y)&&t(a)},{run:f}=re(l,{wait:500}),u={width:"100%",pl:"12px",pr:"16px"},x=i.model==="dall-e-2"?ue:ce;return e.jsxs(pe,{onSubmit:a=>a.preventDefault(),children:[e.jsx(n,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(g,{container:!0,gap:2.5,children:[e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",children:s("aiImagePrompt")}),e.jsx(U,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:i.prompt??"",onChange:a=>{a.stopPropagation(),i.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",children:`${s("aiImageModel")}`}),e.jsx(q,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px"}},value:i.model,onChange:a=>{i.number=1,i.size="1024x1024",i.model=a.target.value},children:xe.map(a=>e.jsx(H,{value:a.value,control:e.jsx(J,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",children:`${s("aiImageSize")}: ${i.size}`}),e.jsx(g,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(n,{flex:1,children:e.jsx(n,{...u,children:e.jsx(E,{size:"small",min:0,max:x.length-1,step:1,value:x.findIndex(a=>a==i.size),onChange:(a,j)=>{i.size=x[j]}})})})})]}),i.model==="dall-e-2"&&e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",children:`${s("aiImageNumber")}: ${i.number}`}),e.jsx(n,{...u,children:e.jsx(E,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:i.number,onChange:(a,j)=>{a.stopPropagation(),i.number=Number(j)}})})]})]})}),e.jsx(T,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:f,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const pe=I(n)`
3
- display: flex;
4
- flex-direction: column;
5
- height: 100%;
6
- overflow: hidden;
7
-
8
- .title {
9
- padding: 0 0 4px 1px;
10
- }
11
-
12
- .label {
13
- font-weight: 500;
14
- font-size: 15px;
15
- line-height: 100%;
16
- margin: 0;
17
- word-wrap: break-word;
18
- text-align: left;
19
- }
20
-
21
- .submit-ai {
22
- height: 40px;
23
- background: linear-gradient(90deg, #45e4fa 0%, #8a45fa 52.08%, #fa45bc 100%);
24
- color: #fff;
25
- border-radius: 30px;
26
- box-shadow: none;
27
- text-transform: none;
28
-
29
- &.Mui-disabled {
30
- color: rgba(0, 0, 0, 0.26) !important;
31
- background: rgba(0, 0, 0, 0.12) !important;
32
- }
33
- }
34
-
35
- .MuiFormHelperText-root {
36
- font-style: normal;
37
- font-weight: 500;
38
- font-size: 12px;
39
- line-height: 14px;
40
- color: #9397a1;
41
- margin: 0;
42
- margin-top: 4px;
43
- }
44
-
45
- .MuiOutlinedInput-root {
46
- background: #fbfbfb;
47
- border-radius: 4px;
48
- padding: 0;
49
-
50
- textarea {
51
- padding: 8.5px 14px;
52
- }
53
-
54
- fieldset {
55
- border: 1px solid #f6f6f6;
56
- }
57
-
58
- &:hover fieldset {
59
- border: 1px solid #a482fe;
60
- }
61
- }
62
-
63
- .Mui-focused {
64
- &.MuiFormLabel-root {
65
- color: #a482fe;
66
- }
67
-
68
- &.MuiOutlinedInput-root {
69
- fieldset {
70
- border: 1px solid #a482fe;
71
- }
72
- }
73
- }
74
-
75
- .Mui-error {
76
- &.MuiFormLabel-root {
77
- color: #f16e6e;
78
- }
79
-
80
- &.MuiOutlinedInput-root + .MuiFormHelperText-root {
81
- color: #f16e6e;
82
- }
83
-
84
- &.MuiOutlinedInput-root {
85
- fieldset {
86
- border: 1px solid #f16e6e;
87
- }
88
- }
89
- }
90
- `,fe=({onDelete:t,selected:c,onLoad:s,src:i,alt:l,...f})=>{const u=L({loading:!0});return e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{className:"lazy-image-wrapper",style:{visibility:u.loading?"hidden":"visible",background:"#f4f4f4",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("img",{alt:l,src:i,...f,onLoad:()=>{u.loading=!1;try{s==null||s()}catch(x){console.error("image onLoad error: ",x)}},loading:"eager"})}),u.loading&&e.jsx(M,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{position:"absolute",top:0}}),e.jsx(ge,{onClick:()=>t(i),sx:{position:"absolute",left:10,bottom:10},children:e.jsx(W,{sx:{fontSize:20}})}),l&&e.jsxs(he,{unstyled:!0,tip:l,sx:{position:"absolute",right:10,bottom:10,fontSize:14,width:"calc(100% - 20px - 10px - 36px)",display:"flex",alignItems:"center"},arrow:!0,tipPlacement:"top",PopperProps:{disablePortal:!0},children:[e.jsx(X,{sx:{fontSize:20,mr:.5}}),e.jsx(S,{sx:{fontSize:14,overflowX:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l})]}),e.jsx(n,{sx:{position:"absolute",right:8,top:8},onClick:f==null?void 0:f.onClick,children:c?e.jsx(be,{sx:{fontSize:30}}):e.jsx(K,{sx:{fontSize:30,color:"#fff"}})})]})},he=I(se)`
91
- height: 36px;
92
- padding: 8px;
93
- background: rgba(0, 0, 0, 0.42);
94
- color: #f7f8f8;
95
- display: flex;
96
- justify-content: center;
97
- align-items: center;
98
- border-radius: 6px;
99
- color: #fff;
100
- transition: all 0.3s;
101
-
102
- &:hover {
103
- background: rgba(0, 0, 0, 0.69);
104
- }
105
- `,ge=I(Y)`
106
- height: 36px;
107
- width: 36px;
108
- padding: 0;
109
- background: rgba(0, 0, 0, 0.42);
110
- color: #f7f8f8;
111
- display: flex;
112
- justify-content: center;
113
- align-items: center;
114
- border-radius: 6px;
115
- transition: all 0.3s;
116
-
117
- &:hover {
118
- background: rgba(0, 0, 0, 0.69);
119
- }
120
- `,be=I(Q)`
121
- & path:first-of-type {
122
- fill: ${({theme:t})=>{var c,s;return((s=(c=t.palette)==null?void 0:c.primary)==null?void 0:s.main)||"#1976d2"}};
123
- opacity: 1;
124
- }
125
- & path:last-child {
126
- fill: white;
127
- }
128
- `,je=b.lazy(()=>_(()=>import("./lottie-react.esm-D2t-u0YU.js"),__vite__mapDeps([0,1])).then(t=>({default:t.Player})));function R({src:t}){return e.jsx(je,{src:t,loop:!0,autoplay:!0})}function ye({options:t,handleApi:c,onSelect:s,onFinish:i,onClose:l,isMobile:f}){const{loading:u,onLoading:x,restrictions:a,i18n:j}=B(),[d,y]=b.useState([]),[m,k]=b.useState(),P=Z(),z=a==null?void 0:a.maxNumberOfFiles,[h,A]=b.useState({}),p=L({}),O=Object.keys(p).filter(r=>p[r]),F={xs:6,sm:6};b.useEffect(()=>{m&&!h.error&&_(()=>import("./lottie-error-CMOXHtBH.js"),[]).then(r=>{A(o=>({...o,error:r.default}))}),t&&!d.length&&!h.loading&&_(()=>import("./lottie-loading-o-GBrhM9.js"),[]).then(r=>{A(o=>({...o,loading:r.default}))}),!t&&!h.welcome&&_(()=>import("./lottie-welcome-C9B95FIi.js"),[]).then(r=>{A(o=>({...o,welcome:r.default}))})},[m,t,d.length,h]),oe(async()=>{var r;if(t){k(void 0),x(!0);try{const o=await c({...t,responseFormat:"b64_json"});if(o.data){const w=(o.data||[]).map(C=>({src:`data:image/png;base64,${C.b64Json||C.b64_json}`,width:t.size?Number((t.size||"").split("x")[0]):1024,alt:t.prompt}));y(d?[...w,...d]:w)}else k(o)}catch(o){console.error("AIImage generate error: ",o),k(((r=o==null?void 0:o.response)==null?void 0:r.data)||o)}finally{x(!1),i()}}},[t==null?void 0:t.number,t==null?void 0:t.prompt,t==null?void 0:t.size]);const D=r=>{const o=Object.keys(p).filter(w=>p[w]);if(z?o.length<z:!0)p[r]?p[r]=!1:p[r]=!0;else{const w=o.pop();w!==r&&(p[w]=!1),p[r]=!p[r]}},$=r=>{if(d){const o=d.findIndex(v=>v.src===r);o>-1&&(p[r]=!1,d.splice(o,1),y([...d]))}},V=()=>{var o,v;const r={width:((o=document.querySelector(".photo-item img"))==null?void 0:o.offsetWidth)||0,height:((v=document.querySelector(".photo-item img"))==null?void 0:v.offsetHeight)||0};return e.jsx(e.Fragment,{children:Array.from({length:(t==null?void 0:t.number)||1}).map((w,C)=>b.createElement(g,{item:!0,...F,key:C},e.jsx(M,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...r}})))})},G=()=>m?e.jsxs(n,{width:300,height:300,m:"auto",children:[h.error&&e.jsx(R,{src:h.error},"error"),e.jsx(n,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:m==null?void 0:m.message})]}):d&&Array.isArray(d)&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n,{flexGrow:1,sx:{height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ve,{sx:f?{p:0,border:"none !important"}:{p:2},children:e.jsxs(g,{spacing:2,container:!0,className:"photo-wrapper",children:[u&&e.jsx(V,{}),d.map((r,o)=>b.createElement(g,{item:!0,...F,key:r.src,className:"photo-item"},e.jsx(fe,{...r,selected:p[r.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:p[r.src]?`2px solid ${P.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{D(r.src)},onDelete:()=>{$(r.src)}})))]})})}),e.jsxs(n,{sx:{mt:2,display:"flex",justifyContent:l?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[l&&typeof l=="function"&&e.jsx(T,{color:"primary",variant:"outlined",onClick:l,children:e.jsx(ee,{})}),e.jsx(T,{color:"primary",variant:"contained",disabled:!O.length||u,onClick:()=>{const r=ne(d,"src");s(O.map(o=>r[o]))},children:O.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):t?e.jsx(n,{width:220,height:220,m:"auto",children:h.loading&&e.jsx(R,{src:h.loading},"loading")}):e.jsx(n,{width:300,height:300,m:"auto",children:h.welcome&&e.jsx(R,{src:h.welcome},"welcome")});return e.jsx(we,{children:G()})}const we=I(n)`
129
- min-height: 100%;
130
- display: flex;
131
- flex-direction: column;
132
-
133
- .lazy-image-wrapper {
134
- border-radius: 12px;
135
-
136
- img {
137
- border-radius: 12px;
138
- }
139
- }
140
-
141
- .tips {
142
- overflow: hidden;
143
- display: -webkit-box;
144
- -webkit-box-orient: vertical;
145
- -webkit-line-clamp: 3;
146
- }
147
- `,ve=I(n)`
148
- display: flex;
149
- flex-direction: column;
150
- background: #fbfbfb;
151
- border: 1px solid #f6f6f6;
152
- border-radius: 12px;
153
- min-height: 100%;
154
-
155
- &:has(.Mui-focused) {
156
- border: 1px solid #a482fe;
157
- }
158
-
159
- > .input {
160
- padding: 12px;
161
- font-weight: 500;
162
- font-size: 16px;
163
- line-height: 19px;
164
- color: #25292f;
165
- }
166
-
167
- > .footer {
168
- display: flex;
169
- align-items: center;
170
- justify-content: flex-end;
171
- padding: 0 12px 12px;
172
-
173
- > .counter {
174
- flex: 1;
175
- overflow: hidden;
176
- text-overflow: ellipsis;
177
- white-space: nowrap;
178
- font-weight: 400;
179
- font-size: 12px;
180
- line-height: 14px;
181
- color: #9397a1;
182
- }
183
-
184
- > .copy {
185
- height: 25px;
186
- width: 25px;
187
- min-width: 0;
188
- padding: 0;
189
- color: #9397a1;
190
- }
191
- }
192
- `;function Le({onSelect:t,api:c,restrictions:s,i18n:i,theme:l}){const[f,u]=b.useState(),[x,a]=b.useState(!1),j=()=>u(void 0),d=()=>a(!1),y=ie(document.body);let m=!!(y&&y.width<768);if(!le())return e.jsx(n,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center",children:i("aiKitRequired")});const k=!m||m&&!x,P=!m||m&&x,z=m?d:!1;return e.jsx(de,{restrictions:s,i18n:i,theme:l,children:e.jsx(n,{sx:{display:"flex",width:"100%",height:"100%",bgcolor:"#fff"},children:e.jsxs(g,{container:!0,sx:{flexGrow:1,height:"100%"},children:[e.jsx(g,{item:!0,xs:12,sm:4,sx:{borderRight:{sm:"1px solid #eee"},display:k?"unset":"none"},children:e.jsx(n,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:e.jsx(me,{onSubmit:(...h)=>{a(!0),u(...h)}})})}),e.jsx(g,{item:!0,xs:12,sm:8,sx:{height:"100%",overflow:"hidden",p:2,display:P?"unset":"none"},children:e.jsx(ye,{isMobile:m,options:f,handleApi:c,onSelect:t,onFinish:j,onClose:z})})]})})})}export{Le as default};
@@ -1,6 +0,0 @@
1
- import{j as e,H as f,ah as _e,T as C,ab as w,e as $e,cG as _,ae as $,cH as et,aa as g,al as J,s as Se,ad as je,ap as tt,cI as Le,a9 as ye,q as K,b5 as V,b6 as G,y as st,aq as ot,bd as Oe}from"./vendor-mui-core-B6POpIBB.js";import{m as nt,i as Me,f as he}from"./vendor-hooks-DXGUREV9.js";import{r as y,h as at}from"./vendor-react-DEoibe3W.js";import{c as F,Q as rt,a5 as it,Z as ct,a6 as lt,w as dt,a7 as pe,P as pt}from"./vendor-arcblock-DpCuGvAS.js";import{a2 as k,u as E,b5 as ut,n as T,ba as W,ab as mt,r as Ce,bu as ht,a as ue,as as ft,G as Fe,av as gt}from"./vendor-ux-did-connect-CeGz2B7G.js";import{C as O,z,t as v,a2 as xt,ae as St,ax as jt}from"./index-DMRB_27Q.js";import{u as yt}from"./use-mobile-BKvZ6hcv.js";import{b as Y,d as ze,a6 as Ct,I as At,E as Pe,A as fe}from"./vendor-utils-CjMBJT5V.js";import"./api-Bf1onQOz.js";import{u as Ne,C as Bt,D as bt,a as kt}from"./connect-to-B_yuzVhS.js";import{b as It,c as vt,d as Et,i as Rt,e as ge,f as Tt,h as Dt,j as wt}from"./spaces-DHRCc5pJ.js";import{f as X}from"./format-error-BrmqJs5a.js";import{I as Ot}from"./index-aGp3zmpA.js";import{R as Ut}from"./index--MMFwLMX.js";import{d as Lt}from"./MoreHoriz-DrhBbQGZ.js";import{b as Mt}from"./dashboard-DyRSlDZ8.js";import{d as Ft}from"./DeleteOutline-BU7WZ4i1.js";import{g as Ue}from"./get-safe-url-DGnHBj8n.js";import{S as zt}from"./switch-control-CYExQdC4.js";import{L as xe}from"./list-header-8k1_C0K0.js";import{C as Pt,u as Nt}from"./config-space-CcDRmzuH.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-B_V0diy4.js";import"./confirm-oEG91BF3.js";import"./PlayArrow-CeIK7-yb.js";import"./session-B_RsakU4.js";import"./use-blocklet-logo-ZrVs0Fgp.js";import"./InfoOutlined-hS_Bn_IB.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";async function Jt({blockletDid:t,nodeApi:a,spaceGateways:n}){let s=!1;const r=await Promise.all(n.map(async o=>{let{name:i}=o;const l=await It(o.endpoint);return!Y(l)&&l!==i&&(i=l,s=!0),{...o,name:i}}));return s&&await Promise.all(r.filter(o=>o.did).map(o=>a.updateBlockletSpaceGateway({input:{did:t,where:{did:o.did},spaceGateway:{...o}}}))),r}function Qt({refresh:t}={}){var r;const{blocklet:a}=O(),n=(r=a==null?void 0:a.meta)==null?void 0:r.did,{api:s}=z();return nt(async()=>{if(!n)return[];const{spaceGateways:o}=await s.getBlockletSpaceGateways({input:{did:n}});return await Jt({blockletDid:n,nodeApi:s,spaceGateways:o})??[]},{refreshDeps:[n,t],onError(o){var i;(i=o==null?void 0:o.message)!=null&&i.includes("not logged")?console.warn(o):(console.error(o),k.error(X(o)))}})}function Je({deps:t,setLoading:a,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[r,o]=y.useState([]),{api:i}=z(),[l,p]=y.useMemo(()=>n?[v(n).startOf("day").toISOString(),v(n).endOf("day").toISOString()]:[v().startOf("year").toISOString(),v().endOf("day").toISOString()],[n]),c=ze(async()=>{try{if(a(!0),!s){o([]);return}const{backups:u}=await i.getBlockletBackups({input:{did:s.meta.did,startTime:l,endTime:p}});o(u??[])}catch(u){console.error(u),k.error(X(u))}finally{a(!1)}},1e3);return Me(async()=>{c()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:r}}function Zt({appDid:t}){const{backups:a}=Je(),[n,s]=y.useState({message:"",progress:0,completed:!1}),r=z(),{ws:{useSubscription:o}}=r;return o(F.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&s(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(a!=null&&a.length&&Ct((i=a[0])==null?void 0:i.status)){const[l]=a;s(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[a]),n}function Ht({deps:t=[],setLoading:a=()=>{}}={}){var l;const{blocklet:n}=O(),[s,r]=y.useState([]),{api:o}=z(),i=y.useCallback(ze(async()=>{var p;if(!o||!((p=n==null?void 0:n.meta)!=null&&p.did)){r([]);return}try{a(!0);const c=v(),x=c.subtract(1,"year"),{summary:u}=await o.getBlockletBackupSummary({input:{did:n.meta.did,startTime:x.toISOString(),endTime:c.toISOString()}});r(Array.isArray(u)?u:[])}catch(c){console.error("Failed to fetch backup summary:",c),k.error(X(c)),r([])}finally{a(!1)}},1e3),[]);return Me(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:s}}const Qe=y.createContext({}),{Provider:Kt,Consumer:Js}=Qe;function Ae({children:t}){var Z;const{t:a}=E(),{api:n}=z(),{blocklet:s}=O(),[r,o]=y.useState(null),[i,l]=y.useState(!1),{data:p,loading:c,mutate:x}=Qt({refresh:i}),u=At(p),S=Zt({appDid:s==null?void 0:s.appDid}),m=y.useMemo(()=>vt(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[A,b]=y.useState(!1),[j,d]=y.useState(!1),{backups:te}=Je({deps:[j,r],setLoading:b,backupDate:r}),[se,oe]=y.useState(!1),{backupSummary:ne}=Ht({deps:[se]}),[P,L]=y.useState(p==null?void 0:p.find(h=>h.endpoint===m)),R=(Z=s==null?void 0:s.settings)==null?void 0:Z.autoBackup,D=()=>{l(h=>!h)},ae=()=>{oe(h=>!h)},re=()=>{d(h=>!h)},Q=async h=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:h}})},q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(h,N)=>{try{x(I=>{const M=[...I];return M.push({...h,loading:!0}),M}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:h}}),m!==N&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(h),D(),k.success(a("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"}))}catch(I){throw console.error(I),x(M=>[...M].filter(de=>de.did!==h.did)),I}},ce=async h=>{h&&(h.endpoint===m&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),R!=null&&R.enabled&&await Q({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:h==null?void 0:h.did}}),x(N=>{const I=[...N];return I.splice(I.indexOf(h),1),I}),L(h),D())},le=async h=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:h.did},spaceGateway:h}}),m!==h.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:h.endpoint}]}})]),k.success(a("storage.spaces.connectedWithName",{name:(h==null?void 0:h.name)??"DID Spaces"})),D()},B=h=>(h==null?void 0:h.endpoint)===m;return e.jsx(Kt,{value:{spaceGateways:p||[],selectedSpaceGateway:P,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:D,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:B,updateAutoBackup:Q,abortBlockletBackup:q,backupEndpoint:m,backupProgress:S,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:o,backupsLoading:A,autoBackup:R},children:t})}Ae.propTypes={children:f.any.isRequired};Ae.defaultProps={};function U(){return y.useContext(Qe)}function ee({...t}){const{blocklet:a}=O(),{info:n}=z(),{t:s}=E(),r=Ne({blocklet:a}),o=xt(n),{spaceGateways:i,addSpaceGateway:l}=U(),p={checkFn:Pe.create({baseURL:fe(window.location.origin,St())}).get,webWalletUrl:o,extraParams:{appPid:a.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},c=async({endpoint:u,name:S,did:m})=>{const A=await Et(u);if(!await Rt(A)){k.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===u)){k.error(s("storage.spaces.gateway.add.duplicate",{name:S}));return}await l({name:S,did:m,url:A,endpoint:u},u)},x=async({spaceGateway:u})=>{try{await c(u)}catch(S){console.error(S),k.error(X(S))}};return e.jsx(rt,{...t,options:p,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ze({...t}){const{t:a}=y.useContext(ut),{blocklet:n,loadingDiskInfo:s,actions:r}=O();if(y.useEffect(()=>{r==null||r.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const o=(p,c,x)=>e.jsxs(C,{children:[p," ",e.jsx("strong",{children:c?jt(c):"empty"})]}),i=n.environments.reduce((p,c)=>(p[c.key]=c.value,p),{}),l=[{key:"appDir",name:a("blocklet.diskInfo.appDir"),value:o(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:a("blocklet.diskInfo.dataDir"),value:o(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:a("blocklet.diskInfo.logDir"),value:o(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:a("blocklet.diskInfo.cacheDir"),value:o(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Vt,{component:"div",...t,children:l.map(p=>e.jsx(Ot,{valueComponent:"div",nameWidth:120,name:p.name,children:p.value},p.key))})}return s?e.jsx(w,{}):e.jsx(C,{children:a("blocklet.diskInfo.empty")})}const Vt=_e(C)``;function Be(){const{t}=E(),{setBackupDate:a,backupSummary:n}=U(),s=it({key:"lg"}),r=y.useRef(null),o=$e(),i=y.useCallback(c=>{a(c)},[a]),l=y.useMemo(()=>{const c=v().subtract(1,"year"),x=v().add(1,"day"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),S=[];for(let m=c.clone();v(m).isBefore(x);m=m.add(1,"day")){const A=m.format("YYYY-MM-DD");S.push(u.get(A)||{date:A,successCount:0,errorCount:0})}return S},[n]),p=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:10},tooltip:{formatter:m=>{const{date:A,successCount:b,errorCount:j}=l[m.dataIndex]||{date:m.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${A}</div>`,`<div>${t("common.succeeded")}: ${b}</div>`,`<div>${t("common.failed")}: ${j}</div>`].join(`
2
- `)},backgroundColor:o.palette.background.paper,borderColor:o.palette.divider,textStyle:{color:o.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${o.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:_[600]},{min:-9,max:-6,color:_[500]},{min:-6,max:-3,color:_[400]},{min:-3,max:-1,color:_[300]},{min:0,max:0,color:o.palette.grey[200]},{min:1,max:3,color:$[300]},{min:3,max:6,color:$[400]},{min:6,max:9,color:$[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:$[600]}],orient:"horizontal",left:"center",bottom:10,itemWidth:12,itemHeight:12,textStyle:{color:o.palette.text.secondary,fontSize:12}},calendar:{top:30,left:40,right:5,bottom:20,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:4,borderColor:o.palette.background.default,borderRadius:0,color:o.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:12,fontSize:14,color:o.palette.text.primary,fontWeight:"400"},monthLabel:{show:!0,nameMap:"cn",align:"left",color:o.palette.text.primary,fontWeight:"400",fontSize:16,position:"start"},yearLabel:{show:!1},range:[v().subtract(1,"year").format("YYYY-MM-DD"),v().format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:l.map(m=>[m.date,m.errorCount?-m.errorCount:m.successCount]),label:{show:!1},itemStyle:{borderWidth:1.5,borderColor:o.palette.background.default,borderRadius:5},emphasis:{itemStyle:{borderWidth:2.5,borderColor:et[200],color:"inherit"}}}}),[l,t,o]);return y.useEffect(()=>{r.current&&s&&setTimeout(()=>{r.current.scrollLeft=r.current.scrollWidth},100)},[s,l]),e.jsxs(e.Fragment,{children:[e.jsx(g,{ref:r,sx:{overflowX:s?"visible":"hidden",overflowY:"hidden"},children:e.jsx(g,{sx:{minWidth:s?"1600px":"100%",height:"240px"},children:e.jsx(Ut,{option:p,style:{height:"100%",width:"100%",padding:"8px"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&i(c.data[0])}}})})}),e.jsx(g,{display:"flex",justifyContent:"flex-end",mr:s?2:5,mb:2,mt:.5,children:e.jsxs(J,{direction:s?"column":"row",spacing:s?2:1,alignItems:"flex-end",width:"100%",justifyContent:s?"flex-start":"flex-end",children:[e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.failed"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#8B5000",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#A36200",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#C17700",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#E29000",borderRadius:.5})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.without"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"grey.200",borderRadius:.5,border:"1px solid",borderColor:"grey.200"})]}),e.jsxs(J,{direction:"row",alignItems:"center",spacing:1,children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[t("storage.spaces.backup.succeeded"),":"]}),e.jsx(g,{width:12,height:12,bgcolor:"#9be9a8",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#40c463",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#30a14e",borderRadius:.5}),e.jsx(g,{width:12,height:12,bgcolor:"#216e39",borderRadius:.5})]})]})})]})}Be.propTypes={};const Gt=Se(({className:t,...a})=>e.jsx(je,{...a,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function be({status:t,message:a,createdAt:n}){const{t:s}=E(),r=t===T.BACKUPS.STATUS.PROGRESS&&v().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,o=r&&s("common.timeoutError"),i=t===T.BACKUPS.STATUS.PROGRESS&&!r,l=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return i?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):l?e.jsx(W,{type:"success",children:s("common.succeeded")}):e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(W,{type:"error",children:s("common.failed")}),"  ",e.jsx(je,{style:{display:"flex",alignItems:"center",flexShrink:0},title:a||o,children:e.jsx(Le,{children:e.jsx(ct,{style:{width:"24px",height:"24px"},color:"error"})})})]})}be.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};be.defaultProps={message:""};function ke({metadata:t}){const{t:a}=E();if(Y(t))return e.jsx(W,{type:"success",children:a("common.succeeded")});const n=t.count||0,s=t.size||0,r=lt(s,{iec:!0}),o=e.jsxs(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[a("common.fileCount"),": ",n]}),e.jsxs(C,{variant:"body2",children:[a("common.fileSize"),": ",r]})]});return e.jsxs(g,{display:"inline-flex",alignItems:"center",children:[e.jsx(W,{type:"success",children:a("common.succeeded")})," ",e.jsx(Gt,{title:o,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Le,{children:e.jsx(dt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ke.propTypes={metadata:f.object};ke.defaultProps={metadata:{}};function Ie(){const{t,locale:a}=E(),{spaceGateways:n,backups:s,backupsLoading:r}=U(),o=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var b;const{targetUrl:p,targetName:c,status:x,createdAt:u}=s[l],S=x===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,m=x===T.BACKUPS.STATUS.SUCCEEDED&&!S,A=c||((b=n.find(j=>p==null?void 0:p.includes(ge(j==null?void 0:j.endpoint))))==null?void 0:b.name)||"Unknown DID Space";return m?e.jsx(tt,{fontSize:"16px",href:p,target:"_blank",children:A}):e.jsx(C,{variant:"body1",fontSize:"16px",children:A})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const p=t(l===0?"common.auto":"common.manual");return e.jsx(W,{children:p})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:l=>v(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>Y(l)?"":v(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:l=>{const p=(s==null?void 0:s[l])??{},{status:c,message:x,createdAt:u,metadata:S}=p,m=c===T.BACKUPS.STATUS.PROGRESS&&v().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,A=c===T.BACKUPS.STATUS.PROGRESS&&!m,b=c===T.BACKUPS.STATUS.SUCCEEDED&&!m;return A?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(w,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):b?e.jsx(ke,{metadata:S}):e.jsx(be,{status:c,message:x,createdAt:u})}}}],[s,n,t]),i=y.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:i?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(mt,{title:"",loading:r,data:s,columns:o,emptyNode:t("storage.spaces.record.emptyData",a),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Ie.propTypes={};var He=function(a){return e.jsxs("svg",{...a,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sB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B/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};He.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Ke(){const{t}=E();return e.jsxs(g,{children:[e.jsxs(g,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(g,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(He,{viewBox:"0 0 228 258",style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(g,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Be,{})]})]}),e.jsx(Ie,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ze,{})]})}Ke.propTypes={};var ve={},Wt=ye;Object.defineProperty(ve,"__esModule",{value:!0});var Ve=ve.default=void 0,Yt=Wt(Ce()),Xt=e;Ve=ve.default=(0,Yt.default)((0,Xt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ee={},qt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var Ge=Ee.default=void 0,_t=qt(Ce()),$t=e;Ge=Ee.default=(0,_t.default)((0,$t.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},es=ye;Object.defineProperty(Re,"__esModule",{value:!0});var We=Re.default=void 0,ts=es(Ce()),ss=e;We=Re.default=(0,ts.default)((0,ss.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Te({spaceGateway:t,onConfirm:a,onCancel:n}){const{t:s}=E(),[r,o]=y.useState(!1),[i,l]=y.useState(!1),p=(u,S)=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),o(S)},c=async u=>{try{u==null||u.stopPropagation(),l(!0),await(a==null?void 0:a(t)),o(!1)}catch(S){console.error(S),k.error(`${s("storage.space.gateway.delete.failed")}: ${X(S)}`)}finally{o(!1),l(!1)}},x=u=>{p(u,!1),n==null||n(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:u=>p(u,!0),children:[e.jsx(V,{style:{minWidth:24,color:"red"},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(G,{style:{color:"red"},children:s("common.delete")})]}),e.jsx(ht,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:c,onCancel:x,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Te.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};Te.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function De({spaceGateway:t,selected:a,onDelete:n,onConnect:s,enableSwitchToSpace:r,backupInProgress:o,...i}){const{abortBlockletBackup:l}=U(),[p,c]=y.useState(null),{t:x}=E(),[u,S]=y.useState(!1),m=(j,d)=>{j.stopPropagation(),j.preventDefault(),c(d&&j.currentTarget)},A=async j=>{try{S(!0),m(j,!1),await s(t)}catch(d){console.error(d),k.error(d.message)}finally{S(!1)}},b=async j=>{try{S(!0),m(j,!1),await l()}catch(d){console.error(d),k.error(d.message)}finally{S(!1)}};return e.jsxs(e.Fragment,{children:[u||t!=null&&t.loading?e.jsx(w,{sx:{ml:1},size:"24px"}):e.jsx(st,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:j=>m(j,!0),...i,children:e.jsx(Lt,{})}),e.jsxs(ot,{id:"simple-menu",anchorEl:p,keepMounted:!0,open:!!p,onClose:j=>m(j,!1),children:[e.jsxs(K,{onClick:j=>{m(j,!1),window.open(Ue(t.endpoint?Tt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(G,{children:x("common.open")})]}),e.jsxs(K,{onClick:j=>{m(j,!1),window.open(Ue(Dt(t.endpoint),{allowDomains:null}))},children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(We,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!a&&r&&e.jsxs(K,{onClick:A,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Ge,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.connect.switchToSpace")})]}),o&&e.jsxs(K,{onClick:b,children:[e.jsx(V,{style:{minWidth:24},children:e.jsx(Mt,{fontSize:"small"})}),e.jsx(G,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!o&&e.jsx(Te,{spaceGateway:t,onConfirm:async()=>{c(null),await(n==null?void 0:n(t))},onCancel:()=>c(null)})]})]})}De.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};De.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const os=Se(({className:t,...a})=>e.jsx(je,{...a,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function we({spaceGateway:t,spaceStatus:a,selected:n,onConnected:s,onDeleted:r,onBackedUp:o}){const{t:i,locale:l}=E(),{blocklet:p}=O(),{api:c,info:{did:x}}=z(),{appDid:u,appName:S,appDescription:m,scopes:A,appUrl:b,referrer:j}=Ne({blocklet:p}),{backupProgress:d,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=U(),[P,L]=y.useState(!1),[R,D]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:S},l),scan:i("storage.spaces.authorize.scan",{appName:S},l),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{D(B=>({...B,open:!1}))}}),ae=n&&!P&&a===pe.DISCONNECTED,re=n&&!P&&!t.loading&&a===pe.CONNECTED,Q=n&&P&&a===pe.CONNECTED&&(d==null?void 0:d.progress)>=0,q=async()=>{try{if(await wt(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[p.meta.did],configs:[{key:F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),k.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(B){console.error(B),s==null||s(B,t);return}D(B=>({...B,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Pe.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:S,appDescription:m,scopes:A,appUrl:b,referrer:j,nodeDid:x,spaceDid:t.did}}))},ie=async(B,Z)=>{const h=Z(B.endpoint),N=ge(h),I=B.space?Z(B.space):{};if(t.did&&N!==t.did){D(de=>({...de,open:!1}));const H=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:I!=null&&I.name?I.name:""});k.error(H),s==null||s(new Error(H),t);return}const M={...t,name:I.name??"DID Space",did:I.did??ge(h),endpoint:h};await te(M),D(H=>({...H,open:!1})),s==null||s(null,M)},ce=async()=>{try{if(P)return;L(!0),await c.backupBlocklet({input:{appDid:p.appDid,to:"spaces"}})}catch(B){console.error(B),k.error(B.message),o==null||o(B,t)}finally{L(!0)}},le=async()=>{try{await se(t),k.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r==null||r(null,t)}catch(B){console.error(B),r==null||r(B,t)}};return y.useEffect(()=>{d!=null&&d.completed?(n&&((d==null?void 0:d.progress)===100?(k.success(i("storage.spaces.backupSuccessfully")),o==null||o(null,t)):d.message&&(o==null||o(new Error(d==null?void 0:d.message),t)),d.progress=0,d.message=""),L(!1),setTimeout(()=>{oe(),ne()},1e3)):d.progress&&L(!0)},[d]),e.jsxs(e.Fragment,{children:[e.jsxs(g,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[re&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:i("storage.spaces.strategy.backupNow")}),ae&&e.jsx(ue,{className:"action-btn",variant:"outlined",size:"small",onClick:q,children:i("storage.spaces.disconnected.reconnectNow")}),Q&&e.jsx(os,{title:(d==null?void 0:d.message)&&e.jsx(g,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:d.message})}),children:e.jsxs(ue,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(w,{variant:"determinate",value:d==null?void 0:d.progress,size:14,sx:{mr:1}}),d==null?void 0:d.progress,"%"]})}),e.jsx(ft,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:ie,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:l},"get-endpoint")]}),e.jsx(De,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:q,enableSwitchToSpace:(d==null?void 0:d.completed)||Y(d==null?void 0:d.message),backupInProgress:Q})]})}we.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};we.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ye({...t}){const{t:a}=E();return e.jsxs(g,{...t,children:[e.jsx(g,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:a("storage.spaces.backup.records")})}),e.jsx(Be,{}),e.jsx(Ie,{})]})}Ye.propTypes={};function Xe({...t}){const{t:a}=E(),{autoBackup:n,updateAutoBackup:s}=U(),r=async()=>{try{const o=!(n!=null&&n.enabled);await s({enabled:o}),k.success(a(o?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(o){k.error(o.message)}};return e.jsx(zt,{checked:!!(n!=null&&n.enabled),onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:a("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Xe.propTypes={};function ns(){const{t}=E(),{spaceGateways:a,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=U(),r=n&&!(a!=null&&a.length),o=({spaceGateway:i,spaceStatus:l,selected:p,refresh:c})=>e.jsx(we,{spaceGateway:i,spaceStatus:l,selected:p,onConnected:()=>c(),onBackedUp:x=>x&&c()});return e.jsxs(g,{display:"flex",flexDirection:"column",children:[e.jsx(xe,{sx:{button:{fontSize:"revert",fontWeight:500}},left:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Xe,{}),e.jsx(ee,{})]})}),e.jsx(g,{mt:2,children:r?e.jsx(g,{display:"flex",justifyContent:"center",children:e.jsx(w,{})}):e.jsx(Oe,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:a.map(i=>e.jsx(Oe,{item:!0,xs:12,md:6,children:e.jsx(pt,{endpoint:i.endpoint,selected:s(i),action:o},i.endpoint)}))})})}),e.jsx(Ye,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ze,{})]})}function as(){const{spaceGatewaysFirstLoading:t,spaceGateways:a}=U();return t?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):Y(a)?e.jsx(Ke,{}):e.jsx(ns,{})}function rs(){return e.jsx(Ae,{children:e.jsx(as,{})})}function is(){const{spaceGateway:t,settingStorageEndpoint:a,updateSpaceGateway:n,hasStorageEndpoint:s,loading:r,storageEndpoint:o}=Nt(),i=he(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Fe,{relative:"parent",children:e.jsx(w,{})}):e.jsxs(g,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(Bt,{spaceGateway:t,settingStorageEndpoint:a}):e.jsx(bt,{}),e.jsx(g,{sx:i,children:e.jsx(kt,{onConnect:n,storageEndpoint:o})})]})}function cs(){const{t}=E();return e.jsxs(Pt,{children:[e.jsxs(J,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(is,{})]})}function qe({navOrientation:t,...a}){const{t:n,locale:s}=E(),{blocklet:r}=O(),o=yt({key:"md"}),[i,l]=at(),p=i.get("tab")||"backup",c=o?"horizontal":t,x=he(()=>{var d;const b=[{label:n("common.backup"),value:"backup"}],j=(d=r==null?void 0:r.capabilities)==null?void 0:d.didSpace;return(j===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||j===F.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&b.push({label:n("common.storage"),value:"storage"}),b},[s,c]),S=he(()=>({backup:e.jsx(rs,{}),storage:e.jsx(cs,{})}))[p],m=b=>{l(j=>(b==="backup"?j.delete("tab"):j.set("tab",b),j))};if(x.length<=1)return e.jsx(me,{children:S});const A=e.jsx(gt,{tabs:x,current:p,orientation:c,onChange:m,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(g,{...a,children:e.jsxs(J,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(g,{sx:{flexShrink:0},children:e.jsx(xe,{left:A})}),e.jsx(g,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:S})})]})});if(c==="horizontal")return e.jsxs(g,{...a,children:[e.jsx(xe,{left:A}),e.jsx(me,{sx:{mt:2},children:S})]})}qe.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};qe.defaultProps={navOrientation:"vertical"};const me=Se(g)`
3
- position: relative;
4
- min-height: 66vh;
5
- overflow: hidden;
6
- `;export{qe as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-B6POpIBB.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-Dt-yrfsf.js";import"./vendor-ux-did-connect-CeGz2B7G.js";import"./vendor-utils-CjMBJT5V.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DpCuGvAS.js";import"./TuneOutlined-B-fSgZvP.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};
@@ -1 +0,0 @@
1
- import{v as n,j as i,aa as l}from"./vendor-mui-core-B6POpIBB.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{u,aq as h}from"./vendor-ux-did-connect-CeGz2B7G.js";import g from"./index-v90LUntw.js";import"./vendor-utils-CjMBJT5V.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./index-DMRB_27Q.js";import"./vendor-arcblock-DpCuGvAS.js";import"./Error-2fR4-pmz.js";import"./confirm-oEG91BF3.js";import"./format-error-BrmqJs5a.js";import"./session-B_RsakU4.js";import"./did-address-DXsoioR-.js";import"./empty-spinner-BYUFR95o.js";import"./bundle-avatar-DB3E7EOv.js";import"./shorten-label-SbKUBkvs.js";import"./list-header-8k1_C0K0.js";import"./Download-Drp0bexG.js";import"./click-to-copy-j_gx9gFG.js";import"./QuestionMarkCircle-DpFFQWud.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./index-DIe9psLc.js";import"./api-Bf1onQOz.js";import"./ChevronRight-Br0ablb7.js";import"./vendor-mui-x-CATHW1QL.js";import"./DeleteOutline-BU7WZ4i1.js";import"./react-beautiful-dnd.esm-J_09ZTBJ.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-BA9iP7co.js";import"./Launch-BvpJnrFC.js";import"./Done-SwUOq9KC.js";import"./delete-confirm-4a9iCk5U.js";import"./get-safe-url-DGnHBj8n.js";import"./ArrowDropDown-CtOiDsfU.js";import"./index-CMFOn8T3.js";import"./index-Bt7GP-dU.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
@@ -1 +0,0 @@
1
- import{a_ as o}from"./vendor-ux-did-connect-CeGz2B7G.js";const e=o();export{e as b};