@abtnode/webapp 1.16.52 → 1.16.53-beta-20251009-103017-c7694a7e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-C0VLC28_.js → AdapterDayjs-DovOOpck.js} +1 -1
  4. package/dist/assets/{Add-DItRD8hT.js → Add-DyTieGiH.js} +1 -1
  5. package/dist/assets/ArrowDropDown-BFKf-Ws9.js +1 -0
  6. package/dist/assets/{Autocomplete-DTzPpKKP.js → Autocomplete-DeRVpEU5.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-BnLqLMCb.js → Breadcrumbs-BnYzoMmu.js} +1 -1
  8. package/dist/assets/{ButtonGroup-fE_sAFXd.js → ButtonGroup-CzZQ8Npu.js} +1 -1
  9. package/dist/assets/{CSSTransition-2GLd-U2B.js → CSSTransition-CjXLkGon.js} +1 -1
  10. package/dist/assets/{CallMerge-CYv9yw9D.js → CallMerge-DmrftrOd.js} +1 -1
  11. package/dist/assets/{CardContent-BhLNX_6W.js → CardContent-CpM-_HeI.js} +1 -1
  12. package/dist/assets/{ChevronLeft-PIrHiVVI.js → ChevronLeft-CcsCSRKu.js} +1 -1
  13. package/dist/assets/{ChevronRight-Cap_v1qc.js → ChevronRight-o-pKt_xW.js} +1 -1
  14. package/dist/assets/{Clear-D3ljia7f.js → Clear-DbuaJOFI.js} +1 -1
  15. package/dist/assets/{DeleteOutline-CoCXX_dF.js → DeleteOutline-D-kT-jdx.js} +1 -1
  16. package/dist/assets/{Done-D4_4Gmhf.js → Done-C2ulOvk7.js} +1 -1
  17. package/dist/assets/{Edit-DpH5F9Ou.js → Edit-DWhNMMIZ.js} +1 -1
  18. package/dist/assets/{ErrorOutline-ByEltPMY.js → ErrorOutline-B0ozV6sd.js} +1 -1
  19. package/dist/assets/{FilterList-hQMSrEvV.js → FilterList-CQA7G7Vn.js} +1 -1
  20. package/dist/assets/{Google-CR2lnf8Q.js → Google-CdFzL70-.js} +1 -1
  21. package/dist/assets/{HelpOutline-D0pwqrsD.js → HelpOutline-aMigqk6S.js} +1 -1
  22. package/dist/assets/{KeyboardArrowDown-DA-SBYMy.js → KeyboardArrowDown-Ccl83jb_.js} +1 -1
  23. package/dist/assets/{Launch-Ce5twmbU.js → Launch-DR4ser43.js} +1 -1
  24. package/dist/assets/{Link-DbdTXtCg.js → Link-8FWBk0pv.js} +1 -1
  25. package/dist/assets/{ListItemButton-DQP1NltN.js → ListItemButton-xoowqbX5.js} +1 -1
  26. package/dist/assets/{ListSubheader-BmA89Ccv.js → ListSubheader-Tf0tPSi7.js} +1 -1
  27. package/dist/assets/{LoadingButton-D7vsv6MC.js → LoadingButton-DdsR40-y.js} +1 -1
  28. package/dist/assets/{MoreVert-BB0EapQ9.js → MoreVert-CDZKGaWW.js} +1 -1
  29. package/dist/assets/{OpenInNew-CX1PTvdx.js → OpenInNew-5dmOmuOP.js} +1 -1
  30. package/dist/assets/{Refresh-BEOo7D9p.js → Refresh-6wYRerOp.js} +1 -1
  31. package/dist/assets/{Search-DvsqADee.js → Search-CYv1OPLx.js} +1 -1
  32. package/dist/assets/{Stepper-6HLv_yoR.js → Stepper-BdbxyKvR.js} +1 -1
  33. package/dist/assets/{Switch-CCEATBz-.js → Switch-CJCk9M4e.js} +1 -1
  34. package/dist/assets/{TableSearch-BNfAQQQc.js → TableSearch-DEuaLdIb.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-B6SzpdjP.js → ToggleButtonGroup-CJvpk2kD.js} +1 -1
  36. package/dist/assets/{UnfoldMore-Cqql8JCY.js → UnfoldMore-I9efh077.js} +1 -1
  37. package/dist/assets/{Verified-Br_OBCRt.js → Verified-B6ag8nG6.js} +1 -1
  38. package/dist/assets/{VerifiedUser-DsoT5lfk.js → VerifiedUser-ueCIxEYY.js} +1 -1
  39. package/dist/assets/{ViewList-BHhtVkRR.js → ViewList-STBCUXtD.js} +1 -1
  40. package/dist/assets/{_createAggregator-V4MWiBUY.js → _createAggregator-Cnz_HrZy.js} +1 -1
  41. package/dist/assets/{actions-BFVrQ8dq.js → actions-0xA8jgJe.js} +1 -1
  42. package/dist/assets/{actions-DHXimNo1.js → actions-i2UahyAp.js} +1 -1
  43. package/dist/assets/{agreement-CU5uoH1n.js → agreement-DoAGWhqk.js} +1 -1
  44. package/dist/assets/api-BLz72Lsh.js +1 -0
  45. package/dist/assets/{appearance-BsXaEZpM.js → appearance-BLnd4o8Y.js} +1 -1
  46. package/dist/assets/{audit-logs-DV2kDgJ-.js → audit-logs-D__bx07h.js} +1 -1
  47. package/dist/assets/{base-chart-CLNRL1BX.js → base-chart-Dr8SHE0h.js} +1 -1
  48. package/dist/assets/{blocklet-BLUhhQuJ.js → blocklet-Ddfm_VL2.js} +1 -1
  49. package/dist/assets/{chain-C4d980k-.js → chain-CdexttSs.js} +1 -1
  50. package/dist/assets/{click-to-copy-CzS2KJO6.js → click-to-copy-D6M1fnDc.js} +1 -1
  51. package/dist/assets/client-wk4MeJIg.js +1 -0
  52. package/dist/assets/cloneDeep-C1r6zWUN.js +1 -0
  53. package/dist/assets/{collapse-mSz6lvYA.js → collapse-D2q_m0jc.js} +1 -1
  54. package/dist/assets/{config-navigation-CxzOxzQV.js → config-navigation-B6vV0qs8.js} +3 -3
  55. package/dist/assets/{connect-to-D1uid_Cx.js → connect-to-Co7U9qsv.js} +1 -1
  56. package/dist/assets/{cssMode-BJT_I60d.js → cssMode-C5uxwgRY.js} +1 -1
  57. package/dist/assets/{delete-confirm-DJBKt73W.js → delete-confirm-C1ZQ29Q4.js} +1 -1
  58. package/dist/assets/{depsEqual-5RWUMijK.js → depsEqual-DQDFZSyD.js} +1 -1
  59. package/dist/assets/{detail-s703Qvcy.js → detail-a5SJkzSR.js} +3 -3
  60. package/dist/assets/{domains-DkmRNJAK.js → domains-BRe4M7bx.js} +1 -1
  61. package/dist/assets/{download-D44_QQrB.js → download-Cwb05ySd.js} +1 -1
  62. package/dist/assets/{edit.svg-B2xfqD5T.js → edit.svg-DCbVw9zw.js} +1 -1
  63. package/dist/assets/emotion-cache.browser.esm-CgS-LeII.js +1 -0
  64. package/dist/assets/engine-DHL9Z21k.js +1 -0
  65. package/dist/assets/{freemarker2-CdZv880S.js → freemarker2-DVpsezSy.js} +1 -1
  66. package/dist/assets/{get-safe-url-DLG8kU6z.js → get-safe-url-BjFdr4OL.js} +1 -1
  67. package/dist/assets/getValidReactChildren-BImmvw4C.js +1 -0
  68. package/dist/assets/{graphqlMode-DgYKXtUS.js → graphqlMode-ChKOq_KJ.js} +2 -2
  69. package/dist/assets/{handlebars-BaOgwoIT.js → handlebars-BU9OFTYI.js} +1 -1
  70. package/dist/assets/{html-o0YXxeym.js → html-UexVD9vB.js} +1 -1
  71. package/dist/assets/{html-title-CBcwzP0O.js → html-title-C4Q1l9hV.js} +1 -1
  72. package/dist/assets/{htmlMode-CbCzFTis.js → htmlMode-TJopYsor.js} +1 -1
  73. package/dist/assets/{iframe-MaiD-uXS.js → iframe-DMkrJLov.js} +1 -1
  74. package/dist/assets/{index-CjuJfi2v.js → index--oO30Jkn.js} +1 -1
  75. package/dist/assets/{index-BaeT60Bm.js → index-1ecJNhOT.js} +1 -1
  76. package/dist/assets/{index-BBAaOgn9.js → index-B4kOKoNV.js} +1 -1
  77. package/dist/assets/{index-CSfc7lBZ.js → index-B7EJvfHM.js} +1 -1
  78. package/dist/assets/{index-BFB2WIzs.js → index-BRdnv7Wp.js} +1 -1
  79. package/dist/assets/{index-B1Nr4_oN.js → index-BS0sLGRz.js} +1 -1
  80. package/dist/assets/{index-Bo59eWBY.js → index-BTulqglm.js} +9 -9
  81. package/dist/assets/{index-BWMncemp.js → index-BYbMJbBQ.js} +1 -1
  82. package/dist/assets/{index-C_IsnknD.js → index-Bi1dCbDw.js} +1 -1
  83. package/dist/assets/{index-BsuKmuut.js → index-BlH5R4ip.js} +1 -1
  84. package/dist/assets/{index-BfZFUZ64.js → index-C3SQ4eIT.js} +1 -1
  85. package/dist/assets/{index-DD1oUJ1v.js → index-C7AJ9wZq.js} +1 -1
  86. package/dist/assets/{index-t9s_9ji7.js → index-CB7PBjDX.js} +3 -3
  87. package/dist/assets/{index-BTId5Ivl.js → index-CFWi7Q8M.js} +1 -1
  88. package/dist/assets/{index-CoUQzwgb.js → index-CIUZoemD.js} +1 -1
  89. package/dist/assets/{index-CzdSuw55.js → index-CNPrEh7K.js} +1 -1
  90. package/dist/assets/{index-CqPFGhPw.js → index-CaUe3dMj.js} +1 -1
  91. package/dist/assets/{index-CGLptp69.js → index-CbZ9HAj8.js} +1 -1
  92. package/dist/assets/index-CgWUU7yZ.js +1 -0
  93. package/dist/assets/{index-BBmJKAvO.js → index-Cie1Z-Am.js} +1 -1
  94. package/dist/assets/{index-C9I-5XlU.js → index-CjedGlyf.js} +1 -1
  95. package/dist/assets/{index-DybxhkYV.js → index-CnTj486q.js} +1 -1
  96. package/dist/assets/{index-ZddV22Vm.js → index-CsmIWfmp.js} +1 -1
  97. package/dist/assets/{index-DmYMtqM2.js → index-CwdwMEyK.js} +1 -1
  98. package/dist/assets/{index-CAKHHLao.js → index-D0uKz0V_.js} +1 -1
  99. package/dist/assets/{index-BjpjGoUP.js → index-DAqbo3x1.js} +1 -1
  100. package/dist/assets/{index-fifF2FyW.js → index-DGSsefUZ.js} +5 -5
  101. package/dist/assets/{index-BukltlJb.js → index-DWPS9ieq.js} +1 -1
  102. package/dist/assets/{index-DPdFthJE.js → index-D_kWYNJi.js} +3 -3
  103. package/dist/assets/{index-umFCHUhg.js → index-DdqV6Ziy.js} +2 -2
  104. package/dist/assets/{index-z364FkCN.js → index-DfwECgSx.js} +1 -1
  105. package/dist/assets/{index-xGQ9OvSX.js → index-Di3fMIen.js} +1 -1
  106. package/dist/assets/{index-g_xdfDPD.js → index-DkJyV264.js} +3 -3
  107. package/dist/assets/{index-C6IoSffB.js → index-Do106lNr.js} +1 -1
  108. package/dist/assets/{index-BjCT_wy8.js → index-DtIh1vFa.js} +1 -1
  109. package/dist/assets/{index-D4-Mkb8d.js → index-H-jmtxXo.js} +1 -1
  110. package/dist/assets/{index-POkTG5Qk.js → index-SQHqCeph.js} +1 -1
  111. package/dist/assets/{index-Ci-UG7Ps.js → index-SpGv84ec.js} +3 -3
  112. package/dist/assets/{index-SbPSO7T7.js → index-T209NFxy.js} +1 -1
  113. package/dist/assets/{index-CizGeSmr.js → index-TglI0woB.js} +1 -1
  114. package/dist/assets/{index-DgoTiE-a.js → index-Xej91YkM.js} +1 -1
  115. package/dist/assets/{index-OVpMjiet.js → index-b3XeYmTe.js} +1 -1
  116. package/dist/assets/{index-DRjTE6Aa.js → index-bK6g80kL.js} +1 -1
  117. package/dist/assets/{index-eMea8AsO.js → index-hCRLdd4Q.js} +1 -1
  118. package/dist/assets/{index-C33d2J-e.js → index-uisuBluj.js} +1 -1
  119. package/dist/assets/{index-erQKCh-p.js → index-wNvsBj9G.js} +1 -1
  120. package/dist/assets/{index.esm-x93gmns6.js → index.esm-Lk0YHlgv.js} +1 -1
  121. package/dist/assets/{install-from-url-DTuR9LC1.js → install-from-url-BRio3aeH.js} +1 -1
  122. package/dist/assets/{invitation-C_Ikm_Yb.js → invitation-CqYyE8ME.js} +1 -1
  123. package/dist/assets/{is-path-prefix-equal-DyJ6xlMG.js → is-path-prefix-equal-CC7-GVaa.js} +1 -1
  124. package/dist/assets/{item-BEwqO77L.js → item-BxAxNpJk.js} +1 -1
  125. package/dist/assets/{javascript-DLWzqOuy.js → javascript-ChDh5iSe.js} +1 -1
  126. package/dist/assets/{jsonMode-BKVZwvfv.js → jsonMode-_2nbeNvy.js} +1 -1
  127. package/dist/assets/{liquid-CRMCESQs.js → liquid-B4GHkAyg.js} +1 -1
  128. package/dist/assets/{list-header-B1d4qFE1.js → list-header-Cb1uRm5G.js} +1 -1
  129. package/dist/assets/{lock.svg-BZModqK2.js → lock.svg-BH7_YT0q.js} +1 -1
  130. package/dist/assets/{log-FByBwZ08.js → log-6_0GK9Sf.js} +1 -1
  131. package/dist/assets/{lottie-react.esm-937AIg7X.js → lottie-react.esm-DmwbnPOn.js} +1 -1
  132. package/dist/assets/{mdx-BOaUu5J0.js → mdx-B_wFriqY.js} +1 -1
  133. package/dist/assets/{memory-B2_C_I8D.js → memory-sDoTeyx0.js} +1 -1
  134. package/dist/assets/{metric-kEGofNrG.js → metric-BKabdyQk.js} +1 -1
  135. package/dist/assets/omit-Cd7qywqq.js +1 -0
  136. package/dist/assets/{overview-DcvxUTQy.js → overview-aAlDPd4Q.js} +1 -1
  137. package/dist/assets/{permission-if925jUs.js → permission-crhdqXhd.js} +1 -1
  138. package/dist/assets/{preference-DLFzPDO8.js → preference-BNQQaSX0.js} +3 -3
  139. package/dist/assets/{python-zu-74iQq.js → python-BtYeLxMR.js} +1 -1
  140. package/dist/assets/{raf-schd.esm-CgzYR87f.js → raf-schd.esm-K0lox3Rf.js} +1 -1
  141. package/dist/assets/{razor-2TDyJzsA.js → razor-B4KFVo2j.js} +1 -1
  142. package/dist/assets/{rotate-session-key--fFPkV5O.js → rotate-session-key-DTg7AVbr.js} +1 -1
  143. package/dist/assets/{runtime-B8CtLdRa.js → runtime-De89eo0q.js} +1 -1
  144. package/dist/assets/schema-CjV-LIXx.js +1 -0
  145. package/dist/assets/sdk-DZ3OhIyg.js +1 -0
  146. package/dist/assets/{service-BtcSUQUg.js → service-DLCTpVab.js} +1 -1
  147. package/dist/assets/{shorten-label-CqoMlCEn.js → shorten-label-B1hTVv56.js} +1 -1
  148. package/dist/assets/{simple-select-Cx8Rifji.js → simple-select-Cdud---B.js} +1 -1
  149. package/dist/assets/{spaces-BKJPXs_t.js → spaces-Du4ytYyE.js} +1 -1
  150. package/dist/assets/{status-BvFVqTft.js → status-BM8-Rpzz.js} +1 -1
  151. package/dist/assets/{status-CZoMrFz2.js → status-DYjJgZF9.js} +1 -1
  152. package/dist/assets/{switch-control-BJLlH9bj.js → switch-control-HQMK5p78.js} +1 -1
  153. package/dist/assets/{table-icons-BcSpx-Kl.js → table-icons-DPEJ6Pbc.js} +1 -1
  154. package/dist/assets/{team-MquyQUWI.js → team-ouIwaQum.js} +1 -1
  155. package/dist/assets/{toLower-DhEA6WSE.js → toLower-3JDTZiHY.js} +1 -1
  156. package/dist/assets/toUpper-Cmpm1h81.js +1 -0
  157. package/dist/assets/{traffic-kjLWyE1D.js → traffic-DQX3XpFH.js} +1 -1
  158. package/dist/assets/{tsMode-CG7DdtAX.js → tsMode-DdJdi-Cl.js} +1 -1
  159. package/dist/assets/{typescript-rYWsiIOr.js → typescript-BRTY57X5.js} +1 -1
  160. package/dist/assets/{url-evaluation-CSwxSB5J.js → url-evaluation-4RA6nhhV.js} +1 -1
  161. package/dist/assets/{url-join-C_cs-ddV.js → url-join-s-abjyAU.js} +1 -1
  162. package/dist/assets/{use-mobile-V-C8ZTE7.js → use-mobile-9H63c6Kz.js} +1 -1
  163. package/dist/assets/{use-mobile-DpjjV6uK.js → use-mobile-CNA5itNx.js} +1 -1
  164. package/dist/assets/{useAsync-By1M7ID3.js → useAsync-B0Ca_r2m.js} +1 -1
  165. package/dist/assets/{useAsyncRetry-CSWhStFy.js → useAsyncRetry-CtsBX_BZ.js} +1 -1
  166. package/dist/assets/{useLocalStorage-BeAHV6We.js → useLocalStorage-T0_FQRxp.js} +1 -1
  167. package/dist/assets/{useThemeProps-BAKR-Tdk.js → useThemeProps-EahRu2x5.js} +1 -1
  168. package/dist/assets/{util-BvlN6gOG.js → util-CUni4mda.js} +1 -1
  169. package/dist/assets/{wait-container-DwVlMmHb.js → wait-container-xOI954wH.js} +1 -1
  170. package/dist/assets/{without-wallet-CCjSjnWg.js → without-wallet-DOZiTpC3.js} +1 -1
  171. package/dist/assets/{wrap-locale-x3lhQGHt.js → wrap-locale-Des5gfRA.js} +1 -1
  172. package/dist/assets/{xml-4RrF1Wys.js → xml-B19Uai7I.js} +1 -1
  173. package/dist/assets/{yaml-Dh4kDkfH.js → yaml-D5iuUIms.js} +1 -1
  174. package/dist/index.html +1 -1
  175. package/dist/service-worker.js +1 -1
  176. package/package.json +1 -1
  177. package/dist/assets/ArrowDropDown-D9CDJDee.js +0 -1
  178. package/dist/assets/api-D-_3OFye.js +0 -1
  179. package/dist/assets/client-Dy8AXmPI.js +0 -1
  180. package/dist/assets/cloneDeep-Cj4uuMbO.js +0 -1
  181. package/dist/assets/emotion-cache.browser.esm-Cb8UHF8_.js +0 -1
  182. package/dist/assets/engine-BDnZCRC2.js +0 -1
  183. package/dist/assets/getValidReactChildren-B144ChcV.js +0 -1
  184. package/dist/assets/index-D95Qz4OD.js +0 -1
  185. package/dist/assets/omit-CIssTx-S.js +0 -1
  186. package/dist/assets/schema-k8CvrfNy.js +0 -1
  187. package/dist/assets/sdk-DQC72wRi.js +0 -1
  188. package/dist/assets/toUpper-BWJs3vVl.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,n as Q,eO as Fe,P as Pe,il as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,im as et,w as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,io as Ct,ip as Nt,$ as nt,iq as wt,ir as Rt,is as Tt,it as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,iu as Lt,a3 as kt}from"./index-fifF2FyW.js";import{d as Ft,H as at,g as Pt}from"./index-DRjTE6Aa.js";import{R as _e,S as _t}from"./actions-BFVrQ8dq.js";import{B as Bt}from"./index-BaeT60Bm.js";import{S as me}from"./shorten-label-CqoMlCEn.js";import{v as ot}from"./index-BjpjGoUP.js";import{T as zt}from"./html-title-CBcwzP0O.js";import{R as Wt}from"./Refresh-BEOo7D9p.js";import{D as Mt,g as Kt}from"./traffic-kjLWyE1D.js";import{u as Ht}from"./use-mobile-V-C8ZTE7.js";import"./FilterList-hQMSrEvV.js";import"./CSSTransition-2GLd-U2B.js";import"./emotion-cache.browser.esm-Cb8UHF8_.js";import"./index-CzdSuw55.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-5RWUMijK.js";import"./index-BTId5Ivl.js";import"./TableSearch-BNfAQQQc.js";import"./Search-DvsqADee.js";import"./Clear-D3ljia7f.js";import"./MoreVert-BB0EapQ9.js";import"./useLocalStorage-BeAHV6We.js";import"./url-evaluation-CSwxSB5J.js";import"./get-safe-url-DLG8kU6z.js";import"./ButtonGroup-fE_sAFXd.js";import"./getValidReactChildren-B144ChcV.js";import"./permission-if925jUs.js";import"./index.esm-x93gmns6.js";import"./collapse-mSz6lvYA.js";import"./blocklet-BLUhhQuJ.js";import"./Switch-CCEATBz-.js";import"./iframe-MaiD-uXS.js";import"./ChevronLeft-PIrHiVVI.js";import"./ChevronRight-Cap_v1qc.js";import"./index-DBii9-f-.js";import"./base-chart-CLNRL1BX.js";import"./index-CoUQzwgb.js";import"./AdapterDayjs-C0VLC28_.js";import"./useThemeProps-BAKR-Tdk.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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 Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{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(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
