@abtnode/webapp 1.16.47-beta-20250724-080141-d80ab374 → 1.16.47-beta-20250725-140845-15481a97

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 (211) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-B4V244DK.js → AdapterDayjs-DPTb1mSQ.js} +1 -1
  4. package/dist/assets/{Add-DNK3-YER.js → Add-DD8MScAx.js} +1 -1
  5. package/dist/assets/ArrowDropDown-B4JFpTo9.js +1 -0
  6. package/dist/assets/{Autocomplete-BWhtsDmg.js → Autocomplete-Cq435hZq.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-BcoAUzZm.js → Breadcrumbs-C9jZiry0.js} +1 -1
  8. package/dist/assets/{ButtonGroup-CO-3Gd2r.js → ButtonGroup-Dk6oPkTY.js} +1 -1
  9. package/dist/assets/{CSSTransition-DVvLNPEG.js → CSSTransition-C1fvxvPN.js} +1 -1
  10. package/dist/assets/{CallMerge-CO7O6BIP.js → CallMerge-D9hyidIF.js} +1 -1
  11. package/dist/assets/{CardContent-CRWKEGyT.js → CardContent-D9MyeTia.js} +1 -1
  12. package/dist/assets/{ChevronLeft-BmUpUTH_.js → ChevronLeft-Cn84uWzO.js} +1 -1
  13. package/dist/assets/{ChevronRight-DDhIWK8t.js → ChevronRight-Cfe9Ltow.js} +1 -1
  14. package/dist/assets/{Clear-B_fV2Y4r.js → Clear-BwooXVqX.js} +1 -1
  15. package/dist/assets/{DeleteOutline-CHPUiy2-.js → DeleteOutline-D435DmAa.js} +1 -1
  16. package/dist/assets/{Done-Cz6nN-bV.js → Done-Dvvf3-WX.js} +1 -1
  17. package/dist/assets/{Edit-Car5frKm.js → Edit-CdxfETzo.js} +1 -1
  18. package/dist/assets/{ErrorOutline-BPdDMUCb.js → ErrorOutline-XMmhDF6k.js} +1 -1
  19. package/dist/assets/{FilterList-CkOj30Dt.js → FilterList-CMsi8nwW.js} +1 -1
  20. package/dist/assets/{Google-CJdW8TVA.js → Google-RkdWLWhs.js} +1 -1
  21. package/dist/assets/{HelpOutline-Qg9I2LLo.js → HelpOutline-hrNaaelS.js} +1 -1
  22. package/dist/assets/{Launch-CZLWPIfP.js → Launch-BxhXypAR.js} +1 -1
  23. package/dist/assets/{Link-BQnmEzFa.js → Link-Dp2yV4ZC.js} +1 -1
  24. package/dist/assets/{ListItemButton-D4jvuJIP.js → ListItemButton-VMszpmME.js} +1 -1
  25. package/dist/assets/{ListSubheader-B1S4gfd7.js → ListSubheader-DmKGdU_q.js} +1 -1
  26. package/dist/assets/{LoadingButton-CCUOcwg2.js → LoadingButton-CXSzlafJ.js} +1 -1
  27. package/dist/assets/{MoreVert-BbI3jg4_.js → MoreVert-Coua8qOx.js} +1 -1
  28. package/dist/assets/{OpenInNew-D_vS6EnU.js → OpenInNew-CKR-Uc6r.js} +1 -1
  29. package/dist/assets/{Refresh-C_5ivjcA.js → Refresh-7Vv0mUfT.js} +1 -1
  30. package/dist/assets/{Search-D4YbOYOK.js → Search-bAJjS7Xv.js} +1 -1
  31. package/dist/assets/{Slider-DnheougG.js → Slider-Dv-x7QDz.js} +1 -1
  32. package/dist/assets/{Stepper-Dy98Hr8q.js → Stepper-D1SqN5Ci.js} +1 -1
  33. package/dist/assets/{Switch-DHHERzZ6.js → Switch--S3Uh1XY.js} +1 -1
  34. package/dist/assets/{TableSearch-23MMpd51.js → TableSearch-DbCt9XJz.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-BcSbqmBs.js → ToggleButtonGroup-CX-Av2Om.js} +1 -1
  36. package/dist/assets/{Verified-C6qIp--t.js → Verified-BQeezku1.js} +1 -1
  37. package/dist/assets/{VerifiedUser-Bg3Gv2Vm.js → VerifiedUser-RW47UR2w.js} +1 -1
  38. package/dist/assets/{ViewList-cT0wwN-5.js → ViewList-DqYPCI-E.js} +1 -1
  39. package/dist/assets/{_createAggregator-DFMM18eQ.js → _createAggregator-5Fftcexu.js} +1 -1
  40. package/dist/assets/{actions-Bme9nBfF.js → actions-D64g1c7L.js} +1 -1
  41. package/dist/assets/{actions-CdUK4R4K.js → actions-Ov9HmpEw.js} +1 -1
  42. package/dist/assets/{agreement-B7_hHdi9.js → agreement-mN9UPuLB.js} +1 -1
  43. package/dist/assets/api-DKIvFibS.js +1 -0
  44. package/dist/assets/{appearance-BAU75gwY.js → appearance-DfTpAXr4.js} +1 -1
  45. package/dist/assets/{ar-CcCysAXs.js → ar-C6feXgCU.js} +3 -3
  46. package/dist/assets/{audit-logs-BRCxlOPX.js → audit-logs-thBiWriP.js} +1 -1
  47. package/dist/assets/{base-chart-CoPrXOgN.js → base-chart-BGirt4Mn.js} +1 -1
  48. package/dist/assets/{blocklet-DxxuDtDd.js → blocklet-DLDh_xx4.js} +1 -1
  49. package/dist/assets/{chain-CzJs2FaF.js → chain-DZ88My0U.js} +1 -1
  50. package/dist/assets/{click-to-copy-BpGKSPIq.js → click-to-copy-Btn7osS5.js} +1 -1
  51. package/dist/assets/client-dGp_pJel.js +1 -0
  52. package/dist/assets/cloneDeep-C1g_DWn4.js +1 -0
  53. package/dist/assets/{collapse-DDx3Se-u.js → collapse-cq9L6hiJ.js} +1 -1
  54. package/dist/assets/{config-navigation-_EYoDYyK.js → config-navigation-RcB2NlQw.js} +3 -3
  55. package/dist/assets/{connect-to-DK3YrVRl.js → connect-to-DS_CTXt7.js} +1 -1
  56. package/dist/assets/{cssMode-wlscPrk9.js → cssMode-CYe1WWE4.js} +1 -1
  57. package/dist/assets/de-Bac37XGJ.js +7 -0
  58. package/dist/assets/{delete-confirm-BpzBze8z.js → delete-confirm-C_IV5rS4.js} +1 -1
  59. package/dist/assets/{depsEqual-D4qhf48v.js → depsEqual-C35aJ6fX.js} +1 -1
  60. package/dist/assets/{detail-rHECq0CZ.js → detail-znyX61zh.js} +3 -3
  61. package/dist/assets/{domains-DJbBkJa2.js → domains-Yfo-yUpa.js} +1 -1
  62. package/dist/assets/{download-MY8FKHA1.js → download-DUWhW0i0.js} +1 -1
  63. package/dist/assets/emotion-cache.browser.esm-D-8-5Qqp.js +1 -0
  64. package/dist/assets/engine-NE_bcM5l.js +1 -0
  65. package/dist/assets/es-yR0ybdzc.js +9 -0
  66. package/dist/assets/fr-Ck_83QEV.js +7 -0
  67. package/dist/assets/{freemarker2-Qqfk0nUi.js → freemarker2-DrXLqJsQ.js} +1 -1
  68. package/dist/assets/{get-safe-url-vKpbgfEn.js → get-safe-url-WrjxIbow.js} +1 -1
  69. package/dist/assets/getValidReactChildren-kYI4jRgi.js +1 -0
  70. package/dist/assets/{graphqlMode-DcGinoEv.js → graphqlMode-0yg_NoI5.js} +2 -2
  71. package/dist/assets/{handlebars-DPShQ3J3.js → handlebars-DocVoj5v.js} +1 -1
  72. package/dist/assets/hi-uFi-fD-h.js +5 -0
  73. package/dist/assets/{html-DY7vjcfj.js → html-CAvnDX7h.js} +1 -1
  74. package/dist/assets/{htmlMode-BXbbLmnG.js → htmlMode-CMbQMo4p.js} +1 -1
  75. package/dist/assets/{id-CsK9Cnbo.js → id-vCjhjvq0.js} +3 -3
  76. package/dist/assets/{iframe-BW1FqOmD.js → iframe-TuMfzu_u.js} +1 -1
  77. package/dist/assets/{index-Cw7or6L8.js → index-2CtjRwN7.js} +1 -1
  78. package/dist/assets/index-2lwNEw4H.js +163 -0
  79. package/dist/assets/{index-CeqGY73Y.js → index-7gsNWNx1.js} +1 -1
  80. package/dist/assets/{index-BwktDBoi.js → index-B-SpV4Ip.js} +1 -1
  81. package/dist/assets/{index-t1zsNxNX.js → index-B3BB7eqU.js} +3 -3
  82. package/dist/assets/{index-COCoWUpw.js → index-B5U6Xhkj.js} +1 -1
  83. package/dist/assets/{index-CSCzsyNv.js → index-BRYl-UyK.js} +1 -1
  84. package/dist/assets/{index-Bt3HuVYr.js → index-BbdsGvpI.js} +1 -1
  85. package/dist/assets/{index-B-8VRY8W.js → index-Bc4XPWC3.js} +1 -1
  86. package/dist/assets/{index-DaR-YDyo.js → index-Bhz6YZ5l.js} +1 -1
  87. package/dist/assets/{index-CFlheGNL.js → index-Bj6H1B4Z.js} +1 -1
  88. package/dist/assets/{index-DJDK0L2i.js → index-BjLMysVB.js} +9 -9
  89. package/dist/assets/{index-1ieYcci9.js → index-ByZzQ0r1.js} +11 -11
  90. package/dist/assets/{index-BUwi80JW.js → index-ByyGaJQC.js} +1 -1
  91. package/dist/assets/{index-C_WfbPqz.js → index-C4IrPGjb.js} +1 -1
  92. package/dist/assets/{index-BJ1o6C6U.js → index-C6IrCCvU.js} +1 -1
  93. package/dist/assets/{index-B_8mJR1J.js → index-C8B19Suz.js} +1 -1
  94. package/dist/assets/{index-DB7mpC0v.js → index-C99CaRqd.js} +1 -1
  95. package/dist/assets/{index-CJlHEguG.js → index-CK_w-RKC.js} +1 -1
  96. package/dist/assets/{index-VQBAFIvA.js → index-CKc942wN.js} +2 -2
  97. package/dist/assets/{index-DdT_Bsba.js → index-CLJo_ZRf.js} +3 -3
  98. package/dist/assets/index-CTMvQBXJ.js +120 -0
  99. package/dist/assets/{index-B9R-XK-O.js → index-CUsQzTM0.js} +1 -1
  100. package/dist/assets/{index-55LTi2YM.js → index-CVe26v9m.js} +1 -1
  101. package/dist/assets/index-CaSqDrQJ.js +20 -0
  102. package/dist/assets/{index-7YlHxq_1.js → index-CdLaBL6r.js} +3 -3
  103. package/dist/assets/{index-M7TMcTCW.js → index-CfDErAp8.js} +1 -1
  104. package/dist/assets/{index-B6aOKE2k.js → index-CmOss_WU.js} +1 -1
  105. package/dist/assets/{index-DJNEdvwh.js → index-CvXrq2y2.js} +1 -1
  106. package/dist/assets/{index-DX2TiS2s.js → index-Cvuv-dHw.js} +2 -2
  107. package/dist/assets/index-Cx9Rxh8C.js +1 -0
  108. package/dist/assets/{index-BHKwO-Qo.js → index-D5FJgsNk.js} +3 -3
  109. package/dist/assets/{index-n2PU-CcY.js → index-D5wD9tqC.js} +1 -1
  110. package/dist/assets/{index-B9csEnaJ.js → index-DAyHEo4e.js} +1 -1
  111. package/dist/assets/{index-3-XTQAjW.js → index-DIhjnyYK.js} +1 -1
  112. package/dist/assets/{index-BGjHw-jQ.js → index-DSmIN8Lk.js} +90 -90
  113. package/dist/assets/{index-B8gA92Dw.js → index-DWHdpvDd.js} +1 -1
  114. package/dist/assets/{index-DWsUER_c.js → index-Dv8OKOCm.js} +1 -1
  115. package/dist/assets/{index-DSIZ4WUJ.js → index-DxKjLuQU.js} +1 -1
  116. package/dist/assets/{index-CS2c1-99.js → index-DzJlUXPN.js} +1 -1
  117. package/dist/assets/{index-Bbktq9jr.js → index-GypVneLV.js} +1 -1
  118. package/dist/assets/{index-BoSKx-3H.js → index-LF8taadH.js} +1 -1
  119. package/dist/assets/{index-C6e7bjfS.js → index-S5q_uMQU.js} +1 -1
  120. package/dist/assets/{index-BjYZKyD9.js → index-WwrDUgja.js} +1 -1
  121. package/dist/assets/{index-DcIaMKCn.js → index-cF_RbLJB.js} +1 -1
  122. package/dist/assets/{index-B85k3I0z.js → index-eQNvctSG.js} +1 -1
  123. package/dist/assets/{index-C2RM00E5.js → index-q_hTfpTA.js} +1 -1
  124. package/dist/assets/{index.esm-DjyjR9DX.js → index.esm-B9eKOJrD.js} +1 -1
  125. package/dist/assets/{install-from-url-50WHkmcy.js → install-from-url-Catd2dIx.js} +1 -1
  126. package/dist/assets/{invitation-BMRfRUNn.js → invitation-DdYhUro0.js} +1 -1
  127. package/dist/assets/{is-path-prefix-equal-DZF3zLXU.js → is-path-prefix-equal-QFrFkcRe.js} +1 -1
  128. package/dist/assets/{item-CmUJpRUG.js → item-HR0eNm12.js} +1 -1
  129. package/dist/assets/{ja-bb6qPt27.js → ja-BpmpH32u.js} +3 -3
  130. package/dist/assets/{javascript-Dru_doUe.js → javascript-CdfhYZK0.js} +1 -1
  131. package/dist/assets/{jsonMode-CKIXu-eI.js → jsonMode-BCBLnATI.js} +1 -1
  132. package/dist/assets/{ko-DxiDEd1I.js → ko-KPtXpJmI.js} +3 -3
  133. package/dist/assets/{liquid-BQFDIANO.js → liquid-O2GLjFyj.js} +1 -1
  134. package/dist/assets/{list-header-hmApugaf.js → list-header-BXNq7AiD.js} +1 -1
  135. package/dist/assets/{log-ffg9hr-o.js → log-CWLio4EI.js} +1 -1
  136. package/dist/assets/{lottie-react.esm-B2dXnGld.js → lottie-react.esm-CQpDaqeX.js} +1 -1
  137. package/dist/assets/{mdx-B11M142O.js → mdx-BrLzyMAp.js} +1 -1
  138. package/dist/assets/{memory-o3keM0c3.js → memory-xjGb5J-2.js} +1 -1
  139. package/dist/assets/{metric-rYGW-9vt.js → metric-srGkHZo_.js} +1 -1
  140. package/dist/assets/omit-CblnAea-.js +1 -0
  141. package/dist/assets/{overview-Cvbqap03.js → overview-B0FHoD2J.js} +1 -1
  142. package/dist/assets/{permission-C1RZ4tb5.js → permission-D8AA2j8a.js} +1 -1
  143. package/dist/assets/{preference-CWp52IT1.js → preference-qUkBQeHJ.js} +3 -3
  144. package/dist/assets/pt-DMhdW8tM.js +5 -0
  145. package/dist/assets/{python-BFjKNPTF.js → python-CoQw-E4H.js} +1 -1
  146. package/dist/assets/{raf-schd.esm-BNXK89xb.js → raf-schd.esm-wby_E5ZF.js} +1 -1
  147. package/dist/assets/{razor-C10JZg4P.js → razor-BDeR06dV.js} +1 -1
  148. package/dist/assets/{rotate-session-key-CH6BtiuM.js → rotate-session-key-Dl3UmPcz.js} +1 -1
  149. package/dist/assets/ru-iMSChq7P.js +5 -0
  150. package/dist/assets/{runtime-BddJCu2Z.js → runtime-D1Pjlk5o.js} +1 -1
  151. package/dist/assets/schema-BTObaR2x.js +1 -0
  152. package/dist/assets/sdk-CKMexl7S.js +1 -0
  153. package/dist/assets/{service-I_BVIRjC.js → service-DF_6raHa.js} +1 -1
  154. package/dist/assets/{shorten-label-C0nC06EK.js → shorten-label-CQ2mcJGL.js} +1 -1
  155. package/dist/assets/{simple-select-Dq4eH3Z5.js → simple-select-CaAamOhK.js} +1 -1
  156. package/dist/assets/{spaces-TN4UdKD7.js → spaces-Cw5dyT82.js} +1 -1
  157. package/dist/assets/{status-MhdxvHuN.js → status-D54K3RUR.js} +1 -1
  158. package/dist/assets/{status-DKWcjPi5.js → status-bhklMhAj.js} +1 -1
  159. package/dist/assets/{switch-control-xi5xOnff.js → switch-control-DFulS16M.js} +1 -1
  160. package/dist/assets/{table-icons-DAQhRile.js → table-icons-BfWw05z2.js} +1 -1
  161. package/dist/assets/{team-oS0T7K1r.js → team-BLrn7VS2.js} +1 -1
  162. package/dist/assets/th-DbMd7IRR.js +5 -0
  163. package/dist/assets/{toLower-5ro7hWGW.js → toLower-Cfpyt4eW.js} +1 -1
  164. package/dist/assets/toUpper-C8HDO4pv.js +1 -0
  165. package/dist/assets/{traffic-CnPSz4wt.js → traffic-D5lH-Qti.js} +1 -1
  166. package/dist/assets/{tsMode-uM8D-X_Z.js → tsMode-D4ysns_Y.js} +1 -1
  167. package/dist/assets/{typescript-B0Y5UsPY.js → typescript-tlISCoEP.js} +1 -1
  168. package/dist/assets/{url-evaluation-CkF_rVJP.js → url-evaluation-CnxlGDaY.js} +1 -1
  169. package/dist/assets/{url-join-B2I2wiTE.js → url-join-CmQWf24D.js} +1 -1
  170. package/dist/assets/{use-mobile-CrxQdGcZ.js → use-mobile-D73gcDpA.js} +1 -1
  171. package/dist/assets/{use-mobile-Bi2nMTFx.js → use-mobile-Du8kf9CZ.js} +1 -1
  172. package/dist/assets/{useAsync-CAkfYwzQ.js → useAsync-CdFxv1Yw.js} +1 -1
  173. package/dist/assets/{useAsyncRetry-q3S75JEr.js → useAsyncRetry-BkYf8OA3.js} +1 -1
  174. package/dist/assets/{useLocalStorage-DemYxCTT.js → useLocalStorage-DTDaPcMQ.js} +1 -1
  175. package/dist/assets/{useThemeProps-CTl-EdJ3.js → useThemeProps-FM7Bl9Z4.js} +1 -1
  176. package/dist/assets/{util-CcL4yrb2.js → util-DVAAYq4O.js} +1 -1
  177. package/dist/assets/vi-CmYRzn_U.js +5 -0
  178. package/dist/assets/{wait-container-ClHfAptV.js → wait-container-DbcHCshY.js} +1 -1
  179. package/dist/assets/{without-wallet-CuWFjKH0.js → without-wallet-yCrd-wY2.js} +1 -1
  180. package/dist/assets/wrap-locale-B1w0mMGL.js +1 -0
  181. package/dist/assets/{xml-DXorBSx3.js → xml-CkjYbaAI.js} +1 -1
  182. package/dist/assets/{yaml-nd1Neb2K.js → yaml-D5gmQkdY.js} +1 -1
  183. package/dist/assets/{zh-DkzyaEBh.js → zh-Dz39CLak.js} +3 -3
  184. package/dist/assets/{zh-tw-BNjyxfNh.js → zh-tw-CCltfULq.js} +3 -3
  185. package/dist/index.html +1 -1
  186. package/dist/service-worker.js +1 -1
  187. package/package.json +1 -1
  188. package/dist/assets/ArrowDropDown-BCAdjBjK.js +0 -1
  189. package/dist/assets/api-Ck-zvycJ.js +0 -1
  190. package/dist/assets/client-C-vk08Vn.js +0 -1
  191. package/dist/assets/cloneDeep-Dkfm8VBo.js +0 -1
  192. package/dist/assets/de-BTXwRUYy.js +0 -7
  193. package/dist/assets/emotion-cache.browser.esm-DbJKstH3.js +0 -1
  194. package/dist/assets/engine-Cfb30esF.js +0 -1
  195. package/dist/assets/es-DCyLy_vM.js +0 -9
  196. package/dist/assets/fr-CNGOyo0v.js +0 -7
  197. package/dist/assets/getValidReactChildren-a3_fEqAv.js +0 -1
  198. package/dist/assets/hi-DsFnKfzk.js +0 -5
  199. package/dist/assets/index-B-Y0AnSu.js +0 -20
  200. package/dist/assets/index-B35ISoUS.js +0 -1
  201. package/dist/assets/index-CVcwZKHE.js +0 -120
  202. package/dist/assets/index-Dr8YnekS.js +0 -163
  203. package/dist/assets/omit-CXboSI2N.js +0 -1
  204. package/dist/assets/pt-Yj5llJx7.js +0 -5
  205. package/dist/assets/ru-DaVu35Yr.js +0 -5
  206. package/dist/assets/schema-DyznD-qm.js +0 -1
  207. package/dist/assets/sdk-DTvEp2g_.js +0 -1
  208. package/dist/assets/th-DEoqTEHf.js +0 -5
  209. package/dist/assets/toUpper-BSy5KpPm.js +0 -1
  210. package/dist/assets/vi-D7Q19sbd.js +0 -5
  211. package/dist/assets/wrap-locale-DOGf8_5t.js +0 -1
