@abtnode/webapp 1.17.3-beta-20251126-121502-d0926972 → 1.17.3-beta-20251127-063055-94957209

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 (188) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-BjSFvDvr.js → AdapterDayjs-DU0D4sqH.js} +1 -1
  4. package/dist/assets/{Add-BmZCIl-_.js → Add-BKe5i02H.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DZ4LPniJ.js +1 -0
  6. package/dist/assets/{Autocomplete-kBTyvXut.js → Autocomplete-DK0iCUAm.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-DbJOP5vy.js → Breadcrumbs-2mIcJJiP.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BlhSVfK3.js → ButtonGroup-B86tCmd3.js} +1 -1
  9. package/dist/assets/{CSSTransition-Cyc7snYy.js → CSSTransition-BZnv4uwU.js} +1 -1
  10. package/dist/assets/{CallMerge-CKPqdgb2.js → CallMerge-BdwpnGaL.js} +1 -1
  11. package/dist/assets/{CardContent-CJq0LG9T.js → CardContent-B3Ns-1d7.js} +1 -1
  12. package/dist/assets/{ChevronLeft-B42HGuyE.js → ChevronLeft-DKTuWlNz.js} +1 -1
  13. package/dist/assets/{ChevronRight-BLRImDEd.js → ChevronRight-U_VKk8yi.js} +1 -1
  14. package/dist/assets/{Clear-BoRiznJI.js → Clear-Bjaoevyy.js} +1 -1
  15. package/dist/assets/{DeleteOutline-_XfCv5J6.js → DeleteOutline-1L0qVW5f.js} +1 -1
  16. package/dist/assets/{Done-b5-rnBrk.js → Done-fcctYBnn.js} +1 -1
  17. package/dist/assets/{Edit-DGAlfiQv.js → Edit-Df-gu5W0.js} +1 -1
  18. package/dist/assets/{ErrorOutline-DevVxMhb.js → ErrorOutline-C2BuHaFO.js} +1 -1
  19. package/dist/assets/{FilterList-tXxMVwM9.js → FilterList-ip4QUiRE.js} +1 -1
  20. package/dist/assets/{Google-MSCLr2Nf.js → Google-C4HUt8aJ.js} +1 -1
  21. package/dist/assets/{HelpOutline-DIH3coQJ.js → HelpOutline-Dn_yz-1h.js} +1 -1
  22. package/dist/assets/{KeyboardArrowDown-DDe3llHj.js → KeyboardArrowDown-C9ZFNMos.js} +1 -1
  23. package/dist/assets/{Launch-DZ6lDDzp.js → Launch-CFi1NSiy.js} +1 -1
  24. package/dist/assets/{Link-CQj5KcJh.js → Link-CQpp_kV1.js} +1 -1
  25. package/dist/assets/{ListItemButton-BJq_k_rp.js → ListItemButton-Dq8kjXAC.js} +1 -1
  26. package/dist/assets/{ListSubheader-BO55OpFe.js → ListSubheader-BN5vdmXx.js} +1 -1
  27. package/dist/assets/{LoadingButton-Bw73z7Kp.js → LoadingButton-YsBwLHRI.js} +1 -1
  28. package/dist/assets/{MoreVert-CykMlsrj.js → MoreVert-BFhM4QD_.js} +1 -1
  29. package/dist/assets/{OpenInNew-D8CczU9i.js → OpenInNew-BQ_lyYyz.js} +1 -1
  30. package/dist/assets/{Refresh-BClPDZOR.js → Refresh-BH-2JQxb.js} +1 -1
  31. package/dist/assets/{Search-BrXfrk6s.js → Search-XYz8f8XA.js} +1 -1
  32. package/dist/assets/{Stepper-Clv2yUpj.js → Stepper-CgNQuoDq.js} +1 -1
  33. package/dist/assets/{Switch-btQlV2VF.js → Switch-D-GptXzp.js} +1 -1
  34. package/dist/assets/{TableSearch-BkWoZDH8.js → TableSearch-20ltCGV9.js} +2 -2
  35. package/dist/assets/{ToggleButtonGroup-BBbP2Jx0.js → ToggleButtonGroup-BeJ2H-vs.js} +1 -1
  36. package/dist/assets/{UnfoldMore-RJlxkooV.js → UnfoldMore-ogSRr9M8.js} +1 -1
  37. package/dist/assets/{Verified-l0Y44mJl.js → Verified-DoWJRqF2.js} +1 -1
  38. package/dist/assets/{VerifiedUser-agBH4B6_.js → VerifiedUser-C8oAKXOY.js} +1 -1
  39. package/dist/assets/{ViewList-DqVhCHtG.js → ViewList-B9yb0HBO.js} +1 -1
  40. package/dist/assets/{_createAggregator-D2uXgg5x.js → _createAggregator-Ctg83h-t.js} +1 -1
  41. package/dist/assets/{actions-DOkacRyd.js → actions-CEVha9Lm.js} +2 -2
  42. package/dist/assets/{actions-BPQhtNul.js → actions-CcYVxFDV.js} +1 -1
  43. package/dist/assets/{agreement-peew__AK.js → agreement-Do9LS1H9.js} +3 -3
  44. package/dist/assets/api-BgkTVaD7.js +1 -0
  45. package/dist/assets/{appearance-Nhx9Kmv1.js → appearance-BAXcLNQv.js} +1 -1
  46. package/dist/assets/{audit-logs-BlbUuwN_.js → audit-logs-CNWSS6cO.js} +2 -2
  47. package/dist/assets/{base-chart-CzLW1tBo.js → base-chart-CtBedy-P.js} +1 -1
  48. package/dist/assets/{blocklet-DooKd_sI.js → blocklet-Dcm-KWY0.js} +1 -1
  49. package/dist/assets/{chain-EI4hm_8e.js → chain-B1M1oJUZ.js} +1 -1
  50. package/dist/assets/click-to-copy-UAGH53Qf.js +1 -0
  51. package/dist/assets/cloneDeep-a4PlXlaR.js +1 -0
  52. package/dist/assets/{collapse-CmeTRdrT.js → collapse-SFvNptyB.js} +1 -1
  53. package/dist/assets/{config-navigation-SDiPbeiK.js → config-navigation-BXWbV-Cs.js} +3 -3
  54. package/dist/assets/{connect-to-DxqW5HVH.js → connect-to-C1HXhR31.js} +4 -4
  55. package/dist/assets/{cssMode-U50M1_i-.js → cssMode-a2Qinu_F.js} +1 -1
  56. package/dist/assets/{delete-confirm-B_mXlLTh.js → delete-confirm-CykvEZcZ.js} +1 -1
  57. package/dist/assets/{depsEqual-CI7FeWZW.js → depsEqual-CNVuMuEd.js} +1 -1
  58. package/dist/assets/{detail-B_ewDRP9.js → detail-DgAURCp6.js} +3 -3
  59. package/dist/assets/{domains-DWWQ8C3v.js → domains-DzUka-Py.js} +2 -2
  60. package/dist/assets/{download-Jmt9jl6E.js → download-DAgi3KG_.js} +1 -1
  61. package/dist/assets/{edit.svg-DOKf0NKv.js → edit.svg-DYBjroym.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-Dakakd0R.js +1 -0
  63. package/dist/assets/engine-4rlPqZXl.js +1 -0
  64. package/dist/assets/{freemarker2-wCdJg_1P.js → freemarker2-C-5txAzw.js} +1 -1
  65. package/dist/assets/{get-safe-url-mJazyUZj.js → get-safe-url-slTYcduh.js} +1 -1
  66. package/dist/assets/getValidReactChildren-D4p_s3zF.js +1 -0
  67. package/dist/assets/{graphqlMode-r_xp5vcq.js → graphqlMode-CqvY2dvn.js} +2 -2
  68. package/dist/assets/{handlebars-CmQCPbdG.js → handlebars-BYAvYDfA.js} +1 -1
  69. package/dist/assets/{html-DYkdCzxq.js → html-BvL9XBVt.js} +1 -1
  70. package/dist/assets/{html-title-x1db95S1.js → html-title-C8DFoE3o.js} +1 -1
  71. package/dist/assets/{htmlMode-B2_nCAdZ.js → htmlMode-B2ou9eLB.js} +1 -1
  72. package/dist/assets/{iframe-BBrwuPrb.js → iframe-B2nulerg.js} +1 -1
  73. package/dist/assets/{index-Bexo5RVe.js → index-B069rJrU.js} +1 -1
  74. package/dist/assets/{index-9oTGqHiK.js → index-B0ezkZD_.js} +9 -9
  75. package/dist/assets/{index-DYWrZZLV.js → index-B22sxjhK.js} +1 -1
  76. package/dist/assets/{index-Ca1VB0fP.js → index-B7yK5r9r.js} +1 -1
  77. package/dist/assets/{index-m0BJnU58.js → index-BE_VxsDo.js} +1 -1
  78. package/dist/assets/{index-Bsv4O26i.js → index-BIyZS31y.js} +3 -3
  79. package/dist/assets/{index-cW_e6AnH.js → index-BQoDUo8G.js} +14 -14
  80. package/dist/assets/{index-C6nj_8zr.js → index-BTZ0eV0N.js} +1 -1
  81. package/dist/assets/{index-DMGtaArc.js → index-BVPjbwFh.js} +3 -3
  82. package/dist/assets/{index-Bge0nxkS.js → index-BYvHyq2X.js} +2 -2
  83. package/dist/assets/{index-BKe-qavD.js → index-BeBFdIcq.js} +1 -1
  84. package/dist/assets/{index-CMGLmPFR.js → index-Bk3Q7htA.js} +2 -2
  85. package/dist/assets/{index-eIb8MZiw.js → index-BxE9QNGJ.js} +1 -1
  86. package/dist/assets/{index-BD7DDM8N.js → index-C-ZSaiUf.js} +1 -1
  87. package/dist/assets/{index-BX3e3-Yl.js → index-C-ikBis3.js} +10 -10
  88. package/dist/assets/{index-DlRSxwJY.js → index-C3LdZf6o.js} +3 -3
  89. package/dist/assets/{index-D0h_Lxum.js → index-C4O6nFZK.js} +1 -1
  90. package/dist/assets/{index-BwyiJPiC.js → index-C4sXNe3X.js} +1 -1
  91. package/dist/assets/{index-BGAQvWoz.js → index-CGPesPdM.js} +1 -1
  92. package/dist/assets/{index-sHP8LVQG.js → index-CQBXMXxB.js} +1 -1
  93. package/dist/assets/{index-BNYZMueI.js → index-CcoyIHc2.js} +1 -1
  94. package/dist/assets/{index-8dobedE4.js → index-Cmq6DzBi.js} +1 -1
  95. package/dist/assets/{index-B7vOpBED.js → index-Cq0PEg3C.js} +1 -1
  96. package/dist/assets/{index-CCR0588i.js → index-CzOe4kWN.js} +1 -1
  97. package/dist/assets/{index-MQfB--7g.js → index-D1v2ub6O.js} +1 -1
  98. package/dist/assets/{index-DSwwhtGQ.js → index-DDHwRT_8.js} +1 -1
  99. package/dist/assets/{index-Cs2sn0We.js → index-DE2n9InK.js} +8 -8
  100. package/dist/assets/{index-D1rJ129A.js → index-DKNNRdfd.js} +2 -2
  101. package/dist/assets/{index-C6cKgXcg.js → index-DLW-FPc1.js} +1 -1
  102. package/dist/assets/{index-DWhhB9Hi.js → index-DNQRuNMg.js} +2 -2
  103. package/dist/assets/{index-BDfVLYgm.js → index-DcJaC3Zv.js} +1 -1
  104. package/dist/assets/{index-CNWl5k-n.js → index-Dd8DBQ06.js} +1 -1
  105. package/dist/assets/{index-ccBUb-g_.js → index-DevzmDa7.js} +2 -2
  106. package/dist/assets/{index-Q3-b6N6x.js → index-Dmm7CN3L.js} +1 -1
  107. package/dist/assets/{index-B6WuMj55.js → index-DrzeWNxs.js} +1 -1
  108. package/dist/assets/{index-BvQcTKRh.js → index-DudW3VZ0.js} +1 -1
  109. package/dist/assets/{index-CvM9vyEK.js → index-DxHUxvwT.js} +1 -1
  110. package/dist/assets/{index-BJY_2WX8.js → index-Dxb5VoXb.js} +1 -1
  111. package/dist/assets/{index-B1zRPZ23.js → index-Dxe6NqUd.js} +1 -1
  112. package/dist/assets/{index-bHYz6L_6.js → index-Gy9GijRe.js} +1 -1
  113. package/dist/assets/{index-CsRtSmIh.js → index-MI1PE9cE.js} +1 -1
  114. package/dist/assets/index-PmpfUMid.js +1 -0
  115. package/dist/assets/{index-Bf9Tsnzp.js → index-m59yehWt.js} +1 -1
  116. package/dist/assets/{index-B3mxPYvg.js → index-o0W75sh0.js} +2 -2
  117. package/dist/assets/{index-l0ejZk6e.js → index-t7M3AlIl.js} +2 -2
  118. package/dist/assets/{index-tY4NTQdt.js → index-zEOfnqWp.js} +1 -1
  119. package/dist/assets/{index.esm-CmfVZ8uo.js → index.esm-y0ki7yla.js} +1 -1
  120. package/dist/assets/{install-from-url-DKaI4Rhw.js → install-from-url-bDGtH7bg.js} +1 -1
  121. package/dist/assets/{invitation-BP2qXMkU.js → invitation-BMQ8ii-U.js} +2 -2
  122. package/dist/assets/{is-path-prefix-equal-D367I16F.js → is-path-prefix-equal-6ZIHUdY4.js} +1 -1
  123. package/dist/assets/{item-C6-NqxXS.js → item-CcYR2iTB.js} +8 -8
  124. package/dist/assets/{javascript-C8IdANXc.js → javascript-Dv9tLB_N.js} +1 -1
  125. package/dist/assets/{jsonMode-7RTtLpT6.js → jsonMode-DUlsfgRc.js} +1 -1
  126. package/dist/assets/{liquid-CF0mRQ0b.js → liquid-C9JfvrHT.js} +1 -1
  127. package/dist/assets/{list-header-DnPG8RQK.js → list-header-DE2pVYNH.js} +1 -1
  128. package/dist/assets/{lock.svg-DIpUz3_T.js → lock.svg-DK6tzOS0.js} +1 -1
  129. package/dist/assets/{log-CLLKDcVS.js → log-B0JHspX2.js} +1 -1
  130. package/dist/assets/{lottie-react.esm-BzADuacJ.js → lottie-react.esm-BQ1sE4G7.js} +1 -1
  131. package/dist/assets/{mdx-393D49gD.js → mdx-D_F4JUXE.js} +1 -1
  132. package/dist/assets/{memory-BiZfGzaA.js → memory-Ca0TT2wR.js} +1 -1
  133. package/dist/assets/{metric-DQF3F8Ee.js → metric-B_ux39Cy.js} +1 -1
  134. package/dist/assets/omit-Cxe_6CRp.js +1 -0
  135. package/dist/assets/{overview-CCLYGiqE.js → overview-DdKaJYs3.js} +1 -1
  136. package/dist/assets/{permission-CB_zs2G4.js → permission-DL-rt2kz.js} +1 -1
  137. package/dist/assets/{preference-2qHeMKaE.js → preference-B32PPIXC.js} +4 -4
  138. package/dist/assets/{python-DeXJ9-sq.js → python-DxxmtajH.js} +1 -1
  139. package/dist/assets/{raf-schd.esm-gP-_XKJP.js → raf-schd.esm-C3uAJs0d.js} +1 -1
  140. package/dist/assets/{razor-D15rTZli.js → razor-C21hzdPt.js} +1 -1
  141. package/dist/assets/{rotate-session-key-BqAzAxv_.js → rotate-session-key-Cxb_738W.js} +1 -1
  142. package/dist/assets/{runtime-Cf5aBcfV.js → runtime-Bdx0ukMN.js} +1 -1
  143. package/dist/assets/schema-CSqqEtp_.js +1 -0
  144. package/dist/assets/sdk-C4od53R_.js +1 -0
  145. package/dist/assets/{service-pECpZ6Fv.js → service-BM2nSHO0.js} +1 -1
  146. package/dist/assets/{shorten-label-5tBjSQXq.js → shorten-label-DnblKkIH.js} +1 -1
  147. package/dist/assets/{simple-select-DCNot1u5.js → simple-select-DPUPpFQ5.js} +1 -1
  148. package/dist/assets/{spaces-1p_UMor_.js → spaces-BKKKu_Dh.js} +1 -1
  149. package/dist/assets/{status-Xk2ZLYz1.js → status-COOoCu8i.js} +1 -1
  150. package/dist/assets/{status-DyTELFmb.js → status-DtYf6aZS.js} +1 -1
  151. package/dist/assets/{switch-control-DBKg8KSu.js → switch-control-CNmlIEr7.js} +1 -1
  152. package/dist/assets/{table-icons-DfjWu9CY.js → table-icons-C91WckX-.js} +1 -1
  153. package/dist/assets/{team-DHZ07Mee.js → team-DMp941g-.js} +1 -1
  154. package/dist/assets/{toLower-ylIkvfVr.js → toLower-BOZmijH1.js} +1 -1
  155. package/dist/assets/toUpper-BVrGP8Kf.js +1 -0
  156. package/dist/assets/{traffic-BlWSHfOP.js → traffic-CAtwfrwW.js} +1 -1
  157. package/dist/assets/{tsMode-BbObiMoD.js → tsMode-BsmIUAx_.js} +1 -1
  158. package/dist/assets/{typescript-Cuj7nGhN.js → typescript-CuXsCA8e.js} +1 -1
  159. package/dist/assets/{url-evaluation-DAoEPnuZ.js → url-evaluation-Dx99nTAj.js} +1 -1
  160. package/dist/assets/{url-join-CNIVoOP5.js → url-join--uxDIQ5s.js} +1 -1
  161. package/dist/assets/{use-mobile-B06ZsBLv.js → use-mobile-B_qRraPN.js} +1 -1
  162. package/dist/assets/{use-mobile-DRLSkCfk.js → use-mobile-gk4f0z32.js} +1 -1
  163. package/dist/assets/{useAsync-C_IdsZLT.js → useAsync-BkAVfcXM.js} +1 -1
  164. package/dist/assets/{useAsyncRetry-AD_J4c2Y.js → useAsyncRetry-B53j1afR.js} +1 -1
  165. package/dist/assets/{useLocalStorage-CaDSR1Wc.js → useLocalStorage-BNDc6dCy.js} +1 -1
  166. package/dist/assets/{useThemeProps-DAtqRnvX.js → useThemeProps-CWZCrmyJ.js} +1 -1
  167. package/dist/assets/{util-B5JRPt0_.js → util-Hbz7ULeM.js} +1 -1
  168. package/dist/assets/{wait-container-D08poArP.js → wait-container-BwhzxN9f.js} +1 -1
  169. package/dist/assets/{without-wallet-Cq0jHe0-.js → without-wallet-Bms_Rs1m.js} +1 -1
  170. package/dist/assets/wrap-locale-BYm00LUc.js +1 -0
  171. package/dist/assets/{xml-yaEsWuy9.js → xml-jOEN8hj5.js} +1 -1
  172. package/dist/assets/{yaml-B2xGL9-8.js → yaml-DIuLKVgk.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-DAMbspww.js +0 -1
  177. package/dist/assets/api-BEwC7jzb.js +0 -1
  178. package/dist/assets/click-to-copy-BYLhYz_K.js +0 -1
  179. package/dist/assets/cloneDeep-F6LuuTz3.js +0 -1
  180. package/dist/assets/emotion-cache.browser.esm-CKIgFJwY.js +0 -1
  181. package/dist/assets/engine-PA5Hlqhs.js +0 -1
  182. package/dist/assets/getValidReactChildren-C2GpPG5h.js +0 -1
  183. package/dist/assets/index-B8pH5JDj.js +0 -1
  184. package/dist/assets/omit-B8z6Iws2.js +0 -1
  185. package/dist/assets/schema-DVKja_3K.js +0 -1
  186. package/dist/assets/sdk-D_BY3a8P.js +0 -1
  187. package/dist/assets/toUpper-D9lAXG2I.js +0 -1
  188. package/dist/assets/wrap-locale-fe2iWyZX.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aF as Ge,j as e,bn as gt,r as g,bC as J,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as Q,eO as Fe,O as Pe,io as Ye,bj as Te,aU as Ie,R as Ee,dI as Ne,b3 as qe,b1 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,as as Ze,ip as et,v as Oe,f2 as tt,bq as je,fJ as st,dC as St,s as ie,af as pe,G as Ue,au as vt,iq as Ct,ir as Nt,$ as nt,is as wt,it as Rt,iu as Tt,iv as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,iw as kt,a3 as Ft}from"./index-l0ejZk6e.js";import{d as Pt,H as at,g as _t}from"./index-BKe-qavD.js";import{R as _e,S as Bt}from"./actions-DOkacRyd.js";import{B as zt}from"./index-m0BJnU58.js";import{S as me}from"./shorten-label-5tBjSQXq.js";import{v as ot}from"./index-CvM9vyEK.js";import{T as Wt}from"./html-title-x1db95S1.js";import{R as Mt}from"./Refresh-BClPDZOR.js";import{D as Kt,g as Ht}from"./traffic-BlWSHfOP.js";import{u as qt}from"./use-mobile-B06ZsBLv.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-BwyiJPiC.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CI7FeWZW.js";import"./index-B1zRPZ23.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./useLocalStorage-CaDSR1Wc.js";import"./url-evaluation-DAoEPnuZ.js";import"./get-safe-url-mJazyUZj.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./permission-CB_zs2G4.js";import"./index.esm-CmfVZ8uo.js";import"./collapse-CmeTRdrT.js";import"./blocklet-DooKd_sI.js";import"./Switch-btQlV2VF.js";import"./iframe-BBrwuPrb.js";import"./ChevronLeft-B42HGuyE.js";import"./ChevronRight-BLRImDEd.js";import"./index-DBii9-f-.js";import"./base-chart-CzLW1tBo.js";import"./index-DYWrZZLV.js";import"./AdapterDayjs-BjSFvDvr.js";import"./useThemeProps-DAtqRnvX.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
1
+ import{aF as Ge,j as e,bn as gt,r as g,bD as J,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as Q,eO as Fe,O as Pe,io as Ye,bj as Te,aU as Ie,R as Ee,bA as Ne,b3 as qe,b1 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,as as Ze,ip as et,v as Oe,f2 as tt,bq as je,fJ as st,dD as St,s as ie,af as pe,G as Ue,au as vt,iq as Ct,ir as Nt,$ as nt,is as wt,it as Rt,iu as Tt,iv as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,iw as kt,a3 as Ft}from"./index-t7M3AlIl.js";import{d as Pt,H as at,g as _t}from"./index-BeBFdIcq.js";import{R as _e,S as Bt}from"./actions-CEVha9Lm.js";import{B as zt}from"./index-BE_VxsDo.js";import{S as me}from"./shorten-label-DnblKkIH.js";import{v as ot}from"./index-DxHUxvwT.js";import{T as Wt}from"./html-title-C8DFoE3o.js";import{R as Mt}from"./Refresh-BH-2JQxb.js";import{D as Kt,g as Ht}from"./traffic-CAtwfrwW.js";import{u as qt}from"./use-mobile-B_qRraPN.js";import"./FilterList-ip4QUiRE.js";import"./CSSTransition-BZnv4uwU.js";import"./emotion-cache.browser.esm-Dakakd0R.js";import"./index-C4sXNe3X.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CNVuMuEd.js";import"./index-Dxe6NqUd.js";import"./TableSearch-20ltCGV9.js";import"./Search-XYz8f8XA.js";import"./Clear-Bjaoevyy.js";import"./MoreVert-BFhM4QD_.js";import"./useLocalStorage-BNDc6dCy.js";import"./url-evaluation-Dx99nTAj.js";import"./get-safe-url-slTYcduh.js";import"./ButtonGroup-B86tCmd3.js";import"./getValidReactChildren-D4p_s3zF.js";import"./permission-DL-rt2kz.js";import"./index.esm-y0ki7yla.js";import"./collapse-SFvNptyB.js";import"./blocklet-Dcm-KWY0.js";import"./Switch-D-GptXzp.js";import"./iframe-B2nulerg.js";import"./ChevronLeft-DKTuWlNz.js";import"./ChevronRight-U_VKk8yi.js";import"./index-DBii9-f-.js";import"./base-chart-CtBedy-P.js";import"./index-B22sxjhK.js";import"./AdapterDayjs-DU0D4sqH.js";import"./useThemeProps-CWZCrmyJ.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -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-l0ejZk6e.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{cs as u,r as o,p as x,ct as r,B as g,j as s,K as m,cu as d}from"./index-t7M3AlIl.js";function P(){const i=u(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=g();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};
@@ -0,0 +1 @@
1
+ import{c5 as c,r as _,cw as f,h2 as S,cW as r}from"./index-t7M3AlIl.js";var d=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{d as u};
@@ -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-l0ejZk6e.js";import{u as $e}from"./useLocalStorage-CaDSR1Wc.js";import{g as Oe,H as ze}from"./index-BKe-qavD.js";import{y as qe}from"./index-B1zRPZ23.js";import{W as Ve,B as E}from"./status-DyTELFmb.js";import{D as He,u as Qe,B as re}from"./actions-DOkacRyd.js";import{I as Ke,B as Xe}from"./install-from-url-DKaI4Rhw.js";import{u as de}from"./url-evaluation-DAoEPnuZ.js";import{L as Je}from"./Launch-DZ6lDDzp.js";import{A as Ye}from"./Add-BmZCIl-_.js";import{v as F}from"./index-DWhhB9Hi.js";import{s as ae}from"./schema-DVKja_3K.js";import{P as Ge}from"./permission-CB_zs2G4.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-BwyiJPiC.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CI7FeWZW.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./get-safe-url-mJazyUZj.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./without-wallet-Cq0jHe0-.js";import"./index-BD7DDM8N.js";import"./cloneDeep-F6LuuTz3.js";import"./index-CvM9vyEK.js";import"./Autocomplete-kBTyvXut.js";import"./ListSubheader-BO55OpFe.js";import"./ListItemButton-BJq_k_rp.js";import"./Stepper-Clv2yUpj.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-t7M3AlIl.js";import{u as $e}from"./useLocalStorage-BNDc6dCy.js";import{g as Oe,H as ze}from"./index-BeBFdIcq.js";import{y as qe}from"./index-Dxe6NqUd.js";import{W as Ve,B as E}from"./status-DtYf6aZS.js";import{D as He,u as Qe,B as re}from"./actions-CEVha9Lm.js";import{I as Ke,B as Xe}from"./install-from-url-bDGtH7bg.js";import{u as de}from"./url-evaluation-Dx99nTAj.js";import{L as Je}from"./Launch-CFi1NSiy.js";import{A as Ye}from"./Add-BKe5i02H.js";import{v as F}from"./index-DNQRuNMg.js";import{s as ae}from"./schema-CSqqEtp_.js";import{P as Ge}from"./permission-DL-rt2kz.js";import"./FilterList-ip4QUiRE.js";import"./CSSTransition-BZnv4uwU.js";import"./emotion-cache.browser.esm-Dakakd0R.js";import"./index-C4sXNe3X.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CNVuMuEd.js";import"./TableSearch-20ltCGV9.js";import"./Search-XYz8f8XA.js";import"./Clear-Bjaoevyy.js";import"./MoreVert-BFhM4QD_.js";import"./get-safe-url-slTYcduh.js";import"./ButtonGroup-B86tCmd3.js";import"./getValidReactChildren-D4p_s3zF.js";import"./without-wallet-Bms_Rs1m.js";import"./index-C-ZSaiUf.js";import"./cloneDeep-a4PlXlaR.js";import"./index-DxHUxvwT.js";import"./Autocomplete-DK0iCUAm.js";import"./ListSubheader-BN5vdmXx.js";import"./ListItemButton-Dq8kjXAC.js";import"./Stepper-CgNQuoDq.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,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 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,fD as we,aQ as Be,b as N,i$ as Ve,V as D,gE 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,j0 as X,i1 as J,j1 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,gu 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-l0ejZk6e.js";import{T as ut}from"./html-title-x1db95S1.js";import{u as U}from"./blocklet-DooKd_sI.js";import{u as mt}from"./use-mobile-B06ZsBLv.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-DxqW5HVH.js";import"./index-DWhhB9Hi.js";import"./index-BojVbZw0.js";import"./api-BEwC7jzb.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-1p_UMor_.js";import{v as Rt}from"./index-CvM9vyEK.js";import{E as zt}from"./index-DYWrZZLV.js";import{H as vt}from"./HelpOutline-DIH3coQJ.js";import{H as Pt}from"./index-BKe-qavD.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-DOkacRyd.js";import{D as Ut}from"./DeleteOutline-_XfCv5J6.js";import{g as ke}from"./get-safe-url-mJazyUZj.js";import{S as Ot}from"./switch-control-DBKg8KSu.js";import{L as je}from"./list-header-DnPG8RQK.js";import"./OpenInNew-D8CczU9i.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-BwyiJPiC.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CI7FeWZW.js";import"./index-B1zRPZ23.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./useLocalStorage-CaDSR1Wc.js";import"./url-evaluation-DAoEPnuZ.js";import"./permission-CB_zs2G4.js";import"./Switch-btQlV2VF.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)`
1
+ import{c0 as Ke,b$ as Fe,r as h,c1 as Ge,j as e,b8 as ee,c3 as $e,cg as J,c4 as Ye,bZ as He,ci as qe,aF as he,M as q,bn as A,cv as Ce,H as B,X as V,bf as E,fD as we,aQ as Be,b as N,i$ as Ve,V as D,gE 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,j0 as X,i1 as Z,j1 as st,K as S,aV as K,aH as T,L as nt,g as H,dm as at,ay as Se,Q as G,aE as $,a8 as Y,a4 as rt,bA as it,gu as ct,a$ as lt,v as pe,w as dt,G as be,Y as Ee,bD as xe,B as pt}from"./index-t7M3AlIl.js";import{T as ut}from"./html-title-C8DFoE3o.js";import{u as U}from"./blocklet-Dcm-KWY0.js";import{u as mt}from"./use-mobile-B_qRraPN.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-C1HXhR31.js";import"./index-DNQRuNMg.js";import"./index-BojVbZw0.js";import"./api-BgkTVaD7.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-BKKKu_Dh.js";import{v as Rt}from"./index-DxHUxvwT.js";import{E as zt}from"./index-B22sxjhK.js";import{H as vt}from"./HelpOutline-Dn_yz-1h.js";import{H as Pt}from"./index-BeBFdIcq.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-CEVha9Lm.js";import{D as Ut}from"./DeleteOutline-1L0qVW5f.js";import{g as ke}from"./get-safe-url-slTYcduh.js";import{S as Ot}from"./switch-control-CNmlIEr7.js";import{L as je}from"./list-header-DE2pVYNH.js";import"./OpenInNew-BQ_lyYyz.js";import"./ButtonGroup-B86tCmd3.js";import"./getValidReactChildren-D4p_s3zF.js";import"./FilterList-ip4QUiRE.js";import"./CSSTransition-BZnv4uwU.js";import"./emotion-cache.browser.esm-Dakakd0R.js";import"./index-C4sXNe3X.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CNVuMuEd.js";import"./index-Dxe6NqUd.js";import"./TableSearch-20ltCGV9.js";import"./Search-XYz8f8XA.js";import"./Clear-Bjaoevyy.js";import"./MoreVert-BFhM4QD_.js";import"./useLocalStorage-BNDc6dCy.js";import"./url-evaluation-Dx99nTAj.js";import"./permission-DL-rt2kz.js";import"./Switch-D-GptXzp.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)`
3
3
  position: relative;
4
4
  min-height: 66vh;
5
5
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Ca1VB0fP.js","./index-BojVbZw0.js","./index-CvM9vyEK.js","./metric-DQF3F8Ee.js","./click-to-copy-BYLhYz_K.js","./index-Bf9Tsnzp.js","./useLocalStorage-CaDSR1Wc.js","./index-BKe-qavD.js","./FilterList-tXxMVwM9.js","./CSSTransition-Cyc7snYy.js","./emotion-cache.browser.esm-CKIgFJwY.js","./index-BwyiJPiC.js","./redux-DfszZyTl.js","./typeof-QjJsDpFa.js","./depsEqual-CI7FeWZW.js","./index-B1zRPZ23.js","./TableSearch-BkWoZDH8.js","./Search-BrXfrk6s.js","./Clear-BoRiznJI.js","./MoreVert-CykMlsrj.js","./status-DyTELFmb.js","./actions-DOkacRyd.js","./url-evaluation-DAoEPnuZ.js","./get-safe-url-mJazyUZj.js","./ButtonGroup-BlhSVfK3.js","./getValidReactChildren-C2GpPG5h.js","./permission-CB_zs2G4.js","./install-from-url-DKaI4Rhw.js","./without-wallet-Cq0jHe0-.js","./index-BD7DDM8N.js","./cloneDeep-F6LuuTz3.js","./Autocomplete-kBTyvXut.js","./ListSubheader-BO55OpFe.js","./ListItemButton-BJq_k_rp.js","./Stepper-Clv2yUpj.js","./Launch-DZ6lDDzp.js","./Add-BmZCIl-_.js","./index-DWhhB9Hi.js","./schema-DVKja_3K.js","./index-D0h_Lxum.js","./toLower-ylIkvfVr.js","./index-D1rJ129A.js","./url-join-CNIVoOP5.js","./wait-container-D08poArP.js","./use-mobile-B06ZsBLv.js","./DeleteOutline-_XfCv5J6.js","./spaces-1p_UMor_.js","./api-BEwC7jzb.js","./index-8dobedE4.js","./item-C6-NqxXS.js","./index-BDfVLYgm.js","./KeyboardArrowDown-DDe3llHj.js","./ChevronLeft-B42HGuyE.js","./ChevronRight-BLRImDEd.js","./blocklet-DooKd_sI.js","./Verified-l0Y44mJl.js","./VerifiedUser-agBH4B6_.js","./Done-b5-rnBrk.js","./delete-confirm-B_mXlLTh.js","./item-G0iZE90Q.css","./engine-PA5Hlqhs.js","./ArrowDropDown-DAMbspww.js","./Breadcrumbs-DbJOP5vy.js","./index-CNWl5k-n.js","./html-title-x1db95S1.js","./index.esm-CmfVZ8uo.js","./switch-control-DBKg8KSu.js","./Switch-btQlV2VF.js","./Link-CQj5KcJh.js","./logo-BKA11TRi.js","./Refresh-BClPDZOR.js","./LoadingButton-Bw73z7Kp.js","./rotate-session-key-BqAzAxv_.js","./visuallyHidden-Dan1xhjv.js","./is-path-prefix-equal-D367I16F.js","./Edit-DGAlfiQv.js","./CallMerge-CKPqdgb2.js","./CardContent-CJq0LG9T.js","./index-C6nj_8zr.js","./download-Jmt9jl6E.js","./index-BX3e3-Yl.js","./audit-logs-BlbUuwN_.js","./index-eIb8MZiw.js","./decode-DPztD6kB.js","./index-gnjjKJuC.css","./UnfoldMore-RJlxkooV.js","./shorten-label-5tBjSQXq.js","./team-DHZ07Mee.js","./index-B6WuMj55.js","./ViewList-DqVhCHtG.js","./Google-MSCLr2Nf.js","./AdapterDayjs-BjSFvDvr.js","./useThemeProps-DAtqRnvX.js","./ErrorOutline-DevVxMhb.js","./index-sHP8LVQG.js","./sdk-D_BY3a8P.js","./actions-BPQhtNul.js","./ua-parser-DP5omx3I.js","./index-B7vOpBED.js","./edit.svg-DOKf0NKv.js","./list-header-DnPG8RQK.js","./chain-EI4hm_8e.js","./ToggleButtonGroup-BBbP2Jx0.js","./lock.svg-DIpUz3_T.js","./useAsyncRetry-AD_J4c2Y.js","./useAsync-C_IdsZLT.js","./index-ZgkIHsf0.css","./detail-B_ewDRP9.js","./index-Bge0nxkS.js","./index-Q3-b6N6x.js","./invitation-BP2qXMkU.js","./wrap-locale-fe2iWyZX.js","./index-DSwwhtGQ.js","./index-Bsv4O26i.js","./index-BvQcTKRh.js","./index-C6cKgXcg.js","./agreement-peew__AK.js","./index-BJY_2WX8.js","./index-ccBUb-g_.js","./index-tY4NTQdt.js","./traffic-BlWSHfOP.js","./iframe-BBrwuPrb.js","./index-DBii9-f-.js","./base-chart-CzLW1tBo.js","./index-DYWrZZLV.js","./index-DRYJ0xIl.js","./memory-BiZfGzaA.js","./index-Bexo5RVe.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B7yK5r9r.js","./index-BojVbZw0.js","./index-DxHUxvwT.js","./metric-B_ux39Cy.js","./click-to-copy-UAGH53Qf.js","./index-m59yehWt.js","./useLocalStorage-BNDc6dCy.js","./index-BeBFdIcq.js","./FilterList-ip4QUiRE.js","./CSSTransition-BZnv4uwU.js","./emotion-cache.browser.esm-Dakakd0R.js","./index-C4sXNe3X.js","./redux-DfszZyTl.js","./typeof-QjJsDpFa.js","./depsEqual-CNVuMuEd.js","./index-Dxe6NqUd.js","./TableSearch-20ltCGV9.js","./Search-XYz8f8XA.js","./Clear-Bjaoevyy.js","./MoreVert-BFhM4QD_.js","./status-DtYf6aZS.js","./actions-CEVha9Lm.js","./url-evaluation-Dx99nTAj.js","./get-safe-url-slTYcduh.js","./ButtonGroup-B86tCmd3.js","./getValidReactChildren-D4p_s3zF.js","./permission-DL-rt2kz.js","./install-from-url-bDGtH7bg.js","./without-wallet-Bms_Rs1m.js","./index-C-ZSaiUf.js","./cloneDeep-a4PlXlaR.js","./Autocomplete-DK0iCUAm.js","./ListSubheader-BN5vdmXx.js","./ListItemButton-Dq8kjXAC.js","./Stepper-CgNQuoDq.js","./Launch-CFi1NSiy.js","./Add-BKe5i02H.js","./index-DNQRuNMg.js","./schema-CSqqEtp_.js","./index-C4O6nFZK.js","./toLower-BOZmijH1.js","./index-DKNNRdfd.js","./url-join--uxDIQ5s.js","./wait-container-BwhzxN9f.js","./use-mobile-B_qRraPN.js","./DeleteOutline-1L0qVW5f.js","./spaces-BKKKu_Dh.js","./api-BgkTVaD7.js","./index-Cmq6DzBi.js","./item-CcYR2iTB.js","./index-DcJaC3Zv.js","./KeyboardArrowDown-C9ZFNMos.js","./ChevronLeft-DKTuWlNz.js","./ChevronRight-U_VKk8yi.js","./blocklet-Dcm-KWY0.js","./Verified-DoWJRqF2.js","./VerifiedUser-C8oAKXOY.js","./Done-fcctYBnn.js","./delete-confirm-CykvEZcZ.js","./item-G0iZE90Q.css","./engine-4rlPqZXl.js","./ArrowDropDown-DZ4LPniJ.js","./Breadcrumbs-2mIcJJiP.js","./index-Dd8DBQ06.js","./html-title-C8DFoE3o.js","./index.esm-y0ki7yla.js","./switch-control-CNmlIEr7.js","./Switch-D-GptXzp.js","./Link-CQpp_kV1.js","./logo-BKA11TRi.js","./Refresh-BH-2JQxb.js","./LoadingButton-YsBwLHRI.js","./rotate-session-key-Cxb_738W.js","./visuallyHidden-Dan1xhjv.js","./is-path-prefix-equal-6ZIHUdY4.js","./Edit-Df-gu5W0.js","./CallMerge-BdwpnGaL.js","./CardContent-B3Ns-1d7.js","./index-BTZ0eV0N.js","./download-DAgi3KG_.js","./index-C-ikBis3.js","./audit-logs-CNWSS6cO.js","./index-BxE9QNGJ.js","./decode-DPztD6kB.js","./index-gnjjKJuC.css","./UnfoldMore-ogSRr9M8.js","./shorten-label-DnblKkIH.js","./team-DMp941g-.js","./index-DrzeWNxs.js","./ViewList-B9yb0HBO.js","./Google-C4HUt8aJ.js","./AdapterDayjs-DU0D4sqH.js","./useThemeProps-CWZCrmyJ.js","./ErrorOutline-C2BuHaFO.js","./index-CQBXMXxB.js","./sdk-C4od53R_.js","./actions-CcYVxFDV.js","./ua-parser-DP5omx3I.js","./index-Cq0PEg3C.js","./edit.svg-DYBjroym.js","./list-header-DE2pVYNH.js","./chain-B1M1oJUZ.js","./ToggleButtonGroup-BeJ2H-vs.js","./lock.svg-DK6tzOS0.js","./useAsyncRetry-B53j1afR.js","./useAsync-BkAVfcXM.js","./index-ZgkIHsf0.css","./detail-DgAURCp6.js","./index-BYvHyq2X.js","./index-Dmm7CN3L.js","./invitation-BMQ8ii-U.js","./wrap-locale-BYm00LUc.js","./index-DDHwRT_8.js","./index-BIyZS31y.js","./index-DudW3VZ0.js","./index-DLW-FPc1.js","./agreement-Do9LS1H9.js","./index-Dxb5VoXb.js","./index-DevzmDa7.js","./index-zEOfnqWp.js","./traffic-CAtwfrwW.js","./iframe-B2nulerg.js","./index-DBii9-f-.js","./base-chart-CtBedy-P.js","./index-B22sxjhK.js","./index-DRYJ0xIl.js","./memory-Ca0TT2wR.js","./index-B069rJrU.js"])))=>i.map(i=>d[i]);
2
2
  function _mergeNamespaces(De,Me){for(var He=0;He<Me.length;He++){const Ge=Me[He];if(typeof Ge!="string"&&!Array.isArray(Ge)){for(const Je in Ge)if(Je!=="default"&&!(Je in De)){const Ye=Object.getOwnPropertyDescriptor(Ge,Je);Ye&&Object.defineProperty(De,Je,Ye.get?Ye:{enumerable:!0,get:()=>Ge[Je]})}}}return Object.freeze(Object.defineProperty(De,Symbol.toStringTag,{value:"Module"}))}(function(){const Me=document.createElement("link").relList;if(Me&&Me.supports&&Me.supports("modulepreload"))return;for(const Je of document.querySelectorAll('link[rel="modulepreload"]'))Ge(Je);new MutationObserver(Je=>{for(const Ye of Je)if(Ye.type==="childList")for(const Ze of Ye.addedNodes)Ze.tagName==="LINK"&&Ze.rel==="modulepreload"&&Ge(Ze)}).observe(document,{childList:!0,subtree:!0});function He(Je){const Ye={};return Je.integrity&&(Ye.integrity=Je.integrity),Je.referrerPolicy&&(Ye.referrerPolicy=Je.referrerPolicy),Je.crossOrigin==="use-credentials"?Ye.credentials="include":Je.crossOrigin==="anonymous"?Ye.credentials="omit":Ye.credentials="same-origin",Ye}function Ge(Je){if(Je.ep)return;Je.ep=!0;const Ye=He(Je);fetch(Je.href,Ye)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(De){return De&&De.__esModule&&Object.prototype.hasOwnProperty.call(De,"default")?De.default:De}function getAugmentedNamespace(De){if(Object.prototype.hasOwnProperty.call(De,"__esModule"))return De;var Me=De.default;if(typeof Me=="function"){var He=function Ge(){var Je=!1;try{Je=this instanceof Ge}catch{}return Je?Reflect.construct(Me,arguments,this.constructor):Me.apply(this,arguments)};He.prototype=Me.prototype}else He={};return Object.defineProperty(He,"__esModule",{value:!0}),Object.keys(De).forEach(function(Ge){var Je=Object.getOwnPropertyDescriptor(De,Ge);Object.defineProperty(He,Ge,Je.get?Je:{enumerable:!0,get:function(){return De[Ge]}})}),He}var jsxRuntime={exports:{}},reactJsxRuntime_production={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -2903,4 +2903,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2903
2903
  padding-top: 16px;
2904
2904
  ${De=>De.scrollable?"":"overflow: hidden"};
2905
2905
  }
2906
- `;function GlobalSubscriber(){const{t:De}=V$2(),{session:Me}=useSessionContext$1(),{info:He,refresh:Ge}=useNodeContext();return useSubscription(constantExports.TeamEvents.userUpdated,({teamDid:Je,user:Ye})=>{Je===He.did&&Ye&&!Ye.approved&&Me&&Me.user&&Me.user.did===Ye.did&&(H$7.warning(De("session.blockAccess"),{autoHideDuration:10*1e3}),Me.logout())}),useSubscription(constantExports$1.EVENTS.NOTIFICATION_CREATE,Je=>{Je.entityType==="node"&&Ge({silent:!0})}),useSubscription(constantExports$1.EVENTS.NODE_UPDATED,()=>{Ge({silent:!0})}),null}const authorize=({user:De,launchType:Me,nftId:He})=>{if(!De)return!1;if(Me==="serverless"){if(!He)throw new Error("nftId is required");return De?.controller?.nftId===He}return(De.permissions||[]).includes("mutate_blocklets")},isServerlessBlockletInstalled=De=>De.isGetBlocklet&&De.runtimeBlocklet?.controller?.consumedAt,getRestoredAccessUrl=async De=>{const Me=getBlockletUrls({blocklet:De});let He="";return He=Me.find(Ge=>{try{const{hostname:Je}=new URL(Ge);return urlEvaluationExports.isSlpDomain(Je)}catch(Je){return console.error(Je),!1}}),He||(He=await getAccessibleUrl(Me)),He},LaunchBlockletContext=reactExports.createContext({}),{Provider:Provider$1,Consumer:Consumer$1}=LaunchBlockletContext;function LaunchBlockletProvider({children:De}){const{session:Me}=useSessionContext$1(),{t:He}=V$2(),{api:Ge,info:Je}=useNodeContext(),[Ye]=useSearchParams(),Ze=Ye.get("launchType"),et=Ye.get("fromLauncher"),Qe=Ye.get("blocklet_meta_url")||"",nt=Ye.get("nftId")||"",tt=Ye.get("from")||"",rt=Ye.get("launcherSessionId")||"",ot=Ye.get("launcherUrl")||"",at=tt==="url",st=tt==="empty",ut=at||st?"":new URL(Qe).origin,[dt,ct]=reactExports.useState({meta:null,appDid:Ye.get("appDid")||null,sessionId:Ye.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null,registryUrl:""}),ht=(Rt,Tt)=>ct(yt=>({...yt,appDid:Rt,sessionId:Tt})),pt=authorize({user:Me.user,launchType:Ze,nftId:nt}),[mt,gt]=reactExports.useState(null),[xt,Ct]=reactExports.useState(!0),_t=reactExports.useMemo(()=>Je?getServerUrl(Je):"",[Je]),Bt=async Rt=>{if(!Rt)throw new Error("appDid should not be empty");const{blocklet:Tt}=await Ge.getBlocklet({input:{did:Rt,attachConfig:!1}});if(!Tt)return null;const yt=constantExports.BlockletStatus[Tt.status],bt=!!nt,Et=yt<constantExports.BlockletStatus.installed,St=yt===constantExports.BlockletStatus.installed,wt=yt===constantExports.BlockletStatus.running;return ct($t=>({...$t,isInstalled:St,isRunning:wt,isExternal:bt,isInstalling:Et})),{isInstalled:St,isRunning:wt,isExternal:bt,isInstalling:Et}},kt=async()=>{if(Ct(!0),st){ct(Rt=>({...Rt,meta:{title:Ye.get("title")||"",description:Ye.get("description")||""}})),Ct(!1);return}try{if(!Qe&&!st)throw new Error(He("common.invalidParam"));const[{meta:Rt,isFree:Tt,registryUrl:yt},{launcherSession:bt,error:Et}]=await Promise.all([Ge.getBlockletMetaFromUrl({input:{url:Qe,checkPrice:!0}}),rt?Ge.getLauncherSession({input:{launcherSessionId:rt,launcherUrl:ot}}):Promise.resolve({})]);if(rt&&!bt)throw new Error(`Launch session invalid: ${Et}`);if(!Rt)throw new Error(He("LaunchBlockletBlocklet.error.loadMetaFailed"));let St={};pt&&dt.appDid&&(St=await Bt(dt.appDid)),ct(wt=>({...wt,...St,meta:Rt,isFree:Tt,registryUrl:yt,launcherSession:bt}))}catch(Rt){console.error(Rt),gt(Rt.message)}finally{Ct(!1)}};reactExports.useEffect(()=>{Me?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&Me?.user?.controller?.nftId!==nt&&Me.logout(),kt()},[]),reactExports.useEffect(()=>{xt||!dt.meta||(pt?dt.appDid&&Bt(dt.appDid).catch(Rt=>{H$7.error(Rt.message)}):(ct(Rt=>({...Rt,isInstalled:!1,isRunning:!1,isExternal:!1})),gt(null)))},[pt]);const qt={meta:dt.meta,isFree:dt.isFree,appDid:dt.appDid,sessionId:dt.sessionId,isInstalling:dt.isInstalling,isInstalled:dt.isInstalled,isExternal:dt.isExternal,isRunning:dt.isRunning,serverUrl:_t,storeUrl:dt.registryUrl||ut,blockletMetaUrl:Qe,fromLauncher:et,loading:xt,error:mt,api:Ge,getBlocklet:Bt,setAppDid:ht,launcherUrl:ot,launcherSession:dt.launcherSession,launcherSessionId:rt,launchType:Ze};return jsxRuntimeExports.jsx(Provider$1,{value:qt,children:De})}function useLaunchBlockletContext(){return reactExports.useContext(LaunchBlockletContext)}var useAsyncExports=requireUseAsync();const useAsync=getDefaultExportFromCjs$1(useAsyncExports);function useQuery(){return new URLSearchParams(useLocation().search)}const BlockletAppContext=reactExports.createContext(),{Provider,Consumer}=BlockletAppContext;function BlockletAppProvider({children:De}){const He=useQuery().get("blocklet_meta_url"),Ge=useAsync(async()=>{const{data:Ye}=await axios.get(He);return Ye});if(Ge.loading)return jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});const Je={meta:Ge.value,error:Ge.error};return jsxRuntimeExports.jsx(Provider,{value:Je,children:De})}BlockletAppProvider.propTypes={children:o$h.any.isRequired};function useBlockletAppContext(){return reactExports.useContext(BlockletAppContext)}const Dashboard=reactExports.lazy(()=>__vitePreload(()=>import("./index-Ca1VB0fP.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),BlockletList=reactExports.lazy(()=>__vitePreload(()=>import("./index-Bf9Tsnzp.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,2,31,32,33,34,35,36,37,38]),import.meta.url)),BlockletRestore=reactExports.lazy(()=>__vitePreload(()=>import("./index-D0h_Lxum.js"),__vite__mapDeps([39,40,41,42,43,44,23,6,35,45,46,47,19,15]),import.meta.url)),BlockletStore=reactExports.lazy(()=>__vitePreload(()=>import("./index-8dobedE4.js"),__vite__mapDeps([48,6,49,50,51,52,53,17,15,54,31,32,55,56,36,35,57,45,58,4,19,23,24,25,59,60,26,61,62]),import.meta.url)),Settings=reactExports.lazy(()=>__vitePreload(()=>import("./index-CNWl5k-n.js"),__vite__mapDeps([63,64,61,65,66,67,26,7,8,9,10,11,12,13,14,15,16,17,18,19,68,22,58,4,2,69,6,70,71,72,73,36,20,74,53,75,76,77]),import.meta.url)),LogPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-C6nj_8zr.js"),__vite__mapDeps([78,79,24,25,6]),import.meta.url)),TeamPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-BX3e3-Yl.js"),__vite__mapDeps([80,64,81,15,16,17,18,6,82,83,84,85,86,87,54,22,88,36,89,7,8,9,10,11,12,13,14,19,37,24,25,65,90,30,31,32,26,4,91,92,73,2,55,45,93,94,95,50,44,96,97,98,99,100,101,102,103,75,1,58,104,105,106]),import.meta.url)),BlockletDetail=reactExports.lazy(()=>__vitePreload(()=>import("./detail-B_ewDRP9.js"),__vite__mapDeps([107,64,20,21,6,19,22,23,24,25,26,54,108,87,62]),import.meta.url)),EULAPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-CCR0588i.js"),[],import.meta.url)),Notifications=reactExports.lazy(()=>__vitePreload(()=>import("./index-CsRtSmIh.js"),[],import.meta.url)),IssuePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-Q3-b6N6x.js"),__vite__mapDeps([109,110,108,94,10,95,111,112,23]),import.meta.url)),LostPassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-Bsv4O26i.js"),__vite__mapDeps([113,89,57,94,10,111,112,23,34]),import.meta.url)),ExchangePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-BvQcTKRh.js"),__vite__mapDeps([114,111,112,23]),import.meta.url)),BlockletLauncher=reactExports.lazy(()=>__vitePreload(()=>import("./index-C6cKgXcg.js"),__vite__mapDeps([115,41,42,43,44,104,105,116,82,83,84,23,28,29,47,38,6,69,60]),import.meta.url)),NotFoundPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-BJY_2WX8.js"),__vite__mapDeps([117,108]),import.meta.url)),Invite=reactExports.lazy(()=>__vitePreload(()=>import("./index-ccBUb-g_.js"),__vite__mapDeps([118,110,108,94,10,95,111,112]),import.meta.url)),Console=reactExports.lazy(()=>__vitePreload(()=>import("./index-CMGLmPFR.js"),[],import.meta.url)),AnalyticsPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-tY4NTQdt.js"),__vite__mapDeps([119,64,120,121,52,53,122,13,123,124,91,92,9,73,7,8,10,11,12,14,15,16,17,18,19,125,126,77,6,102,25]),import.meta.url)),GenKeyPair=reactExports.lazy(()=>__vitePreload(()=>import("./index-Bexo5RVe.js"),__vite__mapDeps([127,108]),import.meta.url));function useSharedContext(){const De=useNodeContext(),{session:Me}=useSessionContext$1(),{wallet:He}=d$d(),Ge=Me.user&&Me.user.did;return reactExports.useEffect(()=>{const Je=getWsClient();return Ge?Je.connect():Je.isConnected()&&Je.disconnect(),()=>{Je.isConnected()&&Je.disconnect()}},[Ge]),reactExports.useEffect(()=>{if(He)return()=>{};const Je=()=>{document.visibilityState==="visible"&&Me.refresh()};return document.addEventListener("visibilitychange",Je),()=>{document.removeEventListener("visibilitychange",Je)}},[]),{node:De,session:Me}}function ProtectedApp(){const{t:De}=V$2(),{node:Me,session:He}=useSharedContext(),Ge=useLocation();reactExports.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${Ge.pathname}${Ge.search}`)},[Ge]),reactExports.useEffect(()=>{He?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&He.logout()},[He?.user?.role]);const Je=jsxRuntimeExports.jsx(CircularProgress,{});if(Me.loading||He.loading)return jsxRuntimeExports.jsx(o$f,{children:Je});if(!Me.info.initialized)return getAuthMethodExports.getServerAuthMethod(Me.info)==="nft"?jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"verify-owner"}):jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(NodeConnectOwner,{})});if(Me.info.upgradeSessionId)return jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(MaintainProgress,{})});if(!He.user)return jsxRuntimeExports.jsx(NodeLogin,{loadingEle:Je});const Ye=jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(BlockletsProvider,{children:jsxRuntimeExports.jsxs(NotificationProvider,{children:[jsxRuntimeExports.jsx(Health,{}),jsxRuntimeExports.jsx(CheckNodeStatus,{}),jsxRuntimeExports.jsx(GlobalSubscriber,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:Ye,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/dashboard",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Dashboard",children:jsxRuntimeExports.jsx(Dashboard,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.blocklets"),children:jsxRuntimeExports.jsx(BlockletList,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/:did/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Blocklets",children:jsxRuntimeExports.jsx(BlockletDetail,{})})}),jsxRuntimeExports.jsx(Route,{path:"/settings/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.setting"),children:jsxRuntimeExports.jsx(Settings,{})})}),jsxRuntimeExports.jsx(Route,{path:"/eula",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("setup.steps.eula"),children:jsxRuntimeExports.jsx(EULAPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/store",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.store"),children:jsxRuntimeExports.jsx(BlockletStore,{})})}),jsxRuntimeExports.jsx(Route,{path:"/console",element:jsxRuntimeExports.jsx(DashboardRoute,{title:`GraphQL ${De("common.console")}`,scrollable:!1,fullWidth:!0,children:jsxRuntimeExports.jsx(Console,{})})}),jsxRuntimeExports.jsx(Route,{path:"/notifications",element:jsxRuntimeExports.jsx(DashboardRoute,{title:De("notification.title"),children:jsxRuntimeExports.jsx(Notifications,{})})}),jsxRuntimeExports.jsx(Route,{path:"/team/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.team"),children:jsxRuntimeExports.jsx(TeamPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/logs/:name?",element:jsxRuntimeExports.jsx(DashboardRoute,{scrollable:!1,fullWidth:!0,title:De("common.logs"),children:jsxRuntimeExports.jsx(LogPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/analytics/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.analytics"),children:jsxRuntimeExports.jsx(AnalyticsPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(Navigate,{to:"/dashboard",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/team",element:jsxRuntimeExports.jsx(Navigate,{to:"/team/members",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/analytics",element:jsxRuntimeExports.jsx(Navigate,{to:"/analytics/traffic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/router",element:jsxRuntimeExports.jsx(Navigate,{to:"/router/rules",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/settings",element:jsxRuntimeExports.jsx(Navigate,{to:"/settings/basic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace",element:jsxRuntimeExports.jsx(Navigate,{to:"/store",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace/:did",element:jsxRuntimeExports.jsx(Navigate,{to:"/store/:did",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(NotFoundPage,{})})]})})]})})}function UnprotectedWrapper({children:De}){const{node:Me,session:He}=useSharedContext();return Me.loading||!He.initialized&&He.loading?jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})}):Me.info.upgradeSessionId?jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(MaintainProgress,{})}):De}function App(){const{changeLocale:De}=V$2(),Me=useQuery();reactExports.useEffect(()=>{const Ge=Me.get("locale");Ge&&["zh","en"].includes(Ge)&&De(Ge)},[]);const He=jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:He,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(IssuePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LostPassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(ExchangePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:"/accept-server",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"accept-server"})})}),jsxRuntimeExports.jsx(Route,{path:"/gen-key-pair/",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(GenKeyPair,{})})}),jsxRuntimeExports.jsx(Route,{path:"/launch-blocklet/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LaunchBlockletProvider,{children:jsxRuntimeExports.jsx(BlockletLauncher,{})})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/restore/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(BlockletAppProvider,{children:jsxRuntimeExports.jsx(BlockletRestore,{})})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(Invite,{})})}),jsxRuntimeExports.jsx(Route,{path:"/*",element:jsxRuntimeExports.jsx(ProtectedApp,{})})]})})}function AppWrapper(){const De=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return jsxRuntimeExports.jsx(BrowserRouter,{history:history$1,basename:De,children:jsxRuntimeExports.jsx(Root,{children:jsxRuntimeExports.jsx(App,{})})})}const root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(AppWrapper,{}));const prefix=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";register(`${prefix}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:prefix},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(De){console.error("Error during service worker registration:",De)}});export{$$4 as $,useNavigate as A,useSearchParams as B,CircularProgress as C,DialogContentText as D,useMediaQuery as E,libExports$5 as F,Grid$1 as G,H$7 as H,Link$1 as I,BlockletAppAvatar as J,Box as K,Link as L,isEmpty as M,oe as N,FormControl as O,InputLabel as P,MenuItem as Q,Checkbox as R,Select as S,Typography as T,Alert as U,V$2 as V,WrappedDidAddress as W,formatError as X,o$f as Y,CheckIcon$2 as Z,propTypesExports as _,useSubscription as a,Menu as a$,api as a0,merge as a1,cloneDeep as a2,IconButton as a3,R$3 as a4,ListItemSecondaryAction as a5,List as a6,ListItem as a7,ListItemText as a8,getServerUrl as a9,ErrorBoundary as aA,k$1 as aB,formatRegistryLogoPath as aC,Icon as aD,ListItemIcon as aE,createSvgIcon as aF,ensureDomainAliases as aG,constantExports$1 as aH,getIp as aI,normalizePathPrefix as aJ,sortBy as aK,stringSortHandlerAsc as aL,getAccessUrl as aM,history$1 as aN,semver as aO,useReactive as aP,useAsyncEffect as aQ,InfoOutlinedIcon as aR,sleep as aS,checkInputByType as aT,FormControlLabel as aU,Stack$1 as aV,useAsync as aW,axios as aX,shouldCheckDomainStatus as aY,formatMountPoint as aZ,urlPathFriendlyExports as a_,useBlockletAppContext as aa,getAuthMethodExports as ab,ConfirmDialog as ac,getRestoredAccessUrl as ad,setSessionToken as ae,isEqual as af,isServerlessBlockletInstalled as ag,Debug as ah,getWsClient as ai,useQuery as aj,getPathPrefix as ak,Global as al,Routes as am,Route as an,Navigate as ao,HeaderAddon as ap,SessionContext as aq,css as ar,$$5 as as,formatToDatetime as at,alpha$1 as au,getLaunchAgreementUrl as av,axios$2 as aw,useSessionContext$1 as ax,Tooltip as ay,getBlockletMetaUrl as az,constantExports as b,generateUtilityClass as b$,checkIsWildcardDomain as b0,Popover as b1,Card as b2,formatToDate as b3,sortDomains as b4,C$9 as b5,Collapse as b6,CheckCircle as b7,styled as b8,isUrl as b9,createPassportSvg as bA,getWalletType as bB,useCreation as bC,BlockletAdminRoles as bD,isInstalling as bE,Badge as bF,createAppPassportSvg as bG,NavLink as bH,__vitePreload as bI,SetCache as bJ,arrayIncludes$1 as bK,arrayIncludesWith as bL,cacheHas as bM,baseUniq as bN,baseFlatten as bO,baseRest as bP,last as bQ,arrayFilter as bR,isArrayLikeObject as bS,t$a as bT,isDownloading as bU,getBlockletUrl as bV,getBlockletUrlParams as bW,ButtonBase as bX,memoTheme as bY,emphasize as bZ,generateUtilityClasses as b_,__awaiter as ba,__generator as bb,__spread as bc,getDefaultExportFromCjs$1 as bd,U$3 as be,dayjs$1 as bf,Divider as bg,isCertificateMatch as bh,FormHelperText as bi,FormGroup as bj,o$c as bk,NodeContext as bl,useParams as bm,useNodeContext$1 as bn,uniqBy as bo,l as bp,e$c as bq,l$p as br,copy as bs,libExports$3 as bt,B$5 as bu,o$9 as bv,l$i as bw,BlockletAvatar as bx,ClickAwayListener as by,f$7 as bz,createCompounder as c,formatDateTime as c$,useDefaultProps as c0,useSlotProps as c1,clsx$1 as c2,composeClasses as c3,__read as c4,toSlotDomain as c5,omit as c6,fixBlocklet as c7,isProtectedRole as c8,baseOrderBy as c9,Avatar as cA,isFromWallet as cB,usePassportId as cC,isFunction$3 as cD,Container$3 as cE,K$4 as cF,getLauncherBaseURL as cG,SvgIcon as cH,Buffer$1 as cI,parseURL as cJ,withHttps as cK,useLaunchBlockletContext as cL,z$2 as cM,authorize as cN,ArrowForwardIcon as cO,isNewStoreUrl as cP,getAccessibleUrl as cQ,getBlockletLogoUrl as cR,t as cS,M$8 as cT,__spreadArrays as cU,__assign as cV,h$6 as cW,useLocation as cX,l$8 as cY,useMount as cZ,s$8 as c_,isArray$1 as ca,rootShouldForwardProp as cb,useFormControl as cc,createChainedFunction$1 as cd,useSlot as ce,capitalize$1 as cf,SwitchBase as cg,createSimplePaletteValueFilter as ch,useControlled as ci,useForkRef as cj,useId as ck,getBlockletUrls as cl,defaultCheckAccessible as cm,urlEvaluationExports as cn,memoize as co,ButtonGroupContext as cp,ButtonGroupButtonContext as cq,useNotificationContext as cr,utilExports as cs,NotificationList as ct,useRequest as cu,useMemoizedFn as cv,isNumber$3 as cw,useLatest as cx,dayjs as cy,d$d as cz,useBlockletsContext as d,afterMain as d$,getExplorerLink as d0,patchJsxToLocale as d1,T$6 as d2,getSessionToken as d3,LinearProgress as d4,SvgLogo as d5,isNumber$1 as d6,useEnhancedEffect$1 as d7,debounce$2 as d8,ownerWindow as d9,requirePropTypes as dA,requireReactDom as dB,isObject$3 as dC,require$$0$2 as dD,require$$5$1 as dE,requireConstant$1 as dF,$e$1 as dG,noop$1 as dH,Button as dI,Paper as dJ,MenuList as dK,Popper as dL,_inheritsLoose$1 as dM,ReactDOM as dN,_objectWithoutPropertiesLoose$1 as dO,TransitionGroup as dP,ENTERED as dQ,ENTERING as dR,EXITING as dS,TransitionGroupContext as dT,Transition as dU,config$1 as dV,popperGenerator as dW,eventListeners as dX,popperOffsets$1 as dY,computeStyles$1 as dZ,applyStyles$1 as d_,useRtl as da,KeyboardArrowLeft as db,KeyboardArrowRight as dc,useEventCallback$1 as dd,ownerDocument as de,getCommonHtmlTitle as df,HelmetExport as dg,requireReact as dh,i$e as di,te$2 as dj,se$1 as dk,InfoIcon$2 as dl,upperFirst as dm,camelCase as dn,Skeleton as dp,R$5 as dq,isArrayLike as dr,baseIteratee as ds,keys as dt,toInteger as du,baseFindIndex as dv,commonjsGlobal as dw,getAugmentedNamespace as dx,emotionUtils_browser_esm as dy,requireJsxRuntime as dz,useAsyncRetry as e,toString$2 as e$,afterRead as e0,afterWrite as e1,arrow$1 as e2,auto as e3,basePlacements as e4,beforeMain as e5,beforeRead as e6,beforeWrite as e7,bottom as e8,clippingParents as e9,requireLib$7 as eA,requireLib$a as eB,requireLib$6 as eC,requireConstant$2 as eD,requireUrlPathFriendly as eE,b$8 as eF,data$s as eG,global$2 as eH,hoistStatics as eI,isEqual$3 as eJ,usePreviousProps as eK,setRef as eL,ClearIcon as eM,ArrowDropDownIcon as eN,Chip as eO,filledInputClasses as eP,inputBaseClasses as eQ,outlinedInputClasses as eR,inputClasses as eS,ListContext as eT,getListItemButtonUtilityClass as eU,listItemButtonClasses as eV,emotionReact_browser_esm as eW,emotionCache_browser_esm as eX,cloneDeep$1 as eY,forceReflow as eZ,_extends$2 as e_,createPopper as ea,createPopper$1 as eb,detectOverflow as ec,end as ed,flip$1 as ee,hide$1 as ef,left as eg,main as eh,modifierPhases as ei,offset$1 as ej,placements as ek,popper as el,preventOverflow$1 as em,read as en,reference as eo,right as ep,start as eq,top as er,variationPlacements as es,viewport as et,write as eu,requireReactIs as ev,emotionStyled_browser_esm as ew,emotionSerialize_esm as ex,emotionSheet_esm as ey,process$1 as ez,useTheme as f,requireCryptoBrowserify as f$,mergeThemeOptions as f0,StyledEngineProvider as f1,ThemeProvider as f2,ThemeProvider$3 as f3,s$3 as f4,CloseIcon as f5,isString$1 as f6,isMobile as f7,createTheme as f8,createAxios as f9,darken as fA,slotShouldForwardProp as fB,requireNormalizePathPrefix as fC,debounce as fD,useInterval as fE,formatTime as fF,CloseFullscreenIcon as fG,S$8 as fH,TablePagination as fI,parseAvatar as fJ,__rest as fK,useEffectWithTarget$1 as fL,__values as fM,tmp as fN,useUpdate as fO,requireUtil$8 as fP,requireObjectKeys$1 as fQ,requireShams$1 as fR,requireCallBound as fS,requireEsObjectAtoms as fT,requireDefineDataProperty as fU,requireHasPropertyDescriptors as fV,requireCallBind as fW,requireCallBound$1 as fX,requireSafeBuffer$1 as fY,requireBrowser$h as fZ,requireElliptic as f_,pick as fa,omitBy as fb,flat as fc,MenuIcon as fd,useDebounceFn as fe,Dialog as ff,OutlinedInput as fg,data as fh,Drawer as fi,parseQuery as fj,parseFilename as fk,stringifyParsedURL as fl,Grow as fm,Wt as fn,InputAdornment as fo,tooltipClasses as fp,requireEngine as fq,__spreadArray as fr,useEventListener as fs,le$7 as ft,getTargetElement as fu,clamp as fv,extractEventHandlers as fw,isFocusVisible as fx,isHostComponent as fy,lighten as fz,p$3 as g,__extends as g$,requireRipemd160 as g0,requireLib$4 as g1,requireUtil$2 as g2,uniq as g3,useLocalStorageState as g4,InputBase as g5,useSize as g6,DialogTitle as g7,DialogContent as g8,DialogActions as g9,baseForOwn as gA,isPlainObject$2 as gB,require$$12 as gC,throttle$2 as gD,isUndefined$1 as gE,useTimeout as gF,Fade as gG,FocusTrap as gH,dialogClasses as gI,localizedFormatPlugin as gJ,n$8 as gK,purify as gL,Buffer$1$1 as gM,Q$2 as gN,require$$0$1 as gO,requireIsAbsoluteUrl as gP,requireDist$1 as gQ,requireBrowser as gR,require$$3 as gS,resolveProps as gT,useThemeProps as gU,defaultTheme$1 as gV,THEME_ID as gW,en$2 as gX,isIndex as gY,useTheme$4 as gZ,objectAssign as g_,pickBy as ga,shouldForwardProp as gb,resolveComponentProps as gc,getInviteLink as gd,e$e as ge,getIssuePassportLink as gf,uniqBy$1 as gg,isNodeOwner as gh,isSelf as gi,Q$1 as gj,I$3 as gk,Y$3 as gl,PQueue as gm,getBlockletAccessibleUrl as gn,A$1 as go,createPassportSvg$1 as gp,requireMs as gq,E$3 as gr,trim as gs,getBlockletSDK as gt,MoreHorizIcon as gu,identity$1 as gv,arrayEach as gw,baseEach as gx,arrayMap as gy,baseMap as gz,get$1 as h,useSnackbar as h$,isServerless as h0,requireJsonStableStringify as h1,isFunction$2 as h2,omit$1 as h3,TableContext as h4,Tablelvl2Context as h5,g$e as h6,useUnmount as h7,isDidDomainOrIpEchoDomain as h8,ExpandLess as h9,createUseStorageState as hA,isBrowser$1 as hB,root$1 as hC,isNil$1 as hD,require$$11 as hE,requireHoistNonReactStatics_cjs as hF,_assertThisInitialized$1 as hG,reactDomExports as hH,loadIcon as hI,withoutLeadingSlash as hJ,fetchSvgAsPng as hK,blobToFile as hL,withoutTrailingSlash as hM,u$2 as hN,Ce as hO,t$g as hP,i as hQ,R$8 as hR,p$f as hS,requireBrowser$7 as hT,requireEventemitter3$1 as hU,requirePhoenix_cjs as hV,usePrevious as hW,BlockletSDK as hX,highlightExports as hY,funcExports as hZ,data$y as h_,validateDomain as ha,requireDist$2 as hb,requireAxios as hc,trim$1 as hd,requirePRetry as he,TableCell as hf,xe$1 as hg,getSystemDomains as hh,copyArray as hi,baseIndexOf as hj,ke as hk,useAppLogo as hl,getTransferAppLink as hm,requireBn$1 as hn,require$$2 as ho,updateWindowEnv as hp,M$4 as hq,isNil as hr,requireBase32 as hs,Re as ht,withTrailingSlash as hu,data$B as hv,keyframes as hw,requireAssertString as hx,isEmail as hy,isURL as hz,utilExports$1 as i,isNull as i$,common$3 as i0,green as i1,amber as i2,SnackbarContent as i3,d$f as i4,t$1 as i5,useDebounce as i6,Y as i7,g$3 as i8,b as i9,isValidClusterSize as iA,extractStatusUrlFromNextWorkflow as iB,pWaitFor as iC,hasRequiredSteps as iD,getStoreList as iE,commonjsRequire as iF,require_interface as iG,requireHasown as iH,requireBrowser$3 as iI,requireSemver as iJ,require$$4$1 as iK,flatten as iL,trimEnd as iM,base32Exports as iN,flatExports as iO,Xt as iP,AxiosError as iQ,requireSha3$4 as iR,requireHash$2 as iS,requireNaclFast as iT,requireBrowser$j as iU,requireAccount as iV,requireHash as iW,requireHelpers as iX,require$$0$7 as iY,require$$1$5 as iZ,I$6 as i_,g$9 as ia,withErrorBoundary as ib,z$1 as ic,M$5 as id,Be as ie,G$1 as ig,xe as ih,useBlockletLogo as ii,isPlainObject$1 as ij,Toolbar as ik,_setPrototypeOf as il,isString$3 as im,FormLabel as io,RelativeTime as ip,isIncludeActivity as iq,isUserActor as ir,ActorAvatar as is,SendComponentAvatar as it,Activity as iu,NotificationContent$1 as iv,AvatarGroup as iw,requireCjs as ix,useTheme$2 as iy,baseAssignValue as iz,jsxRuntimeExports as j,orange as j0,purple as j1,useStore as j2,createStore as j3,create$1 as j4,t$h as j5,clientExports as j6,ke$1 as j7,retry as j8,isNetworkError as j9,requirePTimeout as ja,n$5 as jb,Modal as jc,GlobalStyles$2 as jd,filesize as k,prettyMs as l,formatLocale as m,useSessionContext as n,o$h as o,p$e as p,useSetState as q,reactExports as r,styled$3 as s,TextField as t,useNodeContext as u,n$4 as v,lo as w,getWebWalletUrl as x,joinURL as y,withQuery as z};
2906
+ `;function GlobalSubscriber(){const{t:De}=V$2(),{session:Me}=useSessionContext$1(),{info:He,refresh:Ge}=useNodeContext();return useSubscription(constantExports.TeamEvents.userUpdated,({teamDid:Je,user:Ye})=>{Je===He.did&&Ye&&!Ye.approved&&Me&&Me.user&&Me.user.did===Ye.did&&(H$7.warning(De("session.blockAccess"),{autoHideDuration:10*1e3}),Me.logout())}),useSubscription(constantExports$1.EVENTS.NOTIFICATION_CREATE,Je=>{Je.entityType==="node"&&Ge({silent:!0})}),useSubscription(constantExports$1.EVENTS.NODE_UPDATED,()=>{Ge({silent:!0})}),null}const authorize=({user:De,launchType:Me,nftId:He})=>{if(!De)return!1;if(Me==="serverless"){if(!He)throw new Error("nftId is required");return De?.controller?.nftId===He}return(De.permissions||[]).includes("mutate_blocklets")},isServerlessBlockletInstalled=De=>De.isGetBlocklet&&De.runtimeBlocklet?.controller?.consumedAt,getRestoredAccessUrl=async De=>{const Me=getBlockletUrls({blocklet:De});let He="";return He=Me.find(Ge=>{try{const{hostname:Je}=new URL(Ge);return urlEvaluationExports.isSlpDomain(Je)}catch(Je){return console.error(Je),!1}}),He||(He=await getAccessibleUrl(Me)),He},LaunchBlockletContext=reactExports.createContext({}),{Provider:Provider$1,Consumer:Consumer$1}=LaunchBlockletContext;function LaunchBlockletProvider({children:De}){const{session:Me}=useSessionContext$1(),{t:He}=V$2(),{api:Ge,info:Je}=useNodeContext(),[Ye]=useSearchParams(),Ze=Ye.get("launchType"),et=Ye.get("fromLauncher"),Qe=Ye.get("blocklet_meta_url")||"",nt=Ye.get("nftId")||"",tt=Ye.get("from")||"",rt=Ye.get("launcherSessionId")||"",ot=Ye.get("launcherUrl")||"",at=tt==="url",st=tt==="empty",ut=at||st?"":new URL(Qe).origin,[dt,ct]=reactExports.useState({meta:null,appDid:Ye.get("appDid")||null,sessionId:Ye.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null,registryUrl:""}),ht=(Rt,Tt)=>ct(yt=>({...yt,appDid:Rt,sessionId:Tt})),pt=authorize({user:Me.user,launchType:Ze,nftId:nt}),[mt,gt]=reactExports.useState(null),[xt,Ct]=reactExports.useState(!0),_t=reactExports.useMemo(()=>Je?getServerUrl(Je):"",[Je]),Bt=async Rt=>{if(!Rt)throw new Error("appDid should not be empty");const{blocklet:Tt}=await Ge.getBlocklet({input:{did:Rt,attachConfig:!1}});if(!Tt)return null;const yt=constantExports.BlockletStatus[Tt.status],bt=!!nt,Et=yt<constantExports.BlockletStatus.installed,St=yt===constantExports.BlockletStatus.installed,wt=yt===constantExports.BlockletStatus.running;return ct($t=>({...$t,isInstalled:St,isRunning:wt,isExternal:bt,isInstalling:Et})),{isInstalled:St,isRunning:wt,isExternal:bt,isInstalling:Et}},kt=async()=>{if(Ct(!0),st){ct(Rt=>({...Rt,meta:{title:Ye.get("title")||"",description:Ye.get("description")||""}})),Ct(!1);return}try{if(!Qe&&!st)throw new Error(He("common.invalidParam"));const[{meta:Rt,isFree:Tt,registryUrl:yt},{launcherSession:bt,error:Et}]=await Promise.all([Ge.getBlockletMetaFromUrl({input:{url:Qe,checkPrice:!0}}),rt?Ge.getLauncherSession({input:{launcherSessionId:rt,launcherUrl:ot}}):Promise.resolve({})]);if(rt&&!bt)throw new Error(`Launch session invalid: ${Et}`);if(!Rt)throw new Error(He("LaunchBlockletBlocklet.error.loadMetaFailed"));let St={};pt&&dt.appDid&&(St=await Bt(dt.appDid)),ct(wt=>({...wt,...St,meta:Rt,isFree:Tt,registryUrl:yt,launcherSession:bt}))}catch(Rt){console.error(Rt),gt(Rt.message)}finally{Ct(!1)}};reactExports.useEffect(()=>{Me?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&Me?.user?.controller?.nftId!==nt&&Me.logout(),kt()},[]),reactExports.useEffect(()=>{xt||!dt.meta||(pt?dt.appDid&&Bt(dt.appDid).catch(Rt=>{H$7.error(Rt.message)}):(ct(Rt=>({...Rt,isInstalled:!1,isRunning:!1,isExternal:!1})),gt(null)))},[pt]);const qt={meta:dt.meta,isFree:dt.isFree,appDid:dt.appDid,sessionId:dt.sessionId,isInstalling:dt.isInstalling,isInstalled:dt.isInstalled,isExternal:dt.isExternal,isRunning:dt.isRunning,serverUrl:_t,storeUrl:dt.registryUrl||ut,blockletMetaUrl:Qe,fromLauncher:et,loading:xt,error:mt,api:Ge,getBlocklet:Bt,setAppDid:ht,launcherUrl:ot,launcherSession:dt.launcherSession,launcherSessionId:rt,launchType:Ze};return jsxRuntimeExports.jsx(Provider$1,{value:qt,children:De})}function useLaunchBlockletContext(){return reactExports.useContext(LaunchBlockletContext)}var useAsyncExports=requireUseAsync();const useAsync=getDefaultExportFromCjs$1(useAsyncExports);function useQuery(){return new URLSearchParams(useLocation().search)}const BlockletAppContext=reactExports.createContext(),{Provider,Consumer}=BlockletAppContext;function BlockletAppProvider({children:De}){const He=useQuery().get("blocklet_meta_url"),Ge=useAsync(async()=>{const{data:Ye}=await axios.get(He);return Ye});if(Ge.loading)return jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});const Je={meta:Ge.value,error:Ge.error};return jsxRuntimeExports.jsx(Provider,{value:Je,children:De})}BlockletAppProvider.propTypes={children:o$h.any.isRequired};function useBlockletAppContext(){return reactExports.useContext(BlockletAppContext)}const Dashboard=reactExports.lazy(()=>__vitePreload(()=>import("./index-B7yK5r9r.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),BlockletList=reactExports.lazy(()=>__vitePreload(()=>import("./index-m59yehWt.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,2,31,32,33,34,35,36,37,38]),import.meta.url)),BlockletRestore=reactExports.lazy(()=>__vitePreload(()=>import("./index-C4O6nFZK.js"),__vite__mapDeps([39,40,41,42,43,44,23,6,35,45,46,47,19,15]),import.meta.url)),BlockletStore=reactExports.lazy(()=>__vitePreload(()=>import("./index-Cmq6DzBi.js"),__vite__mapDeps([48,6,49,50,51,52,53,17,15,54,31,32,55,56,36,35,57,45,58,4,19,23,24,25,59,60,26,61,62]),import.meta.url)),Settings=reactExports.lazy(()=>__vitePreload(()=>import("./index-Dd8DBQ06.js"),__vite__mapDeps([63,64,61,65,66,67,26,7,8,9,10,11,12,13,14,15,16,17,18,19,68,22,58,4,2,69,6,70,71,72,73,36,20,74,53,75,76,77]),import.meta.url)),LogPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-BTZ0eV0N.js"),__vite__mapDeps([78,79,24,25,6]),import.meta.url)),TeamPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-C-ikBis3.js"),__vite__mapDeps([80,64,81,15,16,17,18,6,82,83,84,85,86,87,54,22,88,36,89,7,8,9,10,11,12,13,14,19,37,24,25,65,90,30,31,32,26,4,91,92,73,2,55,45,93,94,95,50,44,96,97,98,99,100,101,102,103,70,75,1,58,104,105,106]),import.meta.url)),BlockletDetail=reactExports.lazy(()=>__vitePreload(()=>import("./detail-DgAURCp6.js"),__vite__mapDeps([107,64,20,21,6,19,22,23,24,25,26,54,108,87,62]),import.meta.url)),EULAPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-CzOe4kWN.js"),[],import.meta.url)),Notifications=reactExports.lazy(()=>__vitePreload(()=>import("./index-MI1PE9cE.js"),[],import.meta.url)),IssuePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-Dmm7CN3L.js"),__vite__mapDeps([109,110,108,94,10,95,111,112,23]),import.meta.url)),LostPassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-BIyZS31y.js"),__vite__mapDeps([113,89,57,94,10,111,112,23,34]),import.meta.url)),ExchangePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-DudW3VZ0.js"),__vite__mapDeps([114,111,112,23]),import.meta.url)),BlockletLauncher=reactExports.lazy(()=>__vitePreload(()=>import("./index-DLW-FPc1.js"),__vite__mapDeps([115,41,42,43,44,104,105,116,82,83,84,23,28,29,47,38,6,69,60]),import.meta.url)),NotFoundPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-Dxb5VoXb.js"),__vite__mapDeps([117,108]),import.meta.url)),Invite=reactExports.lazy(()=>__vitePreload(()=>import("./index-DevzmDa7.js"),__vite__mapDeps([118,110,108,94,10,95,111,112]),import.meta.url)),Console=reactExports.lazy(()=>__vitePreload(()=>import("./index-Bk3Q7htA.js"),[],import.meta.url)),AnalyticsPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-zEOfnqWp.js"),__vite__mapDeps([119,64,120,121,52,53,122,13,123,124,91,92,9,73,7,8,10,11,12,14,15,16,17,18,19,125,126,77,6,102,25]),import.meta.url)),GenKeyPair=reactExports.lazy(()=>__vitePreload(()=>import("./index-B069rJrU.js"),__vite__mapDeps([127,108]),import.meta.url));function useSharedContext(){const De=useNodeContext(),{session:Me}=useSessionContext$1(),{wallet:He}=d$d(),Ge=Me.user&&Me.user.did;return reactExports.useEffect(()=>{const Je=getWsClient();return Ge?Je.connect():Je.isConnected()&&Je.disconnect(),()=>{Je.isConnected()&&Je.disconnect()}},[Ge]),reactExports.useEffect(()=>{if(He)return()=>{};const Je=()=>{document.visibilityState==="visible"&&Me.refresh()};return document.addEventListener("visibilitychange",Je),()=>{document.removeEventListener("visibilitychange",Je)}},[]),{node:De,session:Me}}function ProtectedApp(){const{t:De}=V$2(),{node:Me,session:He}=useSharedContext(),Ge=useLocation();reactExports.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${Ge.pathname}${Ge.search}`)},[Ge]),reactExports.useEffect(()=>{He?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&He.logout()},[He?.user?.role]);const Je=jsxRuntimeExports.jsx(CircularProgress,{});if(Me.loading||He.loading)return jsxRuntimeExports.jsx(o$f,{children:Je});if(!Me.info.initialized)return getAuthMethodExports.getServerAuthMethod(Me.info)==="nft"?jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"verify-owner"}):jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(NodeConnectOwner,{})});if(Me.info.upgradeSessionId)return jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(MaintainProgress,{})});if(!He.user)return jsxRuntimeExports.jsx(NodeLogin,{loadingEle:Je});const Ye=jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(BlockletsProvider,{children:jsxRuntimeExports.jsxs(NotificationProvider,{children:[jsxRuntimeExports.jsx(Health,{}),jsxRuntimeExports.jsx(CheckNodeStatus,{}),jsxRuntimeExports.jsx(GlobalSubscriber,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:Ye,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/dashboard",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Dashboard",children:jsxRuntimeExports.jsx(Dashboard,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.blocklets"),children:jsxRuntimeExports.jsx(BlockletList,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/:did/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Blocklets",children:jsxRuntimeExports.jsx(BlockletDetail,{})})}),jsxRuntimeExports.jsx(Route,{path:"/settings/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.setting"),children:jsxRuntimeExports.jsx(Settings,{})})}),jsxRuntimeExports.jsx(Route,{path:"/eula",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("setup.steps.eula"),children:jsxRuntimeExports.jsx(EULAPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/store",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.store"),children:jsxRuntimeExports.jsx(BlockletStore,{})})}),jsxRuntimeExports.jsx(Route,{path:"/console",element:jsxRuntimeExports.jsx(DashboardRoute,{title:`GraphQL ${De("common.console")}`,scrollable:!1,fullWidth:!0,children:jsxRuntimeExports.jsx(Console,{})})}),jsxRuntimeExports.jsx(Route,{path:"/notifications",element:jsxRuntimeExports.jsx(DashboardRoute,{title:De("notification.title"),children:jsxRuntimeExports.jsx(Notifications,{})})}),jsxRuntimeExports.jsx(Route,{path:"/team/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.team"),children:jsxRuntimeExports.jsx(TeamPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/logs/:name?",element:jsxRuntimeExports.jsx(DashboardRoute,{scrollable:!1,fullWidth:!0,title:De("common.logs"),children:jsxRuntimeExports.jsx(LogPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/analytics/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:De("common.analytics"),children:jsxRuntimeExports.jsx(AnalyticsPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(Navigate,{to:"/dashboard",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/team",element:jsxRuntimeExports.jsx(Navigate,{to:"/team/members",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/analytics",element:jsxRuntimeExports.jsx(Navigate,{to:"/analytics/traffic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/router",element:jsxRuntimeExports.jsx(Navigate,{to:"/router/rules",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/settings",element:jsxRuntimeExports.jsx(Navigate,{to:"/settings/basic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace",element:jsxRuntimeExports.jsx(Navigate,{to:"/store",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace/:did",element:jsxRuntimeExports.jsx(Navigate,{to:"/store/:did",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(NotFoundPage,{})})]})})]})})}function UnprotectedWrapper({children:De}){const{node:Me,session:He}=useSharedContext();return Me.loading||!He.initialized&&He.loading?jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})}):Me.info.upgradeSessionId?jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(MaintainProgress,{})}):De}function App(){const{changeLocale:De}=V$2(),Me=useQuery();reactExports.useEffect(()=>{const Ge=Me.get("locale");Ge&&["zh","en"].includes(Ge)&&De(Ge)},[]);const He=jsxRuntimeExports.jsx(o$f,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:He,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(IssuePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LostPassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(ExchangePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:"/accept-server",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"accept-server"})})}),jsxRuntimeExports.jsx(Route,{path:"/gen-key-pair/",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(GenKeyPair,{})})}),jsxRuntimeExports.jsx(Route,{path:"/launch-blocklet/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LaunchBlockletProvider,{children:jsxRuntimeExports.jsx(BlockletLauncher,{})})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/restore/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(BlockletAppProvider,{children:jsxRuntimeExports.jsx(BlockletRestore,{})})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(Invite,{})})}),jsxRuntimeExports.jsx(Route,{path:"/*",element:jsxRuntimeExports.jsx(ProtectedApp,{})})]})})}function AppWrapper(){const De=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return jsxRuntimeExports.jsx(BrowserRouter,{history:history$1,basename:De,children:jsxRuntimeExports.jsx(Root,{children:jsxRuntimeExports.jsx(App,{})})})}const root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(AppWrapper,{}));const prefix=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";register(`${prefix}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:prefix},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(De){console.error("Error during service worker registration:",De)}});export{$$4 as $,useNavigate as A,useSearchParams as B,CircularProgress as C,DialogContentText as D,useMediaQuery as E,libExports$5 as F,Grid$1 as G,H$7 as H,Link$1 as I,BlockletAppAvatar as J,Box as K,Link as L,isEmpty as M,oe as N,FormControl as O,InputLabel as P,MenuItem as Q,Checkbox as R,Select as S,Typography as T,Alert as U,V$2 as V,WrappedDidAddress as W,formatError as X,o$f as Y,CheckIcon$2 as Z,propTypesExports as _,useSubscription as a,Menu as a$,api as a0,merge as a1,cloneDeep as a2,IconButton as a3,R$3 as a4,ListItemSecondaryAction as a5,List as a6,ListItem as a7,ListItemText as a8,getServerUrl as a9,ErrorBoundary as aA,k$1 as aB,formatRegistryLogoPath as aC,Icon as aD,ListItemIcon as aE,createSvgIcon as aF,ensureDomainAliases as aG,constantExports$1 as aH,getIp as aI,normalizePathPrefix as aJ,sortBy as aK,stringSortHandlerAsc as aL,getAccessUrl as aM,history$1 as aN,semver as aO,useReactive as aP,useAsyncEffect as aQ,InfoOutlinedIcon as aR,sleep as aS,checkInputByType as aT,FormControlLabel as aU,Stack$1 as aV,useAsync as aW,axios as aX,shouldCheckDomainStatus as aY,formatMountPoint as aZ,urlPathFriendlyExports as a_,useBlockletAppContext as aa,getAuthMethodExports as ab,ConfirmDialog as ac,getRestoredAccessUrl as ad,setSessionToken as ae,isEqual as af,isServerlessBlockletInstalled as ag,Debug as ah,getWsClient as ai,useQuery as aj,getPathPrefix as ak,Global as al,Routes as am,Route as an,Navigate as ao,HeaderAddon as ap,SessionContext as aq,css as ar,$$5 as as,formatToDatetime as at,alpha$1 as au,getLaunchAgreementUrl as av,axios$2 as aw,useSessionContext$1 as ax,Tooltip as ay,getBlockletMetaUrl as az,constantExports as b,generateUtilityClasses as b$,checkIsWildcardDomain as b0,Popover as b1,Card as b2,formatToDate as b3,sortDomains as b4,C$9 as b5,Collapse as b6,CheckCircle as b7,styled as b8,isUrl as b9,Button as bA,createPassportSvg as bB,getWalletType as bC,useCreation as bD,BlockletAdminRoles as bE,isInstalling as bF,Badge as bG,createAppPassportSvg as bH,NavLink as bI,__vitePreload as bJ,SetCache as bK,arrayIncludes$1 as bL,arrayIncludesWith as bM,cacheHas as bN,baseUniq as bO,baseFlatten as bP,baseRest as bQ,last as bR,arrayFilter as bS,isArrayLikeObject as bT,t$a as bU,isDownloading as bV,getBlockletUrl as bW,getBlockletUrlParams as bX,ButtonBase as bY,memoTheme as bZ,emphasize as b_,__awaiter as ba,__generator as bb,__spread as bc,getDefaultExportFromCjs$1 as bd,U$3 as be,dayjs$1 as bf,Divider as bg,isCertificateMatch as bh,FormHelperText as bi,FormGroup as bj,o$c as bk,NodeContext as bl,useParams as bm,useNodeContext$1 as bn,uniqBy as bo,l as bp,e$c as bq,l$p as br,copy as bs,libExports$3 as bt,B$5 as bu,o$9 as bv,l$i as bw,BlockletAvatar as bx,ClickAwayListener as by,f$7 as bz,createCompounder as c,s$8 as c$,generateUtilityClass as c0,useDefaultProps as c1,useSlotProps as c2,clsx$1 as c3,composeClasses as c4,__read as c5,toSlotDomain as c6,omit as c7,fixBlocklet as c8,isProtectedRole as c9,d$d as cA,Avatar as cB,isFromWallet as cC,usePassportId as cD,isFunction$3 as cE,Container$3 as cF,K$4 as cG,getLauncherBaseURL as cH,SvgIcon as cI,Buffer$1 as cJ,parseURL as cK,withHttps as cL,useLaunchBlockletContext as cM,z$2 as cN,authorize as cO,ArrowForwardIcon as cP,isNewStoreUrl as cQ,getAccessibleUrl as cR,getBlockletLogoUrl as cS,t as cT,M$8 as cU,__spreadArrays as cV,__assign as cW,h$6 as cX,useLocation as cY,l$8 as cZ,useMount as c_,baseOrderBy as ca,isArray$1 as cb,rootShouldForwardProp as cc,useFormControl as cd,createChainedFunction$1 as ce,useSlot as cf,capitalize$1 as cg,SwitchBase as ch,createSimplePaletteValueFilter as ci,useControlled as cj,useForkRef as ck,useId as cl,getBlockletUrls as cm,defaultCheckAccessible as cn,urlEvaluationExports as co,memoize as cp,ButtonGroupContext as cq,ButtonGroupButtonContext as cr,useNotificationContext as cs,utilExports as ct,NotificationList as cu,useRequest as cv,useMemoizedFn as cw,isNumber$3 as cx,useLatest as cy,dayjs as cz,useBlockletsContext as d,afterMain as d$,formatDateTime as d0,getExplorerLink as d1,patchJsxToLocale as d2,T$6 as d3,getSessionToken as d4,LinearProgress as d5,SvgLogo as d6,isNumber$1 as d7,useEnhancedEffect$1 as d8,debounce$2 as d9,requireJsxRuntime as dA,requirePropTypes as dB,requireReactDom as dC,isObject$3 as dD,require$$0$2 as dE,require$$5$1 as dF,requireConstant$1 as dG,$e$1 as dH,noop$1 as dI,Paper as dJ,MenuList as dK,Popper as dL,_inheritsLoose$1 as dM,ReactDOM as dN,_objectWithoutPropertiesLoose$1 as dO,TransitionGroup as dP,ENTERED as dQ,ENTERING as dR,EXITING as dS,TransitionGroupContext as dT,Transition as dU,config$1 as dV,popperGenerator as dW,eventListeners as dX,popperOffsets$1 as dY,computeStyles$1 as dZ,applyStyles$1 as d_,ownerWindow as da,useRtl as db,KeyboardArrowLeft as dc,KeyboardArrowRight as dd,useEventCallback$1 as de,ownerDocument as df,getCommonHtmlTitle as dg,HelmetExport as dh,requireReact as di,i$e as dj,te$2 as dk,se$1 as dl,InfoIcon$2 as dm,upperFirst as dn,camelCase as dp,Skeleton as dq,R$5 as dr,isArrayLike as ds,baseIteratee as dt,keys as du,toInteger as dv,baseFindIndex as dw,commonjsGlobal as dx,getAugmentedNamespace as dy,emotionUtils_browser_esm as dz,useAsyncRetry as e,toString$2 as e$,afterRead as e0,afterWrite as e1,arrow$1 as e2,auto as e3,basePlacements as e4,beforeMain as e5,beforeRead as e6,beforeWrite as e7,bottom as e8,clippingParents as e9,requireLib$7 as eA,requireLib$a as eB,requireLib$6 as eC,requireConstant$2 as eD,requireUrlPathFriendly as eE,b$8 as eF,data$s as eG,global$2 as eH,hoistStatics as eI,isEqual$3 as eJ,usePreviousProps as eK,setRef as eL,ClearIcon as eM,ArrowDropDownIcon as eN,Chip as eO,filledInputClasses as eP,inputBaseClasses as eQ,outlinedInputClasses as eR,inputClasses as eS,ListContext as eT,getListItemButtonUtilityClass as eU,listItemButtonClasses as eV,emotionReact_browser_esm as eW,emotionCache_browser_esm as eX,cloneDeep$1 as eY,forceReflow as eZ,_extends$2 as e_,createPopper as ea,createPopper$1 as eb,detectOverflow as ec,end as ed,flip$1 as ee,hide$1 as ef,left as eg,main as eh,modifierPhases as ei,offset$1 as ej,placements as ek,popper as el,preventOverflow$1 as em,read as en,reference as eo,right as ep,start as eq,top as er,variationPlacements as es,viewport as et,write as eu,requireReactIs as ev,emotionStyled_browser_esm as ew,emotionSerialize_esm as ex,emotionSheet_esm as ey,process$1 as ez,useTheme as f,requireCryptoBrowserify as f$,mergeThemeOptions as f0,StyledEngineProvider as f1,ThemeProvider as f2,ThemeProvider$3 as f3,s$3 as f4,CloseIcon as f5,isString$1 as f6,isMobile as f7,createTheme as f8,createAxios as f9,darken as fA,slotShouldForwardProp as fB,requireNormalizePathPrefix as fC,debounce as fD,useInterval as fE,formatTime as fF,CloseFullscreenIcon as fG,S$8 as fH,TablePagination as fI,parseAvatar as fJ,__rest as fK,useEffectWithTarget$1 as fL,__values as fM,tmp as fN,useUpdate as fO,requireUtil$8 as fP,requireObjectKeys$1 as fQ,requireShams$1 as fR,requireCallBound as fS,requireEsObjectAtoms as fT,requireDefineDataProperty as fU,requireHasPropertyDescriptors as fV,requireCallBind as fW,requireCallBound$1 as fX,requireSafeBuffer$1 as fY,requireBrowser$h as fZ,requireElliptic as f_,pick as fa,omitBy as fb,flat as fc,MenuIcon as fd,useDebounceFn as fe,Dialog as ff,OutlinedInput as fg,data as fh,Drawer as fi,parseQuery as fj,parseFilename as fk,stringifyParsedURL as fl,Grow as fm,Wt as fn,InputAdornment as fo,tooltipClasses as fp,requireEngine as fq,__spreadArray as fr,useEventListener as fs,le$7 as ft,getTargetElement as fu,clamp as fv,extractEventHandlers as fw,isFocusVisible as fx,isHostComponent as fy,lighten as fz,p$3 as g,__extends as g$,requireRipemd160 as g0,requireLib$4 as g1,requireUtil$2 as g2,uniq as g3,useLocalStorageState as g4,InputBase as g5,useSize as g6,DialogTitle as g7,DialogContent as g8,DialogActions as g9,baseForOwn as gA,isPlainObject$2 as gB,require$$12 as gC,throttle$2 as gD,isUndefined$1 as gE,useTimeout as gF,Fade as gG,FocusTrap as gH,dialogClasses as gI,localizedFormatPlugin as gJ,n$8 as gK,purify as gL,Buffer$1$1 as gM,Q$2 as gN,require$$0$1 as gO,requireIsAbsoluteUrl as gP,requireDist$1 as gQ,requireBrowser as gR,require$$3 as gS,resolveProps as gT,useThemeProps as gU,defaultTheme$1 as gV,THEME_ID as gW,en$2 as gX,isIndex as gY,useTheme$4 as gZ,objectAssign as g_,pickBy as ga,shouldForwardProp as gb,resolveComponentProps as gc,getInviteLink as gd,e$e as ge,getIssuePassportLink as gf,uniqBy$1 as gg,isNodeOwner as gh,isSelf as gi,Q$1 as gj,I$3 as gk,Y$3 as gl,PQueue as gm,getBlockletAccessibleUrl as gn,A$1 as go,createPassportSvg$1 as gp,requireMs as gq,E$3 as gr,trim as gs,getBlockletSDK as gt,MoreHorizIcon as gu,identity$1 as gv,arrayEach as gw,baseEach as gx,arrayMap as gy,baseMap as gz,get$1 as h,useSnackbar as h$,isServerless as h0,requireJsonStableStringify as h1,isFunction$2 as h2,omit$1 as h3,TableContext as h4,Tablelvl2Context as h5,g$e as h6,useUnmount as h7,isDidDomainOrIpEchoDomain as h8,ExpandLess as h9,createUseStorageState as hA,isBrowser$1 as hB,root$1 as hC,isNil$1 as hD,require$$11 as hE,requireHoistNonReactStatics_cjs as hF,_assertThisInitialized$1 as hG,reactDomExports as hH,loadIcon as hI,withoutLeadingSlash as hJ,fetchSvgAsPng as hK,blobToFile as hL,withoutTrailingSlash as hM,u$2 as hN,Ce as hO,t$g as hP,i as hQ,R$8 as hR,p$f as hS,requireBrowser$7 as hT,requireEventemitter3$1 as hU,requirePhoenix_cjs as hV,usePrevious as hW,BlockletSDK as hX,highlightExports as hY,funcExports as hZ,data$y as h_,validateDomain as ha,requireDist$2 as hb,requireAxios as hc,trim$1 as hd,requirePRetry as he,TableCell as hf,xe$1 as hg,getSystemDomains as hh,copyArray as hi,baseIndexOf as hj,ke as hk,useAppLogo as hl,getTransferAppLink as hm,requireBn$1 as hn,require$$2 as ho,updateWindowEnv as hp,M$4 as hq,isNil as hr,requireBase32 as hs,Re as ht,withTrailingSlash as hu,data$B as hv,keyframes as hw,requireAssertString as hx,isEmail as hy,isURL as hz,utilExports$1 as i,isNull as i$,common$3 as i0,green as i1,amber as i2,SnackbarContent as i3,d$f as i4,t$1 as i5,useDebounce as i6,Y as i7,g$3 as i8,b as i9,isValidClusterSize as iA,extractStatusUrlFromNextWorkflow as iB,pWaitFor as iC,hasRequiredSteps as iD,getStoreList as iE,commonjsRequire as iF,require_interface as iG,requireHasown as iH,requireBrowser$3 as iI,requireSemver as iJ,require$$4$1 as iK,flatten as iL,trimEnd as iM,base32Exports as iN,flatExports as iO,Xt as iP,AxiosError as iQ,requireSha3$4 as iR,requireHash$2 as iS,requireNaclFast as iT,requireBrowser$j as iU,requireAccount as iV,requireHash as iW,requireHelpers as iX,require$$0$7 as iY,require$$1$5 as iZ,I$6 as i_,g$9 as ia,withErrorBoundary as ib,z$1 as ic,M$5 as id,Be as ie,G$1 as ig,xe as ih,useBlockletLogo as ii,isPlainObject$1 as ij,Toolbar as ik,_setPrototypeOf as il,isString$3 as im,FormLabel as io,RelativeTime as ip,isIncludeActivity as iq,isUserActor as ir,ActorAvatar as is,SendComponentAvatar as it,Activity as iu,NotificationContent$1 as iv,AvatarGroup as iw,requireCjs as ix,useTheme$2 as iy,baseAssignValue as iz,jsxRuntimeExports as j,orange as j0,purple as j1,useStore as j2,createStore as j3,create$1 as j4,t$h as j5,clientExports as j6,ke$1 as j7,retry as j8,isNetworkError as j9,requirePTimeout as ja,n$5 as jb,Modal as jc,GlobalStyles$2 as jd,filesize as k,prettyMs as l,formatLocale as m,useSessionContext as n,o$h as o,p$e as p,useSetState as q,reactExports as r,styled$3 as s,TextField as t,useNodeContext as u,n$4 as v,lo as w,getWebWalletUrl as x,joinURL as y,withQuery as z};
@@ -1,4 +1,4 @@
1
- import{r as a,u as D,j as e,T as k,be as Y,K as i,s as U,b2 as Q,o as l,p as P,k as M,d4 as X,bk as ee,d as te,Y as re,C as ne,V as se,i as v,a as h,aH as T,b,d5 as oe,J as ie,bx as ae,aD as le,d6 as me,G as C,H as R,l as ce,m as ue,A as de,bm as pe}from"./index-l0ejZk6e.js";import{u as fe,T as xe}from"./html-title-x1db95S1.js";import{T as ge}from"./traffic-BlWSHfOP.js";import{H as he}from"./index-BKe-qavD.js";import{x as V}from"./index-DRYJ0xIl.js";import{C as ye,M as L}from"./memory-BiZfGzaA.js";import{C as ve}from"./CardContent-CJq0LG9T.js";import{u as Ce}from"./useLocalStorage-CaDSR1Wc.js";import{T as je,a as Ie}from"./ToggleButtonGroup-BBbP2Jx0.js";import"./iframe-BBrwuPrb.js";import"./ChevronLeft-B42HGuyE.js";import"./ChevronRight-BLRImDEd.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./base-chart-CzLW1tBo.js";import"./index-DYWrZZLV.js";import"./AdapterDayjs-BjSFvDvr.js";import"./useThemeProps-DAtqRnvX.js";import"./CSSTransition-Cyc7snYy.js";import"./visuallyHidden-Dan1xhjv.js";import"./FilterList-tXxMVwM9.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-BwyiJPiC.js";import"./redux-DfszZyTl.js";import"./depsEqual-CI7FeWZW.js";import"./index-B1zRPZ23.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./getValidReactChildren-C2GpPG5h.js";const be=o=>a.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...o},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08295 3.2C2.08295 2.58144 2.58439 2.08 3.20295 2.08H28.8029C29.4215 2.08 29.9229 2.58144 29.9229 3.2V13.44C29.9229 14.0586 29.4215 14.56 28.8029 14.56H3.20295C2.58439 14.56 2.08295 14.0586 2.08295 13.44V3.2ZM4.32295 4.32V12.32H27.6829V4.32H4.32295ZM2.08295 18.56C2.08295 17.9414 2.58439 17.44 3.20295 17.44H28.8029C29.4215 17.44 29.9229 17.9414 29.9229 18.56V28.8C29.9229 29.4186 29.4215 29.92 28.8029 29.92H3.20295C2.58439 29.92 2.08295 29.4186 2.08295 28.8V18.56ZM4.32295 19.68V27.68H27.6829V19.68H4.32295Z",fill:"currentColor"}),a.createElement("path",{d:"M8.96297 7.04001H7.68297C7.51323 7.04001 7.35044 7.10744 7.23042 7.22746C7.1104 7.34748 7.04297 7.51027 7.04297 7.68001V8.96001C7.04297 9.12975 7.1104 9.29253 7.23042 9.41256C7.35044 9.53258 7.51323 9.60001 7.68297 9.60001H8.96297C9.13271 9.60001 9.29549 9.53258 9.41552 9.41256C9.53554 9.29253 9.60297 9.12975 9.60297 8.96001V7.68001C9.60297 7.51027 9.53554 7.34748 9.41552 7.22746C9.29549 7.10744 9.13271 7.04001 8.96297 7.04001ZM8.96297 22.4H7.68297C7.51323 22.4 7.35044 22.4674 7.23042 22.5875C7.1104 22.7075 7.04297 22.8703 7.04297 23.04V24.32C7.04297 24.4897 7.1104 24.6525 7.23042 24.7726C7.35044 24.8926 7.51323 24.96 7.68297 24.96H8.96297C9.13271 24.96 9.29549 24.8926 9.41552 24.7726C9.53554 24.6525 9.60297 24.4897 9.60297 24.32V23.04C9.60297 22.8703 9.53554 22.7075 9.41552 22.5875C9.29549 22.4674 9.13271 22.4 8.96297 22.4ZM14.083 7.04001H12.803C12.6332 7.04001 12.4704 7.10744 12.3504 7.22746C12.2304 7.34748 12.163 7.51027 12.163 7.68001V8.96001C12.163 9.12975 12.2304 9.29253 12.3504 9.41256C12.4704 9.53258 12.6332 9.60001 12.803 9.60001H14.083C14.2527 9.60001 14.4155 9.53258 14.5355 9.41256C14.6555 9.29253 14.723 9.12975 14.723 8.96001V7.68001C14.723 7.51027 14.6555 7.34748 14.5355 7.22746C14.4155 7.10744 14.2527 7.04001 14.083 7.04001ZM14.083 22.4H12.803C12.6332 22.4 12.4704 22.4674 12.3504 22.5875C12.2304 22.7075 12.163 22.8703 12.163 23.04V24.32C12.163 24.4897 12.2304 24.6525 12.3504 24.7726C12.4704 24.8926 12.6332 24.96 12.803 24.96H14.083C14.2527 24.96 14.4155 24.8926 14.5355 24.7726C14.6555 24.6525 14.723 24.4897 14.723 24.32V23.04C14.723 22.8703 14.6555 22.7075 14.5355 22.5875C14.4155 22.4674 14.2527 22.4 14.083 22.4Z",fill:"currentColor"}));function Me(){const{api:o,info:s}=D();return e.jsx(ge,{client:o,did:s.did})}function $({style:o={},title:s=null,value:m=null,graph:c=null,description:p=null,empty:f=null}){return e.jsx(ke,{children:e.jsxs(ve,{style:{...o},children:[e.jsx(k,{sx:{color:"text.secondary",fontSize:14},children:s}),f&&Y.isValidElement(f)?e.jsx(i,{style:{height:150},sx:{color:"text.secondary",display:"flex",justifyContent:"center",alignItems:"center"},children:f}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"h5",component:"div",sx:{mt:1},children:m}),c,!!p&&e.jsx(i,{sx:{display:"flex",color:"text.secondary",fontSize:12,marginTop:3},children:p})]})]})})}$.propTypes={style:l.object,title:l.node,value:l.node,graph:l.node,description:l.any,empty:l.node};const ke=U(Q)`
1
+ import{r as a,u as D,j as e,T as k,be as Y,K as i,s as U,b2 as Q,o as l,p as P,k as M,d5 as X,bk as ee,d as te,Y as re,C as ne,V as se,i as v,a as h,aH as T,b,d6 as oe,J as ie,bx as ae,aD as le,d7 as me,G as C,H as R,l as ce,m as ue,A as de,bm as pe}from"./index-t7M3AlIl.js";import{u as fe,T as xe}from"./html-title-C8DFoE3o.js";import{T as ge}from"./traffic-CAtwfrwW.js";import{H as he}from"./index-BeBFdIcq.js";import{x as V}from"./index-DRYJ0xIl.js";import{C as ye,M as L}from"./memory-Ca0TT2wR.js";import{C as ve}from"./CardContent-B3Ns-1d7.js";import{u as Ce}from"./useLocalStorage-BNDc6dCy.js";import{T as je,a as Ie}from"./ToggleButtonGroup-BeJ2H-vs.js";import"./iframe-B2nulerg.js";import"./ChevronLeft-DKTuWlNz.js";import"./ChevronRight-U_VKk8yi.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./base-chart-CtBedy-P.js";import"./index-B22sxjhK.js";import"./AdapterDayjs-DU0D4sqH.js";import"./useThemeProps-CWZCrmyJ.js";import"./CSSTransition-BZnv4uwU.js";import"./visuallyHidden-Dan1xhjv.js";import"./FilterList-ip4QUiRE.js";import"./emotion-cache.browser.esm-Dakakd0R.js";import"./index-C4sXNe3X.js";import"./redux-DfszZyTl.js";import"./depsEqual-CNVuMuEd.js";import"./index-Dxe6NqUd.js";import"./TableSearch-20ltCGV9.js";import"./Search-XYz8f8XA.js";import"./Clear-Bjaoevyy.js";import"./MoreVert-BFhM4QD_.js";import"./getValidReactChildren-D4p_s3zF.js";const be=o=>a.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...o},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08295 3.2C2.08295 2.58144 2.58439 2.08 3.20295 2.08H28.8029C29.4215 2.08 29.9229 2.58144 29.9229 3.2V13.44C29.9229 14.0586 29.4215 14.56 28.8029 14.56H3.20295C2.58439 14.56 2.08295 14.0586 2.08295 13.44V3.2ZM4.32295 4.32V12.32H27.6829V4.32H4.32295ZM2.08295 18.56C2.08295 17.9414 2.58439 17.44 3.20295 17.44H28.8029C29.4215 17.44 29.9229 17.9414 29.9229 18.56V28.8C29.9229 29.4186 29.4215 29.92 28.8029 29.92H3.20295C2.58439 29.92 2.08295 29.4186 2.08295 28.8V18.56ZM4.32295 19.68V27.68H27.6829V19.68H4.32295Z",fill:"currentColor"}),a.createElement("path",{d:"M8.96297 7.04001H7.68297C7.51323 7.04001 7.35044 7.10744 7.23042 7.22746C7.1104 7.34748 7.04297 7.51027 7.04297 7.68001V8.96001C7.04297 9.12975 7.1104 9.29253 7.23042 9.41256C7.35044 9.53258 7.51323 9.60001 7.68297 9.60001H8.96297C9.13271 9.60001 9.29549 9.53258 9.41552 9.41256C9.53554 9.29253 9.60297 9.12975 9.60297 8.96001V7.68001C9.60297 7.51027 9.53554 7.34748 9.41552 7.22746C9.29549 7.10744 9.13271 7.04001 8.96297 7.04001ZM8.96297 22.4H7.68297C7.51323 22.4 7.35044 22.4674 7.23042 22.5875C7.1104 22.7075 7.04297 22.8703 7.04297 23.04V24.32C7.04297 24.4897 7.1104 24.6525 7.23042 24.7726C7.35044 24.8926 7.51323 24.96 7.68297 24.96H8.96297C9.13271 24.96 9.29549 24.8926 9.41552 24.7726C9.53554 24.6525 9.60297 24.4897 9.60297 24.32V23.04C9.60297 22.8703 9.53554 22.7075 9.41552 22.5875C9.29549 22.4674 9.13271 22.4 8.96297 22.4ZM14.083 7.04001H12.803C12.6332 7.04001 12.4704 7.10744 12.3504 7.22746C12.2304 7.34748 12.163 7.51027 12.163 7.68001V8.96001C12.163 9.12975 12.2304 9.29253 12.3504 9.41256C12.4704 9.53258 12.6332 9.60001 12.803 9.60001H14.083C14.2527 9.60001 14.4155 9.53258 14.5355 9.41256C14.6555 9.29253 14.723 9.12975 14.723 8.96001V7.68001C14.723 7.51027 14.6555 7.34748 14.5355 7.22746C14.4155 7.10744 14.2527 7.04001 14.083 7.04001ZM14.083 22.4H12.803C12.6332 22.4 12.4704 22.4674 12.3504 22.5875C12.2304 22.7075 12.163 22.8703 12.163 23.04V24.32C12.163 24.4897 12.2304 24.6525 12.3504 24.7726C12.4704 24.8926 12.6332 24.96 12.803 24.96H14.083C14.2527 24.96 14.4155 24.8926 14.5355 24.7726C14.6555 24.6525 14.723 24.4897 14.723 24.32V23.04C14.723 22.8703 14.6555 22.7075 14.5355 22.5875C14.4155 22.4674 14.2527 22.4 14.083 22.4Z",fill:"currentColor"}));function Me(){const{api:o,info:s}=D();return e.jsx(ge,{client:o,did:s.did})}function $({style:o={},title:s=null,value:m=null,graph:c=null,description:p=null,empty:f=null}){return e.jsx(ke,{children:e.jsxs(ve,{style:{...o},children:[e.jsx(k,{sx:{color:"text.secondary",fontSize:14},children:s}),f&&Y.isValidElement(f)?e.jsx(i,{style:{height:150},sx:{color:"text.secondary",display:"flex",justifyContent:"center",alignItems:"center"},children:f}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"h5",component:"div",sx:{mt:1},children:m}),c,!!p&&e.jsx(i,{sx:{display:"flex",color:"text.secondary",fontSize:12,marginTop:3},children:p})]})]})})}$.propTypes={style:l.object,title:l.node,value:l.node,graph:l.node,description:l.any,empty:l.node};const ke=U(Q)`
2
2
  .card-content {
3
3
  height: 150px;
4
4
  }