1
+ import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,n as Q,eO as Fe,P as Pe,il as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,im as et,w as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,io as Ct,ip as Nt,$ as nt,iq as wt,ir as Rt,is as Tt,it as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,iu as Lt,a3 as kt}from"./index-DGSsefUZ.js";import{d as Ft,H as at,g as Pt}from"./index-bK6g80kL.js";import{R as _e,S as _t}from"./actions-0xA8jgJe.js";import{B as Bt}from"./index-1ecJNhOT.js";import{S as me}from"./shorten-label-B1hTVv56.js";import{v as ot}from"./index-DAqbo3x1.js";import{T as zt}from"./html-title-C4Q1l9hV.js";import{R as Wt}from"./Refresh-6wYRerOp.js";import{D as Mt,g as Kt}from"./traffic-DQX3XpFH.js";import{u as Ht}from"./use-mobile-9H63c6Kz.js";import"./FilterList-CQA7G7Vn.js";import"./CSSTransition-CjXLkGon.js";import"./emotion-cache.browser.esm-CgS-LeII.js";import"./index-CNPrEh7K.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DQDFZSyD.js";import"./index-CFWi7Q8M.js";import"./TableSearch-DEuaLdIb.js";import"./Search-CYv1OPLx.js";import"./Clear-DbuaJOFI.js";import"./MoreVert-CDZKGaWW.js";import"./useLocalStorage-T0_FQRxp.js";import"./url-evaluation-4RA6nhhV.js";import"./get-safe-url-BjFdr4OL.js";import"./ButtonGroup-CzZQ8Npu.js";import"./getValidReactChildren-BImmvw4C.js";import"./permission-crhdqXhd.js";import"./index.esm-Lk0YHlgv.js";import"./collapse-D2q_m0jc.js";import"./blocklet-Ddfm_VL2.js";import"./Switch-CJCk9M4e.js";import"./iframe-DMkrJLov.js";import"./ChevronLeft-CcsCSRKu.js";import"./ChevronRight-o-pKt_xW.js";import"./index-DBii9-f-.js";import"./base-chart-Dr8SHE0h.js";import"./index-CIUZoemD.js";import"./AdapterDayjs-DovOOpck.js";import"./useThemeProps-EahRu2x5.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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 Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{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(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{c as H,u as W,r as i,a as R,b as D,j as e,o as y,d as Q,e as Y,g as F,f as X,W as U,L as J,p 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-fifF2FyW.js";import{f as ne}from"./index-BojVbZw0.js";import{v as $}from"./index-BjpjGoUP.js";import{M as V}from"./metric-kEGofNrG.js";import{C as M}from"./click-to-copy-CzS2KJO6.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:he}=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(D.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R(D.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R(D.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(U,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(U,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(U,{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:2,sm:3,md:4,lg:5},children:O.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},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:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},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($,{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($,{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($,{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 D,j as e,o as y,d as Q,e as Y,g as F,f as X,W as U,L as J,p 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-DGSsefUZ.js";import{f as ne}from"./index-BojVbZw0.js";import{v as $}from"./index-DAqbo3x1.js";import{M as V}from"./metric-BKabdyQk.js";import{C as M}from"./click-to-copy-D6M1fnDc.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:he}=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(D.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R(D.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R(D.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(U,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(U,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(U,{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:2,sm:3,md:4,lg:5},children:O.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},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:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},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($,{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($,{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($,{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,4 +1,4 @@
1
- import{aH as L,bn as I,bo as Ke,n as S,j as e,O as B,r as h,P as X,Q as G,S as Q,R as J,M as p,bp as ce,o as x,q as Re,w as U,C as Se,ac as le,aV as Y,v as H,g as De,z as E,$ as de,aU as Ie,U as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as ze,br as pe,bs as me,bt as ue,bu as Ee,i as _e,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,V as qe,X as Ue,B as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-fifF2FyW.js";import{u as Ge,T as Qe}from"./html-title-CBcwzP0O.js";import Je from"./audit-logs-DV2kDgJ-.js";import{T as xe,M as Ye}from"./index-CizGeSmr.js";import{r as he,P as Ze}from"./index-SbPSO7T7.js";import{u as _,T as et}from"./team-MquyQUWI.js";import{g as tt,H as st}from"./index-DRjTE6Aa.js";import{D as nt}from"./url-evaluation-CSwxSB5J.js";import{E as ot}from"./Edit-DpH5F9Ou.js";import{y as it}from"./index-BTId5Ivl.js";import{A as at}from"./Add-DItRD8hT.js";import{l as F}from"./index-xGQ9OvSX.js";import{C as O}from"./click-to-copy-CzS2KJO6.js";import{f as rt}from"./index-BojVbZw0.js";import{D as ct}from"./delete-confirm-DJBKt73W.js";import{P as lt}from"./permission-if925jUs.js";import{u as dt}from"./blocklet-BLUhhQuJ.js";import{u as Z}from"./use-mobile-V-C8ZTE7.js";import{A as pt}from"./actions-DHXimNo1.js";import{u as mt}from"./useAsyncRetry-CSWhStFy.js";import"./TableSearch-BNfAQQQc.js";import"./Search-DvsqADee.js";import"./Clear-D3ljia7f.js";import"./useLocalStorage-BeAHV6We.js";import"./index-CAKHHLao.js";import"./decode-DPztD6kB.js";import"./UnfoldMore-Cqql8JCY.js";import"./shorten-label-CqoMlCEn.js";import"./ViewList-BHhtVkRR.js";import"./use-mobile-DpjjV6uK.js";import"./client-Dy8AXmPI.js";import"./index-erQKCh-p.js";import"./ButtonGroup-fE_sAFXd.js";import"./getValidReactChildren-B144ChcV.js";import"./index-D95Qz4OD.js";import"./Google-CR2lnf8Q.js";import"./cloneDeep-Cj4uuMbO.js";import"./Autocomplete-DTzPpKKP.js";import"./ListSubheader-BmA89Ccv.js";import"./AdapterDayjs-C0VLC28_.js";import"./useThemeProps-BAKR-Tdk.js";import"./CSSTransition-2GLd-U2B.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-BjpjGoUP.js";import"./Verified-Br_OBCRt.js";import"./DeleteOutline-CoCXX_dF.js";import"./ErrorOutline-ByEltPMY.js";import"./index-CSfc7lBZ.js";import"./emotion-cache.browser.esm-Cb8UHF8_.js";import"./sdk-DQC72wRi.js";import"./index-BjCT_wy8.js";import"./edit.svg-B2xfqD5T.js";import"./list-header-B1d4qFE1.js";import"./chain-C4d980k-.js";import"./ToggleButtonGroup-B6SzpdjP.js";import"./lock.svg-BZModqK2.js";import"./FilterList-hQMSrEvV.js";import"./index-CzdSuw55.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-5RWUMijK.js";import"./MoreVert-BB0EapQ9.js";import"./useAsync-By1M7ID3.js";function ee({value:s}){const{t,locale:n}=S(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:s,onChange:t,...n}){const{t:i}=S(),a=h.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(Q,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),IconComponent:r=>e.jsx(ce,{...r,width:20,height:20}),children:a.map(r=>e.jsx(J,{value:r.value,children:e.jsxs(p,{children:[e.jsx("span",{children:r.title}),e.jsx(p,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:r.description})]})},r.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const se=()=>{const s=L.RBAC_CONFIG.roles.filter(a=>a.passport),{inService:t}=I(),{roles:n}=_(),i=[...s,...t?n:[]];return Ke(i,"name").filter(a=>a.name!==L.ROLES.OWNER)};function fe(){const{session:s}=Re(),t=se();return h.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(r=>r.name==="guest");return[...t.filter(r=>r.name!=="guest").filter(r=>s.user.passports.find(f=>f.role===r.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ge({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=_(),{t:a}=S(),[r,f]=h.useState(!1),[m,b]=h.useState(null),u=fe(),T=()=>{f(!1),b(null)},v=async l=>{const{remark:k,passport:g,authType:o}=l;f(!0);const j=await n.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:g,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:o}}),{data:A}=j;s(A),b(null),f(!1)},c={title:`${a("common.create")} ${a("accessKey")}`,description:(l,k,g)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(H,{label:a("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:o=>{k({...l,remark:o.target.value,__disableConfirm:!l.passport||!o.target.value.trim()}),o.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{sx:{width:"calc(100% - 46px)"},children:a("setting.accessKey.passport")}),e.jsx(Q,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:o=>{const j=o.target.value;g(null),k({...l,passport:j,__disableConfirm:!l.remark||!j})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:r,IconComponent:o=>e.jsx(ce,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(p,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(te,{value:l.authType,onChange:o=>{k({...l,authType:o.target.value})}}),e.jsx(xe,{placeholder:a("setting.accessKey.expireTime"),value:l.expireAt,onChange:o=>{k({...l,expireAt:o,__disableConfirm:!l.passport||!l.remark||!o})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:v,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>b(c),className:"rule-action",children:[r?e.jsx(Se,{size:16}):e.jsx(at,{style:{fontSize:16}}),a("common.create")]}),m&&e.jsx(le,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:x.string,onCreate:x.func};function ye({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:a}=h.useContext(De),[r,f]=h.useState(!1),[m,b]=h.useState(()=>i),u=I(),T=()=>{b(!m)},v=g=>{f(g.target.checked)},c=E(window.location.origin,u?.info?.routing?.adminPath),l=h.useMemo(()=>i?`const Client = require('@blocklet/server-js');
1
+ import{aH as L,bn as I,bo as Ke,n as S,j as e,O as B,r as h,P as X,Q as G,S as Q,R as J,M as p,bp as ce,o as x,q as Re,w as U,C as Se,ac as le,aV as Y,v as H,g as De,z as E,$ as de,aU as Ie,U as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as ze,br as pe,bs as me,bt as ue,bu as Ee,i as _e,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,V as qe,X as Ue,B as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-DGSsefUZ.js";import{u as Ge,T as Qe}from"./html-title-C4Q1l9hV.js";import Je from"./audit-logs-D__bx07h.js";import{T as xe,M as Ye}from"./index-TglI0woB.js";import{r as he,P as Ze}from"./index-T209NFxy.js";import{u as _,T as et}from"./team-ouIwaQum.js";import{g as tt,H as st}from"./index-bK6g80kL.js";import{D as nt}from"./url-evaluation-4RA6nhhV.js";import{E as ot}from"./Edit-DWhNMMIZ.js";import{y as it}from"./index-CFWi7Q8M.js";import{A as at}from"./Add-DyTieGiH.js";import{l as F}from"./index-Di3fMIen.js";import{C as O}from"./click-to-copy-D6M1fnDc.js";import{f as rt}from"./index-BojVbZw0.js";import{D as ct}from"./delete-confirm-C1ZQ29Q4.js";import{P as lt}from"./permission-crhdqXhd.js";import{u as dt}from"./blocklet-Ddfm_VL2.js";import{u as Z}from"./use-mobile-9H63c6Kz.js";import{A as pt}from"./actions-i2UahyAp.js";import{u as mt}from"./useAsyncRetry-CtsBX_BZ.js";import"./TableSearch-DEuaLdIb.js";import"./Search-CYv1OPLx.js";import"./Clear-DbuaJOFI.js";import"./useLocalStorage-T0_FQRxp.js";import"./index-D0uKz0V_.js";import"./decode-DPztD6kB.js";import"./UnfoldMore-I9efh077.js";import"./shorten-label-B1hTVv56.js";import"./ViewList-STBCUXtD.js";import"./use-mobile-CNA5itNx.js";import"./client-wk4MeJIg.js";import"./index-wNvsBj9G.js";import"./ButtonGroup-CzZQ8Npu.js";import"./getValidReactChildren-BImmvw4C.js";import"./index-CgWUU7yZ.js";import"./Google-CdFzL70-.js";import"./cloneDeep-C1r6zWUN.js";import"./Autocomplete-DeRVpEU5.js";import"./ListSubheader-Tf0tPSi7.js";import"./AdapterDayjs-DovOOpck.js";import"./useThemeProps-EahRu2x5.js";import"./CSSTransition-CjXLkGon.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-DAqbo3x1.js";import"./Verified-B6ag8nG6.js";import"./DeleteOutline-D-kT-jdx.js";import"./ErrorOutline-B0ozV6sd.js";import"./index-B7EJvfHM.js";import"./emotion-cache.browser.esm-CgS-LeII.js";import"./sdk-DZ3OhIyg.js";import"./index-DtIh1vFa.js";import"./edit.svg-DCbVw9zw.js";import"./list-header-Cb1uRm5G.js";import"./chain-CdexttSs.js";import"./ToggleButtonGroup-CJvpk2kD.js";import"./lock.svg-BH7_YT0q.js";import"./FilterList-CQA7G7Vn.js";import"./index-CNPrEh7K.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DQDFZSyD.js";import"./MoreVert-CDZKGaWW.js";import"./useAsync-B0Ca_r2m.js";function ee({value:s}){const{t,locale:n}=S(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:s,onChange:t,...n}){const{t:i}=S(),a=h.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(Q,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),IconComponent:r=>e.jsx(ce,{...r,width:20,height:20}),children:a.map(r=>e.jsx(J,{value:r.value,children:e.jsxs(p,{children:[e.jsx("span",{children:r.title}),e.jsx(p,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:r.description})]})},r.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const se=()=>{const s=L.RBAC_CONFIG.roles.filter(a=>a.passport),{inService:t}=I(),{roles:n}=_(),i=[...s,...t?n:[]];return Ke(i,"name").filter(a=>a.name!==L.ROLES.OWNER)};function fe(){const{session:s}=Re(),t=se();return h.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(r=>r.name==="guest");return[...t.filter(r=>r.name!=="guest").filter(r=>s.user.passports.find(f=>f.role===r.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ge({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=_(),{t:a}=S(),[r,f]=h.useState(!1),[m,b]=h.useState(null),u=fe(),T=()=>{f(!1),b(null)},v=async l=>{const{remark:k,passport:g,authType:o}=l;f(!0);const j=await n.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:g,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:o}}),{data:A}=j;s(A),b(null),f(!1)},c={title:`${a("common.create")} ${a("accessKey")}`,description:(l,k,g)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(H,{label:a("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:o=>{k({...l,remark:o.target.value,__disableConfirm:!l.passport||!o.target.value.trim()}),o.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{sx:{width:"calc(100% - 46px)"},children:a("setting.accessKey.passport")}),e.jsx(Q,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:o=>{const j=o.target.value;g(null),k({...l,passport:j,__disableConfirm:!l.remark||!j})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:r,IconComponent:o=>e.jsx(ce,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(p,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(te,{value:l.authType,onChange:o=>{k({...l,authType:o.target.value})}}),e.jsx(xe,{placeholder:a("setting.accessKey.expireTime"),value:l.expireAt,onChange:o=>{k({...l,expireAt:o,__disableConfirm:!l.passport||!l.remark||!o})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:v,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>b(c),className:"rule-action",children:[r?e.jsx(Se,{size:16}):e.jsx(at,{style:{fontSize:16}}),a("common.create")]}),m&&e.jsx(le,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:x.string,onCreate:x.func};function ye({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:a}=h.useContext(De),[r,f]=h.useState(!1),[m,b]=h.useState(()=>i),u=I(),T=()=>{b(!m)},v=g=>{f(g.target.checked)},c=E(window.location.origin,u?.info?.routing?.adminPath),l=h.useMemo(()=>i?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -1,4 +1,4 @@
1
- import{aF as de,j as e,hl as Ts,hm as Es,bM as Is,r as q,s as xe,M as $,f5 as kt,v as U,eO as ft,a3 as ie,C as Ee,bi as Bt,dL as Ds,o as T,hn as Ls,b2 as Ht,cx as qs,cQ as Ms,dp as zs,T as Y,dG as at,bn as ne,bA as mt,g as ue,ho as Bs,bB as pt,b as W,bg as G,dI as ee,H as Z,aV as ae,n as oe,q as Nt,t as Hs,x as Ft,ac as Ns,i as Zt,gi as Fs,hp as Zs,at as Vs,aU as X,U as Te,$ as ke,D as Us,V as Ws,w as re,X as it,hq as Js,hr as Ks,eA as Gs,eC as Ys,I as je,aH as J,g6 as Xs,cY as St,W as Qs,fm as Vt,ay as te,aR as Ct,hs as er,f9 as Re,cs as E,bz as ge,aD as se,P as Q,aP as ye,ht as qe,a1 as tr,hu as Je,c3 as Ce,eD as sr,hv as rr,dH as ce,f as Oe,z as Ut,bw as ot,N as nr,cE as Wt,gh as ar,fP as Ze,hw as ir,b9 as or,L as lr,cr as ze,aK as He,hx as cr,R as dr,af as Rt,a2 as Jt,bj as Ne,hy as Kt,b6 as ur,gH as we,fa as Gt,cW as Yt,E as hr,b5 as Ot,fb as fr,fg as mr,G as Ke,K as pr,bu as gr}from"./index-fifF2FyW.js";import{F as yr,a as lt,s as xr,L as _e,S as vr,B as br}from"./preference-DLFzPDO8.js";import{N as $t}from"./ChevronRight-Cap_v1qc.js";import{T as Fe}from"./html-title-CBcwzP0O.js";import{w as Ie,P as jr}from"./permission-if925jUs.js";import{u as gt}from"./index-D95Qz4OD.js";import{D as _r}from"./Done-D4_4Gmhf.js";import{R as wr,S as M}from"./collapse-mSz6lvYA.js";import{A as kr,a as At}from"./Autocomplete-DTzPpKKP.js";import{C as Sr,R as Cr,S as Rr,P as Or}from"./rotate-session-key--fFPkV5O.js";import{u as le}from"./blocklet-BLUhhQuJ.js";import{C as $r}from"./click-to-copy-CzS2KJO6.js";import{u as Ve}from"./team-MquyQUWI.js";import{v as Xt}from"./index-BjpjGoUP.js";import{g as Ar}from"./chain-C4d980k-.js";import{V as Pr,d as Tr}from"./status-CZoMrFz2.js";import{S as pe}from"./Switch-CCEATBz-.js";import{B as Er}from"./index-BaeT60Bm.js";import{y as Ir}from"./index-BTId5Ivl.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-CzdSuw55.js";import{u as ve,C as H,b as Pt}from"./index.esm-x93gmns6.js";import{S as Be,u as zr}from"./switch-control-BJLlH9bj.js";import{D as Tt,R as Qt,a as es}from"./url-evaluation-CSwxSB5J.js";import{A as Et}from"./Add-DItRD8hT.js";import{H as Ue}from"./index-DRjTE6Aa.js";import{l as Br}from"./index-xGQ9OvSX.js";import{u as ts}from"./use-mobile-V-C8ZTE7.js";import{S as Ge}from"./simple-select-Cx8Rifji.js";import{G as Hr}from"./actions-BFVrQ8dq.js";import{C as Nr}from"./CardContent-BhLNX_6W.js";import"./omit-CIssTx-S.js";import"./index-C_IsnknD.js";import"./edit.svg-B2xfqD5T.js";import"./ArrowDropDown-D9CDJDee.js";import"./ButtonGroup-fE_sAFXd.js";import"./getValidReactChildren-B144ChcV.js";import"./index-BFB2WIzs.js";import"./iframe-MaiD-uXS.js";import"./ListSubheader-BmA89Ccv.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-ByEltPMY.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-hQMSrEvV.js";import"./CSSTransition-2GLd-U2B.js";import"./emotion-cache.browser.esm-Cb8UHF8_.js";import"./depsEqual-5RWUMijK.js";import"./TableSearch-BNfAQQQc.js";import"./Search-DvsqADee.js";import"./Clear-D3ljia7f.js";import"./MoreVert-BB0EapQ9.js";import"./useLocalStorage-BeAHV6We.js";import"./get-safe-url-DLG8kU6z.js";const ss=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),rs=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,It=Qr.splice;function en(v,R,O,C){var _=Es,j=-1,p=R.length,a=v;for(v===R&&(R=Ts(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==v&&It.call(a,m,1),It.call(v,m,1);return v}function tn(v,R){return v&&v.length&&R&&R.length?en(v,R):v}var sn=Is(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function ns({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const B={};return m.forEach(I=>{B[I.code]=I}),B},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const B=new RegExp(y.toLowerCase());return m.filter(I=>{for(let z=0;z<r.length;z++){const F=r[z];if(B.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),i(!1)}},D=(B,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const z=I.filter(F=>A[F]);if(!z.length){S([]),_([]);return}S(z),_(z)},N=B=>{B.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(B,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:B=>A[B]?.name,renderInput:B=>e.jsx(U,{...B,label:"",placeholder:t}),renderOption:(B,I)=>{const z=b.indexOf(I)!==-1;return q.createElement(nn,{component:"li",...B,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:z?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:z?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(B=>m.some(I=>I.code===B)).map(B=>e.jsx(ft,{label:m.find(I=>I.code===B).name,style:{marginRight:8},size:"small"},B))});return e.jsx(yr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(wr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ie,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ie,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(Bt,{children:h})]})})}ns.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=xe.div`
1
+ import{aF as de,j as e,hl as Ts,hm as Es,bM as Is,r as q,s as xe,M as $,f5 as kt,v as U,eO as ft,a3 as ie,C as Ee,bi as Bt,dL as Ds,o as T,hn as Ls,b2 as Ht,cx as qs,cQ as Ms,dp as zs,T as Y,dG as at,bn as ne,bA as mt,g as ue,ho as Bs,bB as pt,b as W,bg as G,dI as ee,H as Z,aV as ae,n as oe,q as Nt,t as Hs,x as Ft,ac as Ns,i as Zt,gi as Fs,hp as Zs,at as Vs,aU as X,U as Te,$ as ke,D as Us,V as Ws,w as re,X as it,hq as Js,hr as Ks,eA as Gs,eC as Ys,I as je,aH as J,g6 as Xs,cY as St,W as Qs,fm as Vt,ay as te,aR as Ct,hs as er,f9 as Re,cs as E,bz as ge,aD as se,P as Q,aP as ye,ht as qe,a1 as tr,hu as Je,c3 as Ce,eD as sr,hv as rr,dH as ce,f as Oe,z as Ut,bw as ot,N as nr,cE as Wt,gh as ar,fP as Ze,hw as ir,b9 as or,L as lr,cr as ze,aK as He,hx as cr,R as dr,af as Rt,a2 as Jt,bj as Ne,hy as Kt,b6 as ur,gH as we,fa as Gt,cW as Yt,E as hr,b5 as Ot,fb as fr,fg as mr,G as Ke,K as pr,bu as gr}from"./index-DGSsefUZ.js";import{F as yr,a as lt,s as xr,L as _e,S as vr,B as br}from"./preference-BNQQaSX0.js";import{N as $t}from"./ChevronRight-o-pKt_xW.js";import{T as Fe}from"./html-title-C4Q1l9hV.js";import{w as Ie,P as jr}from"./permission-crhdqXhd.js";import{u as gt}from"./index-CgWUU7yZ.js";import{D as _r}from"./Done-C2ulOvk7.js";import{R as wr,S as M}from"./collapse-D2q_m0jc.js";import{A as kr,a as At}from"./Autocomplete-DeRVpEU5.js";import{C as Sr,R as Cr,S as Rr,P as Or}from"./rotate-session-key-DTg7AVbr.js";import{u as le}from"./blocklet-Ddfm_VL2.js";import{C as $r}from"./click-to-copy-D6M1fnDc.js";import{u as Ve}from"./team-ouIwaQum.js";import{v as Xt}from"./index-DAqbo3x1.js";import{g as Ar}from"./chain-CdexttSs.js";import{V as Pr,d as Tr}from"./status-DYjJgZF9.js";import{S as pe}from"./Switch-CJCk9M4e.js";import{B as Er}from"./index-1ecJNhOT.js";import{y as Ir}from"./index-CFWi7Q8M.js";import{I as Dr,J as Lr,K as qr,L as Mr}from"./index-CNPrEh7K.js";import{u as ve,C as H,b as Pt}from"./index.esm-Lk0YHlgv.js";import{S as Be,u as zr}from"./switch-control-HQMK5p78.js";import{D as Tt,R as Qt,a as es}from"./url-evaluation-4RA6nhhV.js";import{A as Et}from"./Add-DyTieGiH.js";import{H as Ue}from"./index-bK6g80kL.js";import{l as Br}from"./index-Di3fMIen.js";import{u as ts}from"./use-mobile-9H63c6Kz.js";import{S as Ge}from"./simple-select-Cdud---B.js";import{G as Hr}from"./actions-0xA8jgJe.js";import{C as Nr}from"./CardContent-CpM-_HeI.js";import"./omit-Cd7qywqq.js";import"./index-Bi1dCbDw.js";import"./edit.svg-DCbVw9zw.js";import"./ArrowDropDown-BFKf-Ws9.js";import"./ButtonGroup-CzZQ8Npu.js";import"./getValidReactChildren-BImmvw4C.js";import"./index-BRdnv7Wp.js";import"./iframe-DMkrJLov.js";import"./ListSubheader-Tf0tPSi7.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-B0ozV6sd.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-CQA7G7Vn.js";import"./CSSTransition-CjXLkGon.js";import"./emotion-cache.browser.esm-CgS-LeII.js";import"./depsEqual-DQDFZSyD.js";import"./TableSearch-DEuaLdIb.js";import"./Search-CYv1OPLx.js";import"./Clear-DbuaJOFI.js";import"./MoreVert-CDZKGaWW.js";import"./useLocalStorage-T0_FQRxp.js";import"./get-safe-url-BjFdr4OL.js";const ss=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),rs=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,It=Qr.splice;function en(v,R,O,C){var _=Es,j=-1,p=R.length,a=v;for(v===R&&(R=Ts(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(a,h,m))>-1;)a!==v&&It.call(a,m,1),It.call(v,m,1);return v}function tn(v,R){return v&&v.length&&R&&R.length?en(v,R):v}var sn=Is(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function ns({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:a=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,i]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const B={};return m.forEach(I=>{B[I.code]=I}),B},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const B=new RegExp(y.toLowerCase());return m.filter(I=>{for(let z=0;z<r.length;z++){const F=r[z];if(B.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),i(!1)}},D=(B,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const z=I.filter(F=>A[F]);if(!z.length){S([]),_([]);return}S(z),_(z)},N=B=>{B.stopPropagation(),i(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(kr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(B,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:B=>A[B]?.name,renderInput:B=>e.jsx(U,{...B,label:"",placeholder:t}),renderOption:(B,I)=>{const z=b.indexOf(I)!==-1;return q.createElement(nn,{component:"li",...B,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:z?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:z?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(B=>m.some(I=>I.code===B)).map(B=>e.jsx(ft,{label:m.find(I=>I.code===B).name,style:{marginRight:8},size:"small"},B))});return e.jsx(yr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(wr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ie,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(_r,{})}),e.jsx(ie,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),i(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(Bt,{children:h})]})})}ns.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=xe.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;