@abtnode/webapp 1.17.0-beta-20251105-000053-53e6e3e9 → 1.17.0-beta-20251105-030013-0c24dbf6

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 (190) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-C1sxBzYJ.js → AdapterDayjs-Dsdzg0fF.js} +7 -7
  4. package/dist/assets/{Add-CVk8tm4G.js → Add-l70J_4yZ.js} +1 -1
  5. package/dist/assets/ArrowDropDown-C4ph_aC2.js +1 -0
  6. package/dist/assets/{Autocomplete--rexVX3g.js → Autocomplete-BGzNUg3v.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-DIp-nJJ5.js → Breadcrumbs-qX1unYdA.js} +1 -1
  8. package/dist/assets/{ButtonGroup-WBTgkkFs.js → ButtonGroup-DWV84mOp.js} +1 -1
  9. package/dist/assets/{CSSTransition-PyxA7qM9.js → CSSTransition-D0ZJqc3V.js} +1 -1
  10. package/dist/assets/{CallMerge-Dp0TbxtD.js → CallMerge-47e0SFej.js} +1 -1
  11. package/dist/assets/{CardContent-DZnvuvBx.js → CardContent-049bCJeP.js} +1 -1
  12. package/dist/assets/{ChevronLeft-DrAVxRvq.js → ChevronLeft-xNPAnZUM.js} +1 -1
  13. package/dist/assets/{ChevronRight-99818llK.js → ChevronRight-hEVn0ieo.js} +1 -1
  14. package/dist/assets/{Clear-D22lsM0L.js → Clear-DmQaaBy1.js} +1 -1
  15. package/dist/assets/{DeleteOutline-DcDoLQRc.js → DeleteOutline-CvnvGjYc.js} +1 -1
  16. package/dist/assets/{Done-DUd7dseY.js → Done-rLg9w1bb.js} +1 -1
  17. package/dist/assets/{Edit-C1yGiyPP.js → Edit-BLWQBSLN.js} +1 -1
  18. package/dist/assets/{ErrorOutline-DFDmseSI.js → ErrorOutline-wpxhPFAL.js} +1 -1
  19. package/dist/assets/{FilterList-CoAmsJca.js → FilterList-CBCl7dbD.js} +1 -1
  20. package/dist/assets/{Google-Ci_keRvX.js → Google--H7JIVD-.js} +1 -1
  21. package/dist/assets/{HelpOutline-xaytOWsN.js → HelpOutline-dwnyWw6W.js} +1 -1
  22. package/dist/assets/{KeyboardArrowDown-DYZijrNX.js → KeyboardArrowDown-CqHZKzOB.js} +1 -1
  23. package/dist/assets/{Launch-ZizNNCSa.js → Launch-D-brFkhF.js} +1 -1
  24. package/dist/assets/{Link-CkPvBkz3.js → Link-D4UceNDZ.js} +1 -1
  25. package/dist/assets/{ListItemButton-2dC6jb60.js → ListItemButton-BbKr2tws.js} +1 -1
  26. package/dist/assets/{ListSubheader-DOllyY_2.js → ListSubheader-CPl5W-Om.js} +1 -1
  27. package/dist/assets/{LoadingButton-D7sWfuNv.js → LoadingButton-yUpEuEJK.js} +1 -1
  28. package/dist/assets/{MoreVert-Botcj4tQ.js → MoreVert-Cy81E-t5.js} +1 -1
  29. package/dist/assets/{OpenInNew-39NtggiI.js → OpenInNew-B2F4Jqwb.js} +1 -1
  30. package/dist/assets/{Refresh-CBmbur-d.js → Refresh-C7TD1E1-.js} +1 -1
  31. package/dist/assets/{Search-B-Eed1a-.js → Search-nsuHiAfr.js} +1 -1
  32. package/dist/assets/{Stepper-BA4R6xKY.js → Stepper-N4JW-HWm.js} +1 -1
  33. package/dist/assets/{Switch-why5ntqD.js → Switch-Ch-Dpg3J.js} +1 -1
  34. package/dist/assets/{TableSearch-C69nhsKl.js → TableSearch-B7cAFRBU.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-aXZO2Onm.js → ToggleButtonGroup-BEbdhUkr.js} +1 -1
  36. package/dist/assets/{UnfoldMore-BOYfBOR7.js → UnfoldMore-BJCswty9.js} +1 -1
  37. package/dist/assets/{Verified-CQgxIDWe.js → Verified-Cj9BE95b.js} +1 -1
  38. package/dist/assets/{VerifiedUser-BVU63hxW.js → VerifiedUser-CzoOgILE.js} +1 -1
  39. package/dist/assets/{ViewList-B7S2k-sU.js → ViewList-DII-BNLQ.js} +1 -1
  40. package/dist/assets/{_createAggregator-BNiCJG5j.js → _createAggregator-C4guq0cF.js} +1 -1
  41. package/dist/assets/{actions-BpEnjnkW.js → actions-C9R61uoD.js} +1 -1
  42. package/dist/assets/actions-D2ujhOWD.js +1 -0
  43. package/dist/assets/{agreement-Bt36aRmm.js → agreement-DtxuiQja.js} +1 -1
  44. package/dist/assets/api-W7sKIR80.js +1 -0
  45. package/dist/assets/{appearance-DccfzWN4.js → appearance-B_sMk1g7.js} +1 -1
  46. package/dist/assets/{audit-logs-CslK755Q.js → audit-logs-DHuwThvE.js} +1 -1
  47. package/dist/assets/{base-chart-BU5T7HXW.js → base-chart-BuPD5Oqs.js} +1 -1
  48. package/dist/assets/{blocklet-D7RCIEVC.js → blocklet-BMb-DKa8.js} +1 -1
  49. package/dist/assets/{chain-B-R5jJqh.js → chain-DG7hV9jl.js} +1 -1
  50. package/dist/assets/{click-to-copy-Cs2W8Ot6.js → click-to-copy-BlUoHpyD.js} +1 -1
  51. package/dist/assets/cloneDeep-yO838gNj.js +1 -0
  52. package/dist/assets/{collapse-vdXCKJot.js → collapse-DKt3eXVz.js} +1 -1
  53. package/dist/assets/{config-navigation-AF6Aprwe.js → config-navigation-C1LKuM9I.js} +3 -3
  54. package/dist/assets/{connect-to-DGN9otz2.js → connect-to-UN--0_6w.js} +1 -1
  55. package/dist/assets/{cssMode-JaFRvrWP.js → cssMode-CLw2RNKf.js} +1 -1
  56. package/dist/assets/{delete-confirm-DdsP1xyX.js → delete-confirm-CCfwND5U.js} +1 -1
  57. package/dist/assets/{depsEqual-8ro4t59x.js → depsEqual-DZ2epQ9y.js} +1 -1
  58. package/dist/assets/{detail-BkdxMbP7.js → detail-DT3mxGBF.js} +3 -3
  59. package/dist/assets/{domains-Bs2OrCXo.js → domains-ByJxly5j.js} +2 -2
  60. package/dist/assets/{download-C5s3qgpB.js → download-DYcl5mTN.js} +1 -1
  61. package/dist/assets/{edit.svg-CgNs-lHu.js → edit.svg-DYKibMjZ.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-Bm19UyCk.js +1 -0
  63. package/dist/assets/engine-BX2tPglZ.js +1 -0
  64. package/dist/assets/{freemarker2-C4KFDsum.js → freemarker2-l0VGQqvD.js} +1 -1
  65. package/dist/assets/{get-safe-url-a5kkThOJ.js → get-safe-url-I2vTcMcF.js} +1 -1
  66. package/dist/assets/getValidReactChildren-Ao387m76.js +1 -0
  67. package/dist/assets/{graphqlMode-BQN2Pyso.js → graphqlMode-CA_yndFf.js} +2 -2
  68. package/dist/assets/{handlebars-Bxdyn0Yn.js → handlebars-BILq1CrH.js} +1 -1
  69. package/dist/assets/{html-BXfLVUmP.js → html-CoOIbPZt.js} +1 -1
  70. package/dist/assets/{html-title-BTTzke5t.js → html-title-CRD93SB4.js} +1 -1
  71. package/dist/assets/{htmlMode-B2oLOCDA.js → htmlMode-C2G2f8dC.js} +1 -1
  72. package/dist/assets/{iframe-Cicf5L2q.js → iframe-SmTUaAma.js} +1 -1
  73. package/dist/assets/{index-i7kcAUgC.js → index-1q_fL1CO.js} +1 -1
  74. package/dist/assets/index-4__iBGFR.js +376 -0
  75. package/dist/assets/{index-DhjS03h3.js → index-9AtlSAca.js} +1 -1
  76. package/dist/assets/{index-CMm_ZkMo.js → index-B2OP4n2J.js} +1 -1
  77. package/dist/assets/{index-CmuytZWV.js → index-B78zCe1U.js} +1 -1
  78. package/dist/assets/{index-CITKVnf5.js → index-B7UU2Xx3.js} +1 -1
  79. package/dist/assets/{index-C7Esiph6.js → index-BBJPyEqY.js} +1 -1
  80. package/dist/assets/{index-Bc_nEfNZ.js → index-BE13FI7n.js} +1 -1
  81. package/dist/assets/{index-C7DTyHie.js → index-BEjzeaWf.js} +1 -1
  82. package/dist/assets/{index-CVrpd5_C.js → index-BJzB0IwK.js} +1 -1
  83. package/dist/assets/{index-B-m9CinS.js → index-BKgXnbrz.js} +1 -1
  84. package/dist/assets/{index-CJFsrBQ5.js → index-BXhWMfbn.js} +134 -132
  85. package/dist/assets/{index-CNk3pS5z.js → index-BcyBYFKw.js} +1 -1
  86. package/dist/assets/{index-BC1L97j-.js → index-BiowOJQr.js} +3 -3
  87. package/dist/assets/{index-BTs6uaV-.js → index-BpLexnAZ.js} +3 -3
  88. package/dist/assets/{index-468i7WVc.js → index-BqE2dSbo.js} +1 -1
  89. package/dist/assets/{index-C9CIOKxJ.js → index-Brhgisql.js} +3 -3
  90. package/dist/assets/{index-CrupdUIS.js → index-BvBppb16.js} +1 -1
  91. package/dist/assets/{index-CgbbU3bh.js → index-By5xDEFZ.js} +1 -1
  92. package/dist/assets/{index-D4DtKxKS.js → index-Bz-PgJMC.js} +9 -9
  93. package/dist/assets/{index-VJfxcHdZ.js → index-C5xxqnjy.js} +1 -1
  94. package/dist/assets/{index-DyoZj6uk.js → index-C8GO1leJ.js} +4 -4
  95. package/dist/assets/{index-BDu6x0_Z.js → index-CCyFCqBE.js} +1 -1
  96. package/dist/assets/{index-BBHAknYl.js → index-CL4In6gd.js} +2 -2
  97. package/dist/assets/{index-CSwO0V18.js → index-COM-tUig.js} +1 -1
  98. package/dist/assets/index-CZlN1gWv.js +1 -0
  99. package/dist/assets/{index-Ck5m3-AY.js → index-CeSi6fPS.js} +1 -1
  100. package/dist/assets/{index-CmBcZynd.js → index-Cl_OUu5V.js} +2 -2
  101. package/dist/assets/{index-CglwoJ4l.js → index-CqGdRTFr.js} +1 -1
  102. package/dist/assets/{index-DWwkMgfO.js → index-CuAcM2e2.js} +1 -1
  103. package/dist/assets/{index-Bcrk0zCL.js → index-CyeREPie.js} +1 -1
  104. package/dist/assets/{index-DtI9eoxB.js → index-D4AEyg0i.js} +1 -1
  105. package/dist/assets/{index-CO1BYEVU.js → index-DEOQ0jcQ.js} +12 -12
  106. package/dist/assets/{index-BLOW8-05.js → index-DFZr7N5Q.js} +1 -1
  107. package/dist/assets/{index-DlQZkZhK.js → index-DWBKwIO3.js} +1 -1
  108. package/dist/assets/{index-Cs1PrbfL.js → index-DfDQYXHJ.js} +1 -1
  109. package/dist/assets/{index-BsebOrBD.js → index-Di7TwMAz.js} +1 -1
  110. package/dist/assets/{index-M-MTkoXO.js → index-DiSjj8dD.js} +1 -1
  111. package/dist/assets/{index-CIvoUxWN.js → index-DjgzvzkV.js} +1 -1
  112. package/dist/assets/{index-CZfcxgEo.js → index-Ee8S2Bwe.js} +1 -1
  113. package/dist/assets/{index-B5-kbyFB.js → index-NTEIlaHw.js} +1 -1
  114. package/dist/assets/{index-Ck-gWyqL.js → index-SpBKG2cj.js} +1 -1
  115. package/dist/assets/{index-C8F-5PWV.js → index-_RQVek-9.js} +1 -1
  116. package/dist/assets/{index-DDyfTi5n.js → index-_nnYDXM-.js} +1 -1
  117. package/dist/assets/{index-QnHJYq_m.js → index-cI3GtZiR.js} +1 -1
  118. package/dist/assets/{index-gyZ9aaBv.js → index-f_-DLUob.js} +1 -1
  119. package/dist/assets/{index.esm-DB98s2du.js → index.esm-DLVaVv6G.js} +1 -1
  120. package/dist/assets/{install-from-url-F6loz7h2.js → install-from-url-B-_Dp6ah.js} +1 -1
  121. package/dist/assets/{invitation-BJ2Uygqj.js → invitation-BgD3_vhn.js} +1 -1
  122. package/dist/assets/{is-path-prefix-equal-Difybx2-.js → is-path-prefix-equal-BSoCAT8S.js} +1 -1
  123. package/dist/assets/{item-CxruHGnZ.js → item-Cq6FTbYA.js} +1 -1
  124. package/dist/assets/{javascript-B5yPsZ_g.js → javascript-C-FROqLb.js} +1 -1
  125. package/dist/assets/{jsonMode-BVpfBbU7.js → jsonMode-DPJOjZF1.js} +1 -1
  126. package/dist/assets/{liquid-BJEDzwTx.js → liquid-C2IF5DcJ.js} +1 -1
  127. package/dist/assets/{list-header-CGkXsFzD.js → list-header-CGaXNTl1.js} +1 -1
  128. package/dist/assets/{lock.svg-DwT00kVZ.js → lock.svg-chUJBTRM.js} +1 -1
  129. package/dist/assets/{log-DYD4cTem.js → log-CQYCsC7O.js} +1 -1
  130. package/dist/assets/{lottie-react.esm-C063f4ie.js → lottie-react.esm-BDZ_FnV5.js} +1 -1
  131. package/dist/assets/{mdx-BR7dn9Rf.js → mdx-DN-yyYQV.js} +1 -1
  132. package/dist/assets/{memory-DQ_7c29A.js → memory-Cp2D5Xn4.js} +1 -1
  133. package/dist/assets/{metric-CDqUu5So.js → metric-D8boeqOT.js} +1 -1
  134. package/dist/assets/omit-BtJfXKsY.js +1 -0
  135. package/dist/assets/{overview-CHbJGWIv.js → overview-CmJ-twrW.js} +1 -1
  136. package/dist/assets/{permission-Bua2xv7v.js → permission-yeSmXMT8.js} +1 -1
  137. package/dist/assets/{preference-DQKWe7NS.js → preference-B8o0Jhqm.js} +4 -4
  138. package/dist/assets/{python-d38i22CZ.js → python-dlp0zMNM.js} +1 -1
  139. package/dist/assets/{raf-schd.esm-BLz-9fA6.js → raf-schd.esm-CrHfyPhA.js} +1 -1
  140. package/dist/assets/{razor-BUH6xPUt.js → razor-BShM2kTq.js} +1 -1
  141. package/dist/assets/{rotate-session-key-D8E21OhA.js → rotate-session-key-cXEhy_K2.js} +1 -1
  142. package/dist/assets/{runtime-zIDt9gd7.js → runtime-BkYiwqrJ.js} +1 -1
  143. package/dist/assets/schema-CJmd8wL1.js +1 -0
  144. package/dist/assets/sdk-B9JEpY9l.js +1 -0
  145. package/dist/assets/{service-DC-Ma2Y_.js → service-CZ6mQjKM.js} +1 -1
  146. package/dist/assets/{shorten-label-D5KSzN_m.js → shorten-label-B41dh7aP.js} +1 -1
  147. package/dist/assets/{simple-select-Cvy9anyw.js → simple-select-BvGPk5Cy.js} +1 -1
  148. package/dist/assets/{spaces-qM60YnI6.js → spaces-C-llvyn7.js} +1 -1
  149. package/dist/assets/{status-D-FG1Yu_.js → status-BX4NNsVD.js} +1 -1
  150. package/dist/assets/{status-C4qpe8_G.js → status-PYw3sa-W.js} +1 -1
  151. package/dist/assets/{switch-control-B_wibGty.js → switch-control-IXycQg7u.js} +1 -1
  152. package/dist/assets/{table-icons-DM37eENd.js → table-icons-PekhxfR1.js} +1 -1
  153. package/dist/assets/{team-Ab4Rjw5t.js → team-C3mY0ELl.js} +1 -1
  154. package/dist/assets/{toLower-CBhWm63w.js → toLower-B1XYGfB3.js} +1 -1
  155. package/dist/assets/toUpper-BnIypMIu.js +1 -0
  156. package/dist/assets/{traffic-Dbe1eVsp.js → traffic-Bj6CYWfW.js} +1 -1
  157. package/dist/assets/{tsMode-BBmJxoNm.js → tsMode-O71ldBJ0.js} +1 -1
  158. package/dist/assets/{typescript-B5oowpNq.js → typescript-awLwl-Q4.js} +1 -1
  159. package/dist/assets/{url-evaluation-Czitveke.js → url-evaluation-Dt0gDvx3.js} +1 -1
  160. package/dist/assets/{url-join-Dlksg43I.js → url-join--yrZIt5c.js} +1 -1
  161. package/dist/assets/{use-mobile-CqXOdImD.js → use-mobile-0LaImk5H.js} +1 -1
  162. package/dist/assets/{use-mobile-xj4-48vY.js → use-mobile-CMlrBzPG.js} +1 -1
  163. package/dist/assets/{useAsync-CJVElk0R.js → useAsync-Drf6IH2B.js} +1 -1
  164. package/dist/assets/{useAsyncRetry-Rwe7Z4iE.js → useAsyncRetry-C9hqas1l.js} +1 -1
  165. package/dist/assets/{useLocalStorage-CIRKZCap.js → useLocalStorage-pzfOZ90P.js} +1 -1
  166. package/dist/assets/useThemeProps-BgkGtCgI.js +1 -0
  167. package/dist/assets/{util-BihDhLwk.js → util-CHsC18AZ.js} +1 -1
  168. package/dist/assets/{wait-container-ob8SJAT5.js → wait-container-D-JLmV2c.js} +1 -1
  169. package/dist/assets/{without-wallet-umivViXK.js → without-wallet-BVl72vUK.js} +1 -1
  170. package/dist/assets/wrap-locale-C5BuyfxR.js +1 -0
  171. package/dist/assets/{xml-hxQSF0c5.js → xml-clTeeJoN.js} +1 -1
  172. package/dist/assets/{yaml-CoAnSuk2.js → yaml-D17cEXW_.js} +1 -1
  173. package/dist/index.html +1 -1
  174. package/dist/service-worker.js +1 -1
  175. package/package.json +1 -1
  176. package/dist/assets/ArrowDropDown-BcWLUFmU.js +0 -1
  177. package/dist/assets/actions-BzyeZEph.js +0 -1
  178. package/dist/assets/api-h3phlD2Z.js +0 -1
  179. package/dist/assets/cloneDeep-CeDP5Mtp.js +0 -1
  180. package/dist/assets/emotion-cache.browser.esm-BNNaie_f.js +0 -1
  181. package/dist/assets/engine-CSHOt69S.js +0 -1
  182. package/dist/assets/getValidReactChildren-S2ketUV4.js +0 -1
  183. package/dist/assets/index-DdwdZFN8.js +0 -1
  184. package/dist/assets/index-Mu4IyZyD.js +0 -375
  185. package/dist/assets/omit-B6O9Uuy1.js +0 -1
  186. package/dist/assets/schema-DG44unLC.js +0 -1
  187. package/dist/assets/sdk-C0GTX-m3.js +0 -1
  188. package/dist/assets/toUpper-CKbst6Y6.js +0 -1
  189. package/dist/assets/useThemeProps-CEmDRTQP.js +0 -1
  190. package/dist/assets/wrap-locale-DyzSmWtH.js +0 -1
@@ -1,5 +1,5 @@
1
- import{b$ as Ke,b_ as Fe,r as h,c0 as Ge,j as e,b8 as ee,c2 as $e,cf as J,c3 as Ye,bY as He,ch as qe,aF as he,M as q,bn as A,cu as Ce,H as B,X as V,bf as E,fC as we,aQ as Be,b as N,iO as Ve,V as D,gD as Qe,o as m,x as Xe,aw as De,y as fe,ak as Ze,p as Je,C as L,T as j,k as et,s as tt,f as ot,iP as X,hZ as Z,iQ as st,K as S,aV as K,aH as T,L as nt,g as H,dl as at,ay as Se,Q as G,aE as $,a8 as Y,a4 as rt,dI as it,gt as ct,a$ as lt,v as pe,w as dt,G as be,Y as Ee,bC as xe,B as pt}from"./index-CJFsrBQ5.js";import{T as ut}from"./html-title-BTTzke5t.js";import{u as U}from"./blocklet-D7RCIEVC.js";import{u as mt}from"./use-mobile-xj4-48vY.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-DGN9otz2.js";import"./index-BsebOrBD.js";import"./index-BojVbZw0.js";import"./api-h3phlD2Z.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-qM60YnI6.js";import{v as Rt}from"./index-C8F-5PWV.js";import{E as zt}from"./index-DtI9eoxB.js";import{H as vt}from"./HelpOutline-xaytOWsN.js";import{H as Pt}from"./index-CmuytZWV.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-BpEnjnkW.js";import{D as Ut}from"./DeleteOutline-DcDoLQRc.js";import{g as ke}from"./get-safe-url-a5kkThOJ.js";import{S as Ot}from"./switch-control-B_wibGty.js";import{L as je}from"./list-header-CGkXsFzD.js";import"./OpenInNew-39NtggiI.js";import"./ButtonGroup-WBTgkkFs.js";import"./getValidReactChildren-S2ketUV4.js";import"./FilterList-CoAmsJca.js";import"./CSSTransition-PyxA7qM9.js";import"./emotion-cache.browser.esm-BNNaie_f.js";import"./index-DhjS03h3.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-8ro4t59x.js";import"./index-DDyfTi5n.js";import"./TableSearch-C69nhsKl.js";import"./Search-B-Eed1a-.js";import"./Clear-D22lsM0L.js";import"./MoreVert-Botcj4tQ.js";import"./useLocalStorage-CIRKZCap.js";import"./url-evaluation-Czitveke.js";import"./permission-Bua2xv7v.js";import"./Switch-why5ntqD.js";function Mt(t){return Ke("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:o,fontSize:n,classes:s}=t,r={root:["root",o!=="inherit"&&`color${J(o)}`,`fontSize${J(n)}`]};return Ye(r,Mt,s)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,n.color!=="inherit"&&o[`color${J(n.color)}`],o[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([o])=>({props:{color:o},style:{color:(t.vars||t).palette[o].main}}))]}))),ye=h.forwardRef(function(o,n){const s=Ge({props:o,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=s,p={...s,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.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"})),Ft=he(e.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"}));async function Gt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:o}=U(),n=o?.meta?.did,{api:s}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(o(!0),!s){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{o(!1)}},1e3);return Be(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:o}=Te(),[n,s]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),h.useEffect(()=>{if(o?.length&&Ve(o[0]?.status)){const[c]=o;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[o]),n}function Ht({deps:t=[],setLoading:o=()=>{}}={}){const{blocklet:n}=U(),[s,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{o(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{o(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:s}}const Re=h.createContext({}),{Provider:qt,Consumer:Ho}=Re;function ze({children:t}){const{t:o}=D(),{api:n}=A(),{blocklet:s}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:s?.appDid}),u=h.useMemo(()=>wt(s?.environments),[s?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[oe,se]=h.useState(0),{backupSummary:ne}=Ht({deps:[oe]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=s?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{se(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:o}=U(),{info:n}=A(),{t:s}=D(),r=Ie({blocklet:o}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:o.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(s("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:o}=U(),{data:n,loading:s}=Ce(()=>t.getBlocklet({input:{did:o?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!o?.meta?.did,refreshDeps:[o?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}function Pe({...t}){const{t:o}=h.useContext(Je),{blocklet:n,loading:s}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(L,{}):e.jsx(j,{children:o("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:o,backupSummary:n}=O(),s=xt({key:"lg"}),r=h.useRef(null),a=ot(),c=h.useCallback(l=>{o(l)},[o]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
2
- `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:st[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(K,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({status:t,message:o="",createdAt:n}){const{t:s}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(H,{type:"success",children:s("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:s("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Le.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Ue({metadata:t={}}){const{t:o}=D();if(q(t))return e.jsx(H,{type:"success",children:o("common.succeeded")});const n=t.count||0,s=t.size||0,r=At(s,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[o("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[o("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:o("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:m.object};function Oe(){const{t,locale:o}=D(),{spaceGateways:n,backups:s,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=s[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Le,{status:l,message:p,createdAt:f})}}}],[s,n,t]),c=h.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:o=()=>{},onCancel:n=()=>{}}){const{t:s}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await o?.(t),a(!1)}catch(x){console.error(x),B.error(`${s("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(rt,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:o,onDelete:n=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await s(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(L,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(G,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(G,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!o&&r&&e.jsxs(G,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Kt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(G,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:o,selected:n,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=U(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:oe,refreshBackupSummary:se,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&o===ue.DISCONNECTED,re=n&&!_&&!t.loading&&o===ue.CONNECTED,F=n&&_&&o===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),s?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await oe(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),se(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(L,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function eo({...t}){const{t:o}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:o("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function to({...t}){const{t:o}=D(),{autoBackup:n,updateAutoBackup:s}=O(),r=async()=>{try{const a=!n?.enabled;await s({enabled:a}),B.success(o(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function oo(){const{t}=D(),{spaceGateways:o,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=O(),r=n&&!o?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(to,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(L,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(eo,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function so(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):q(o)?e.jsx(Zt,{}):e.jsx(oo,{})}function no(){return e.jsx(ze,{children:e.jsx(so,{})})}function ao(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:n,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function ro(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(K,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(ao,{})]})}function io({navOrientation:t="vertical",...o}){const{t:n,locale:s}=D(),{blocklet:r}=U(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[s,l]),x=xe(()=>({backup:e.jsx(no,{}),storage:e.jsx(ro,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...o,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...o,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}io.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
1
+ import{b$ as Ke,b_ as Fe,r as h,c0 as Ge,j as e,b8 as ee,c2 as $e,cf as Z,c3 as Ye,bY as He,ch as qe,aF as he,M as q,bn as A,cu as Ce,H as B,X as V,bf as E,fC as we,aQ as Be,b as N,iV as Ve,V as D,gL as Qe,o as m,x as Xe,aw as De,y as fe,ak as Je,p as Ze,C as L,T as j,k as et,s as tt,f as ot,iW as X,i5 as J,iX as st,K as S,aV as K,aH as T,L as nt,g as H,dl as at,ay as Se,Q as G,aE as $,a8 as Y,a4 as rt,dI as it,gB as ct,a$ as lt,v as pe,w as dt,G as be,Y as Ee,bC as xe,B as pt}from"./index-BXhWMfbn.js";import{T as ut}from"./html-title-CRD93SB4.js";import{u as U}from"./blocklet-BMb-DKa8.js";import{u as mt}from"./use-mobile-CMlrBzPG.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-UN--0_6w.js";import"./index-Di7TwMAz.js";import"./index-BojVbZw0.js";import"./api-W7sKIR80.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-C-llvyn7.js";import{v as Rt}from"./index-_RQVek-9.js";import{E as zt}from"./index-D4AEyg0i.js";import{H as vt}from"./HelpOutline-dwnyWw6W.js";import{H as Pt}from"./index-B78zCe1U.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-C9R61uoD.js";import{D as Ut}from"./DeleteOutline-CvnvGjYc.js";import{g as ke}from"./get-safe-url-I2vTcMcF.js";import{S as Ot}from"./switch-control-IXycQg7u.js";import{L as je}from"./list-header-CGaXNTl1.js";import"./OpenInNew-B2F4Jqwb.js";import"./ButtonGroup-DWV84mOp.js";import"./getValidReactChildren-Ao387m76.js";import"./FilterList-CBCl7dbD.js";import"./CSSTransition-D0ZJqc3V.js";import"./emotion-cache.browser.esm-Bm19UyCk.js";import"./index-9AtlSAca.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DZ2epQ9y.js";import"./index-_nnYDXM-.js";import"./TableSearch-B7cAFRBU.js";import"./Search-nsuHiAfr.js";import"./Clear-DmQaaBy1.js";import"./MoreVert-Cy81E-t5.js";import"./useLocalStorage-pzfOZ90P.js";import"./url-evaluation-Dt0gDvx3.js";import"./permission-yeSmXMT8.js";import"./Switch-Ch-Dpg3J.js";function Mt(t){return Ke("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:o,fontSize:n,classes:s}=t,r={root:["root",o!=="inherit"&&`color${Z(o)}`,`fontSize${Z(n)}`]};return Ye(r,Mt,s)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,n.color!=="inherit"&&o[`color${Z(n.color)}`],o[`fontSize${Z(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([o])=>({props:{color:o},style:{color:(t.vars||t).palette[o].main}}))]}))),ye=h.forwardRef(function(o,n){const s=Ge({props:o,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=s,p={...s,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.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"})),Ft=he(e.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"}));async function Gt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:o}=U(),n=o?.meta?.did,{api:s}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(o(!0),!s){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{o(!1)}},1e3);return Be(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:o}=Te(),[n,s]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),h.useEffect(()=>{if(o?.length&&Ve(o[0]?.status)){const[c]=o;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[o]),n}function Ht({deps:t=[],setLoading:o=()=>{}}={}){const{blocklet:n}=U(),[s,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{o(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{o(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:s}}const Re=h.createContext({}),{Provider:qt,Consumer:Ho}=Re;function ze({children:t}){const{t:o}=D(),{api:n}=A(),{blocklet:s}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:s?.appDid}),u=h.useMemo(()=>wt(s?.environments),[s?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[oe,se]=h.useState(0),{backupSummary:ne}=Ht({deps:[oe]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=s?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{se(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:o}=U(),{info:n}=A(),{t:s}=D(),r=Ie({blocklet:o}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Je())}).get,webWalletUrl:a,extraParams:{appPid:o.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(s("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:o}=U(),{data:n,loading:s}=Ce(()=>t.getBlocklet({input:{did:o?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!o?.meta?.did,refreshDeps:[o?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}function Pe({...t}){const{t:o}=h.useContext(Ze),{blocklet:n,loading:s}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(L,{}):e.jsx(j,{children:o("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:o,backupSummary:n}=O(),s=xt({key:"lg"}),r=h.useRef(null),a=ot(),c=h.useCallback(l=>{o(l)},[o]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
2
+ `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:st[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(K,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({status:t,message:o="",createdAt:n}){const{t:s}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(H,{type:"success",children:s("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:s("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Le.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Ue({metadata:t={}}){const{t:o}=D();if(q(t))return e.jsx(H,{type:"success",children:o("common.succeeded")});const n=t.count||0,s=t.size||0,r=At(s,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[o("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[o("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:o("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:m.object};function Oe(){const{t,locale:o}=D(),{spaceGateways:n,backups:s,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=s[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Le,{status:l,message:p,createdAt:f})}}}],[s,n,t]),c=h.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Jt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:o=()=>{},onCancel:n=()=>{}}){const{t:s}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await o?.(t),a(!1)}catch(x){console.error(x),B.error(`${s("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(rt,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:o,onDelete:n=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await s(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(L,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(G,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(G,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!o&&r&&e.jsxs(G,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Kt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(G,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Zt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:o,selected:n,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=U(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:oe,refreshBackupSummary:se,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&o===ue.DISCONNECTED,re=n&&!_&&!t.loading&&o===ue.CONNECTED,F=n&&_&&o===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),s?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await oe(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),se(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Zt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(L,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function eo({...t}){const{t:o}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:o("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function to({...t}){const{t:o}=D(),{autoBackup:n,updateAutoBackup:s}=O(),r=async()=>{try{const a=!n?.enabled;await s({enabled:a}),B.success(o(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function oo(){const{t}=D(),{spaceGateways:o,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=O(),r=n&&!o?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(to,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(L,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(eo,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function so(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):q(o)?e.jsx(Jt,{}):e.jsx(oo,{})}function no(){return e.jsx(ze,{children:e.jsx(so,{})})}function ao(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:n,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function ro(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(K,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(ao,{})]})}function io({navOrientation:t="vertical",...o}){const{t:n,locale:s}=D(),{blocklet:r}=U(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[s,l]),x=xe(()=>({backup:e.jsx(no,{}),storage:e.jsx(ro,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...o,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...o,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}io.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
3
3
  position: relative;
4
4
  min-height: 66vh;
5
5
  overflow: hidden;
@@ -1 +1 @@
1
- import{r as P,V as E,A as C,j as e,Y as W,C as j,cF as I,K as T,w as k,H as u,aH as S,u as U,x as v,aq as N,ae as R}from"./index-CJFsrBQ5.js";import{w as b}from"./wrap-locale-DyzSmWtH.js";import{g as L}from"./get-safe-url-a5kkThOJ.js";import"./index-gyZ9aaBv.js";function F({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),m=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:m,onError:f,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const H=b(F);function V(){const{info:n}=U(),a=v(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(H,{SessionContext:N,webWalletUrl:a,onSuccess:r})}export{V as default};
1
+ import{r as P,V as E,A as C,j as e,Y as W,C as j,cF as I,K as T,w as k,H as u,aH as S,u as U,x as v,aq as N,ae as R}from"./index-BXhWMfbn.js";import{w as b}from"./wrap-locale-C5BuyfxR.js";import{g as L}from"./get-safe-url-I2vTcMcF.js";import"./index-f_-DLUob.js";function F({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),m=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:m,onError:f,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const H=b(F);function V(){const{info:n}=U(),a=v(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(H,{SessionContext:N,webWalletUrl:a,onSuccess:r})}export{V as default};
@@ -0,0 +1 @@
1
+ import{c4 as c,r as _,cv as f,h9 as S,cV as r}from"./index-BXhWMfbn.js";var v=function(n){var a=c(_.useState(n),2),u=a[0],o=a[1],i=f(function(t){o(function(e){var s=S(t)?t(e):t;return s?r(r({},e),s):e})});return[u,i]};export{v as u};
@@ -1 +1 @@
1
- import{cr as x,r as o,p as g,cs as r,B as u,j as s,K as m,ct as d}from"./index-CJFsrBQ5.js";function P(){const i=x(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(g),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
1
+ import{cr as x,r as o,p as g,cs as r,B as u,j as s,K as m,ct as d}from"./index-BXhWMfbn.js";function P(){const i=x(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(g),y=r.generateKey(),[a]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-D4DtKxKS.js","./index-CJFsrBQ5.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
2
- import{r as t,p as n,j as r,bI as i,d3 as a}from"./index-CJFsrBQ5.js";const s=t.lazy(()=>i(()=>import("./index-D4DtKxKS.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),d=`{
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Bz-PgJMC.js","./index-BXhWMfbn.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
2
+ import{r as t,p as n,j as r,bI as i,d3 as a}from"./index-BXhWMfbn.js";const s=t.lazy(()=>i(()=>import("./index-Bz-PgJMC.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),d=`{
3
3
  getNodeInfo {
4
4
  code
5
5
  info {
@@ -1,4 +1,4 @@
1
- import{r as p,p as ye,j as e,C as H,L as Ce,s as W,o as T,u as ce,V as Q,n as ve,q as we,$ as Be,D as Se,T as P,t as Z,v as q,w as Te,x as Le,y as Ae,z as Ie,A as me,H as M,B as De,d as Ee,f as Fe,E as Pe,F as Re,i as D,I as ee,J as te,K as S,M as Ne,N as _,O as se,P as _e,S as oe,Q as le,R as Ue,U as ne,X as Me,Y as We}from"./index-CJFsrBQ5.js";import{u as $e}from"./useLocalStorage-CIRKZCap.js";import{g as Oe,H as ze}from"./index-CmuytZWV.js";import{y as qe}from"./index-DDyfTi5n.js";import{W as Ve,B as E}from"./status-C4qpe8_G.js";import{D as He,u as Qe,B as re}from"./actions-BpEnjnkW.js";import{I as Ke,B as Xe}from"./install-from-url-F6loz7h2.js";import{u as de}from"./url-evaluation-Czitveke.js";import{L as Je}from"./Launch-ZizNNCSa.js";import{A as Ye}from"./Add-CVk8tm4G.js";import{v as F}from"./index-BsebOrBD.js";import{s as ae}from"./schema-DG44unLC.js";import{P as Ge}from"./permission-Bua2xv7v.js";import"./FilterList-CoAmsJca.js";import"./CSSTransition-PyxA7qM9.js";import"./emotion-cache.browser.esm-BNNaie_f.js";import"./index-DhjS03h3.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-8ro4t59x.js";import"./TableSearch-C69nhsKl.js";import"./Search-B-Eed1a-.js";import"./Clear-D22lsM0L.js";import"./MoreVert-Botcj4tQ.js";import"./get-safe-url-a5kkThOJ.js";import"./ButtonGroup-WBTgkkFs.js";import"./getValidReactChildren-S2ketUV4.js";import"./without-wallet-umivViXK.js";import"./index-BDu6x0_Z.js";import"./cloneDeep-CeDP5Mtp.js";import"./index-C8F-5PWV.js";import"./Autocomplete--rexVX3g.js";import"./ListSubheader-DOllyY_2.js";import"./ListItemButton-2dC6jb60.js";import"./Stepper-BA4R6xKY.js";function V({blocklet:j,skipAccessibilityCheck:f=!1,...c}){const{t:r}=p.useContext(ye),{urls:C,loading:n,recommendedUrl:h}=de(j);if(n&&!f)return e.jsx(H,{size:12,...c});const k=f?C[0]:h;return k?e.jsx(et,{...c,children:e.jsx(Ze,{children:e.jsxs(Ce,{href:k,target:"_blank",className:"blocklet-interface",underline:"hover",children:[r("common.visit"),e.jsx(Je,{fontSize:"12",sx:{marginLeft:.5}})]})})}):r("blocklet.router.noAccessibleUrl")}const Ze=W.div`
1
+ import{r as p,p as ye,j as e,C as H,L as Ce,s as W,o as T,u as ce,V as Q,n as ve,q as we,$ as Be,D as Se,T as P,t as Z,v as q,w as Te,x as Le,y as Ae,z as Ie,A as me,H as M,B as De,d as Ee,f as Fe,E as Pe,F as Re,i as D,I as ee,J as te,K as S,M as Ne,N as _,O as se,P as _e,S as oe,Q as le,R as Ue,U as ne,X as Me,Y as We}from"./index-BXhWMfbn.js";import{u as $e}from"./useLocalStorage-pzfOZ90P.js";import{g as Oe,H as ze}from"./index-B78zCe1U.js";import{y as qe}from"./index-_nnYDXM-.js";import{W as Ve,B as E}from"./status-PYw3sa-W.js";import{D as He,u as Qe,B as re}from"./actions-C9R61uoD.js";import{I as Ke,B as Xe}from"./install-from-url-B-_Dp6ah.js";import{u as de}from"./url-evaluation-Dt0gDvx3.js";import{L as Je}from"./Launch-D-brFkhF.js";import{A as Ye}from"./Add-l70J_4yZ.js";import{v as F}from"./index-Di7TwMAz.js";import{s as ae}from"./schema-CJmd8wL1.js";import{P as Ge}from"./permission-yeSmXMT8.js";import"./FilterList-CBCl7dbD.js";import"./CSSTransition-D0ZJqc3V.js";import"./emotion-cache.browser.esm-Bm19UyCk.js";import"./index-9AtlSAca.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DZ2epQ9y.js";import"./TableSearch-B7cAFRBU.js";import"./Search-nsuHiAfr.js";import"./Clear-DmQaaBy1.js";import"./MoreVert-Cy81E-t5.js";import"./get-safe-url-I2vTcMcF.js";import"./ButtonGroup-DWV84mOp.js";import"./getValidReactChildren-Ao387m76.js";import"./without-wallet-BVl72vUK.js";import"./index-CCyFCqBE.js";import"./cloneDeep-yO838gNj.js";import"./index-_RQVek-9.js";import"./Autocomplete-BGzNUg3v.js";import"./ListSubheader-CPl5W-Om.js";import"./ListItemButton-BbKr2tws.js";import"./Stepper-N4JW-HWm.js";function V({blocklet:j,skipAccessibilityCheck:f=!1,...c}){const{t:r}=p.useContext(ye),{urls:C,loading:n,recommendedUrl:h}=de(j);if(n&&!f)return e.jsx(H,{size:12,...c});const k=f?C[0]:h;return k?e.jsx(et,{...c,children:e.jsx(Ze,{children:e.jsxs(Ce,{href:k,target:"_blank",className:"blocklet-interface",underline:"hover",children:[r("common.visit"),e.jsx(Je,{fontSize:"12",sx:{marginLeft:.5}})]})})}):r("blocklet.router.noAccessibleUrl")}const Ze=W.div`
2
2
  display: flex;
3
3
  margin: 4px 0;
4
4
  `,et=W.div`
@@ -1 +1 @@
1
- import{A as g,bm as v,u as y,j as r,O as f,S as x,Q as h}from"./index-CJFsrBQ5.js";import{L as S,D as j}from"./download-C5s3qgpB.js";import{u as L}from"./useLocalStorage-CIRKZCap.js";import"./ButtonGroup-WBTgkkFs.js";import"./getValidReactChildren-S2ketUV4.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
1
+ import{A as g,bm as v,u as y,j as r,O as f,S as x,Q as h}from"./index-BXhWMfbn.js";import{L as S,D as j}from"./download-DYcl5mTN.js";import{u as L}from"./useLocalStorage-pzfOZ90P.js";import"./ButtonGroup-DWV84mOp.js";import"./getValidReactChildren-Ao387m76.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
@@ -1,4 +1,4 @@
1
- import{u as k,j as o,C as N,ax as W,cX as b,A as U,V as E,cM as _,r,aW as D,h as d,y as x,ak as P,ae as R,w as O,aH as A,x as $,aw as H,bA as K,s as M}from"./index-CJFsrBQ5.js";import{I as V}from"./invitation-BJ2Uygqj.js";import"./index-Ck-gWyqL.js";import"./index-DyoZj6uk.js";import"./emotion-cache.browser.esm-BNNaie_f.js";import"./sdk-C0GTX-m3.js";import"./wrap-locale-DyzSmWtH.js";import"./index-gyZ9aaBv.js";function X(h){const{api:i,session:p}=W(),{info:s}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(z,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(V,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const z=M.div`
1
+ import{u as k,j as o,C as N,ax as W,cX as b,A as U,V as E,cM as _,r,aW as D,h as d,y as x,ak as P,ae as R,w as O,aH as A,x as $,aw as H,bA as K,s as M}from"./index-BXhWMfbn.js";import{I as V}from"./invitation-BgD3_vhn.js";import"./index-SpBKG2cj.js";import"./index-C8GO1leJ.js";import"./emotion-cache.browser.esm-Bm19UyCk.js";import"./sdk-B9JEpY9l.js";import"./wrap-locale-C5BuyfxR.js";import"./index-f_-DLUob.js";function X(h){const{api:i,session:p}=W(),{info:s}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(z,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(V,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const z=M.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -1,4 +1,4 @@
1
- import{cI as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cV as qm,be as JL,r as QL}from"./index-CJFsrBQ5.js";/*! *****************************************************************************
1
+ import{cI as $m,bd as jL,h6 as oT,ba as Xm,bb as Zm,cV as qm,be as JL,r as QL}from"./index-BXhWMfbn.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any