@abtnode/webapp 1.17.6 → 1.17.7-beta-20251224-045844-3c7f459a

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 (185) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-BjFsoQ-w.js → AdapterDayjs-CTE9A4XS.js} +1 -1
  4. package/dist/assets/{Add-DwgbzyUw.js → Add-CDjPaJKP.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DVc4YlSr.js +1 -0
  6. package/dist/assets/{Autocomplete-Dm1_2YSl.js → Autocomplete-Bk7apAFc.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-CJg6cGOH.js → Breadcrumbs-CD40dK_D.js} +1 -1
  8. package/dist/assets/{ButtonGroup-Td8BNrZx.js → ButtonGroup-CufACnLw.js} +1 -1
  9. package/dist/assets/{CSSTransition-y8iKTN7d.js → CSSTransition-exmZd1Pd.js} +1 -1
  10. package/dist/assets/{CallMerge-KptmKwB4.js → CallMerge-C9Klwufe.js} +1 -1
  11. package/dist/assets/{CardContent-ewSbhAdG.js → CardContent-_17XtZEs.js} +1 -1
  12. package/dist/assets/{ChevronLeft-nSrR9D_I.js → ChevronLeft-PZrWRTUE.js} +1 -1
  13. package/dist/assets/{ChevronRight-CRb5GVq5.js → ChevronRight-C64VDrVw.js} +1 -1
  14. package/dist/assets/{Clear-CP-1JSsG.js → Clear-Cxz7AyBG.js} +1 -1
  15. package/dist/assets/{Delete-zum6vOfn.js → Delete-BWThh3lU.js} +1 -1
  16. package/dist/assets/{DeleteOutline-BRn6KXm4.js → DeleteOutline-DGv1wjmr.js} +1 -1
  17. package/dist/assets/{Done-BD3-Bno_.js → Done-BPhEa-lh.js} +1 -1
  18. package/dist/assets/{Edit-fbuEYDWz.js → Edit-DU8cRp9d.js} +1 -1
  19. package/dist/assets/{ErrorOutline-eTinVSTi.js → ErrorOutline-BGT4By5f.js} +1 -1
  20. package/dist/assets/{FilterList-CoptEImh.js → FilterList-DnTA4h-A.js} +1 -1
  21. package/dist/assets/{Google-DYe0WpSM.js → Google-CQNl2Qei.js} +1 -1
  22. package/dist/assets/{HelpOutline-CTq25q-V.js → HelpOutline-Cq89intm.js} +1 -1
  23. package/dist/assets/{KeyboardArrowDown-DBKPniSI.js → KeyboardArrowDown-Du2c6qjk.js} +1 -1
  24. package/dist/assets/{Launch-BMpdke3b.js → Launch-MVYS8Hns.js} +1 -1
  25. package/dist/assets/{Link-Bum1u5am.js → Link-BnEYcCWC.js} +1 -1
  26. package/dist/assets/{ListItemButton-DAHFrrOj.js → ListItemButton-7lbPyGsz.js} +1 -1
  27. package/dist/assets/{ListSubheader-DmTgdBz5.js → ListSubheader-DYeGWpur.js} +1 -1
  28. package/dist/assets/{LoadingButton-Hr-4vZXO.js → LoadingButton-DTEhJUCj.js} +1 -1
  29. package/dist/assets/{MoreVert-Bs574HAx.js → MoreVert-CBPzGUWs.js} +1 -1
  30. package/dist/assets/{OpenInNew-Df7bSVHt.js → OpenInNew-Dap82Gj1.js} +1 -1
  31. package/dist/assets/{Refresh-mfLuZ9Wj.js → Refresh-TSC86hrV.js} +1 -1
  32. package/dist/assets/{Replay-CUAnOum2.js → Replay-CCjt3MYi.js} +1 -1
  33. package/dist/assets/{Search-CCrESOjg.js → Search-BTki5Tlw.js} +1 -1
  34. package/dist/assets/{Stepper-CDtZbh-4.js → Stepper-DWCCfU77.js} +1 -1
  35. package/dist/assets/{TableSearch-hUcYhTcB.js → TableSearch-CPKsMI8E.js} +1 -1
  36. package/dist/assets/{ToggleButtonGroup-B8Mjp9ll.js → ToggleButtonGroup-DxN7gyOm.js} +1 -1
  37. package/dist/assets/{UnfoldMore-DDQ8EkCp.js → UnfoldMore-DM7uEg-t.js} +1 -1
  38. package/dist/assets/{Verified-D2LDOD6a.js → Verified-CNxkIuze.js} +1 -1
  39. package/dist/assets/{VerifiedUser-dJrRBh25.js → VerifiedUser-CwrDiVvI.js} +1 -1
  40. package/dist/assets/{ViewList-Dd0smq67.js → ViewList-DAPsQ9qa.js} +1 -1
  41. package/dist/assets/{_createAggregator-Btgpq5ky.js → _createAggregator-CAAbBm3S.js} +1 -1
  42. package/dist/assets/{actions-Bsd5QbHY.js → actions-BSlGM89P.js} +1 -1
  43. package/dist/assets/{actions-PjGF5ddj.js → actions-DLaMcDXc.js} +1 -1
  44. package/dist/assets/{agreement-CR0Ele2A.js → agreement-CetGa5Zn.js} +1 -1
  45. package/dist/assets/api-BgOKuKLm.js +1 -0
  46. package/dist/assets/{appearance-Dde_YYZa.js → appearance-Bw0rB7tg.js} +1 -1
  47. package/dist/assets/{audit-logs-BA1_e5TT.js → audit-logs-VYgS8pEE.js} +1 -1
  48. package/dist/assets/{base-chart-DoQaNYbB.js → base-chart-DK86Bg6l.js} +1 -1
  49. package/dist/assets/{blocklet-9wr_FD8g.js → blocklet-BtHx1Y24.js} +1 -1
  50. package/dist/assets/{chain-xcMn0w3E.js → chain-CnR1vCEL.js} +1 -1
  51. package/dist/assets/{click-to-copy-BkgGJ2iu.js → click-to-copy-C6Ix5G0V.js} +1 -1
  52. package/dist/assets/cloneDeep-CsXhtsDM.js +1 -0
  53. package/dist/assets/{config-navigation-B8xULYAA.js → config-navigation-D2rte6dv.js} +3 -3
  54. package/dist/assets/{connect-to-D7kv9JZG.js → connect-to-ZkEn8UXb.js} +1 -1
  55. package/dist/assets/{cssMode-CrKT5NTU.js → cssMode-Cy0Ht4-w.js} +1 -1
  56. package/dist/assets/{delete-confirm-DsbMbRAa.js → delete-confirm-C6-PGb0E.js} +1 -1
  57. package/dist/assets/{depsEqual-BIKlqTyk.js → depsEqual-IFL5M-qa.js} +1 -1
  58. package/dist/assets/{detail-Y8udUtll.js → detail-akdyilvB.js} +3 -3
  59. package/dist/assets/{domains-B-frEuQt.js → domains-CBW5W-A4.js} +1 -1
  60. package/dist/assets/{download-DjEQp-4L.js → download-_CsYRy7z.js} +1 -1
  61. package/dist/assets/{edit.svg-_S0cvmEV.js → edit.svg-BI9q0cq7.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-P8IIbJhy.js +1 -0
  63. package/dist/assets/engine-DLi7rSr-.js +1 -0
  64. package/dist/assets/{freemarker2-DMLRgxDr.js → freemarker2-CHbFGeGq.js} +1 -1
  65. package/dist/assets/{get-safe-url-DcDP4eG0.js → get-safe-url-DvnzSlO6.js} +1 -1
  66. package/dist/assets/getValidReactChildren-DVWXmlzf.js +1 -0
  67. package/dist/assets/{graphqlMode-BF3BGh5s.js → graphqlMode-DC3lY9Bc.js} +2 -2
  68. package/dist/assets/{handlebars-D79JLSFR.js → handlebars-DRfC1etE.js} +1 -1
  69. package/dist/assets/{html-BnBm7tse.js → html-DSKmnSdn.js} +1 -1
  70. package/dist/assets/{html-title-CFJOQU04.js → html-title-BSurkQWH.js} +1 -1
  71. package/dist/assets/{htmlMode-Dbi5GsHR.js → htmlMode-_-dLWJfg.js} +1 -1
  72. package/dist/assets/{iframe-DTPDSES_.js → iframe-Bt3m8KPW.js} +1 -1
  73. package/dist/assets/{index-_p9TGBvO.js → index-40MfJqec.js} +1 -1
  74. package/dist/assets/{index-Cqnb030V.js → index-8POE69-i.js} +1 -1
  75. package/dist/assets/{index-DxeaApG7.js → index-B108geQF.js} +1 -1
  76. package/dist/assets/{index-DAzO4vT3.js → index-B1FMLcMH.js} +1 -1
  77. package/dist/assets/{index-Br_3Odot.js → index-B1Nj4Dbn.js} +1 -1
  78. package/dist/assets/{index-gW2LRVpQ.js → index-B6ukQo_6.js} +3 -3
  79. package/dist/assets/{index-B3f37Bjf.js → index-BAjBvyiG.js} +1 -1
  80. package/dist/assets/{index-aQCP0zMr.js → index-BD3aqk2R.js} +24 -24
  81. package/dist/assets/{index-CsR2mhWN.js → index-BK7GVg3F.js} +1 -1
  82. package/dist/assets/{index-DpFVufZF.js → index-BRwrysOT.js} +3 -3
  83. package/dist/assets/{index-BOjP8MFh.js → index-BdJ8QXo_.js} +1 -1
  84. package/dist/assets/{index-D49gl1dV.js → index-BdkR_Gq6.js} +1 -1
  85. package/dist/assets/{index-CZVZy3tE.js → index-BkzhB5R6.js} +1 -1
  86. package/dist/assets/{index-DfO0PkR5.js → index-BqbzDVxw.js} +2 -2
  87. package/dist/assets/{index-DAIx6BU9.js → index-Br1ngDZj.js} +9 -9
  88. package/dist/assets/{index-Cj3feFCu.js → index-BsfcFq96.js} +1 -1
  89. package/dist/assets/{index-CusFNu14.js → index-BwYWp4uB.js} +1 -1
  90. package/dist/assets/{index-Crh7ejXx.js → index-BzsBXHYe.js} +3 -3
  91. package/dist/assets/{index-DqKWQ6lA.js → index-C8QDtMUx.js} +1 -1
  92. package/dist/assets/index-CCHTs-ny.js +1 -0
  93. package/dist/assets/{index-CeVw-yV4.js → index-CDv5sV-r.js} +1 -1
  94. package/dist/assets/{index-B6CCglEp.js → index-CFEh-tzA.js} +1 -1
  95. package/dist/assets/{index-C0xGIN2P.js → index-CMgJdphE.js} +1 -1
  96. package/dist/assets/{index-BruXFS68.js → index-CPY0YlbJ.js} +1 -1
  97. package/dist/assets/{index-Dter8RWU.js → index-CRebSTUo.js} +1 -1
  98. package/dist/assets/{index-8vHqMMTo.js → index-CTnrh8HT.js} +1 -1
  99. package/dist/assets/{index-DmsOwDxy.js → index-CW8HQTvR.js} +1 -1
  100. package/dist/assets/{index-BESOxZme.js → index-CgGaIeHC.js} +1 -1
  101. package/dist/assets/{index-D09yH344.js → index-Ci0Kk6rk.js} +1 -1
  102. package/dist/assets/{index-DKlmfMu8.js → index-CixkoMpL.js} +1 -1
  103. package/dist/assets/{index-CySEKiOM.js → index-D5NCDKoy.js} +1 -1
  104. package/dist/assets/{index-DkNsYHWd.js → index-D97ip1uo.js} +1 -1
  105. package/dist/assets/{index-DSki-yHd.js → index-DEcH1z__.js} +3 -3
  106. package/dist/assets/{index-FOfUOpKU.js → index-DfNf7S5Q.js} +1 -1
  107. package/dist/assets/{index-CaHbIkEa.js → index-DkcG4kie.js} +1 -1
  108. package/dist/assets/{index-C-G6LjU2.js → index-Dq_LjxOb.js} +1 -1
  109. package/dist/assets/{index-C4bxvfjr.js → index-DtWrHdLQ.js} +1 -1
  110. package/dist/assets/{index-Cy1gRvjJ.js → index-DxuCw2B5.js} +1 -1
  111. package/dist/assets/{index-TkRGX0aU.js → index-Dyi8pxAj.js} +1 -1
  112. package/dist/assets/{index-CSqb8yB_.js → index-KhMC1sR2.js} +1 -1
  113. package/dist/assets/{index-C6w6MwHd.js → index-LjsyWu4w.js} +1 -1
  114. package/dist/assets/{index-B3S0fIB2.js → index-PyGYazDG.js} +1 -1
  115. package/dist/assets/{index-CnaB1RS2.js → index-WuCKKQ6-.js} +1 -1
  116. package/dist/assets/{index-gY5iKTIg.js → index-jNjCxoJx.js} +1 -1
  117. package/dist/assets/{index-BprceCor.js → index-sKIgMA4E.js} +1 -1
  118. package/dist/assets/{index.esm-DNw2WsMP.js → index.esm-DmjTLIy8.js} +1 -1
  119. package/dist/assets/{install-from-url-ChxBmd8y.js → install-from-url-Ch_1I_g4.js} +1 -1
  120. package/dist/assets/{invitation-CK-9fzay.js → invitation-wPdHjRbO.js} +1 -1
  121. package/dist/assets/{is-path-prefix-equal-z6rXFfWF.js → is-path-prefix-equal-CH8zcdAz.js} +1 -1
  122. package/dist/assets/{item-Bi4YOXoV.js → item-DwlLrYZ8.js} +1 -1
  123. package/dist/assets/{javascript-gR9EmbFN.js → javascript-v_dB2LCD.js} +1 -1
  124. package/dist/assets/{jsonMode-C2iokhm3.js → jsonMode-A_r5s-xz.js} +1 -1
  125. package/dist/assets/{liquid-DlmH91G9.js → liquid-BpLkSRaK.js} +1 -1
  126. package/dist/assets/{list-header-CiZSpcHw.js → list-header-aIJDfQ7C.js} +1 -1
  127. package/dist/assets/{lock.svg-D4RerwXL.js → lock.svg-DIfrAsKr.js} +1 -1
  128. package/dist/assets/{log-fHnfsRRc.js → log-D1BgNL7X.js} +1 -1
  129. package/dist/assets/{lottie-react.esm-DwGuMXwe.js → lottie-react.esm-BWoLX3N3.js} +1 -1
  130. package/dist/assets/{mdx-B4KL37qQ.js → mdx-CcVqE20R.js} +1 -1
  131. package/dist/assets/{memory-_jD3viB0.js → memory-BLdw7rTR.js} +1 -1
  132. package/dist/assets/{metric-D-n9wLBp.js → metric-IUjf35f-.js} +1 -1
  133. package/dist/assets/omit-CDfacidt.js +1 -0
  134. package/dist/assets/{overview-DTGYE6TZ.js → overview-D7Y-efsF.js} +1 -1
  135. package/dist/assets/{permission-a5zDq7rM.js → permission-lRCqS6FX.js} +1 -1
  136. package/dist/assets/{preference-B-CYFAI3.js → preference-BPMZO3G0.js} +3 -3
  137. package/dist/assets/{python-BM52WTwZ.js → python-BOBV8DO9.js} +1 -1
  138. package/dist/assets/{raf-schd.esm-B5OMlrCf.js → raf-schd.esm-1Wuo2M9L.js} +1 -1
  139. package/dist/assets/{razor-DrYd4877.js → razor-Bm4kx_M6.js} +1 -1
  140. package/dist/assets/{rotate-session-key-DETYEvOS.js → rotate-session-key-BVzu2iwA.js} +1 -1
  141. package/dist/assets/{runtime-C5Qv_-EQ.js → runtime-bAThj0Aq.js} +1 -1
  142. package/dist/assets/schema-2rSPa9BO.js +1 -0
  143. package/dist/assets/sdk-DLjX87O7.js +1 -0
  144. package/dist/assets/{service-CU627QjX.js → service-B1eJ3WVA.js} +1 -1
  145. package/dist/assets/{shorten-label-izVabXeE.js → shorten-label-CoRoKICP.js} +1 -1
  146. package/dist/assets/{simple-select-BSptVRvh.js → simple-select-DJQq12UY.js} +1 -1
  147. package/dist/assets/{spaces-CGMxc8V-.js → spaces-DaLcXe5Q.js} +1 -1
  148. package/dist/assets/{status-DsuywKQN.js → status-B9k6GD3L.js} +1 -1
  149. package/dist/assets/{status-Cc65Exxv.js → status-Bqt7B9nn.js} +1 -1
  150. package/dist/assets/{switch-control-BrQIub8A.js → switch-control-CQRoTkvj.js} +1 -1
  151. package/dist/assets/{table-icons-hVAZnA0-.js → table-icons-DNYeh5xy.js} +1 -1
  152. package/dist/assets/{team-651xYHqY.js → team-CCZFetkg.js} +1 -1
  153. package/dist/assets/{toLower-BTh_yPFG.js → toLower-wanvKBaZ.js} +1 -1
  154. package/dist/assets/toUpper-DhA75wMh.js +1 -0
  155. package/dist/assets/{traffic-DEO0b2pJ.js → traffic-DpPN1079.js} +1 -1
  156. package/dist/assets/{tsMode-DFoW-qGq.js → tsMode-BU3eTe2J.js} +1 -1
  157. package/dist/assets/{typescript-yTEHeHqu.js → typescript-BrdqWxrm.js} +1 -1
  158. package/dist/assets/{url-evaluation-htR8cP0c.js → url-evaluation-CgzjVAvg.js} +1 -1
  159. package/dist/assets/{url-join-CvBUjlHE.js → url-join-DOdOelSC.js} +1 -1
  160. package/dist/assets/{use-mobile-CD0b5-fF.js → use-mobile-BVZp-Eov.js} +1 -1
  161. package/dist/assets/{use-mobile-B2fvjcjL.js → use-mobile-DlRpLfd1.js} +1 -1
  162. package/dist/assets/{useAsync-DTSaiLA6.js → useAsync-TDFBzBqx.js} +1 -1
  163. package/dist/assets/{useAsyncRetry-3oMBxbWI.js → useAsyncRetry-CrZDAawF.js} +1 -1
  164. package/dist/assets/{useLocalStorage-pDiaOOl8.js → useLocalStorage-BpFDuJHy.js} +1 -1
  165. package/dist/assets/{useThemeProps-D2o2I8tH.js → useThemeProps-DiahvBki.js} +1 -1
  166. package/dist/assets/{util-CO7za6kW.js → util-DTNmxH9u.js} +1 -1
  167. package/dist/assets/{wait-container-CKMtOVZ5.js → wait-container-DPxn2Zp4.js} +1 -1
  168. package/dist/assets/{without-wallet-Bz0faV9X.js → without-wallet-E48cNWb9.js} +4 -4
  169. package/dist/assets/wrap-locale-BIL9uJmS.js +1 -0
  170. package/dist/assets/{xml-DOoQrL1t.js → xml-BeHXnyv2.js} +1 -1
  171. package/dist/assets/{yaml-CEc3MOv9.js → yaml-apFNFPw8.js} +1 -1
  172. package/dist/index.html +1 -1
  173. package/package.json +1 -1
  174. package/dist/assets/ArrowDropDown-CbNJotqT.js +0 -1
  175. package/dist/assets/api-IHWlq8qW.js +0 -1
  176. package/dist/assets/cloneDeep-DvQOj2-I.js +0 -1
  177. package/dist/assets/emotion-cache.browser.esm-B4otC3_4.js +0 -1
  178. package/dist/assets/engine-B_GmO38d.js +0 -1
  179. package/dist/assets/getValidReactChildren-DUKHPCTn.js +0 -1
  180. package/dist/assets/index-DdF52dPT.js +0 -1
  181. package/dist/assets/omit-CPRZ0B0R.js +0 -1
  182. package/dist/assets/schema-BpWVtFwc.js +0 -1
  183. package/dist/assets/sdk-BCvN9-9d.js +0 -1
  184. package/dist/assets/toUpper-BY5QEPjh.js +0 -1
  185. package/dist/assets/wrap-locale-BbjqZMGZ.js +0 -1
@@ -1 +1 @@
1
- import{c6 as a,r as f,cw as U,bb as V,bc as X,cW as v,fq as u,aT as m,fr as Z,fs as $,ft as I}from"./index-DpFVufZF.js";var ee=function(t){return t===document||t===document.documentElement||t===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):t.scrollTop},O=function(t){return t.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)},re=function(t){return t.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight)},oe=function(t,o){o===void 0&&(o={});var g=o.target,x=o.isNoMore,F=o.threshold,p=F===void 0?100:F,B=o.direction,P=B===void 0?"bottom":B,R=o.reloadDeps,W=R===void 0?[]:R,Y=o.manual,h=o.onBefore,_=o.onSuccess,M=o.onError,y=o.onFinally,q=a(f.useState(),2),c=q[0],E=q[1],D=a(f.useState(!1),2),T=D[0],i=D[1],b=P==="top",H=f.useRef(void 0),L=f.useRef(0),S=f.useMemo(function(){return x?x(c):!1},[c]),s=U(function(r){return V(void 0,void 0,void 0,function(){var e,n,l,d;return X(this,function(C){switch(C.label){case 0:return[4,t(r)];case 1:return e=C.sent(),E(r?v(v({},e),{list:b?u(u([],a(e.list),!1),a((l=r.list)!==null&&l!==void 0?l:[]),!1):u(u([],a((d=r.list)!==null&&d!==void 0?d:[]),!1),a(e.list),!1)}):v(v({},e),{list:u([],a((n=e.list)!==null&&n!==void 0?n:[]),!1)})),[2,e]}})})},{manual:Y,onFinally:function(r,e,n){i(!1),y?.(e,n)},onBefore:function(){return h?.()},onSuccess:function(r){setTimeout(function(){if(b){var e=I(g);if(e=e===document?document.documentElement:e,e){var n=O(e);e.scrollTo(0,n-L.current)}}else z()}),_?.(r)},onError:function(r){return M?.(r)}}),N=s.loading,k=s.error,A=s.run,j=s.runAsync,G=s.cancel,w=m(function(){S||(i(!0),A(c))}),J=m(function(){return S?Promise.reject():(i(!0),j(c))}),K=function(){return i(!1),A()},Q=function(){return i(!1),j()},z=function(){var r=I(g);if(r){var e=r===document?document.documentElement:r,n=ee(e),l=O(e),d=re(e);b?(H.current!==void 0&&H.current>n&&n<=p&&w(),H.current=n,L.current=l-n):l-n<=d+p&&w()}};return Z("scroll",function(){N||T||z()},{target:g}),$(function(){A()},u([],a(W),!1)),{data:c,loading:!T&&N,error:k,loadingMore:T,noMore:S,loadMore:w,loadMoreAsync:J,reload:m(K),reloadAsync:m(Q),mutate:E,cancel:G}};export{oe as u};
1
+ import{c6 as a,r as f,cw as U,bb as V,bc as X,cW as v,fq as u,aT as m,fr as Z,fs as $,ft as I}from"./index-BRwrysOT.js";var ee=function(t){return t===document||t===document.documentElement||t===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):t.scrollTop},O=function(t){return t.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)},re=function(t){return t.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight)},oe=function(t,o){o===void 0&&(o={});var g=o.target,x=o.isNoMore,F=o.threshold,p=F===void 0?100:F,B=o.direction,P=B===void 0?"bottom":B,R=o.reloadDeps,W=R===void 0?[]:R,Y=o.manual,h=o.onBefore,_=o.onSuccess,M=o.onError,y=o.onFinally,q=a(f.useState(),2),c=q[0],E=q[1],D=a(f.useState(!1),2),T=D[0],i=D[1],b=P==="top",H=f.useRef(void 0),L=f.useRef(0),S=f.useMemo(function(){return x?x(c):!1},[c]),s=U(function(r){return V(void 0,void 0,void 0,function(){var e,n,l,d;return X(this,function(C){switch(C.label){case 0:return[4,t(r)];case 1:return e=C.sent(),E(r?v(v({},e),{list:b?u(u([],a(e.list),!1),a((l=r.list)!==null&&l!==void 0?l:[]),!1):u(u([],a((d=r.list)!==null&&d!==void 0?d:[]),!1),a(e.list),!1)}):v(v({},e),{list:u([],a((n=e.list)!==null&&n!==void 0?n:[]),!1)})),[2,e]}})})},{manual:Y,onFinally:function(r,e,n){i(!1),y?.(e,n)},onBefore:function(){return h?.()},onSuccess:function(r){setTimeout(function(){if(b){var e=I(g);if(e=e===document?document.documentElement:e,e){var n=O(e);e.scrollTo(0,n-L.current)}}else z()}),_?.(r)},onError:function(r){return M?.(r)}}),N=s.loading,k=s.error,A=s.run,j=s.runAsync,G=s.cancel,w=m(function(){S||(i(!0),A(c))}),J=m(function(){return S?Promise.reject():(i(!0),j(c))}),K=function(){return i(!1),A()},Q=function(){return i(!1),j()},z=function(){var r=I(g);if(r){var e=r===document?document.documentElement:r,n=ee(e),l=O(e),d=re(e);b?(H.current!==void 0&&H.current>n&&n<=p&&w(),H.current=n,L.current=l-n):l-n<=d+p&&w()}};return Z("scroll",function(){N||T||z()},{target:g}),$(function(){A()},u([],a(W),!1)),{data:c,loading:!T&&N,error:k,loadingMore:T,noMore:S,loadMore:w,loadMoreAsync:J,reload:m(K),reloadAsync:m(Q),mutate:E,cancel:G}};export{oe as u};
@@ -1,4 +1,4 @@
1
- import{cJ as $m,be as jL,g_ as oT,bb as Xm,bc as Zm,cW as qm,bf as JL,r as QL}from"./index-DpFVufZF.js";/*! *****************************************************************************
1
+ import{cJ as $m,be as jL,g_ as oT,bb as Xm,bc as Zm,cW as qm,bf as JL,r as QL}from"./index-BRwrysOT.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BESOxZme.js","./index-DpFVufZF.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
- import{r as d,cx as z,c6 as U,cy as F,cz as X,aF as B,j as s,s as E,o as j,E as H,aP as V,p as G,cA as K,w as D,K as p,cB as O,W as J,v as L,b8 as Q,T as I,cC as M,L as q,cD as Y,bK as Z,cE as ee,cF as te,u as se,x as ae,bC as oe,ar as ne,af as re}from"./index-DpFVufZF.js";import{V as ie}from"./ViewList-Dd0smq67.js";import{D as ce}from"./Done-BD3-Bno_.js";import{N as le}from"./index-Br_3Odot.js";import{w as pe}from"./wrap-locale-BbjqZMGZ.js";import{g as de}from"./get-safe-url-DcDP4eG0.js";import{S as ue,a as me,b as fe}from"./Stepper-CDtZbh-4.js";import"./emotion-cache.browser.esm-B4otC3_4.js";import"./index-CySEKiOM.js";var T=function(e){if(!e)return 0;var r=X(e).valueOf()-Date.now();return r<0?0:r},he=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},xe=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,u=r.interval,w=u===void 0?1e3:u,x=r.onEnd,g=d.useMemo(function(){return z(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,m=U(d.useState(function(){return T(a)}),2),h=m[0],f=m[1],o=F(x);d.useEffect(function(){if(!a){f(0);return}f(T(a));var v=setInterval(function(){var n,c=T(a);f(c),c===0&&(clearInterval(v),(n=o.current)===null||n===void 0||n.call(o))},w);return function(){return clearInterval(v)}},[a,w]);var k=d.useMemo(function(){return he(h)},[h]);return[h,k]};const ge=B(s.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}));function _({list:e=[],width:r=300,height:l=400,cardSpace:i=40,onSelect:u=()=>{},defaultIndex:w=0}){const[x,g]=d.useState(0),[a,m]=d.useState(0),h=d.useRef(null),f=n=>{if(n<0||n>e.length-1)return;g(n);const c=h.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),u(n)};d.useEffect(()=>{f(w);const n=c=>c.preventDefault();h.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const k=n=>{o=n.touches[0].clientX},v=n=>{const c=n.changedTouches[0],y=o-c.clientX;Math.abs(y)>60&&(y>0?f(x+1):f(x-1))};return s.jsx(ve,{ref:h,onTouchStart:k,onTouchEnd:v,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((n,c)=>s.jsx("div",{className:`card-item ${c===x?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>f(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(le,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const ve=E.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CgGaIeHC.js","./index-BRwrysOT.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
+ import{r as d,cx as z,c6 as U,cy as F,cz as X,aF as B,j as s,s as E,o as j,E as H,aP as V,p as G,cA as K,w as D,K as p,cB as O,W as J,v as L,b8 as Q,T as I,cC as M,L as q,cD as Y,bK as Z,cE as ee,cF as te,u as se,x as ae,bC as oe,ar as ne,af as re}from"./index-BRwrysOT.js";import{V as ie}from"./ViewList-DAPsQ9qa.js";import{D as ce}from"./Done-BPhEa-lh.js";import{N as le}from"./index-B1Nj4Dbn.js";import{w as pe}from"./wrap-locale-BIL9uJmS.js";import{g as de}from"./get-safe-url-DvnzSlO6.js";import{S as ue,a as me,b as fe}from"./Stepper-DWCCfU77.js";import"./emotion-cache.browser.esm-P8IIbJhy.js";import"./index-D5NCDKoy.js";var T=function(e){if(!e)return 0;var r=X(e).valueOf()-Date.now();return r<0?0:r},he=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},xe=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,u=r.interval,w=u===void 0?1e3:u,x=r.onEnd,g=d.useMemo(function(){return z(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,m=U(d.useState(function(){return T(a)}),2),h=m[0],f=m[1],o=F(x);d.useEffect(function(){if(!a){f(0);return}f(T(a));var v=setInterval(function(){var n,c=T(a);f(c),c===0&&(clearInterval(v),(n=o.current)===null||n===void 0||n.call(o))},w);return function(){return clearInterval(v)}},[a,w]);var k=d.useMemo(function(){return he(h)},[h]);return[h,k]};const ge=B(s.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}));function _({list:e=[],width:r=300,height:l=400,cardSpace:i=40,onSelect:u=()=>{},defaultIndex:w=0}){const[x,g]=d.useState(0),[a,m]=d.useState(0),h=d.useRef(null),f=n=>{if(n<0||n>e.length-1)return;g(n);const c=h.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),u(n)};d.useEffect(()=>{f(w);const n=c=>c.preventDefault();h.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const k=n=>{o=n.touches[0].clientX},v=n=>{const c=n.changedTouches[0],y=o-c.clientX;Math.abs(y)>60&&(y>0?f(x+1):f(x-1))};return s.jsx(ve,{ref:h,onTouchStart:k,onTouchEnd:v,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((n,c)=>s.jsx("div",{className:`card-item ${c===x?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>f(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(le,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const ve=E.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -33,7 +33,7 @@ import{r as d,cx as z,c6 as U,cy as F,cz as X,aF as B,j as s,s as E,o as j,E as
33
33
  }
34
34
  }
35
35
  }
36
- `;_.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};function be({icon:e,active:r,completed:l}){const i={1:s.jsx(ie,{className:"step-icon"}),2:s.jsx(ge,{className:"step-icon"}),3:s.jsx(ce,{className:"step-icon"})},u=["step-icon-w"];return r&&u.push("step-icon-w--active"),l&&u.push("step-icon-w--completed"),s.jsx("div",{className:u.join(" "),children:i[String(e)]})}function we({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:u,teamDid:w}){const{api:x}=d.useContext(e),g=H(t=>t.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=d.useRef({sessionToken:"",refreshToken:"",csrfToken:""}),{setPassportId:h,clearPassportId:f}=Y(),{t:o,locale:k}=d.useContext(G),{wallet:v}=K(),[n,c]=d.useState(0),{searchParams:y}=new URL(window.location.href),P=()=>{a.activeStep++},$=t=>{a.user=t.user},W=()=>{P()},A=(t,b)=>{t?.passportId&&h(t.passportId),t?.sessionToken&&(m.current.sessionToken=b(t.sessionToken)),t?.refreshToken&&(m.current.refreshToken=b(t.refreshToken)),t?.csrfToken&&(m.current.csrfToken=b(t.csrfToken)),a.success=!0,P()},S=async()=>{if(v&&M()){Z(()=>import("./index-BESOxZme.js").then(b=>b.i),__vite__mapDeps([0,1,2]),import.meta.url).then(b=>{b.call("arcClosePage")});return}ee(u)&&u({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken,csrfToken:m.current.csrfToken});const t=y.get("redirect");if(t){window.location.replace(de(t));return}f(),window.location.replace("/")},R=t=>{a.passport=t.target.value},[C]=xe({leftTime:n,onEnd:()=>{S()}}),N=[{label:o("lostPassport.recoverPassport"),content:()=>{if(!a.user){const t=y.get("scope")||"passport";return s.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:$,locale:k,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")},extraParams:{scope:t}})}return s.jsxs(p,{className:"select-passport",children:[s.jsxs(p,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[s.jsx(O,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(p,{children:[s.jsx(p,{className:"name",children:a.user.fullName}),s.jsx(p,{className:"did",sx:{mt:1},children:s.jsx(J,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx(p,{children:s.jsx(_,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(t=>({src:l({scope:t.scope,role:t.role,title:t.scope==="kyc"?t.name:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:t.scope==="kyc"?{key:"Email",value:t.name}:void 0}),name:t.title,id:t.id,display:t.display})),onSelect:t=>R({target:{value:a.user.passportTypes[t].id}}),defaultIndex:0})}),s.jsx(p,{sx:{textAlign:"center"},children:s.jsx(L,{variant:"contained",color:"primary",onClick:()=>W(),disabled:!a.passport,children:o("common.next")})})]})}},{label:o("lostPassport.receivePassport"),content:()=>{const t={receiverDid:a.user.did,passportId:a.passport,teamDid:w||window?.blocklet?.did};return s.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:A,forceConnected:!1,locale:k,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:t})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(p,{sx:{textAlign:"center"},children:[s.jsx(p,{sx:{mb:3,color:"success.main"},children:s.jsx(Q,{style:{fontSize:60}})}),s.jsx(I,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(I,{component:"p",variant:"body2",color:"gray",children:v&&M()?o("issuePassport.dialog.autoClose",{seconds:Math.round(C/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(C/1e3)})}),s.jsx(L,{style:{marginTop:40},variant:"contained",color:"primary",onClick:S,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(ke,{children:s.jsxs(p,{className:"stepper",children:[s.jsx(ue,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:N.map(({label:t})=>s.jsx(me,{children:s.jsx(fe,{slots:{stepIcon:be},children:t})},t))}),s.jsx(p,{className:"stepper-content",children:N[a.activeStep].content()}),!a.success&&s.jsx(p,{sx:{textAlign:"center",fontSize:12},children:s.jsx(q,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const ke=E(te)`
36
+ `;_.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};function be({icon:e,active:r,completed:l}){const i={1:s.jsx(ie,{className:"step-icon"}),2:s.jsx(ge,{className:"step-icon"}),3:s.jsx(ce,{className:"step-icon"})},u=["step-icon-w"];return r&&u.push("step-icon-w--active"),l&&u.push("step-icon-w--completed"),s.jsx("div",{className:u.join(" "),children:i[String(e)]})}function we({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:u,teamDid:w}){const{api:x}=d.useContext(e),g=H(t=>t.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=d.useRef({sessionToken:"",refreshToken:"",csrfToken:""}),{setPassportId:h,clearPassportId:f}=Y(),{t:o,locale:k}=d.useContext(G),{wallet:v}=K(),[n,c]=d.useState(0),{searchParams:y}=new URL(window.location.href),P=()=>{a.activeStep++},$=t=>{a.user=t.user},W=()=>{P()},A=(t,b)=>{t?.passportId&&h(t.passportId),t?.sessionToken&&(m.current.sessionToken=b(t.sessionToken)),t?.refreshToken&&(m.current.refreshToken=b(t.refreshToken)),t?.csrfToken&&(m.current.csrfToken=b(t.csrfToken)),a.success=!0,P()},S=async()=>{if(v&&M()){Z(()=>import("./index-CgGaIeHC.js").then(b=>b.i),__vite__mapDeps([0,1,2]),import.meta.url).then(b=>{b.call("arcClosePage")});return}ee(u)&&u({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken,csrfToken:m.current.csrfToken});const t=y.get("redirect");if(t){window.location.replace(de(t));return}f(),window.location.replace("/")},R=t=>{a.passport=t.target.value},[C]=xe({leftTime:n,onEnd:()=>{S()}}),N=[{label:o("lostPassport.recoverPassport"),content:()=>{if(!a.user){const t=y.get("scope")||"passport";return s.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:$,locale:k,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")},extraParams:{scope:t}})}return s.jsxs(p,{className:"select-passport",children:[s.jsxs(p,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[s.jsx(O,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(p,{children:[s.jsx(p,{className:"name",children:a.user.fullName}),s.jsx(p,{className:"did",sx:{mt:1},children:s.jsx(J,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx(p,{children:s.jsx(_,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(t=>({src:l({scope:t.scope,role:t.role,title:t.scope==="kyc"?t.name:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:t.scope==="kyc"?{key:"Email",value:t.name}:void 0}),name:t.title,id:t.id,display:t.display})),onSelect:t=>R({target:{value:a.user.passportTypes[t].id}}),defaultIndex:0})}),s.jsx(p,{sx:{textAlign:"center"},children:s.jsx(L,{variant:"contained",color:"primary",onClick:()=>W(),disabled:!a.passport,children:o("common.next")})})]})}},{label:o("lostPassport.receivePassport"),content:()=>{const t={receiverDid:a.user.did,passportId:a.passport,teamDid:w||window?.blocklet?.did};return s.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:A,forceConnected:!1,locale:k,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:t})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(p,{sx:{textAlign:"center"},children:[s.jsx(p,{sx:{mb:3,color:"success.main"},children:s.jsx(Q,{style:{fontSize:60}})}),s.jsx(I,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(I,{component:"p",variant:"body2",color:"gray",children:v&&M()?o("issuePassport.dialog.autoClose",{seconds:Math.round(C/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(C/1e3)})}),s.jsx(L,{style:{marginTop:40},variant:"contained",color:"primary",onClick:S,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(ke,{children:s.jsxs(p,{className:"stepper",children:[s.jsx(ue,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:N.map(({label:t})=>s.jsx(me,{children:s.jsx(fe,{slots:{stepIcon:be},children:t})},t))}),s.jsx(p,{className:"stepper-content",children:N[a.activeStep].content()}),!a.success&&s.jsx(p,{sx:{textAlign:"center",fontSize:12},children:s.jsx(q,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const ke=E(te)`
37
37
  padding-top: 46px;
38
38
  padding-bottom: 46px;
39
39
  height: 100%;
@@ -1,4 +1,4 @@
1
- import{u as N,j as o,C as k,ay as b,cY as U,A as W,V as E,cN as _,r,aX as D,h as d,y as x,al as P,af as R,w as O,aH as A,x as $,ax as H,bC as K,s as V}from"./index-DpFVufZF.js";import{I as X}from"./invitation-CK-9fzay.js";import"./index-CZVZy3tE.js";import"./index-Br_3Odot.js";import"./emotion-cache.browser.esm-B4otC3_4.js";import"./sdk-BCvN9-9d.js";import"./wrap-locale-BbjqZMGZ.js";import"./index-CySEKiOM.js";function z(h){const{api:i,session:f}=b(),{info:s}=N(),c=U(),v=W(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),p=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!p)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:p}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",p);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await f.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,f]);if(a.loading)return o.jsx(k,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),f.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(M,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(X,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const M=V.div`
1
+ import{u as N,j as o,C as k,ay as b,cY as U,A as W,V as E,cN as _,r,aX as D,h as d,y as x,al as P,af as R,w as O,aH as A,x as $,ax as H,bC as K,s as V}from"./index-BRwrysOT.js";import{I as X}from"./invitation-wPdHjRbO.js";import"./index-BkzhB5R6.js";import"./index-B1Nj4Dbn.js";import"./emotion-cache.browser.esm-P8IIbJhy.js";import"./sdk-DLjX87O7.js";import"./wrap-locale-BIL9uJmS.js";import"./index-D5NCDKoy.js";function z(h){const{api:i,session:f}=b(),{info:s}=N(),c=U(),v=W(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),p=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!p)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:p}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",p);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await f.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,f]);if(a.loading)return o.jsx(k,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),f.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(M,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(X,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const M=V.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -0,0 +1 @@
1
+ import{c6 as c,r as _,aT as f,h1 as S,cW as r}from"./index-BRwrysOT.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{j as e,K as g,_ as ue,s as R,a0 as K,V as U,r as f,a1 as fe,y as v,a2 as Me,a3 as ze,o as E,a4 as oe,a5 as We,H as I,Y as Q,T as $,a6 as He,v as B,$ as Ve,D as qe,t as Ye,X as xe,C as ge,a7 as Ke,a8 as Qe,a9 as Xe,u as N,p as Je,aa as M,n as se,B as Ze,ab as re,A as ye,q as ne,ac as et,W as ae,L as X,w as we,x as J,ad as tt,ae as ke,af as st,b as P,ag as le,ah as ot,I as rt,ai as nt,aj as at,M as it,i as lt,f as ct,ak as dt,al as be,am as Se,an as ve,ao as L,ap as je,aq as Re,ar as Ce,as as Pe,at as Te,au as pt,av as ce}from"./index-DpFVufZF.js";import{t as mt}from"./toLower-BTh_yPFG.js";import{a as W,u as ht,W as ut,P as Ee,L as Be}from"./index-D09yH344.js";import{A as ft,D as ie,u as xt,W as gt,P as yt,a as De,L as Ue}from"./wait-container-CKMtOVZ5.js";import{g as Z}from"./get-safe-url-DcDP4eG0.js";import{u as de}from"./useLocalStorage-pDiaOOl8.js";import{L as wt}from"./Launch-BMpdke3b.js";import{D as kt}from"./DeleteOutline-BRn6KXm4.js";import{g as bt,i as St}from"./spaces-CGMxc8V-.js";import{I as vt}from"./MoreVert-Bs574HAx.js";import{y as jt}from"./index-BruXFS68.js";import"./url-join-CvBUjlHE.js";import"./use-mobile-CD0b5-fF.js";import"./api-IHWlq8qW.js";function Oe({children:s,selected:a=!1}){return e.jsxs(Rt,{children:[s,e.jsx(g,{className:`selected-container ${a?"selected":""}`,children:e.jsx(ue,{className:"selected-icon"})})]})}const Rt=R(g)`
1
+ import{j as e,K as g,_ as ue,s as R,a0 as K,V as U,r as f,a1 as fe,y as v,a2 as Me,a3 as ze,o as E,a4 as oe,a5 as We,H as I,Y as Q,T as $,a6 as He,v as B,$ as Ve,D as qe,t as Ye,X as xe,C as ge,a7 as Ke,a8 as Qe,a9 as Xe,u as N,p as Je,aa as M,n as se,B as Ze,ab as re,A as ye,q as ne,ac as et,W as ae,L as X,w as we,x as J,ad as tt,ae as ke,af as st,b as P,ag as le,ah as ot,I as rt,ai as nt,aj as at,M as it,i as lt,f as ct,ak as dt,al as be,am as Se,an as ve,ao as L,ap as je,aq as Re,ar as Ce,as as Pe,at as Te,au as pt,av as ce}from"./index-BRwrysOT.js";import{t as mt}from"./toLower-wanvKBaZ.js";import{a as W,u as ht,W as ut,P as Ee,L as Be}from"./index-Ci0Kk6rk.js";import{A as ft,D as ie,u as xt,W as gt,P as yt,a as De,L as Ue}from"./wait-container-DPxn2Zp4.js";import{g as Z}from"./get-safe-url-DvnzSlO6.js";import{u as de}from"./useLocalStorage-BpFDuJHy.js";import{L as wt}from"./Launch-MVYS8Hns.js";import{D as kt}from"./DeleteOutline-DGv1wjmr.js";import{g as bt,i as St}from"./spaces-DaLcXe5Q.js";import{I as vt}from"./MoreVert-CBPzGUWs.js";import{y as jt}from"./index-CPY0YlbJ.js";import"./url-join-DOdOelSC.js";import"./use-mobile-BVZp-Eov.js";import"./api-BgOKuKLm.js";function Oe({children:s,selected:a=!1}){return e.jsxs(Rt,{children:[s,e.jsx(g,{className:`selected-container ${a?"selected":""}`,children:e.jsx(ue,{className:"selected-icon"})})]})}const Rt=R(g)`
2
2
  position: relative;
3
3
 
4
4
  .selected-container {
@@ -1,4 +1,4 @@
1
- import{aF as G,j as e,r as b,aW as V,cB as Le,T as N,O as K,o as y,V as F,bf as ie,b9 as je,K as g,N as oe,W as J,eO as ve,fJ as be,bE as Nt,bv as Lt,bw as Bt,bx as Mt,aO as Be,aP as $t,$ as H,s as W,bo as A,cw as le,C as O,X as Ke,au as Ot,dm as Et,bg as Ze,bh as _t,aH as U,H as z,bF as X,go as qt,gp as Ht,i as Wt,v as B,b as Ut,a3 as Q,t as E,R as ce,a4 as q,aS as ae,Y as ne,F as Je,ad as Ce,be as Qe,gq as Vt,q as Gt,fn as Yt,Q as Xe,ff as et,bj as tt,g as Kt,D as Zt,ca as st,aV as Jt,U as Qt,bB as Xt,E as es,gr as Me,fH as ts,gs as ss,S as rs}from"./index-DpFVufZF.js";import{H as Se,g as ns}from"./index-DxeaApG7.js";import{T as as}from"./html-title-CFJOQU04.js";import{u as M}from"./team-651xYHqY.js";import{U as os}from"./ua-parser-DP5omx3I.js";import{u as is}from"./use-mobile-CD0b5-fF.js";import{v as se}from"./index-C6w6MwHd.js";import{w as Y,P as rt}from"./permission-a5zDq7rM.js";import{C as ls}from"./Google-DYe0WpSM.js";import{u as cs}from"./blocklet-9wr_FD8g.js";import{A as we}from"./Add-DwgbzyUw.js";import{y as Te}from"./index-BruXFS68.js";import{e as pe}from"./edit.svg-_S0cvmEV.js";import{M as nt}from"./TableSearch-hUcYhTcB.js";import{L as at}from"./list-header-CiZSpcHw.js";import{g as ds}from"./chain-xcMn0w3E.js";import{T as ot,a as re}from"./ToggleButtonGroup-B8Mjp9ll.js";import{C as ps}from"./lock.svg-D4RerwXL.js";const us=G(e.jsx("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"})),$e=G(e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})),it=G(e.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),me=G(e.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),ms=G(e.jsx("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"})),fs=G(e.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"})),xs=G(e.jsx("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"})),fe=G(e.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"})),ue=s=>b.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},b.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));function hs(s){return!s||typeof s!="string"?"break-all":s.includes(" ")?"break-word":"break-all"}function lt({logo:s="",name:n="",description:l="",size:p=40,variant:c="rounded",sx:u={},className:f="",logoName:a="",tooltip:d=null}){const r={width:p,height:p,...u},o=typeof n=="string"?n:s,i=e.jsxs(V,{direction:"row",spacing:1,className:`info-card-wrapper ${f}`,sx:{alignItems:"center",cursor:d?"pointer":"default"},children:[s?e.jsx(Le,{src:s,alt:a??o,variant:c,sx:r}):e.jsx(Le,{variant:c,sx:r,children:o?.slice(0,1)}),e.jsxs(V,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:hs(n),minWidth:{xs:100,sm:140}},children:[e.jsx(N,{variant:"body1",component:"div",sx:{color:"text.primary"},children:n}),l&&e.jsx(N,{variant:"subtitle1",sx:{color:"text.secondary"},children:l})]})]});return d?e.jsx(K,{title:d,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff",color:t=>t.palette.mode==="dark"?"#ffffff":t.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:i}):i}lt.propTypes={logo:y.string,name:y.oneOfType([y.string,y.node]).isRequired,description:y.oneOfType([y.string,y.node]),size:y.oneOfType([y.number,y.string]),variant:y.oneOf(["square","rounded","circular"]),sx:y.object,className:y.string,logoName:y.string,tooltip:y.oneOfType([y.string,y.node])};function gs(s){try{if(!s.trim())return{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}};const l=new os(s).getResult();let p="";const c=s.split(/\s+/).find(d=>d.startsWith("arcwallet"));if(c){const d=c.split("/");d.length>1&&Be.coerce(d[1])&&(p=Be.coerce(d[1]).version)}const u=(()=>{const{type:d="",model:r=""}=l.device;return d==="mobile"?{icon:e.jsx(fs,{fontSize:"small"}),text:r||"Mobile Device"}:d==="tablet"?{icon:e.jsx(xs,{fontSize:"small"}),text:r||"Tablet"}:{icon:e.jsx(ms,{fontSize:"small"}),text:r||"Desktop"}})(),f=(()=>{const{name:d="",version:r=""}=l.os;return d.toLowerCase().includes("mac")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("ios")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("android")?{icon:e.jsx(us,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("windows")?{icon:e.jsx(me,{fontSize:"small"}),text:`${d} ${r}`}:{icon:null,text:d?`${d} ${r}`:"Unknown OS"}})(),a=(()=>{const{name:d="",version:r=""}=l.browser;return{icon:e.jsx(fe,{fontSize:"small"}),text:d?`${d} ${r}`:"Unknown Browser"}})();return{device:u,os:f,browser:a,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(n){return console.error("Error parsing user agent:",n),{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}}}}function ct({ua:s}){const n=gs(s);return e.jsx(V,{spacing:1,children:Object.entries(n).map(([l,{icon:p,text:c}])=>e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(N,{variant:"body2",sx:{display:"flex"},children:c})]},l))})}ct.propTypes={ua:y.string.isRequired};const dt=()=>{const{t:s}=F(),n={$all:s("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:n,formatRoleName:p=>{const c=(p||"").toLowerCase();return c.startsWith("$")?n[c]||c.slice(1):n[c]||c}}},ys=(s,n=!1)=>{const l=n?1:.6;switch(s){case"owner":return`rgba(232, 222, 255, ${l})`;case"admin":return`rgba(227, 242, 253, ${l})`;case"member":return`rgba(232, 245, 233, ${l})`;case"guest":return`rgba(245, 245, 245, ${l})`;default:return`rgba(245, 245, 245, ${l})`}},js=je(ve)(({role:s})=>({backgroundColor:ys(s.toLowerCase()),color:"#000000"})),vs=s=>{switch(s){case"valid":return n=>n.palette.success.light;case"expired":return n=>n.palette.text.disabled;case"revoked":return n=>n.palette.error.light;default:return n=>n.palette.warning.light}},bs=je(ve)(({theme:s,status:n})=>({backgroundColor:vs(n)(s),color:"#FFFFFF"}));function pt({did:s}){return e.jsx(J,{size:14,responsive:!1,compact:!0,copyable:!1,did:s})}pt.propTypes={did:y.string.isRequired};function ut({timestamp:s,locale:n}){return e.jsx(g,{sx:{minWidth:"100px"},children:e.jsx(oe,{value:s,locale:n})})}ut.propTypes={timestamp:y.number.isRequired,locale:y.string.isRequired};function mt({name:s="",role:n}){const{formatRoleName:l}=dt();return e.jsx(js,{label:l(s||n),size:"small",role:s||n,sx:{borderRadius:1}})}mt.propTypes={role:y.string.isRequired,name:y.string};function ft({status:s}){const{t:n}=F();return e.jsx(bs,{label:n(`team.passport.statusMap.${s}`),size:"small",status:s,sx:{borderRadius:1}})}ft.propTypes={status:y.string.isRequired};function xt({source:s}){const{t:n}=F();return s?n(`team.passport.sourceMaps.${s}`):"-"}xt.propTypes={source:y.string.isRequired};function ht({user:s,size:n="default",tooltip:l=!1,inService:p=!1}){const{teamDid:c}=M(),u=ie.useMemo(()=>be(s.avatar,c,p),[s.avatar,c,p]),f=ie.useMemo(()=>e.jsx(J,{did:s?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s?.did]),a=Nt(()=>({...s,avatar:u}),[s,u]);return n==="small"?e.jsx(lt,{variant:"circular",logo:u,name:e.jsx(N,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...n==="small"?{tooltip:l?e.jsx(J,{did:s?.did}):!1,size:24}:{description:f,size:36}}):e.jsx(Lt,{user:a,avatarSize:n==="small"?24:36,cardType:Mt.Detailed,infoType:Bt.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}ht.propTypes={user:y.object.isRequired,size:y.string,tooltip:y.bool,inService:y.bool};const Cs=ie.memo(ht),Ss=s=>e.jsx(pt,{did:s}),Ie=(s,n)=>e.jsx(mt,{name:s,role:n}),Re=s=>e.jsx(ft,{status:s}),gt=(s,n)=>e.jsx(ut,{timestamp:s,locale:n}),de=s=>e.jsx(xt,{source:s}),De=(s,n=!1)=>e.jsx(Cs,{user:s,inService:n}),ws=s=>e.jsx(ct,{ua:s}),Oe="info";function yt({createPassportSvg:s,passport:n,onCancel:l,onSwitchPassport:p=()=>{}}){const{t:c}=F(),u=$t({tab:Oe}),f={info:{label:c("common.basicInfo"),value:Oe,component:()=>e.jsx(jt,{passport:n,createPassportSvg:s})},logs:{label:c("common.logs"),value:"logs",component:()=>e.jsx(Ct,{passport:n})},related:{label:c("team.passport.related"),value:"related",component:()=>e.jsx(St,{passport:n,onSwitchPassport:p})}},a=Object.values(f).map(({label:o,value:i})=>({label:o,value:i})).filter(o=>o.value==="related"?n.parentDid:!0),d=f[u.tab]||f.info,r=o=>{u.tab=o};return e.jsx(H,{title:c("common.passport"),onClose:l,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ts,{children:[e.jsx(g,{className:"tabs",children:e.jsx(as,{tabs:a,current:u.tab,onChange:r,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(d.component,{})})]})})}yt.propTypes={createPassportSvg:y.func.isRequired,passport:y.object.isRequired,onCancel:y.func.isRequired,onSwitchPassport:y.func};const Ts=W(g)`
1
+ import{aF as G,j as e,r as b,aW as V,cB as Le,T as N,O as K,o as y,V as F,bf as ie,b9 as je,K as g,N as oe,W as J,eO as ve,fJ as be,bE as Nt,bv as Lt,bw as Bt,bx as Mt,aO as Be,aP as $t,$ as H,s as W,bo as A,cw as le,C as O,X as Ke,au as Ot,dm as Et,bg as Ze,bh as _t,aH as U,H as z,bF as X,go as qt,gp as Ht,i as Wt,v as B,b as Ut,a3 as Q,t as E,R as ce,a4 as q,aS as ae,Y as ne,F as Je,ad as Ce,be as Qe,gq as Vt,q as Gt,fn as Yt,Q as Xe,ff as et,bj as tt,g as Kt,D as Zt,ca as st,aV as Jt,U as Qt,bB as Xt,E as es,gr as Me,fH as ts,gs as ss,S as rs}from"./index-BRwrysOT.js";import{H as Se,g as ns}from"./index-B108geQF.js";import{T as as}from"./html-title-BSurkQWH.js";import{u as M}from"./team-CCZFetkg.js";import{U as os}from"./ua-parser-DP5omx3I.js";import{u as is}from"./use-mobile-BVZp-Eov.js";import{v as se}from"./index-LjsyWu4w.js";import{w as Y,P as rt}from"./permission-lRCqS6FX.js";import{C as ls}from"./Google-CQNl2Qei.js";import{u as cs}from"./blocklet-BtHx1Y24.js";import{A as we}from"./Add-CDjPaJKP.js";import{y as Te}from"./index-CPY0YlbJ.js";import{e as pe}from"./edit.svg-BI9q0cq7.js";import{M as nt}from"./TableSearch-CPKsMI8E.js";import{L as at}from"./list-header-aIJDfQ7C.js";import{g as ds}from"./chain-CnR1vCEL.js";import{T as ot,a as re}from"./ToggleButtonGroup-DxN7gyOm.js";import{C as ps}from"./lock.svg-DIfrAsKr.js";const us=G(e.jsx("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"})),$e=G(e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})),it=G(e.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),me=G(e.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),ms=G(e.jsx("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"})),fs=G(e.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"})),xs=G(e.jsx("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"})),fe=G(e.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"})),ue=s=>b.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},b.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));function hs(s){return!s||typeof s!="string"?"break-all":s.includes(" ")?"break-word":"break-all"}function lt({logo:s="",name:n="",description:l="",size:p=40,variant:c="rounded",sx:u={},className:f="",logoName:a="",tooltip:d=null}){const r={width:p,height:p,...u},o=typeof n=="string"?n:s,i=e.jsxs(V,{direction:"row",spacing:1,className:`info-card-wrapper ${f}`,sx:{alignItems:"center",cursor:d?"pointer":"default"},children:[s?e.jsx(Le,{src:s,alt:a??o,variant:c,sx:r}):e.jsx(Le,{variant:c,sx:r,children:o?.slice(0,1)}),e.jsxs(V,{direction:"column",sx:{alignItems:"flex-start",justifyContent:"space-around",wordBreak:hs(n),minWidth:{xs:100,sm:140}},children:[e.jsx(N,{variant:"body1",component:"div",sx:{color:"text.primary"},children:n}),l&&e.jsx(N,{variant:"subtitle1",sx:{color:"text.secondary"},children:l})]})]});return d?e.jsx(K,{title:d,placement:"top-start",slotProps:{tooltip:{sx:{bgcolor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff",color:t=>t.palette.mode==="dark"?"#ffffff":t.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:t=>t.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:t=>t.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:i}):i}lt.propTypes={logo:y.string,name:y.oneOfType([y.string,y.node]).isRequired,description:y.oneOfType([y.string,y.node]),size:y.oneOfType([y.number,y.string]),variant:y.oneOf(["square","rounded","circular"]),sx:y.object,className:y.string,logoName:y.string,tooltip:y.oneOfType([y.string,y.node])};function gs(s){try{if(!s.trim())return{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}};const l=new os(s).getResult();let p="";const c=s.split(/\s+/).find(d=>d.startsWith("arcwallet"));if(c){const d=c.split("/");d.length>1&&Be.coerce(d[1])&&(p=Be.coerce(d[1]).version)}const u=(()=>{const{type:d="",model:r=""}=l.device;return d==="mobile"?{icon:e.jsx(fs,{fontSize:"small"}),text:r||"Mobile Device"}:d==="tablet"?{icon:e.jsx(xs,{fontSize:"small"}),text:r||"Tablet"}:{icon:e.jsx(ms,{fontSize:"small"}),text:r||"Desktop"}})(),f=(()=>{const{name:d="",version:r=""}=l.os;return d.toLowerCase().includes("mac")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("ios")?{icon:e.jsx($e,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("android")?{icon:e.jsx(us,{fontSize:"small"}),text:`${d} ${r}`}:d.toLowerCase().includes("windows")?{icon:e.jsx(me,{fontSize:"small"}),text:`${d} ${r}`}:{icon:null,text:d?`${d} ${r}`:"Unknown OS"}})(),a=(()=>{const{name:d="",version:r=""}=l.browser;return{icon:e.jsx(fe,{fontSize:"small"}),text:d?`${d} ${r}`:"Unknown Browser"}})();return{device:u,os:f,browser:a,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(n){return console.error("Error parsing user agent:",n),{device:{icon:e.jsx(me,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}}}}function ct({ua:s}){const n=gs(s);return e.jsx(V,{spacing:1,children:Object.entries(n).map(([l,{icon:p,text:c}])=>e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(N,{variant:"body2",sx:{display:"flex"},children:c})]},l))})}ct.propTypes={ua:y.string.isRequired};const dt=()=>{const{t:s}=F(),n={$all:s("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:n,formatRoleName:p=>{const c=(p||"").toLowerCase();return c.startsWith("$")?n[c]||c.slice(1):n[c]||c}}},ys=(s,n=!1)=>{const l=n?1:.6;switch(s){case"owner":return`rgba(232, 222, 255, ${l})`;case"admin":return`rgba(227, 242, 253, ${l})`;case"member":return`rgba(232, 245, 233, ${l})`;case"guest":return`rgba(245, 245, 245, ${l})`;default:return`rgba(245, 245, 245, ${l})`}},js=je(ve)(({role:s})=>({backgroundColor:ys(s.toLowerCase()),color:"#000000"})),vs=s=>{switch(s){case"valid":return n=>n.palette.success.light;case"expired":return n=>n.palette.text.disabled;case"revoked":return n=>n.palette.error.light;default:return n=>n.palette.warning.light}},bs=je(ve)(({theme:s,status:n})=>({backgroundColor:vs(n)(s),color:"#FFFFFF"}));function pt({did:s}){return e.jsx(J,{size:14,responsive:!1,compact:!0,copyable:!1,did:s})}pt.propTypes={did:y.string.isRequired};function ut({timestamp:s,locale:n}){return e.jsx(g,{sx:{minWidth:"100px"},children:e.jsx(oe,{value:s,locale:n})})}ut.propTypes={timestamp:y.number.isRequired,locale:y.string.isRequired};function mt({name:s="",role:n}){const{formatRoleName:l}=dt();return e.jsx(js,{label:l(s||n),size:"small",role:s||n,sx:{borderRadius:1}})}mt.propTypes={role:y.string.isRequired,name:y.string};function ft({status:s}){const{t:n}=F();return e.jsx(bs,{label:n(`team.passport.statusMap.${s}`),size:"small",status:s,sx:{borderRadius:1}})}ft.propTypes={status:y.string.isRequired};function xt({source:s}){const{t:n}=F();return s?n(`team.passport.sourceMaps.${s}`):"-"}xt.propTypes={source:y.string.isRequired};function ht({user:s,size:n="default",tooltip:l=!1,inService:p=!1}){const{teamDid:c}=M(),u=ie.useMemo(()=>be(s.avatar,c,p),[s.avatar,c,p]),f=ie.useMemo(()=>e.jsx(J,{did:s?.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s?.did]),a=Nt(()=>({...s,avatar:u}),[s,u]);return n==="small"?e.jsx(lt,{variant:"circular",logo:u,name:e.jsx(N,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...n==="small"?{tooltip:l?e.jsx(J,{did:s?.did}):!1,size:24}:{description:f,size:36}}):e.jsx(Lt,{user:a,avatarSize:n==="small"?24:36,cardType:Mt.Detailed,infoType:Bt.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})}ht.propTypes={user:y.object.isRequired,size:y.string,tooltip:y.bool,inService:y.bool};const Cs=ie.memo(ht),Ss=s=>e.jsx(pt,{did:s}),Ie=(s,n)=>e.jsx(mt,{name:s,role:n}),Re=s=>e.jsx(ft,{status:s}),gt=(s,n)=>e.jsx(ut,{timestamp:s,locale:n}),de=s=>e.jsx(xt,{source:s}),De=(s,n=!1)=>e.jsx(Cs,{user:s,inService:n}),ws=s=>e.jsx(ct,{ua:s}),Oe="info";function yt({createPassportSvg:s,passport:n,onCancel:l,onSwitchPassport:p=()=>{}}){const{t:c}=F(),u=$t({tab:Oe}),f={info:{label:c("common.basicInfo"),value:Oe,component:()=>e.jsx(jt,{passport:n,createPassportSvg:s})},logs:{label:c("common.logs"),value:"logs",component:()=>e.jsx(Ct,{passport:n})},related:{label:c("team.passport.related"),value:"related",component:()=>e.jsx(St,{passport:n,onSwitchPassport:p})}},a=Object.values(f).map(({label:o,value:i})=>({label:o,value:i})).filter(o=>o.value==="related"?n.parentDid:!0),d=f[u.tab]||f.info,r=o=>{u.tab=o};return e.jsx(H,{title:c("common.passport"),onClose:l,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ts,{children:[e.jsx(g,{className:"tabs",children:e.jsx(as,{tabs:a,current:u.tab,onChange:r,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(d.component,{})})]})})}yt.propTypes={createPassportSvg:y.func.isRequired,passport:y.object.isRequired,onCancel:y.func.isRequired,onSwitchPassport:y.func};const Ts=W(g)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -1 +1 @@
1
- import{j as e,cG as j,K as v,A as P,r as a,p as S,ay as k,u as w,x as K,f as b,aP as E,dj as W,aT as i,b8 as _,w as U,Z as N,C as R,dk as T,dl as z}from"./index-DpFVufZF.js";import{p as c}from"./index-CZVZy3tE.js";function o({children:r,...s}){return e.jsx(j,{...s,did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(v,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function F(){const r=P(),{t:s,locale:d}=a.useContext(S),{api:l}=k(),{info:u}=w(),p=K(u),f=b(),n=E({ready:!1,success:!1,error:null,invalidSession:!1}),h=W(),m=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=T(g);if(!z(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};a.useLayoutEffect(()=>m(),[]);const x=i(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=i(()=>{n.success=!0});if(n.invalidSession)return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(_,{style:{color:f.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(o,{children:e.jsx(U,{className:"connect",action:"gen-key-pair",checkFn:l.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:h?.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:p,onSuccess:C,onError:x,locale:d,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(N,{children:e.jsx(R,{})})}export{F as default};
1
+ import{j as e,cG as j,K as v,A as P,r as a,p as S,ay as k,u as w,x as K,f as b,aP as E,dj as W,aT as i,b8 as _,w as U,Z as N,C as R,dk as T,dl as z}from"./index-BRwrysOT.js";import{p as c}from"./index-BkzhB5R6.js";function o({children:r,...s}){return e.jsx(j,{...s,did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(v,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function F(){const r=P(),{t:s,locale:d}=a.useContext(S),{api:l}=k(),{info:u}=w(),p=K(u),f=b(),n=E({ready:!1,success:!1,error:null,invalidSession:!1}),h=W(),m=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=T(g);if(!z(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};a.useLayoutEffect(()=>m(),[]);const x=i(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=i(()=>{n.success=!0});if(n.invalidSession)return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(o,{children:e.jsx(c,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(_,{style:{color:f.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(o,{children:e.jsx(U,{className:"connect",action:"gen-key-pair",checkFn:l.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:h?.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:p,onSuccess:C,onError:x,locale:d,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(N,{children:e.jsx(R,{})})}export{F as default};
@@ -1,4 +1,4 @@
1
- import{r as i,j as t,K as o,bs as c,o as n}from"./index-DpFVufZF.js";const h=e=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),a=c(o)`
1
+ import{r as i,j as t,K as o,bs as c,o as n}from"./index-BRwrysOT.js";const h=e=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),a=c(o)`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -1,4 +1,4 @@
1
- import{aF as Ve,j as e,bo as ht,r as x,bE as J,bg as H,H as q,aH as E,g as gt,o as d,h as ee,au as xt,O as bt,K as N,T as Y,V as Q,eO as ke,P as Fe,ip as Ge,bk as Re,aV as Te,U as Ie,bB as Ce,b4 as He,b2 as Ee,C as Ye,f as Je,f0 as Qe,aP as Ae,W as jt,at as Xe,iq as Ze,v as De,f2 as et,br as be,fJ as tt,dD as yt,s as ae,ag as pe,G as qe,av as St,ir as vt,is as Ct,$ as Nt,it as wt,iu as Rt,iv as Tt,iw as It,N as Et,by as st,E as At,J as Dt,Q as Ot,S as Lt,R as Ue,ix as kt}from"./index-DpFVufZF.js";import{d as Ft,H as nt,g as Pt}from"./index-DxeaApG7.js";import{S as me}from"./shorten-label-izVabXeE.js";import{v as at}from"./index-FOfUOpKU.js";import{T as _t}from"./html-title-CFJOQU04.js";import{R as Pe}from"./Replay-CUAnOum2.js";import{R as Bt}from"./Refresh-mfLuZ9Wj.js";import{D as zt,g as Wt}from"./traffic-DEO0b2pJ.js";import"./FilterList-CoptEImh.js";import"./CSSTransition-y8iKTN7d.js";import"./emotion-cache.browser.esm-B4otC3_4.js";import"./index-BprceCor.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BIKlqTyk.js";import"./index-BruXFS68.js";import"./TableSearch-hUcYhTcB.js";import"./Search-CCrESOjg.js";import"./Clear-CP-1JSsG.js";import"./MoreVert-Bs574HAx.js";import"./iframe-DTPDSES_.js";import"./ChevronLeft-nSrR9D_I.js";import"./ChevronRight-CRb5GVq5.js";import"./index-DBii9-f-.js";import"./base-chart-DoQaNYbB.js";import"./index-CusFNu14.js";import"./AdapterDayjs-BjFsoQ-w.js";import"./useThemeProps-D2o2I8tH.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(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"})),Kt=Ve(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"})),it=x.createContext({}),{Provider:Ht,Consumer:Hs}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[j,v]=x.useState([]),[P,F]=x.useState({}),w=J(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const X={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:j,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:X},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Yt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Jt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Qt=(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})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Xt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({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:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Q();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.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 Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(j=>j!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...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:i}){const{t:l,locale:b}=Q(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.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(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{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}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(j,v)=>{v.checked=j.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=j=>{j.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(j=>e.jsx(Te,{control:e.jsx(Ie,{checked:j.checked,onChange:v=>S(v,j),name:j.value}),label:j.label},j.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:j=>m(j.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:j=>{j.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ye,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Q(),l=Je(),b=x.useMemo(()=>Qe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:j,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,X]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{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"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),X(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,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:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await j(o);return c?a==="wallet"?Yt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Jt(c):!0:!1},[j,v]),Ne=x.useCallback(a=>Qt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},y=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await y(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await y(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Xt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||yt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Xe,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(jt,{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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Ye,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
1
+ import{aF as Ve,j as e,bo as ht,r as x,bE as J,bg as H,H as q,aH as E,g as gt,o as d,h as ee,au as xt,O as bt,K as N,T as Y,V as Q,eO as ke,P as Fe,ip as Ge,bk as Re,aV as Te,U as Ie,bB as Ce,b4 as He,b2 as Ee,C as Ye,f as Je,f0 as Qe,aP as Ae,W as jt,at as Xe,iq as Ze,v as De,f2 as et,br as be,fJ as tt,dD as yt,s as ae,ag as pe,G as qe,av as St,ir as vt,is as Ct,$ as Nt,it as wt,iu as Rt,iv as Tt,iw as It,N as Et,by as st,E as At,J as Dt,Q as Ot,S as Lt,R as Ue,ix as kt}from"./index-BRwrysOT.js";import{d as Ft,H as nt,g as Pt}from"./index-B108geQF.js";import{S as me}from"./shorten-label-CoRoKICP.js";import{v as at}from"./index-DfNf7S5Q.js";import{T as _t}from"./html-title-BSurkQWH.js";import{R as Pe}from"./Replay-CCjt3MYi.js";import{R as Bt}from"./Refresh-TSC86hrV.js";import{D as zt,g as Wt}from"./traffic-DpPN1079.js";import"./FilterList-DnTA4h-A.js";import"./CSSTransition-exmZd1Pd.js";import"./emotion-cache.browser.esm-P8IIbJhy.js";import"./index-sKIgMA4E.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-IFL5M-qa.js";import"./index-CPY0YlbJ.js";import"./TableSearch-CPKsMI8E.js";import"./Search-BTki5Tlw.js";import"./Clear-Cxz7AyBG.js";import"./MoreVert-CBPzGUWs.js";import"./iframe-Bt3m8KPW.js";import"./ChevronLeft-PZrWRTUE.js";import"./ChevronRight-C64VDrVw.js";import"./index-DBii9-f-.js";import"./base-chart-DK86Bg6l.js";import"./index-BwYWp4uB.js";import"./AdapterDayjs-CTE9A4XS.js";import"./useThemeProps-DiahvBki.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(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"})),Kt=Ve(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"})),it=x.createContext({}),{Provider:Ht,Consumer:Hs}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[j,v]=x.useState([]),[P,F]=x.useState({}),w=J(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const X={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:j,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:X},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Yt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Jt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Qt=(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})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Xt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({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:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Q();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.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 Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(j=>j!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...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:i}){const{t:l,locale:b}=Q(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.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(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{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}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(j,v)=>{v.checked=j.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=j=>{j.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(j=>e.jsx(Te,{control:e.jsx(Ie,{checked:j.checked,onChange:v=>S(v,j),name:j.value}),label:j.label},j.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:j=>m(j.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:j=>{j.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ye,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Q(),l=Je(),b=x.useMemo(()=>Qe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:j,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,X]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{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"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),X(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,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:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await j(o);return c?a==="wallet"?Yt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Jt(c):!0:!1},[j,v]),Ne=x.useCallback(a=>Qt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},y=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await y(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await y(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Xt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||yt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Xe,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(jt,{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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Ye,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r as f,p as ye,j as e,C as H,L as Ce,s as W,o as L,u as ce,V as Q,n as ve,q as we,$ as Se,D as Be,T as P,t as G,v as q,w as Te,x as Le,y as Ae,z as Ee,A as me,H as M,B as Ie,d as De,f as Fe,E as Pe,F as Re,i as I,I as ee,J as te,K as y,M as Ne,N as _,O as _e,P as se,Q as Ue,S as le,R as oe,U as Me,X as ne,Y as We,Z as Oe}from"./index-DpFVufZF.js";import{u as $e}from"./useLocalStorage-pDiaOOl8.js";import{E as ze}from"./ErrorOutline-eTinVSTi.js";import{g as qe,H as Ve}from"./index-DxeaApG7.js";import{y as He}from"./index-BruXFS68.js";import{W as Qe,B as D}from"./status-Cc65Exxv.js";import{D as Ke,u as Xe,B as re}from"./actions-Bsd5QbHY.js";import{I as Je,B as Ye}from"./install-from-url-ChxBmd8y.js";import{u as de}from"./url-evaluation-htR8cP0c.js";import{L as Ze}from"./Launch-BMpdke3b.js";import{A as Ge}from"./Add-DwgbzyUw.js";import{v as F}from"./index-C6w6MwHd.js";import{s as ae}from"./schema-BpWVtFwc.js";import{P as et}from"./permission-a5zDq7rM.js";import"./FilterList-CoptEImh.js";import"./CSSTransition-y8iKTN7d.js";import"./emotion-cache.browser.esm-B4otC3_4.js";import"./index-BprceCor.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BIKlqTyk.js";import"./TableSearch-hUcYhTcB.js";import"./Search-CCrESOjg.js";import"./Clear-CP-1JSsG.js";import"./MoreVert-Bs574HAx.js";import"./DeleteOutline-BRn6KXm4.js";import"./get-safe-url-DcDP4eG0.js";import"./ButtonGroup-Td8BNrZx.js";import"./getValidReactChildren-DUKHPCTn.js";import"./without-wallet-Bz0faV9X.js";import"./index-BOjP8MFh.js";import"./cloneDeep-DvQOj2-I.js";import"./index-FOfUOpKU.js";import"./Delete-zum6vOfn.js";import"./Autocomplete-Dm1_2YSl.js";import"./ListSubheader-DmTgdBz5.js";import"./ListItemButton-DAHFrrOj.js";import"./Stepper-CDtZbh-4.js";function V({blocklet:j,skipAccessibilityCheck:x=!1,...m}){const{t:r}=f.useContext(ye),{urls:w,loading:n,recommendedUrl:h}=de(j);if(n&&!x)return e.jsx(H,{size:12,...m});const g=x?w[0]:h;return g?e.jsx(st,{...m,children:e.jsx(tt,{children:e.jsxs(Ce,{href:g,target:"_blank",className:"blocklet-interface",underline:"hover",children:[r("common.visit"),e.jsx(Ze,{fontSize:"12",sx:{marginLeft:.5}})]})})}):r("blocklet.router.noAccessibleUrl")}const tt=W.div`
1
+ import{r as f,p as ye,j as e,C as H,L as Ce,s as W,o as L,u as ce,V as Q,n as ve,q as we,$ as Se,D as Be,T as P,t as G,v as q,w as Te,x as Le,y as Ae,z as Ee,A as me,H as M,B as Ie,d as De,f as Fe,E as Pe,F as Re,i as I,I as ee,J as te,K as y,M as Ne,N as _,O as _e,P as se,Q as Ue,S as le,R as oe,U as Me,X as ne,Y as We,Z as Oe}from"./index-BRwrysOT.js";import{u as $e}from"./useLocalStorage-BpFDuJHy.js";import{E as ze}from"./ErrorOutline-BGT4By5f.js";import{g as qe,H as Ve}from"./index-B108geQF.js";import{y as He}from"./index-CPY0YlbJ.js";import{W as Qe,B as D}from"./status-Bqt7B9nn.js";import{D as Ke,u as Xe,B as re}from"./actions-BSlGM89P.js";import{I as Je,B as Ye}from"./install-from-url-Ch_1I_g4.js";import{u as de}from"./url-evaluation-CgzjVAvg.js";import{L as Ze}from"./Launch-MVYS8Hns.js";import{A as Ge}from"./Add-CDjPaJKP.js";import{v as F}from"./index-LjsyWu4w.js";import{s as ae}from"./schema-2rSPa9BO.js";import{P as et}from"./permission-lRCqS6FX.js";import"./FilterList-DnTA4h-A.js";import"./CSSTransition-exmZd1Pd.js";import"./emotion-cache.browser.esm-P8IIbJhy.js";import"./index-sKIgMA4E.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-IFL5M-qa.js";import"./TableSearch-CPKsMI8E.js";import"./Search-BTki5Tlw.js";import"./Clear-Cxz7AyBG.js";import"./MoreVert-CBPzGUWs.js";import"./DeleteOutline-DGv1wjmr.js";import"./get-safe-url-DvnzSlO6.js";import"./ButtonGroup-CufACnLw.js";import"./getValidReactChildren-DVWXmlzf.js";import"./without-wallet-E48cNWb9.js";import"./index-BdJ8QXo_.js";import"./cloneDeep-CsXhtsDM.js";import"./index-DfNf7S5Q.js";import"./Delete-BWThh3lU.js";import"./Autocomplete-Bk7apAFc.js";import"./ListSubheader-DYeGWpur.js";import"./ListItemButton-7lbPyGsz.js";import"./Stepper-DWCCfU77.js";function V({blocklet:j,skipAccessibilityCheck:x=!1,...m}){const{t:r}=f.useContext(ye),{urls:w,loading:n,recommendedUrl:h}=de(j);if(n&&!x)return e.jsx(H,{size:12,...m});const g=x?w[0]:h;return g?e.jsx(st,{...m,children:e.jsx(tt,{children:e.jsxs(Ce,{href:g,target:"_blank",className:"blocklet-interface",underline:"hover",children:[r("common.visit"),e.jsx(Ze,{fontSize:"12",sx:{marginLeft:.5}})]})})}):r("blocklet.router.noAccessibleUrl")}const tt=W.div`
2
2
  display: flex;
3
3
  margin: 4px 0;
4
4
  `,st=W.div`
@@ -1,4 +1,4 @@
1
- import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-DpFVufZF.js";import{f as ne}from"./index-BojVbZw0.js";import{v as U}from"./index-FOfUOpKU.js";import{M as V}from"./metric-D-n9wLBp.js";import{C as M}from"./click-to-copy-BkgGJ2iu.js";import"./CardContent-ewSbhAdG.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:fe}=L;function te({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R($.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R($.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R($.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(ae,{value:{users:b},children:a})}function re(){const{users:a}=i.useContext(L);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},oe=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const ie=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function le(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=Q(),{users:c}=re(),t=Y(()=>ie(d)),{t:s,locale:p}=i.useContext(F),_=X(),f=oe(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:B(p)};return Z(o,m)});let b=null;if(r)b=e.jsx(ee,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(D,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(D,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(D,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(J,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(K(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const G=c.length,A=c.filter(n=>n.approved).length;let P=G;A&&(P+=`<small><strong>${se(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>z.isBlockletRunning(n)).length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>z.isBlockletRunning(n)).length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const O=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ne(new Date(a.createdAt).getTime(),B(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:1,md:2},children:O.map(n=>e.jsx(v,{size:{xl:1.5,lg:3,md:4,sm:12,xs:12},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:1,md:2},children:E.map(n=>e.jsx(v,{size:{xl:1.5,lg:3,md:4,sm:12,xs:12},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx(U,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(ce,{children:b})}const ce=q.main`
1
+ import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-BRwrysOT.js";import{f as ne}from"./index-BojVbZw0.js";import{v as U}from"./index-DfNf7S5Q.js";import{M as V}from"./metric-IUjf35f-.js";import{C as M}from"./click-to-copy-C6Ix5G0V.js";import"./CardContent-_17XtZEs.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:fe}=L;function te({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R($.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R($.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R($.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(ae,{value:{users:b},children:a})}function re(){const{users:a}=i.useContext(L);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},oe=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const ie=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function le(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=Q(),{users:c}=re(),t=Y(()=>ie(d)),{t:s,locale:p}=i.useContext(F),_=X(),f=oe(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:B(p)};return Z(o,m)});let b=null;if(r)b=e.jsx(ee,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(D,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(D,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(D,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(J,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(K(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const G=c.length,A=c.filter(n=>n.approved).length;let P=G;A&&(P+=`<small><strong>${se(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>z.isBlockletRunning(n)).length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>z.isBlockletRunning(n)).length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const O=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ne(new Date(a.createdAt).getTime(),B(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:1,md:2},children:O.map(n=>e.jsx(v,{size:{xl:1.5,lg:3,md:4,sm:12,xs:12},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:1,md:2},children:E.map(n=>e.jsx(v,{size:{xl:1.5,lg:3,md:4,sm:12,xs:12},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx(U,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(ce,{children:b})}const ce=q.main`
2
2
  .page-header {
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1 +1 @@
1
- import{be as x}from"./index-DpFVufZF.js";function D(a,i){for(var r=0;r<i.length;r++){const e=i[r];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in a)){const t=Object.getOwnPropertyDescriptor(e,s);t&&Object.defineProperty(a,s,t.get?t:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var l,w;function J(){if(w)return l;w=1;var a={default:l,call:function(i,r,e){var s="";typeof r=="function"&&(e=r,r={});var t={data:r===void 0?null:r};if(typeof e=="function"){var n="dscb"+window.dscb++;window[n]=e,t._dscbstub=n}return t=JSON.stringify(t),window._dsbridge?s=_dsbridge.call(i,t):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(s=prompt("_dsbridge="+i,t)),JSON.parse(s||"{}").data},register:function(i,r,e){var s=e?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){a.call("_dsb.dsinit")},0)),typeof r=="object"?s._obs[i]=r:s[i]=r},registerAsyn:function(i,r){this.register(i,r,!0)},hasNativeMethod:function(i,r){return this.call("_dsb.hasNativeMethod",{name:i,type:r||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};return function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:a,close:function(){a.call("_dsb.closePage")},_handleMessageFromNative:function(e){var s=JSON.parse(e.data),t={id:e.callbackId,complete:!0},n=this._dsf[e.method],o=this._dsaf[e.method],v=function(_,p){t.data=_.apply(p,s),a.call("_dsb.returnValue",t)},g=function(_,p){s.push(function(O,j){t.data=O,t.complete=j!==!1,a.call("_dsb.returnValue",t)}),_.apply(p,s)};if(n)v(n,this._dsf);else if(o)g(o,this._dsaf);else{var u=e.method.split(".");if(u.length<2)return;var b=u.pop(),h=u.join("."),c=this._dsf._obs,f=c[h]||{},d=f[b];if(d&&typeof d=="function"){v(d,f);return}if(c=this._dsaf._obs,f=c[h]||{},d=f[b],d&&typeof d=="function"){g(d,f);return}}}};for(var r in i)window[r]=i[r];a.register("_hasJavascriptMethod",function(e,s){var t=e.split(".");if(t.length<2)return!!(_dsf[t]||_dsaf[t]);var e=t.pop(),n=t.join("."),o=_dsf._obs[n]||_dsaf._obs[n];return o&&!!o[e]})}}(),l=a,l}var y=J();const N=x(y),k=D({__proto__:null,default:N},[y]);export{k as i};
1
+ import{be as x}from"./index-BRwrysOT.js";function D(a,i){for(var r=0;r<i.length;r++){const e=i[r];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in a)){const t=Object.getOwnPropertyDescriptor(e,s);t&&Object.defineProperty(a,s,t.get?t:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var l,w;function J(){if(w)return l;w=1;var a={default:l,call:function(i,r,e){var s="";typeof r=="function"&&(e=r,r={});var t={data:r===void 0?null:r};if(typeof e=="function"){var n="dscb"+window.dscb++;window[n]=e,t._dscbstub=n}return t=JSON.stringify(t),window._dsbridge?s=_dsbridge.call(i,t):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(s=prompt("_dsbridge="+i,t)),JSON.parse(s||"{}").data},register:function(i,r,e){var s=e?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){a.call("_dsb.dsinit")},0)),typeof r=="object"?s._obs[i]=r:s[i]=r},registerAsyn:function(i,r){this.register(i,r,!0)},hasNativeMethod:function(i,r){return this.call("_dsb.hasNativeMethod",{name:i,type:r||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};return function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:a,close:function(){a.call("_dsb.closePage")},_handleMessageFromNative:function(e){var s=JSON.parse(e.data),t={id:e.callbackId,complete:!0},n=this._dsf[e.method],o=this._dsaf[e.method],v=function(_,p){t.data=_.apply(p,s),a.call("_dsb.returnValue",t)},g=function(_,p){s.push(function(O,j){t.data=O,t.complete=j!==!1,a.call("_dsb.returnValue",t)}),_.apply(p,s)};if(n)v(n,this._dsf);else if(o)g(o,this._dsaf);else{var u=e.method.split(".");if(u.length<2)return;var b=u.pop(),h=u.join("."),c=this._dsf._obs,f=c[h]||{},d=f[b];if(d&&typeof d=="function"){v(d,f);return}if(c=this._dsaf._obs,f=c[h]||{},d=f[b],d&&typeof d=="function"){g(d,f);return}}}};for(var r in i)window[r]=i[r];a.register("_hasJavascriptMethod",function(e,s){var t=e.split(".");if(t.length<2)return!!(_dsf[t]||_dsaf[t]);var e=t.pop(),n=t.join("."),o=_dsf._obs[n]||_dsaf._obs[n];return o&&!!o[e]})}}(),l=a,l}var y=J();const N=x(y),k=D({__proto__:null,default:N},[y]);export{k as i};
@@ -1,4 +1,4 @@
1
- import{aF as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,be as getDefaultExportFromCjs,E as useMediaQuery,s as styled,dq as Skeleton,cU as M$1,_ as CheckIcon,O as Tooltip,bB as Button,T as Typography,K as Box,C as CircularProgress,f as useTheme,dD as isObject,f0 as mergeThemeOptions,f1 as StyledEngineProvider,f2 as ThemeProvider,f3 as ThemeProvider$1,f4 as s,Z as o$1,b9 as styled$1,f5 as CloseIcon,cJ as Buffer,bf as U,bK as __vitePreload,dI as noop,bs as l$2}from"./index-DpFVufZF.js";import{j as joinUrl}from"./url-join-CvBUjlHE.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
1
+ import{aF as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,be as getDefaultExportFromCjs,E as useMediaQuery,s as styled,dq as Skeleton,cU as M$1,_ as CheckIcon,O as Tooltip,bB as Button,T as Typography,K as Box,C as CircularProgress,f as useTheme,dD as isObject,f0 as mergeThemeOptions,f1 as StyledEngineProvider,f2 as ThemeProvider,f3 as ThemeProvider$1,f4 as s,Z as o$1,b9 as styled$1,f5 as CloseIcon,cJ as Buffer,bf as U,bK as __vitePreload,dI as noop,bs as l$2}from"./index-BRwrysOT.js";import{j as joinUrl}from"./url-join-DOdOelSC.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
2
2
  .ellipsis-title {
3
3
  flex: 1;
4
4
  position: absolute;
@@ -1 +1 @@
1
- import{A as g,bn as v,u as y,j as r,P as f,S as x,R as h}from"./index-DpFVufZF.js";import{L as S,D as j}from"./download-DjEQp-4L.js";import{u as L}from"./useLocalStorage-pDiaOOl8.js";import"./ButtonGroup-Td8BNrZx.js";import"./getValidReactChildren-DUKHPCTn.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
1
+ import{A as g,bn as v,u as y,j as r,P as f,S as x,R as h}from"./index-BRwrysOT.js";import{L as S,D as j}from"./download-_CsYRy7z.js";import{u as L}from"./useLocalStorage-BpFDuJHy.js";import"./ButtonGroup-CufACnLw.js";import"./getValidReactChildren-DVWXmlzf.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
@@ -1 +1 @@
1
- import{bK as r,fb as _,gW as e}from"./index-DpFVufZF.js";const i={en:_(e),ar:()=>r(()=>import("./ar-BBr9bsOg.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-CDBOH3k5.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-BJ8CsIZi.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DSXQFpNy.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-DLsQ4VdX.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-AzAQyOHL.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-C3ccbBe-.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-9Vbo8tR2.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-iqygmSLa.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-BkfMvpq6.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-D-pgFsDa.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-BuffIn3I.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-BiloxWNq.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-CSl2KD_S.js"),[],import.meta.url).then(t=>_(t.default))};export{i as t};
1
+ import{bK as r,fb as _,gW as e}from"./index-BRwrysOT.js";const i={en:_(e),ar:()=>r(()=>import("./ar-BBr9bsOg.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-CDBOH3k5.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-BJ8CsIZi.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DSXQFpNy.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-DLsQ4VdX.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-AzAQyOHL.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-C3ccbBe-.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-9Vbo8tR2.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-iqygmSLa.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-BkfMvpq6.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-D-pgFsDa.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-BuffIn3I.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-BiloxWNq.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-CSl2KD_S.js"),[],import.meta.url).then(t=>_(t.default))};export{i as t};
@@ -1,4 +1,4 @@
1
- import{ak as ee,A as T,r as f,a as te,b as se,V as S,u as j,x as re,aw as A,i as F,j as t,w as q,ax as oe,T as C,y as k,$,o as m,ay as ne,O as ae,v as _,C as N,az as ie,H as W,Y as O,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,aa as he,s as M,a7 as fe,a8 as me,aE as ge,a9 as xe}from"./index-DpFVufZF.js";import{u as L}from"./useLocalStorage-pDiaOOl8.js";import{C as be,c as ke,e as ye,_ as Se,a as je,d as we,s as ve,S as V,b as Pe,A as Ce}from"./item-Bi4YOXoV.js";import{e as D}from"./engine-B_GmO38d.js";import{g as U}from"./get-safe-url-DcDP4eG0.js";import{P as z}from"./permission-a5zDq7rM.js";import{A as Re}from"./ArrowDropDown-CbNJotqT.js";import{B as Le}from"./Breadcrumbs-CJg6cGOH.js";import"./index-Cj3feFCu.js";import"./KeyboardArrowDown-DBKPniSI.js";import"./ChevronLeft-nSrR9D_I.js";import"./ChevronRight-CRb5GVq5.js";import"./Search-CCrESOjg.js";import"./index-BruXFS68.js";import"./blocklet-9wr_FD8g.js";import"./Autocomplete-Dm1_2YSl.js";import"./ListSubheader-DmTgdBz5.js";import"./Verified-D2LDOD6a.js";import"./VerifiedUser-dJrRBh25.js";import"./Add-DwgbzyUw.js";import"./Launch-BMpdke3b.js";import"./Done-BD3-Bno_.js";import"./DeleteOutline-BRn6KXm4.js";import"./delete-confirm-DsbMbRAa.js";import"./click-to-copy-BkgGJ2iu.js";import"./MoreVert-Bs574HAx.js";import"./ButtonGroup-Td8BNrZx.js";import"./getValidReactChildren-DUKHPCTn.js";function Be(e){const r=ee(),c=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[l,u]=f.useState(!1),[d,a]=f.useState(null),p=()=>{const{pathname:n,searchParams:b}=new URL(window.location.href),g=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";b.get("sid")&&(o(""),c(n.replace(g,"/"),{replace:!0}))},i=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(a(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(p,2e3)))}),f.useEffect(()=>{d&&d.id!==s&&o(d.id)},[d]),{hasCompleted:l,hasPurchased:i,session:d,setSession:a,doRedirect:p}}function De(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function K({meta:e,onCancel:r,handlePaySuccess:c=De,storeUrl:s}){const{t:o}=S(),{info:l}=j(),[u,d]=f.useState("both"),[a,p]=f.useState(1),i=re(l),n=A(e,l,s),b=P=>{P!==u&&d(P)},g=()=>{u&&(p(2),u==="verify"&&(window.location.href=U(n)))},w=(P,B)=>{B!=="backdropClick"&&r()},x=()=>{c(n)},h=F.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:x,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(C,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(C,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(be,{action:u,onNext:g,onSelect:b})})})}K.propTypes={...ke,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function H({meta:e,buttonText:r,storeUrl:c,isResource:s=!1}){const{t:o}=S(),l=T(),{info:u}=j(),{api:d}=ne(),a=F.isFreeBlocklet(e)===!1,[p,i]=f.useState(!1),{hasPurchased:n}=Be(e.did),[b,g]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[x,h]=f.useState(!1),v=f.useMemo(()=>p?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[p,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?r.purchase:r.launch,[a,r,s]),B=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){g(!0);return}if(w){h(!0);return}if(!a){const R=A(e,u,c);window.location.href=U(R)}}catch(R){W.error(O(R),{autoHideDuration:5e3}),console.error("Blocklet installed failed",R)}finally{i(!1)}},J=()=>{i(!1),g(!1)},X=y=>{i(!1),h(!1),l(`/blocklets/${y.appDid}/components`)},Z=()=>{i(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(z,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(n||b)&&t.jsx(K,{method:"launch",meta:e,mode:"both",onCancel:J,storeUrl:c}),x&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}H.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ee=(e,r,c)=>{const s=he(r);return k(c,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return k(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function G({blocklet:e,endpoint:r="",serverVersion:c=""}){const{t:s}=S(),o=j();let l=k(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)l=k(u,ue(e.did,e.logo,e.version));else{let n=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");n&&(n=`/${n}`),l=k(n,`/blocklet/logo/${e.did}`)}try{const i=new URL(l);i.searchParams.set("v",e.version||+new Date),l=i.href}catch{}const d=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u},p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(je,{serverVersion:c,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(H,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...a})})});return t.jsx(de,{href:Ee(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:d,target:"_blank",children:t.jsx(Ie,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?l:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(E,{sx:{display:"flex",color:"primary.main"},children:t.jsx(pe,{icon:we})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:r=null,extraFilter:c=void 0,...s}){const{locale:o}=S(),l=j(),[u,d]=f.useState({}),a=n=>{d(n)},p=e,i=l?.info?.version;return f.useEffect(()=>{d({})},[p]),t.jsx(le,{FallbackComponent:ce,resetKeys:[p],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(Se,{layout:{showExplore:!1,showTitle:!0},blockletRender:n=>t.jsx(G,{...n,endpoint:p}),baseSearch:!0,endpoint:p,locale:o,onFilterChange:a,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:i})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Ie=M(ve)`
1
+ import{ak as ee,A as T,r as f,a as te,b as se,V as S,u as j,x as re,aw as A,i as F,j as t,w as q,ax as oe,T as C,y as k,$,o as m,ay as ne,O as ae,v as _,C as N,az as ie,H as W,Y as O,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,aa as he,s as M,a7 as fe,a8 as me,aE as ge,a9 as xe}from"./index-BRwrysOT.js";import{u as L}from"./useLocalStorage-BpFDuJHy.js";import{C as be,c as ke,e as ye,_ as Se,a as je,d as we,s as ve,S as V,b as Pe,A as Ce}from"./item-DwlLrYZ8.js";import{e as D}from"./engine-DLi7rSr-.js";import{g as U}from"./get-safe-url-DvnzSlO6.js";import{P as z}from"./permission-lRCqS6FX.js";import{A as Re}from"./ArrowDropDown-DVc4YlSr.js";import{B as Le}from"./Breadcrumbs-CD40dK_D.js";import"./index-BsfcFq96.js";import"./KeyboardArrowDown-Du2c6qjk.js";import"./ChevronLeft-PZrWRTUE.js";import"./ChevronRight-C64VDrVw.js";import"./Search-BTki5Tlw.js";import"./index-CPY0YlbJ.js";import"./blocklet-BtHx1Y24.js";import"./Autocomplete-Bk7apAFc.js";import"./ListSubheader-DYeGWpur.js";import"./Verified-CNxkIuze.js";import"./VerifiedUser-CwrDiVvI.js";import"./Add-CDjPaJKP.js";import"./Launch-MVYS8Hns.js";import"./Done-BPhEa-lh.js";import"./DeleteOutline-DGv1wjmr.js";import"./delete-confirm-C6-PGb0E.js";import"./click-to-copy-C6Ix5G0V.js";import"./MoreVert-CBPzGUWs.js";import"./ButtonGroup-CufACnLw.js";import"./getValidReactChildren-DVWXmlzf.js";function Be(e){const r=ee(),c=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[l,u]=f.useState(!1),[d,a]=f.useState(null),p=()=>{const{pathname:n,searchParams:b}=new URL(window.location.href),g=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";b.get("sid")&&(o(""),c(n.replace(g,"/"),{replace:!0}))},i=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(a(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(p,2e3)))}),f.useEffect(()=>{d&&d.id!==s&&o(d.id)},[d]),{hasCompleted:l,hasPurchased:i,session:d,setSession:a,doRedirect:p}}function De(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function K({meta:e,onCancel:r,handlePaySuccess:c=De,storeUrl:s}){const{t:o}=S(),{info:l}=j(),[u,d]=f.useState("both"),[a,p]=f.useState(1),i=re(l),n=A(e,l,s),b=P=>{P!==u&&d(P)},g=()=>{u&&(p(2),u==="verify"&&(window.location.href=U(n)))},w=(P,B)=>{B!=="backdropClick"&&r()},x=()=>{c(n)},h=F.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:x,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(C,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(C,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(be,{action:u,onNext:g,onSelect:b})})})}K.propTypes={...ke,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function H({meta:e,buttonText:r,storeUrl:c,isResource:s=!1}){const{t:o}=S(),l=T(),{info:u}=j(),{api:d}=ne(),a=F.isFreeBlocklet(e)===!1,[p,i]=f.useState(!1),{hasPurchased:n}=Be(e.did),[b,g]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[x,h]=f.useState(!1),v=f.useMemo(()=>p?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[p,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?r.purchase:r.launch,[a,r,s]),B=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){g(!0);return}if(w){h(!0);return}if(!a){const R=A(e,u,c);window.location.href=U(R)}}catch(R){W.error(O(R),{autoHideDuration:5e3}),console.error("Blocklet installed failed",R)}finally{i(!1)}},J=()=>{i(!1),g(!1)},X=y=>{i(!1),h(!1),l(`/blocklets/${y.appDid}/components`)},Z=()=>{i(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(z,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(n||b)&&t.jsx(K,{method:"launch",meta:e,mode:"both",onCancel:J,storeUrl:c}),x&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}H.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ee=(e,r,c)=>{const s=he(r);return k(c,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return k(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function G({blocklet:e,endpoint:r="",serverVersion:c=""}){const{t:s}=S(),o=j();let l=k(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)l=k(u,ue(e.did,e.logo,e.version));else{let n=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");n&&(n=`/${n}`),l=k(n,`/blocklet/logo/${e.did}`)}try{const i=new URL(l);i.searchParams.set("v",e.version||+new Date),l=i.href}catch{}const d=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u},p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(je,{serverVersion:c,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(H,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...a})})});return t.jsx(de,{href:Ee(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:d,target:"_blank",children:t.jsx(Ie,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?l:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(E,{sx:{display:"flex",color:"primary.main"},children:t.jsx(pe,{icon:we})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:r=null,extraFilter:c=void 0,...s}){const{locale:o}=S(),l=j(),[u,d]=f.useState({}),a=n=>{d(n)},p=e,i=l?.info?.version;return f.useEffect(()=>{d({})},[p]),t.jsx(le,{FallbackComponent:ce,resetKeys:[p],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(Se,{layout:{showExplore:!1,showTitle:!0},blockletRender:n=>t.jsx(G,{...n,endpoint:p}),baseSearch:!0,endpoint:p,locale:o,onFilterChange:a,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:i})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Ie=M(ve)`
2
2
  .ms-highlight {
3
3
  color: ${e=>e.theme.palette.primary.main};
4
4
  }