@@ -1 +1 @@
1
- import{eD as U}from"./index-BGjHw-jQ.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){j(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,G):j(w[0][2],u)}function z(u){I("next",u)}function G(u){I("throw",u)}function j(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:G=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:j=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:D,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof U<"u"?T=U.WebSocket||U.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,B=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await G(B),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});B++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function F(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},D)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),F()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?F():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,B=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||B>=z||!j(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const F=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},D)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},D)),k--,o=!0,x()},await _.finally(F);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
1
+ import{eD as U}from"./index-DSmIN8Lk.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){j(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,G):j(w[0][2],u)}function z(u){I("next",u)}function G(u){I("throw",u)}function j(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:G=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:j=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:D,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof U<"u"?T=U.WebSocket||U.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,B=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await G(B),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});B++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function F(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},D)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),F()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?F():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,B=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||B>=z||!j(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const F=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},D)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},D)),k--,o=!0,x()},await _.finally(F);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
@@ -1,4 +1,4 @@
1
- import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as H,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eK as Fe,Q as Pe,ic as Ye,bj as Te,aU as Ie,V as Ee,dE as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,eY as Je,aP as De,W as yt,at as Ze,id as et,v as Oe,e_ as tt,fo as ye,fE as st,dy as St,s as ie,ag as pe,G as qe,av as vt,ie as Ct,ig as Nt,$ as nt,ih as wt,ii as Rt,ij as Tt,ik as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,il as Lt,a4 as kt}from"./index-BGjHw-jQ.js";import{d as Ft,H as at,g as Pt}from"./index-B8gA92Dw.js";import{R as _e,S as _t}from"./actions-CdUK4R4K.js";import{B as Bt}from"./index-3-XTQAjW.js";import{S as me}from"./shorten-label-C0nC06EK.js";import{v as ot}from"./index-n2PU-CcY.js";import{T as zt}from"./index-DWsUER_c.js";import{R as Wt}from"./Refresh-C_5ivjcA.js";import{D as Mt,g as Kt}from"./traffic-CnPSz4wt.js";import{u as Ht}from"./use-mobile-Bi2nMTFx.js";import"./FilterList-CkOj30Dt.js";import"./CSSTransition-DVvLNPEG.js";import"./emotion-cache.browser.esm-DbJKstH3.js";import"./index-Cw7or6L8.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D4qhf48v.js";import"./index-B_8mJR1J.js";import"./TableSearch-23MMpd51.js";import"./Search-D4YbOYOK.js";import"./Clear-B_fV2Y4r.js";import"./MoreVert-BbI3jg4_.js";import"./useLocalStorage-DemYxCTT.js";import"./url-evaluation-CkF_rVJP.js";import"./get-safe-url-vKpbgfEn.js";import"./ButtonGroup-CO-3Gd2r.js";import"./getValidReactChildren-a3_fEqAv.js";import"./permission-C1RZ4tb5.js";import"./index.esm-DjyjR9DX.js";import"./collapse-DDx3Se-u.js";import"./blocklet-DxxuDtDd.js";import"./Switch-DHHERzZ6.js";import"./iframe-BW1FqOmD.js";import"./ChevronLeft-BmUpUTH_.js";import"./ChevronRight-DDhIWK8t.js";import"./index-DBii9-f-.js";import"./base-chart-CoPrXOgN.js";import"./index-BjYZKyD9.js";import"./AdapterDayjs-B4V244DK.js";import"./useThemeProps-CTl-EdJ3.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),qt=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 q.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}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).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 q.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:U,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){q.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){q.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:[Ue(t[0],n)," - ",Ue(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,U]=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){q.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,U(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){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.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}}U({channel:c});try{const K=await oe(c,o.receiver);await be(1),U({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){q.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(qt,{}):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(Ut,{}),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{aG as Ge,j as e,bn as gt,r as g,by as X,bf as H,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eK as Fe,Q as Pe,ic as Ye,bj as Te,aU as Ie,V as Ee,dE as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,eY as Je,aP as De,W as yt,at as Ze,id as et,v as Oe,e_ as tt,fo as ye,fE as st,dy as St,s as ie,ag as pe,G as qe,av as vt,ie as Ct,ig as Nt,$ as nt,ih as wt,ii as Rt,ij as Tt,ik as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,il as Lt,a4 as kt}from"./index-DSmIN8Lk.js";import{d as Ft,H as at,g as Pt}from"./index-DWHdpvDd.js";import{R as _e,S as _t}from"./actions-Ov9HmpEw.js";import{B as Bt}from"./index-DIhjnyYK.js";import{S as me}from"./shorten-label-CQ2mcJGL.js";import{v as ot}from"./index-D5wD9tqC.js";import{T as zt}from"./index-Dv8OKOCm.js";import{R as Wt}from"./Refresh-7Vv0mUfT.js";import{D as Mt,g as Kt}from"./traffic-D5lH-Qti.js";import{u as Ht}from"./use-mobile-Du8kf9CZ.js";import"./FilterList-CMsi8nwW.js";import"./CSSTransition-C1fvxvPN.js";import"./emotion-cache.browser.esm-D-8-5Qqp.js";import"./index-2CtjRwN7.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C35aJ6fX.js";import"./index-C8B19Suz.js";import"./TableSearch-DbCt9XJz.js";import"./Search-bAJjS7Xv.js";import"./Clear-BwooXVqX.js";import"./MoreVert-Coua8qOx.js";import"./useLocalStorage-DTDaPcMQ.js";import"./url-evaluation-CnxlGDaY.js";import"./get-safe-url-WrjxIbow.js";import"./ButtonGroup-Dk6oPkTY.js";import"./getValidReactChildren-kYI4jRgi.js";import"./permission-D8AA2j8a.js";import"./index.esm-B9eKOJrD.js";import"./collapse-cq9L6hiJ.js";import"./blocklet-DLDh_xx4.js";import"./Switch--S3Uh1XY.js";import"./iframe-TuMfzu_u.js";import"./ChevronLeft-Cn84uWzO.js";import"./ChevronRight-Cfe9Ltow.js";import"./index-DBii9-f-.js";import"./base-chart-BGirt4Mn.js";import"./index-WwrDUgja.js";import"./AdapterDayjs-DPTb1mSQ.js";import"./useThemeProps-FM7Bl9Z4.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),qt=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 q.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}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).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 q.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:U,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){q.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){q.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:[Ue(t[0],n)," - ",Ue(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,U]=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){q.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,U(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){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.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}}U({channel:c});try{const K=await oe(c,o.receiver);await be(1),U({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){q.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(qt,{}):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(Ut,{}),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{dD as b,r as o,U as d,j as e,dE as c,b5 as C,dF as E,bu as I,dG as z,dc as u,dH as A}from"./index-BGjHw-jQ.js";import{B as L}from"./ButtonGroup-CO-3Gd2r.js";function P({...r}){const{size:m="medium",color:i="primary",menu:a=[],children:s=null,variant:p="contained",onClick:x=b,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},M=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:p,size:m,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(C,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(E,{children:e.jsx(I,{onClickAway:M,children:e.jsx(z,{onClick:k,children:g})})})})]})}P.Item=d;const v=u(L)`
1
+ import{dD as b,r as o,U as d,j as e,dE as c,b5 as C,dF as E,bu as I,dG as z,dc as u,dH as A}from"./index-DSmIN8Lk.js";import{B as L}from"./ButtonGroup-Dk6oPkTY.js";function P({...r}){const{size:m="medium",color:i="primary",menu:a=[],children:s=null,variant:p="contained",onClick:x=b,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},M=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:p,size:m,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(C,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(E,{children:e.jsx(I,{onClickAway:M,children:e.jsx(z,{onClick:k,children:g})})})})]})}P.Item=d;const v=u(L)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1,4 +1,4 @@
1
- import{r as l,j as t,N as o,dc as c,o as n}from"./index-BGjHw-jQ.js";const h=e=>l.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),m=c(o)`
1
+ import{r as l,j as t,N as o,dc as c,o as n}from"./index-DSmIN8Lk.js";const h=e=>l.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),m=c(o)`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index-BGjHw-jQ.js";import{w as b}from"./wrap-locale-DOGf8_5t.js";import{g as L}from"./get-safe-url-vKpbgfEn.js";function B({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(B);function K(){const{info:n}=S(),a=U(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:v,webWalletUrl:a,onSuccess:r})}export{K as default};
1
+ import{r as P,m as E,A as C,j as e,Z as W,C as j,cB as I,N as T,w as k,H as u,E as N,u as S,x as U,ar as v,af as R}from"./index-DSmIN8Lk.js";import{w as b}from"./wrap-locale-B1w0mMGL.js";import{g as L}from"./get-safe-url-WrjxIbow.js";function B({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(B);function K(){const{info:n}=S(),a=U(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:v,webWalletUrl:a,onSuccess:r})}export{K as default};
@@ -1,4 +1,4 @@
1
- import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-BGjHw-jQ.js";import{I as M}from"./invitation-BMRfRUNn.js";import"./index-C6e7bjfS.js";import"./index-DJNEdvwh.js";import"./emotion-cache.browser.esm-DbJKstH3.js";import"./index-BwktDBoi.js";import"./sdk-DTvEp2g_.js";import"./wrap-locale-DOGf8_5t.js";function V(h){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),p=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!p)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:p}}),t=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",p);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:t}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const t=s.toString();await f.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,f]);if(a.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(M,{...h,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?T:null})]})}const X=H.div`
1
+ import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-DSmIN8Lk.js";import{I as M}from"./invitation-DdYhUro0.js";import"./index-S5q_uMQU.js";import"./index-CvXrq2y2.js";import"./emotion-cache.browser.esm-D-8-5Qqp.js";import"./index-B-SpV4Ip.js";import"./sdk-CKMexl7S.js";import"./wrap-locale-B1w0mMGL.js";function V(h){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),p=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!p)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:p}}),t=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",p);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:t}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const t=s.toString();await f.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,f]);if(a.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(M,{...h,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?T:null})]})}const X=H.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DJDK0L2i.js","./index-BGjHw-jQ.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
2
- import{r as t,g as n,j as r,bE as i,d0 as a}from"./index-BGjHw-jQ.js";const s=t.lazy(()=>i(()=>import("./index-DJDK0L2i.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),d=`{
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BjLMysVB.js","./index-DSmIN8Lk.js","./index-DGkT7afN.css","./decode-DPztD6kB.js","./index-CX3PrUL2.css"])))=>i.map(i=>d[i]);
2
+ import{r as t,g as n,j as r,bE as i,d0 as a}from"./index-DSmIN8Lk.js";const s=t.lazy(()=>i(()=>import("./index-BjLMysVB.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),d=`{
3
3
  getNodeInfo {
4
4
  code
5
5
  info {
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-B2dXnGld.js","./index-BGjHw-jQ.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
- import{c0 as V,r as b,ct as U,aG as N,j as e,he as q,aP as E,fc as H,N as n,G as g,T as S,t as J,aU as W,dE as A,s as z,dk as T,a4 as X,dl as K,bE as C,f as Y,aQ as Q,f1 as Z,iT as ee}from"./index-BGjHw-jQ.js";import{R as te,a as oe,D as re}from"./url-evaluation-CkF_rVJP.js";import{S as O}from"./Slider-DnheougG.js";import{k as se,g as ie}from"./index-7YlHxq_1.js";import"./visuallyHidden-Dan1xhjv.js";import"./url-join-B2I2wiTE.js";import"./index-55LTi2YM.js";import"./_createAggregator-DFMM18eQ.js";import"./depsEqual-D4qhf48v.js";import"./index-B-8VRY8W.js";import"./index-DRYJ0xIl.js";import"./toUpper-BSy5KpPm.js";function ae(o){var c=V(b.useState(o),2),i=c[0],r=c[1],a=U(i),h=b.useCallback(function(){return a.current},[]);return[i,r,h]}const ne=N([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),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 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")]),le=N(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 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),de=N(e.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"})),B=b.createContext({}),D=()=>b.useContext(B);function ce({children:o,restrictions:c,i18n:i,theme:r}){const[a,h]=ae({loading:!1}),p=s=>h(j=>({...j,loading:s})),u=b.useMemo(()=>({...a,onLoading:p,restrictions:c,i18n:i}),[a]);return e.jsx(q,{theme:r,children:e.jsx(B.Provider,{value:u,children:o})})}const pe=["1024x1024","1024x1792","1792x1024"],xe=["256x256","512x512","1024x1024"],ue=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function me({onSubmit:o}){const{loading:c,i18n:i}=D(),r=E({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),a=()=>{const s=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(s)},{run:h}=H(a,{wait:500}),p={width:"100%",pl:1,pr:1},u=r.model==="dall-e-2"?xe:pe;return e.jsxs(he,{onSubmit:s=>s.preventDefault(),children:[e.jsx(n,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(g,{container:!0,sx:{gap:2.5},children:[e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:i("aiImagePrompt")}),e.jsx(J,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:i("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:s=>{s.stopPropagation(),r.prompt=s.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageModel")}`}),e.jsx(te,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:s=>{r.number=1,r.size="1024x1024",r.model=s.target.value},children:ue.map(s=>e.jsx(W,{value:s.value,control:e.jsx(oe,{size:"small"}),label:s.label},s.label))})]}),e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageSize")}: ${r.size}`}),e.jsx(g,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(n,{sx:{flex:1},children:e.jsx(n,{...p,children:e.jsx(O,{size:"small",min:0,max:u.length-1,step:1,value:u.findIndex(s=>s==r.size),onChange:(s,j)=>{r.size=u[j]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageNumber")}: ${r.number}`}),e.jsx(n,{...p,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(s,j)=>{s.stopPropagation(),r.number=Number(j)}})})]})]})}),e.jsx(A,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:h,disabled:c,children:i(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const he=z(n)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-CQpDaqeX.js","./index-DSmIN8Lk.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
+ import{c0 as V,r as b,ct as U,aG as N,j as e,he as q,aP as E,fc as H,N as n,G as g,T as S,t as J,aU as W,dE as A,s as z,dk as T,a4 as X,dl as K,bE as C,f as Y,aQ as Q,f1 as Z,iT as ee}from"./index-DSmIN8Lk.js";import{R as te,a as oe,D as re}from"./url-evaluation-CnxlGDaY.js";import{S as O}from"./Slider-Dv-x7QDz.js";import{k as se,g as ie}from"./index-CdLaBL6r.js";import"./visuallyHidden-Dan1xhjv.js";import"./url-join-CmQWf24D.js";import"./index-CVe26v9m.js";import"./_createAggregator-5Fftcexu.js";import"./depsEqual-C35aJ6fX.js";import"./index-Bc4XPWC3.js";import"./index-DRYJ0xIl.js";import"./toUpper-C8HDO4pv.js";function ae(o){var c=V(b.useState(o),2),i=c[0],r=c[1],a=U(i),h=b.useCallback(function(){return a.current},[]);return[i,r,h]}const ne=N([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),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 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")]),le=N(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 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),de=N(e.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"})),B=b.createContext({}),D=()=>b.useContext(B);function ce({children:o,restrictions:c,i18n:i,theme:r}){const[a,h]=ae({loading:!1}),p=s=>h(j=>({...j,loading:s})),u=b.useMemo(()=>({...a,onLoading:p,restrictions:c,i18n:i}),[a]);return e.jsx(q,{theme:r,children:e.jsx(B.Provider,{value:u,children:o})})}const pe=["1024x1024","1024x1792","1792x1024"],xe=["256x256","512x512","1024x1024"],ue=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function me({onSubmit:o}){const{loading:c,i18n:i}=D(),r=E({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),a=()=>{const s=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(s)},{run:h}=H(a,{wait:500}),p={width:"100%",pl:1,pr:1},u=r.model==="dall-e-2"?xe:pe;return e.jsxs(he,{onSubmit:s=>s.preventDefault(),children:[e.jsx(n,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(g,{container:!0,sx:{gap:2.5},children:[e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:i("aiImagePrompt")}),e.jsx(J,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:i("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:s=>{s.stopPropagation(),r.prompt=s.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageModel")}`}),e.jsx(te,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:s=>{r.number=1,r.size="1024x1024",r.model=s.target.value},children:ue.map(s=>e.jsx(W,{value:s.value,control:e.jsx(oe,{size:"small"}),label:s.label},s.label))})]}),e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageSize")}: ${r.size}`}),e.jsx(g,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(n,{sx:{flex:1},children:e.jsx(n,{...p,children:e.jsx(O,{size:"small",min:0,max:u.length-1,step:1,value:u.findIndex(s=>s==r.size),onChange:(s,j)=>{r.size=u[j]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(g,{size:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${i("aiImageNumber")}: ${r.number}`}),e.jsx(n,{...p,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(s,j)=>{s.stopPropagation(),r.number=Number(j)}})})]})]})}),e.jsx(A,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:h,disabled:c,children:i(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const he=z(n)`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  height: 100%;
@@ -93,7 +93,7 @@ import{c0 as V,r as b,ct as U,aG as N,j as e,he as q,aP as E,fc as H,N as n,G as
93
93
  & path:last-child {
94
94
  fill: white;
95
95
  }
96
- `,ye=b.lazy(()=>C(()=>import("./lottie-react.esm-B2dXnGld.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(o=>({default:o.Player})));function R({src:o}){return e.jsx(ye,{src:o,loop:!0,autoplay:!0})}function we({options:o,handleApi:c,onSelect:i,onFinish:r,onClose:a,isMobile:h}){const{loading:p,onLoading:u,restrictions:s,i18n:j}=D(),[l,y]=b.useState([]),[f,I]=b.useState(),L=Y(),k=s?.maxNumberOfFiles,[x,_]=b.useState({}),m=E({}),P=Object.keys(m).filter(t=>m[t]);b.useEffect(()=>{f&&!x.error&&C(()=>import("./lottie-error-DeJ4jU66.js"),[],import.meta.url).then(t=>{_(d=>({...d,error:t.default}))}),o&&!l.length&&!x.loading&&C(()=>import("./lottie-loading-Npqo86wA.js"),[],import.meta.url).then(t=>{_(d=>({...d,loading:t.default}))}),!o&&!x.welcome&&C(()=>import("./lottie-welcome-oyMgXGo-.js"),[],import.meta.url).then(t=>{_(d=>({...d,welcome:t.default}))})},[f,o,l.length,x]),Q(async()=>{if(o){I(void 0),u(!0);try{const t=await c({...o,responseFormat:"b64_json"});if(t.data){const w=(t.data||[]).map(v=>({src:`data:image/png;base64,${v.b64Json||v.b64_json}`,width:o.size?Number((o.size||"").split("x")[0]):1024,alt:o.prompt}));y(l?[...w,...l]:w)}else I(t)}catch(t){console.error("AIImage generate error: ",t),I(t?.response?.data||t)}finally{u(!1),r()}}},[o?.number,o?.prompt,o?.size]);const F=t=>{const d=Object.keys(m).filter(v=>m[v]);if(k?d.length<k:!0)m[t]?m[t]=!1:m[t]=!0;else{const v=d.pop();v!==t&&(m[v]=!1),m[t]=!m[t]}},M=t=>{if(l){const d=l.findIndex(w=>w.src===t);d>-1&&(m[t]=!1,l.splice(d,1),y([...l]))}},$=()=>{const t={width:document.querySelector(".photo-item img")?.offsetWidth||0,height:document.querySelector(".photo-item img")?.offsetHeight||0};return e.jsx(e.Fragment,{children:Array.from({length:o?.number||1}).map((d,w)=>e.jsx(g,{children:e.jsx(T,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...t}})},w))})},G=()=>f?e.jsxs(n,{sx:{width:300,height:300,m:"auto"},children:[x.error&&e.jsx(R,{src:x.error},"error"),e.jsx(n,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:f?.message})]}):l&&Array.isArray(l)&&l.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n,{sx:{flexGrow:1,height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ze,{sx:h?{p:0,border:"none !important"}:{p:2},children:e.jsxs(g,{spacing:2,container:!0,className:"photo-wrapper",children:[p&&e.jsx($,{}),l.map((t,d)=>e.jsx(g,{className:"photo-item",children:e.jsx(fe,{...t,selected:m[t.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:m[t.src]?`2px solid ${L.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{F(t.src)},onDelete:()=>{M(t.src)}})},t.src))]})})}),e.jsxs(n,{sx:{mt:2,display:"flex",justifyContent:a?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[a&&typeof a=="function"&&e.jsx(A,{color:"primary",variant:"outlined",onClick:a,children:e.jsx(Z,{})}),e.jsx(A,{color:"primary",variant:"contained",disabled:!P.length||p,onClick:()=>{const t=se(l,"src");i(P.map(d=>t[d]))},children:P.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):o?e.jsx(n,{sx:{width:220,height:220,m:"auto"},children:x.loading&&e.jsx(R,{src:x.loading},"loading")}):e.jsx(n,{sx:{width:300,height:300,m:"auto"},children:x.welcome&&e.jsx(R,{src:x.welcome},"welcome")});return e.jsx(ve,{children:G()})}const ve=z(n)`
96
+ `,ye=b.lazy(()=>C(()=>import("./lottie-react.esm-CQpDaqeX.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(o=>({default:o.Player})));function R({src:o}){return e.jsx(ye,{src:o,loop:!0,autoplay:!0})}function we({options:o,handleApi:c,onSelect:i,onFinish:r,onClose:a,isMobile:h}){const{loading:p,onLoading:u,restrictions:s,i18n:j}=D(),[l,y]=b.useState([]),[f,I]=b.useState(),L=Y(),k=s?.maxNumberOfFiles,[x,_]=b.useState({}),m=E({}),P=Object.keys(m).filter(t=>m[t]);b.useEffect(()=>{f&&!x.error&&C(()=>import("./lottie-error-DeJ4jU66.js"),[],import.meta.url).then(t=>{_(d=>({...d,error:t.default}))}),o&&!l.length&&!x.loading&&C(()=>import("./lottie-loading-Npqo86wA.js"),[],import.meta.url).then(t=>{_(d=>({...d,loading:t.default}))}),!o&&!x.welcome&&C(()=>import("./lottie-welcome-oyMgXGo-.js"),[],import.meta.url).then(t=>{_(d=>({...d,welcome:t.default}))})},[f,o,l.length,x]),Q(async()=>{if(o){I(void 0),u(!0);try{const t=await c({...o,responseFormat:"b64_json"});if(t.data){const w=(t.data||[]).map(v=>({src:`data:image/png;base64,${v.b64Json||v.b64_json}`,width:o.size?Number((o.size||"").split("x")[0]):1024,alt:o.prompt}));y(l?[...w,...l]:w)}else I(t)}catch(t){console.error("AIImage generate error: ",t),I(t?.response?.data||t)}finally{u(!1),r()}}},[o?.number,o?.prompt,o?.size]);const F=t=>{const d=Object.keys(m).filter(v=>m[v]);if(k?d.length<k:!0)m[t]?m[t]=!1:m[t]=!0;else{const v=d.pop();v!==t&&(m[v]=!1),m[t]=!m[t]}},M=t=>{if(l){const d=l.findIndex(w=>w.src===t);d>-1&&(m[t]=!1,l.splice(d,1),y([...l]))}},$=()=>{const t={width:document.querySelector(".photo-item img")?.offsetWidth||0,height:document.querySelector(".photo-item img")?.offsetHeight||0};return e.jsx(e.Fragment,{children:Array.from({length:o?.number||1}).map((d,w)=>e.jsx(g,{children:e.jsx(T,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...t}})},w))})},G=()=>f?e.jsxs(n,{sx:{width:300,height:300,m:"auto"},children:[x.error&&e.jsx(R,{src:x.error},"error"),e.jsx(n,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:f?.message})]}):l&&Array.isArray(l)&&l.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n,{sx:{flexGrow:1,height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ze,{sx:h?{p:0,border:"none !important"}:{p:2},children:e.jsxs(g,{spacing:2,container:!0,className:"photo-wrapper",children:[p&&e.jsx($,{}),l.map((t,d)=>e.jsx(g,{className:"photo-item",children:e.jsx(fe,{...t,selected:m[t.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:m[t.src]?`2px solid ${L.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{F(t.src)},onDelete:()=>{M(t.src)}})},t.src))]})})}),e.jsxs(n,{sx:{mt:2,display:"flex",justifyContent:a?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[a&&typeof a=="function"&&e.jsx(A,{color:"primary",variant:"outlined",onClick:a,children:e.jsx(Z,{})}),e.jsx(A,{color:"primary",variant:"contained",disabled:!P.length||p,onClick:()=>{const t=se(l,"src");i(P.map(d=>t[d]))},children:P.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):o?e.jsx(n,{sx:{width:220,height:220,m:"auto"},children:x.loading&&e.jsx(R,{src:x.loading},"loading")}):e.jsx(n,{sx:{width:300,height:300,m:"auto"},children:x.welcome&&e.jsx(R,{src:x.welcome},"welcome")});return e.jsx(ve,{children:G()})}const ve=z(n)`
97
97
  min-height: 100%;
98
98
  display: flex;
99
99
  flex-direction: column;
@@ -0,0 +1,120 @@
1
+ import{E as z,bn as I,bo as Ae,m as R,j as e,P as B,r as y,Q as G,R as Q,S as J,U as Y,N as l,o as x,n as Ke,v as F,C as Se,ad as ce,aV as Z,t as H,g as Re,y as E,$ as le,aU as De,V as Ie,s as P,au as $e,H as Be,l as Pe,bp as q,W as Ne,bq as de,br as pe,bs as me,bt as Le,J as Ee,T as $,bu as _e,az as ie,a4 as ae,aR as re,bk as ze,bv as We,X as qe,Y as Me,A as Ue,u as Fe,bm as He,d as Oe,bw as Ve}from"./index-DSmIN8Lk.js";import{T as Xe}from"./index-Dv8OKOCm.js";import Ge from"./audit-logs-thBiWriP.js";import{T as ue,M as Qe}from"./index-LF8taadH.js";import{r as xe,P as Je}from"./index-DAyHEo4e.js";import{u as _,T as Ye}from"./team-BLrn7VS2.js";import{g as Ze,H as et}from"./index-DWHdpvDd.js";import{D as tt}from"./url-evaluation-CnxlGDaY.js";import{E as st}from"./Edit-CdxfETzo.js";import{y as nt}from"./index-C8B19Suz.js";import{A as ot}from"./Add-DD8MScAx.js";import{l as O}from"./index-Bhz6YZ5l.js";import{C as V}from"./click-to-copy-Btn7osS5.js";import{f as it}from"./index-BojVbZw0.js";import{D as at}from"./delete-confirm-C_IV5rS4.js";import{P as rt}from"./permission-D8AA2j8a.js";import{u as ct}from"./blocklet-DLDh_xx4.js";import{A as lt}from"./actions-D64g1c7L.js";import{u as fe}from"./use-mobile-Du8kf9CZ.js";import{u as dt}from"./useAsyncRetry-BkYf8OA3.js";import"./TableSearch-DbCt9XJz.js";import"./Search-bAJjS7Xv.js";import"./Clear-BwooXVqX.js";import"./useLocalStorage-DTDaPcMQ.js";import"./index-CmOss_WU.js";import"./decode-DPztD6kB.js";import"./shorten-label-CQ2mcJGL.js";import"./ViewList-DqYPCI-E.js";import"./use-mobile-D73gcDpA.js";import"./client-dGp_pJel.js";import"./AdapterDayjs-DPTb1mSQ.js";import"./useThemeProps-FM7Bl9Z4.js";import"./CSSTransition-C1fvxvPN.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-D5wD9tqC.js";import"./Verified-BQeezku1.js";import"./DeleteOutline-D435DmAa.js";import"./ErrorOutline-XMmhDF6k.js";import"./index-CvXrq2y2.js";import"./emotion-cache.browser.esm-D-8-5Qqp.js";import"./sdk-CKMexl7S.js";import"./index-C6IrCCvU.js";import"./ButtonGroup-Dk6oPkTY.js";import"./getValidReactChildren-kYI4jRgi.js";import"./Google-RkdWLWhs.js";import"./cloneDeep-C1g_DWn4.js";import"./chain-DZ88My0U.js";import"./list-header-BXNq7AiD.js";import"./ToggleButtonGroup-CX-Av2Om.js";import"./FilterList-CMsi8nwW.js";import"./index-2CtjRwN7.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-C35aJ6fX.js";import"./MoreVert-Coua8qOx.js";import"./useAsync-CdFxv1Yw.js";function ee({value:n}){const{t,locale:s}=R(),i=new Date;return new Date(n)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:n,locale:s}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:n,locale:s,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:n,onChange:t,...s}){const{t:i}=R(),c=y.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(G,{style:{width:"100%"},variant:"outlined",...s,children:[e.jsx(Q,{children:i("setting.accessKey.authType")}),e.jsx(J,{value:n,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),children:c.map(a=>e.jsx(Y,{value:a.value,children:e.jsxs(l,{children:[e.jsx("span",{children:a.title}),e.jsx(l,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:a.description})]})},a.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const W=()=>{const n=z.RBAC_CONFIG.roles.filter(c=>c.passport),{inService:t}=I(),{roles:s}=_(),i=[...n,...t?s:[]];return Ae(i,"name").filter(c=>c.name!==z.ROLES.OWNER)};function he({onCreate:n=()=>{},remark:t=""}){const{session:s}=Ke(),{api:i}=I(),{teamDid:c}=_(),{t:a}=R(),[j,b]=y.useState(!1),[h,d]=y.useState(null),k=W(),C=y.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return k;const o=k.filter(g=>g.name==="guest");return[...k.filter(g=>g.name!=="guest").filter(g=>s.user.passports.find(u=>u.role===g.name)),...o]},[k,s?.user?.passports,s?.user?.role]),p=()=>{b(!1),d(null)},T=async o=>{const{remark:m,passport:g,authType:u}=o;b(!0);const f=await i.createAccessKey({input:{teamDid:c,remark:m.trim(),passport:g,expireAt:o.expireAt?new Date(o.expireAt).getTime():null,authType:u}}),{data:v}=f;n(v),d(null),b(!1)},S={title:`${a("common.create")} ${a("accessKey")}`,description:(o,m,g)=>e.jsxs(Z,{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:o.remark,onChange:u=>{m({...o,remark:u.target.value,__disableConfirm:!o.passport||!u.target.value.trim()}),u.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:a("setting.accessKey.passport")}),e.jsx(J,{"data-cy":"create-access-key-select-passport",value:o.passport,onChange:u=>{const f=u.target.value;g(null),m({...o,passport:f,__disableConfirm:!o.remark||!f})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:j,children:C.map(u=>e.jsx(Y,{value:u.name,"data-cy":`create-access-key-passport-option-${u.name}`,children:e.jsxs(l,{children:[e.jsx("span",{children:u.title||u.name}),e.jsx(l,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:u.description})]})},u.name))})]}),e.jsx(te,{value:o.authType,onChange:u=>{m({...o,authType:u.target.value})}}),e.jsx(ue,{placeholder:a("setting.accessKey.expireTime"),value:o.expireAt,onChange:u=>{m({...o,expireAt:u,__disableConfirm:!o.passport||!o.remark||!u})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:T,onCancel:p};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>d(S),className:"rule-action",children:[j?e.jsx(Se,{size:16}):e.jsx(ot,{style:{fontSize:16}}),a("common.create")]}),h&&e.jsx(ce,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}he.propTypes={remark:x.string,onCreate:x.func};function ge({onConfirm:n=()=>{},accessKeyId:t,accessKeySecret:s,hideSecret:i=!0}){const{t:c}=y.useContext(Re),[a,j]=y.useState(!1),[b,h]=y.useState(()=>i),d=I(),k=()=>{h(!b)},C=o=>{j(o.target.checked)},p=E(window.location.origin,d?.info?.routing?.adminPath),T=y.useMemo(()=>i?`const Client = require('@abtnode/client');
2
+ const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
+ const { joinURL } = require('ufo');
4
+
5
+ const { endpoint } = await ensureServerEndpoint("${d.inService?window.blocklet?.appUrl:p}");
6
+ const fullEndpoint = joinURL(endpoint, '/api/gql');
7
+
8
+ const client = new Client(fullEndpoint);
9
+ client.setAuthAccessKey({
10
+ accessKeyId: "${t}",
11
+ accessKeySecret: "${s}",
12
+ });
13
+
14
+ const rootDid = '${window.blocklet?.appId||window.blocklet?.appPid||"{rootDid}"}';
15
+ const result = await client.getBlocklet(
16
+ { input: { did: rootDid, attachRuntimeInfo: false } },
17
+ { headers: { 'x-access-blocklet': rootDid } }
18
+ );
19
+ `:d.inService?`curl -H "Authorization: Bearer ${s}" "${E(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${s}" "${E(p,"/api/did/session")}"`,[i,t,s,d.inService,p]),S=y.useMemo(()=>i?`blocklet deploy --endpoint ${d.inService?window.blocklet?.appUrl:p} --access-key ${t} --access-secret ${s} {blockletPath}/.blocklet/bundle;`:null,[i,t,s,d.inService,p]);return e.jsxs(le,{title:c("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:n,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:i?!a:!1,onClick:n,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:c("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(pt,{children:c(i?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(U,{children:[e.jsx(M,{children:c("setting.accessKey.accessKeyId")}),e.jsx(V,{children:t})]}),e.jsxs(U,{children:[e.jsx(M,{children:c("setting.accessKey.accessKeySecret")}),b?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:k,children:c("setting.accessKey.showSecret")}):e.jsx(V,{children:s})]}),!b&&e.jsxs(U,{children:[e.jsx(M,{children:`Access Key ${c("setting.accessKey.usage")}`}),e.jsx(O,{code:T,language:"shell"}),S&&e.jsx(O,{code:S,language:"shell"})]}),i&&e.jsx("div",{children:e.jsx(De,{value:"end",disabled:b,control:e.jsx(Ie,{checked:a,onChange:C}),label:c("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}ge.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const M=P.div`
20
+ display: flex;
21
+ justify-content: space-between;
22
+ align-items: center;
23
+ font-size: 16px;
24
+ margin-bottom: 8px;
25
+ `,U=P.div`
26
+ margin-bottom: 24px;
27
+ `,pt=P.div`
28
+ font-size: 16px;
29
+ font-weight: bold;
30
+ `;function ye({accessKeyId:n,time:t,remark:s,onDelete:i=()=>{},onClose:c=()=>{}}){const{t:a,locale:j}=R(),{api:b}=I(),{teamDid:h}=_(),d=()=>{c()},k=async()=>{try{await b.deleteAccessKey({input:{teamDid:h,accessKeyId:n}}),i()}catch(T){Be.error(T?.message)}finally{d()}},C=T=>({key:`<b>${n}</b>`,name:`<b>${s}</b>`,time:$e(T,j),timeAge:it(new Date(T),Pe(j))}),p={keyName:s,title:a("setting.accessKey.title"),description:t?`${a("setting.accessKey.description",C(t))}`:`${a("setting.accessKey.descriptionNoTime",{key:`<b>${n}</b>`,name:`<b>${s}</b>`})}`,confirmPlaceholder:a("setting.accessKey.confirm_desc",{name:s}),confirm:a("common.delConfirm"),cancel:a("common.cancel"),onConfirm:k,onCancel:d};return e.jsx(at,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})}ye.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function be({accessKeyId:n,remark:t="",onUpdate:s=()=>{},passport:i="",expireAt:c="",authType:a="signature",onClose:j=()=>{}}){const{api:b}=I(),{teamDid:h}=_(),{t:d}=R(),[k,C]=y.useState(!1),p=W(),T=()=>{C(!1),j()},S=async m=>{const{accessKeyId:g,remark:u="",passport:f,expireAt:v,authType:N}=m;C(!0),await b.updateAccessKey({input:{teamDid:h,accessKeyId:g,remark:u.trim(),passport:f,expireAt:v?new Date(v).getTime():null,authType:N}}),s(),T()},o={title:`${d("common.update")} ${d("accessKey")}`,description:(m,g,u)=>e.jsxs(Z,{sx:{gap:3},children:[e.jsx(H,{label:d("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:m.accessKeyId,disabled:!0}),e.jsx(H,{label:d("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:m.remark,onChange:f=>{g({...m,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?u(""):u(d("setting.accessKey.remarkInvalid"))}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:d("setting.accessKey.passport")}),e.jsx(J,{"data-cy":"update-access-key-select-passport",value:m.passport,onChange:f=>{const v=f.target.value;u(null),g({...m,passport:v,__disableConfirm:!m.remark||!v})},fullWidth:!0,label:d("setting.accessKey.passport"),disabled:k,children:p.map(f=>e.jsx(Y,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(l,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(l,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(te,{disabled:!0,value:m.authType,onChange:f=>{g({...m,authType:f.target.value})}}),e.jsx(ue,{placeholder:d("setting.accessKey.expireTime"),value:m.expireAt,onChange:f=>{g({...m,expireAt:f,__disableConfirm:!m.passport||!m.remark||!f})}})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),color:"primary",params:{accessKeyId:n,remark:t,passport:i,expireAt:c,authType:a},onConfirm:S,onCancel:T};return e.jsx(ce,{title:o.title,description:o.description,confirm:o.confirm,color:o.color,cancel:o.cancel,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})}be.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function je({accessKey:n,onCancel:t}){const{t:s}=R();return e.jsx(le,{title:s("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(mt,{children:e.jsx(Ce,{accessKey:n})})})}je.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const mt=P(l)`
31
+ margin-top: -16px;
32
+
33
+ .tabs {
34
+ margin-left: 0;
35
+ margin-right: 0;
36
+ }
37
+ `;function Ce({accessKey:n}){const{t,locale:s}=R(),{blocklet:i}=ct(),c=I(),a=W(),j=(i?.children||[]).find(C=>C?.meta?.did===n.componentDid),b=a.find(C=>C.name===n.passport),h=b?b.title:n.passport,d=y.useMemo(()=>c.inService?`curl -H "Authorization: Bearer blocklet-${q.toBase58(n.accessKeyPublic)}" "${E(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${q.toBase58(n.accessKeyPublic)}" "${E(window.location.origin,c?.info?.routing?.adminPath,"/api/did/session")}"`,[n.accessKeyPublic,c.inService,c?.info?.routing?.adminPath]),k=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ne,{did:n.accessKeyId,showQrcode:!0})},...n.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${q.toBase58(n.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(l,{children:xe(h,n.passport)})},{label:t("common.createdVia"),content:n.createdVia},{label:t("common.createdBy"),content:n.createdBy?e.jsx(de,{showDid:!0,did:n.createdBy,cardType:me.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:n.createdAt?e.jsx(B,{value:n.createdAt,type:"all",locale:s}):"-"},{label:t("common.lastUsedAt"),content:n.lastUsedAt?e.jsx(B,{value:n.lastUsedAt,type:"all",locale:s}):"-"},{label:t("common.expiredAt"),content:n.expireAt?e.jsx(ee,{value:n.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:n.authType},{label:t("common.remark"),content:n.remark},...n.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:n.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:n.resourceId||"-"}]:[],...j?[{label:t("setting.accessKey.component"),content:e.jsxs(l,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Le,{blocklet:j,ancestors:[i]}),e.jsx(l,{sx:{ml:"16px",minWidth:0},children:e.jsxs(l,{className:"component-header",children:[e.jsx(l,{className:"component-name",children:Ee.getDisplayName(j,!0)}),e.jsx(l,{className:"component-version",children:j?.meta?.version})]})})]},j)}]:[],n.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(O,{code:d,language:"shell"})}:null].filter(Boolean)}];return e.jsx(ut,{gap:3,children:e.jsx(l,{className:"info-area",children:k.map(C=>e.jsxs(l,{sx:{mb:3},children:[e.jsx($,{variant:"h6",sx:{mb:1.5},children:C.title}),e.jsx(l,{className:"info-grid",children:C.items.map(p=>e.jsxs(l,{className:"info-item",children:[e.jsx(l,{className:"info-label",children:e.jsx($,{variant:"subtitle2",color:"textSecondary",children:p.label})}),e.jsx(l,{sx:{flex:1,minWidth:0},children:p.content})]},p.label))})]},C.title))})})}Ce.propTypes={accessKey:x.object.isRequired};const ut=P(Z)`
38
+ .info-card {
39
+ margin-bottom: 24px;
40
+ overflow: hidden;
41
+ }
42
+
43
+ .card-content {
44
+ display: flex;
45
+ gap: 32px;
46
+ padding: 24px;
47
+ }
48
+
49
+ .passport-image {
50
+ width: 150px;
51
+ flex-shrink: 0;
52
+ transition: transform 0.2s ease-in-out;
53
+ cursor: pointer;
54
+
55
+ &:hover {
56
+ transform: scale(1.05);
57
+ }
58
+ }
59
+
60
+ .info-area {
61
+ flex: 1;
62
+ display: flex;
63
+ flex-direction: column;
64
+ }
65
+
66
+ .info-header {
67
+ padding-bottom: 16px;
68
+ border-bottom: 1px solid #eee;
69
+ }
70
+
71
+ .info-grid {
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 12px;
75
+ }
76
+
77
+ .info-item {
78
+ display: flex;
79
+ gap: 8px;
80
+ }
81
+
82
+ .info-label {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: 8px;
86
+ width: 140px;
87
+ }
88
+
89
+ .logs-card {
90
+ .card-header {
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 8px;
94
+ padding: 16px 24px;
95
+ border-bottom: 1px solid #eee;
96
+ }
97
+
98
+ .MuiTimeline-root {
99
+ padding: 24px;
100
+ }
101
+
102
+ .MuiTimelineContent-root {
103
+ padding: 0px 16px;
104
+ }
105
+
106
+ .MuiTimelineDot-root {
107
+ margin: 0;
108
+ }
109
+ }
110
+ `;function X({title:n,tooltipTitle:t,link:s}){const{t:i}=R(),c=fe(),[a,j]=y.useState(!1),b=()=>j(d=>!d),h=()=>j(!1);return c?e.jsxs(l,{sx:{color:"text.secondary",fontSize:"14px",lineHeight:1.5},children:[n,e.jsx(_e,{onClickAway:h,children:e.jsx("span",{children:e.jsx(ie,{open:a,onClose:h,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,title:e.jsxs(l,{sx:{fontSize:"14px",lineHeight:1.5},children:[t,e.jsx(l,{sx:{color:"primary.main",ml:.5},component:"a",href:s,target:"_blank",rel:"noopener noreferrer",children:i("dashboard.document")})]}),children:e.jsx(ae,{size:"small",onClick:b,sx:{ml:.5},children:e.jsx(re,{fontSize:"14"})})})})})]}):e.jsxs(l,{sx:{color:"text.secondary",fontSize:"14px",lineHeight:1.5},children:[n,e.jsx(ie,{enterTouchDelay:0,leaveTouchDelay:3e3,title:e.jsxs(l,{sx:{fontSize:"14px",lineHeight:1.5},children:[t,e.jsx(l,{sx:{color:"primary.main",ml:.5},component:"a",href:s,target:"_blank",rel:"noopener noreferrer",children:i("dashboard.document")})]}),children:e.jsx(ae,{size:"small",sx:{ml:.5},children:e.jsx(re,{fontSize:"14"})})})]})}X.propTypes={title:x.string.isRequired,tooltipTitle:x.string.isRequired,link:x.string.isRequired};function ve({isSelf:n=!1,columnSx:t={}}){const{t:s,locale:i}=R(),{api:c,inService:a}=I(),{teamDid:j}=_(),[b,h]=y.useState({}),[d,k]=y.useState(null),[C,p]=y.useState(null),[T,S]=y.useState(null),o=fe(),m=W(),g=y.useRef(null),u=`access-keys-${j}`,f=Ze(u),[v,N]=y.useState({searchText:f.searchText||"",pageSize:f.rowsPerPage||10,page:1}),D=dt(async()=>{const r={teamDid:j,paging:{page:v.page,pageSize:v.pageSize}};return await c.getAccessKeys({input:r})},[v.page,v.pageSize]),{loading:ke,error:se}=D,L=y.useMemo(()=>D.value?.list||[],[D.value?.list]),ne=y.useMemo(()=>n?["accessKeyId","createdVia","createdBy","createdBy"]:[],[n]),Te=y.useMemo(()=>[{label:s("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:A})=>{const K=L[A];return e.jsx(l,{className:"remark",sx:ze({display:"flex",alignItems:"center",gap:2},t),children:e.jsx($,{children:K.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(l,{sx:t,children:e.jsx(We,{showDidLogo:!1,children:r})})}},{label:s("common.role"),name:"passport",options:{customBodyRender:r=>{const A=m.find(w=>w.name===r),K=A?A.title:r;return e.jsx(l,{sx:t,children:xe(K,r)})}}},{label:s("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx($,{sx:t,children:r})}},{label:s("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx($,{sx:t,children:s(`setting.accessKey.${r}`)})}},{label:s("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(l,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:s("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(l,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:s("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>e.jsx(l,{className:"expired-at",sx:t,children:r?e.jsx(ee,{value:r}):s("common.neverExpired")})}},{label:s("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:r=>e.jsx(l,{sx:t,children:r?e.jsx(de,{showDid:!0,did:r,cardType:me.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,...o&&{minWidth:"unset"}}}):"-"})}},{label:s("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(r,{rowIndex:A})=>{const K=L[A];return e.jsx(l,{sx:t,children:e.jsx(lt,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(st,{}),text:s("common.edit"),onClick:w=>{w.stopPropagation(),S(K)}},{icon:e.jsx(tt,{}),text:s("common.delete"),onClick:w=>{w.stopPropagation(),p(K)}}]})})}}}].filter(r=>!ne.includes(r.name)),[L,i,s,m,p,S,t,o,ne]),we=({page:r,rowsPerPage:A,searchText:K})=>{v.pageSize!==A?N(w=>({...w,searchText:"",pageSize:A,page:1})):v.page!==r+1?N(w=>({...w,searchText:"",page:r+1})):v.searchText!==K&&N(w=>({...w,searchText:K,page:1}))},oe=v.searchText?L.filter(r=>r.accessKeyId.toLowerCase().includes(v.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(v.searchText.toLowerCase())):L;return se?e.jsx(qe,{severity:"error",children:Me(se)}):e.jsxs(l,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[o?e.jsx(X,{title:s("setting.accessKey.listTitle"),tooltipTitle:s("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}):null,e.jsx(et,{durable:u,durableKeys:["page","rowsPerPage"],data:oe,columns:Te,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:v.page-1,rowsPerPage:v.pageSize,count:D.value?.count||0,searchDebounceTime:600,onRowClick(r,{dataIndex:A},K){if(g.current?.contains(K.target)){const w=oe[A];k(w)}}},loading:ke,onChange:we,title:o?null:e.jsx(X,{title:s("setting.accessKey.listTitle"),tooltipTitle:s("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}),customButtons:[e.jsx(rt,{permission:a?"":"mutate_accessKey",children:e.jsx(he,{onCreate:r=>{const{accessKeyId:A,accessKeySecret:K,authType:w}=r;h({show:!0,accessKeyId:A,accessKeySecret:K,authType:w})}})})],emptyNode:e.jsx(nt,{children:s("oauth.client.empty")})}),b.show&&e.jsx(ge,{hideSecret:b.authType==="signature",onConfirm:()=>{D.retry(),h({show:!1})},...b}),d&&e.jsx(je,{onCancel:()=>k(null),accessKey:d}),C&&e.jsx(ye,{accessKeyId:C.accessKeyId,time:C.lastUsedAt,remark:C.remark||"N/A",onDelete:D.retry,onClose:()=>p(null)}),T&&e.jsx(be,{...T,onUpdate:D.retry,onClose:()=>S(null)})]})}ve.propTypes={isSelf:x.bool,columnSx:x.object};function xt(){return e.jsx(ve,{})}function ys(){const n=Ue(),{t}=R(),{info:s}=Fe(),{tab:i="members"}=He(),c=o=>Ve(o,s),{data:a}=Oe(),j=y.useCallback(o=>{const m=a.find(g=>[g.meta.did,g.appDid,g.appPid].includes(o));return m?m.meta.title:"Server"},[a]),b=y.useRef(null);b.current=j;const h=y.useCallback(()=>e.jsx(Ge,{showScope:!0,scopeFormatter:b.current}),[]),d=y.useCallback(()=>e.jsx(Qe,{type:"server",createPassportSvg:c}),[]),k=s.did,C=o=>{n(`/team/${o}`)},p={members:{label:t("common.members"),value:"members",component:d},passports:{label:t("team.member.passports"),value:"passports",component:Je},"access-keys":{label:t("common.accessKey"),value:"access-keys",component:xt},"audit-logs":{label:t("common.auditLogs"),value:"audit-logs",component:h}},T=Object.values(p).map(({label:o,value:m})=>({label:o,value:m})),S=p[i]||p.member;return e.jsx(Ye,{teamDid:k,children:e.jsxs(ft,{children:[e.jsx($,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.team")}),e.jsx(Xe,{tabs:T,current:i,onChange:C,scrollButtons:"auto"}),e.jsx("div",{className:"page-content",children:e.jsx(S.component,{createPassportSvg:c})})]})})}const ft=P.main`
111
+ .page-header {
112
+ display: flex;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ }
116
+
117
+ .page-content {
118
+ margin-top: 24px;
119
+ }
120
+ `;export{ys as default};
@@ -1 +1 @@
1
- import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-BGjHw-jQ.js";import{L as S,D as j}from"./download-MY8FKHA1.js";import{u as L}from"./useLocalStorage-DemYxCTT.js";import"./ButtonGroup-CO-3Gd2r.js";import"./getValidReactChildren-a3_fEqAv.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
1
+ import{A as g,bm as v,u as y,j as r,Q as f,S as x,U as h}from"./index-DSmIN8Lk.js";import{L as S,D as j}from"./download-DUWhW0i0.js";import{u as L}from"./useLocalStorage-DTDaPcMQ.js";import"./ButtonGroup-Dk6oPkTY.js";import"./getValidReactChildren-kYI4jRgi.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
@@ -1 +1 @@
1
- import{ev as k}from"./index-BGjHw-jQ.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
1
+ import{ev as k}from"./index-DSmIN8Lk.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
@@ -0,0 +1,20 @@
1
+ import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-DSmIN8Lk.js";import{u as L}from"./useLocalStorage-DTDaPcMQ.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-HR0eNm12.js";import{e as D}from"./engine-NE_bcM5l.js";import{g as U}from"./get-safe-url-WrjxIbow.js";import{P as V}from"./permission-D8AA2j8a.js";import{A as Le}from"./ArrowDropDown-B4JFpTo9.js";import{B as Ee}from"./Breadcrumbs-C9jZiry0.js";import"./ChevronLeft-Cn84uWzO.js";import"./ChevronRight-Cfe9Ltow.js";import"./Search-bAJjS7Xv.js";import"./index-C8B19Suz.js";import"./blocklet-DLDh_xx4.js";import"./Autocomplete-Cq435hZq.js";import"./ListSubheader-DmKGdU_q.js";import"./Verified-BQeezku1.js";import"./VerifiedUser-RW47UR2w.js";import"./Add-DD8MScAx.js";import"./Launch-BxhXypAR.js";import"./Done-Dvvf3-WX.js";import"./DeleteOutline-D435DmAa.js";import"./delete-confirm-C_IV5rS4.js";import"./click-to-copy-Btn7osS5.js";import"./MoreVert-Coua8qOx.js";import"./ButtonGroup-Dk6oPkTY.js";import"./getValidReactChildren-kYI4jRgi.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
2
+ .ms-highlight {
3
+ color: ${e=>e.theme.palette.primary.main};
4
+ }
5
+ `;function J({ref:e=null,onChange:n=()=>{},onDelete:l=()=>{}}){const{info:s}=j(),{t:r}=S(),[i,c]=f.useState(!1),[u,a]=f.useState(!1),[d,p]=f.useState(-1),[o,g]=L(z),x=Math.max(s.blockletRegistryList.findIndex(b=>b.url===o),0),w=b=>{try{c(!0),p(b);const h=s.blockletRegistryList[b];g(h.url),n(h.url),a(!1)}catch(h){console.error(h),O.error(`${r("store.blockletRegistry.changeFailed")} ${W(h)}`)}finally{c(!1)}};return f.useImperativeHandle(e,()=>({setOpen:a})),t.jsxs(t.Fragment,{children:[t.jsx(_,{sx:{textTransform:"none !important"},color:"secondary","data-cy":"store-toggle",onClick:()=>{a(!0)},endIcon:t.jsx(Le,{}),children:t.jsx(R,{color:"secondary",children:s.blockletRegistryList[x].name})}),t.jsx($,{title:r("store.blockletRegistry.switchRegistry"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:u,onClose:()=>a(!1),children:t.jsxs(me,{children:[s.blockletRegistryList.map((b,h)=>t.jsxs(ge,{button:!0,disabled:i,selected:x===h,"data-cy":"store-switch",onClick:()=>{if(!i){if(h===x){a(!1);return}w(h)}},children:[d===h&&i&&t.jsx(xe,{sx:{minWidth:24},children:t.jsx(N,{size:16})}),t.jsx(be,{children:t.jsx(Re,{teamDid:s.did,store:b,onDelete:()=>l(b.url)})})]},b.url)),t.jsx(V,{permission:"mutate_node",children:b=>t.jsx(Ce,{disabled:i||!b,onAdd:n,teamDid:s.did,blockletRegistryList:s.blockletRegistryList})})]})})]})}J.propTypes={ref:m.any,onChange:m.func,onDelete:m.func};function lt(){const{t:e}=S(),{info:n}=j(),[l]=L(z),{blockletRegistryList:s}=n,r=s.find(o=>l===o.url)||s[0],[i,c]=f.useState(r.url),u=n.routing.adminPath,a=k(window.location.origin,u),d=({detailUrl:o})=>{const g=new URL(o);g.searchParams.set("server-url",a);const x=document.createElement("a");x.setAttribute("target","_blank"),x.setAttribute("href",g.href),x.click()},p=f.useRef(null);return t.jsxs(Ae,{children:[t.jsxs(Ee,{separator:"›","aria-label":"breadcrumb",className:"page-breadcrumb",children:[t.jsx(R,{color:"textPrimary",children:e("common.store")}),t.jsx(J,{ref:p,onChange:o=>c(o),onDelete:o=>{i===o&&c(n.blockletRegistryList[0]?.url)}})]}),t.jsx(B,{className:"store-header",sx:{display:"flex",justifyContent:"space-between",p:0,m:0},children:t.jsx(R,{component:"h2",variant:"h4",color:"textPrimary",children:e("store.headerDescription")})}),t.jsx(Y,{className:"blocklet-list",handleSearchSelect:d,storeUrl:i})]})}const Ae=M.main`
6
+ .blocklet-list {
7
+ aside:hover {
8
+ height: calc(100vh - 235px);
9
+ }
10
+ }
11
+
12
+ .blocklet-list {
13
+ margin-top: -3px;
14
+ .filter-bar {
15
+ margin-top: -10px;
16
+ padding-top: 0;
17
+ background-color: ${e=>e.theme.palette.background.default};
18
+ }
19
+ }
20
+ `;export{lt as default};