@abtnode/webapp 1.16.28-beta-23b06b63 → 1.16.28-beta-bfbab430

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 (162) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-BxRt9WAM.js → Add-DEou6OQu.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-BDCD7rfw.js → ArrowDropDown-B8q6yJii.js} +1 -1
  5. package/dist/assets/{Autocomplete-mKcnfw_W.js → Autocomplete-CxHBaO5x.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-BTPbI2mY.js → Breadcrumbs--9MrOMZw.js} +1 -1
  7. package/dist/assets/{ButtonGroup-B4i-HvgZ.js → ButtonGroup-BbRXyWVe.js} +1 -1
  8. package/dist/assets/{CheckCircle-DO-RcLP9.js → CheckCircle-D6vwJd9K.js} +1 -1
  9. package/dist/assets/{ChevronLeft-DF7lcjk8.js → ChevronLeft-Bc2acyen.js} +1 -1
  10. package/dist/assets/{ChevronRight-CFOkpNut.js → ChevronRight-Bcko4z80.js} +1 -1
  11. package/dist/assets/{Close-TuMd444H.js → Close-DGnER_ve.js} +1 -1
  12. package/dist/assets/{Delete-DDy4lv2l.js → Delete-BGOcGa_D.js} +1 -1
  13. package/dist/assets/{DeleteOutline-5zk5MLVr.js → DeleteOutline-C7JmRduW.js} +1 -1
  14. package/dist/assets/{Done-DZAunZvS.js → Done-CydSjSOx.js} +1 -1
  15. package/dist/assets/{Edit-CGEHojUC.js → Edit-B0yxTPMe.js} +1 -1
  16. package/dist/assets/{EditIcon-BylMjCE4.js → EditIcon-CF5y6ttj.js} +1 -1
  17. package/dist/assets/{FilterList-dxewgEr3.js → FilterList-RGEuYf_e.js} +1 -1
  18. package/dist/assets/{Google-C7F2Ljnc.js → Google-CuSS9iHp.js} +1 -1
  19. package/dist/assets/{Https-Bv4vNlzR.js → Https-B3P9JJiw.js} +1 -1
  20. package/dist/assets/{InfoOutlined-BcGJkJJl.js → InfoOutlined-B4lqtuRU.js} +1 -1
  21. package/dist/assets/{InputAdornment-CELCg_HF.js → InputAdornment-BzCm_2kz.js} +1 -1
  22. package/dist/assets/{InputLabel-Cag35T0N.js → InputLabel-CdW9MyDY.js} +1 -1
  23. package/dist/assets/{LastPage-CHLGEMPh.js → LastPage-dDlMsztV.js} +1 -1
  24. package/dist/assets/{Launch-COxUNu4j.js → Launch-Dhs9Q_70.js} +1 -1
  25. package/dist/assets/{Link-BkQX3hDp.js → Link-DSNZ4PNo.js} +1 -1
  26. package/dist/assets/{LoadingButton-BeuL1wF-.js → LoadingButton-DrVP9tt_.js} +1 -1
  27. package/dist/assets/{LockIcon-D_Uy157g.js → LockIcon-BMilDbx1.js} +1 -1
  28. package/dist/assets/{Loop-Be9bzVMj.js → Loop-CAxjNyCL.js} +1 -1
  29. package/dist/assets/{MoreVert-DCY4R0I6.js → MoreVert-BL42DjcZ.js} +1 -1
  30. package/dist/assets/{Pagination-B8Go1A0z.js → Pagination-DWKt9t_F.js} +1 -1
  31. package/dist/assets/{Public-XvGsN53V.js → Public-BobH8eAT.js} +1 -1
  32. package/dist/assets/{SchemaReference.es-CnykePQs.js → SchemaReference.es-MUfmufV5.js} +1 -1
  33. package/dist/assets/{Search-DbENMUmJ.js → Search-J7ilvWof.js} +1 -1
  34. package/dist/assets/{Select-BDtCsGy7.js → Select-DJl6HmRs.js} +1 -1
  35. package/dist/assets/{Skeleton-D9CMhdYr.js → Skeleton-CSyuj2cV.js} +1 -1
  36. package/dist/assets/{Slider-zMdqR1_D.js → Slider-DRCfqhU1.js} +1 -1
  37. package/dist/assets/{Stepper-Df_RHJ43.js → Stepper-C2a4PQ3_.js} +1 -1
  38. package/dist/assets/{TextField-PSikz4cm.js → TextField-BD0it3d0.js} +1 -1
  39. package/dist/assets/{ToggleButtonGroup-Bnx6aryv.js → ToggleButtonGroup-CR3zvwUX.js} +1 -1
  40. package/dist/assets/{ViewList-B9miFzh4.js → ViewList-D3pEO1Ca.js} +1 -1
  41. package/dist/assets/{actions-BRgdN5cj.js → actions-CL-Y8Eer.js} +1 -1
  42. package/dist/assets/{actions-D5ZCmrTM.js → actions-Dx15LaaC.js} +1 -1
  43. package/dist/assets/{agreement-hUkyT-rU.js → agreement-Dd1yuqFa.js} +1 -1
  44. package/dist/assets/api-Ce74sKYG.js +1 -0
  45. package/dist/assets/{app-avatar-CxghIswG.js → app-avatar-rgMNqIXw.js} +1 -1
  46. package/dist/assets/{audit-logs-Cj79FN7v.js → audit-logs-CmuAN_qn.js} +1 -1
  47. package/dist/assets/{brace-fold.es-D8DT3AwS.js → brace-fold.es-psNZdrWu.js} +1 -1
  48. package/dist/assets/{bundle-avatar-DsCsmlpx.js → bundle-avatar-C_2wXttj.js} +1 -1
  49. package/dist/assets/{chart-CD97eKtM.js → chart-sF6tbndw.js} +1 -1
  50. package/dist/assets/{click-to-copy-BUpbo6bk.js → click-to-copy-KBQWqGOq.js} +1 -1
  51. package/dist/assets/{closebrackets.es-6cHaiFAL.js → closebrackets.es-ZHCmqLUg.js} +1 -1
  52. package/dist/assets/{codemirror.es-fM7kqYGL.js → codemirror.es-DmoQbR9T.js} +1 -1
  53. package/dist/assets/{comment.es-ug3wJMDP.js → comment.es-B7zL23d5.js} +1 -1
  54. package/dist/assets/{config-navigation-BCwYgsZE.js → config-navigation-BN7PO-cf.js} +1 -1
  55. package/dist/assets/{delete-confirm-D2bWY0RH.js → delete-confirm-ztUwg2kj.js} +1 -1
  56. package/dist/assets/{detail-C1AiJgJr.js → detail-CXbwmlpg.js} +3 -3
  57. package/dist/assets/{dialog.es-COYIW3n4.js → dialog.es-CFWHh6H2.js} +1 -1
  58. package/dist/assets/{download-Dr-5p0Eo.js → download-bWTPRaod.js} +1 -1
  59. package/dist/assets/{foldgutter.es-C-4TReDS.js → foldgutter.es-CqRhTHya.js} +1 -1
  60. package/dist/assets/getValidReactChildren-DKO9kPop.js +1 -0
  61. package/dist/assets/{hint.es-D-HPm2KF.js → hint.es-DK_6KY-o.js} +1 -1
  62. package/dist/assets/{hint.es2-RMq3iMHV.js → hint.es2-CgWo28Uj.js} +1 -1
  63. package/dist/assets/{iframe-CZCbAGTG.js → iframe-C32DbqVc.js} +1 -1
  64. package/dist/assets/{index-BWDq0v0v.js → index-84DtgjQO.js} +1 -1
  65. package/dist/assets/{index-Boh9o_k5.js → index-B0WN-XH2.js} +1 -1
  66. package/dist/assets/{index-Cqjpq5LF.js → index-B4ZjZNN8.js} +1 -1
  67. package/dist/assets/{index-CqReN4T9.js → index-BA_TAXpL.js} +1 -1
  68. package/dist/assets/{index-SNuwf_Y1.js → index-BD7uC7gm.js} +3 -3
  69. package/dist/assets/{index-By0wVBLr.js → index-BET56ssY.js} +1 -1
  70. package/dist/assets/{index-BViEd1Qy.js → index-BNulkcXj.js} +1 -1
  71. package/dist/assets/{index-B-DkREsH.js → index-BoZhSN8h.js} +1 -1
  72. package/dist/assets/{index-huf_vvxX.js → index-Bzs05ai8.js} +1 -1
  73. package/dist/assets/{index-Cl-qWd1J.js → index-C4aM6rsI.js} +1 -1
  74. package/dist/assets/index-C6fuJWed.js +262 -0
  75. package/dist/assets/{index-DFgkZLyi.js → index-CE4mBIM_.js} +1 -1
  76. package/dist/assets/{index-G8t_K0Nh.js → index-CEBXL16c.js} +1 -1
  77. package/dist/assets/{index-CfEdAej2.js → index-CYGLUEkg.js} +3 -3
  78. package/dist/assets/{index-BeUBkDTf.js → index-CYZ-ZpV5.js} +1 -1
  79. package/dist/assets/{index-B_hJh8p2.js → index-Ca7UJIsi.js} +1 -1
  80. package/dist/assets/{index-BIi9UAUe.js → index-CfOOBUnf.js} +1 -1
  81. package/dist/assets/{index-ANhJ54Qu.js → index-CiaQ1OoK.js} +1 -1
  82. package/dist/assets/{index-neNekbhs.js → index-Cj3s4CtX.js} +1 -1
  83. package/dist/assets/{index-B6qhr4Vv.js → index-CkI554oc.js} +3 -3
  84. package/dist/assets/{index-Mhb4iWrQ.js → index-Clbjq5Ay.js} +1 -1
  85. package/dist/assets/{index-D5672HTm.js → index-CsNkkebn.js} +1 -1
  86. package/dist/assets/{index-D7ku2TbR.js → index-CwOFD6vt.js} +1 -1
  87. package/dist/assets/{index-hV9d7GzX.js → index-CzZF4DJ9.js} +1 -1
  88. package/dist/assets/{index-CIFB0zK6.js → index-D2cgpNGA.js} +5 -5
  89. package/dist/assets/{index-Cs9Skmx2.js → index-D5A34D-v.js} +1 -1
  90. package/dist/assets/{index-CLjGBj9p.js → index-D9RqTndg.js} +1 -1
  91. package/dist/assets/{index-DtPnnuqa.js → index-DA4GWzzk.js} +1 -1
  92. package/dist/assets/{index-C-KUrp7f.js → index-DG50udXf.js} +1 -1
  93. package/dist/assets/{index-CqR2D9OX.js → index-DHDAQRQS.js} +1 -1
  94. package/dist/assets/{index-BLP6cSf-.js → index-DbaRhcjK.js} +1 -1
  95. package/dist/assets/{index-DWB-NUab.js → index-Dc48oA1e.js} +1 -1
  96. package/dist/assets/{index-Bq_hHWAs.js → index-DeSsBKwN.js} +1 -1
  97. package/dist/assets/{index-Y-bwPY_P.js → index-Dlmo3B4P.js} +1 -1
  98. package/dist/assets/{index-CzRGlzNy.js → index-DoYPOJLK.js} +31 -31
  99. package/dist/assets/{index-Bgy25Yn1.js → index-DuHl-QWf.js} +1 -1
  100. package/dist/assets/{index-C9crSSRz.js → index-HMFhZkjG.js} +1 -1
  101. package/dist/assets/{index-BIT8HWlC.js → index-aVpXIXlo.js} +1 -1
  102. package/dist/assets/{index-3VaCz9mt.js → index-dQw_Q0Sx.js} +1 -1
  103. package/dist/assets/{index-DiW4LiJk.js → index-lXzOGnDm.js} +1 -1
  104. package/dist/assets/{index-oNZ-9nMm.js → index-lfuZxoX8.js} +1 -1
  105. package/dist/assets/{index-BR6wAIPR.js → index-owRl0jyR.js} +1 -1
  106. package/dist/assets/{index-BdfhWOrS.js → index-sNR67yJ2.js} +1 -1
  107. package/dist/assets/{index.es-CCaw5_ry.js → index.es-r9xAwx7Q.js} +1 -1
  108. package/dist/assets/{index.esm-Dh5y71gJ.js → index.esm-BCQ0BZMT.js} +1 -1
  109. package/dist/assets/{info-addon.es-C41XU5oD.js → info-addon.es-BDFdJmkW.js} +1 -1
  110. package/dist/assets/{info.es-DH9xH_89.js → info.es-CBadJSwW.js} +1 -1
  111. package/dist/assets/{install-from-url-C-r4nFEl.js → install-from-url-DuxahkOW.js} +1 -1
  112. package/dist/assets/{invitation-DAmBegDM.js → invitation-CSvGVnhZ.js} +1 -1
  113. package/dist/assets/{isEqual-DyC_2mMM.js → isEqual-DLk5wI5o.js} +1 -1
  114. package/dist/assets/{item-DTFWXAzg.js → item-Bv034Zcl.js} +1 -1
  115. package/dist/assets/{javascript.es-BNAO-PTr.js → javascript.es-Bq6krn1L.js} +1 -1
  116. package/dist/assets/{jump-to-line.es-BgSBJjpn.js → jump-to-line.es-Cm-kakdo.js} +1 -1
  117. package/dist/assets/{jump.es-C8STSrV8.js → jump.es-VEZCju5l.js} +1 -1
  118. package/dist/assets/{line-3blIv37C.js → line-VNmgswg2.js} +3 -3
  119. package/dist/assets/{lint.es-C9oc6jbS.js → lint.es-DhrBN362.js} +1 -1
  120. package/dist/assets/{lint.es2-B3G36s6A.js → lint.es2-CWQYXYDN.js} +1 -1
  121. package/dist/assets/{lint.es3-Bjrk4lMs.js → lint.es3-HsrZT9m1.js} +1 -1
  122. package/dist/assets/{list-header-Ft6n4kyL.js → list-header-DsWkp7IV.js} +1 -1
  123. package/dist/assets/{log-CA5Bfm_H.js → log-DgVRxyob.js} +1 -1
  124. package/dist/assets/{lottie-Djo2tbD7.js → lottie-CYf1PmCL.js} +1 -1
  125. package/dist/assets/{matchbrackets.es-yNyePD2j.js → matchbrackets.es-BthTk6Jn.js} +1 -1
  126. package/dist/assets/{memory-COJcMqTu.js → memory-dGmMptAO.js} +1 -1
  127. package/dist/assets/{mode.es-ul4Y9zvq.js → mode.es-_GdTPtpx.js} +1 -1
  128. package/dist/assets/{mode.es2-4D-VJI99.js → mode.es2-brmgogqJ.js} +1 -1
  129. package/dist/assets/{mode.es3-DnIPUjSA.js → mode.es3-DPGB-Rg-.js} +1 -1
  130. package/dist/assets/{onlineParser.es-DI_N_VZ6.js → onlineParser.es-BUsBjG_x.js} +1 -1
  131. package/dist/assets/{overview-CpWhs8pb.js → overview-BjqHXIvR.js} +1 -1
  132. package/dist/assets/{react-B-cs_65i.js → react-B-xa5K3p.js} +3 -3
  133. package/dist/assets/{redux-DJbvHHJc.js → redux-BBckwmBz.js} +1 -1
  134. package/dist/assets/{resource-dialog-Dwu2vad3.js → resource-dialog-CIpxrG7w.js} +1 -1
  135. package/dist/assets/{runtime-DlE-mVl3.js → runtime-mnz4kggA.js} +1 -1
  136. package/dist/assets/{search.es-DEvV0pC4.js → search.es-CV0d4AUV.js} +1 -1
  137. package/dist/assets/{searchcursor.es-CbJjnyZ6.js → searchcursor.es-CxYOh1mB.js} +1 -1
  138. package/dist/assets/service-DbM6n6e-.js +1 -0
  139. package/dist/assets/{show-hint.es-BAvfzA33.js → show-hint.es-GDHMVUwy.js} +1 -1
  140. package/dist/assets/{slicedToArray-DXz7P6Jc.js → slicedToArray-Pwxti1pp.js} +1 -1
  141. package/dist/assets/{spaces-C_MVXqkk.js → spaces-3s9pbV-M.js} +1 -1
  142. package/dist/assets/{sublime.es-DEVL-EBh.js → sublime.es-BiX2tLa_.js} +1 -1
  143. package/dist/assets/{switch-control-CoAFfWfN.js → switch-control-1CHbJzd5.js} +1 -1
  144. package/dist/assets/{table-icons-D2RHWn5N.js → table-icons-DjAM1A7C.js} +1 -1
  145. package/dist/assets/{tag-CibAXXt2.js → tag-CdoBHuxB.js} +1 -1
  146. package/dist/assets/{team-hCJdZoCR.js → team-CrNp0IgF.js} +1 -1
  147. package/dist/assets/{toUpper-DN83jaGL.js → toUpper-C7enqaxL.js} +1 -1
  148. package/dist/assets/{traffic-CpCVERHX.js → traffic-Bw_e_wEP.js} +1 -1
  149. package/dist/assets/{url-evaluation-CpLQCS2C.js → url-evaluation-asC5XTLH.js} +1 -1
  150. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-ADtRY_BA.js → use-blocklet-info-for-connect-did-spaces-R82fq7SC.js} +1 -1
  151. package/dist/assets/{useLocalStorage-Dhldbzlz.js → useLocalStorage-DRS65jti.js} +1 -1
  152. package/dist/assets/{util-BSjBcY1Q.js → util-BC42zb0j.js} +1 -1
  153. package/dist/assets/{wait-container-CrBtw_vv.js → wait-container-DzvlQJkQ.js} +1 -1
  154. package/dist/assets/{withStyles-BhZN297l.js → withStyles-CPWhmxGn.js} +1 -1
  155. package/dist/assets/{wrap-locale-CA8TyTj3.js → wrap-locale-p7nrsckq.js} +1 -1
  156. package/dist/index.html +1 -1
  157. package/dist/service-worker.js +1 -1
  158. package/package.json +1 -1
  159. package/dist/assets/api-D8MiIqQL.js +0 -1
  160. package/dist/assets/getValidReactChildren-8XnhSvA9.js +0 -1
  161. package/dist/assets/index-B5LCLWLI.js +0 -262
  162. package/dist/assets/service-CmT6d4X_.js +0 -1
@@ -1 +1 @@
1
- import{C as o}from"./codemirror.es-fM7kqYGL.js";import{_ as t,$ as i,a1 as l}from"./index-CIFB0zK6.js";import{o as c}from"./onlineParser.es-DI_N_VZ6.js";import"./index-B6qhr4Vv.js";var d=Object.defineProperty,b=(e,r)=>d(e,"name",{value:r,configurable:!0});o.defineMode("graphql-results",e=>{const r=c({eatWhitespace:n=>n.eatSpace(),lexRules:p,parseRules:m,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:r.startState,token:r.token,indent:s,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});function s(e,r){var n,u;const a=e.levels;return((!a||a.length===0?e.indentLevel:a[a.length-1]-(!((n=this.electricInput)===null||n===void 0)&&n.test(r)?1:0))||0)*(((u=this.config)===null||u===void 0?void 0:u.indentUnit)||0)}b(s,"indent");const p={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},m={Document:[t("{"),i("Entry",t(",")),t("}")],Entry:[l("String","def"),t(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[l("Number","number")],StringValue:[l("String","string")],BooleanValue:[l("Keyword","builtin")],NullValue:[l("Keyword","keyword")],ListValue:[t("["),i("Value",t(",")),t("]")],ObjectValue:[t("{"),i("ObjectField",t(",")),t("}")],ObjectField:[l("String","property"),t(":"),"Value"]};
1
+ import{C as o}from"./codemirror.es-DmoQbR9T.js";import{_ as t,$ as i,a1 as l}from"./index-D2cgpNGA.js";import{o as c}from"./onlineParser.es-BUsBjG_x.js";import"./index-CkI554oc.js";var d=Object.defineProperty,b=(e,r)=>d(e,"name",{value:r,configurable:!0});o.defineMode("graphql-results",e=>{const r=c({eatWhitespace:n=>n.eatSpace(),lexRules:p,parseRules:m,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:r.startState,token:r.token,indent:s,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});function s(e,r){var n,u;const a=e.levels;return((!a||a.length===0?e.indentLevel:a[a.length-1]-(!((n=this.electricInput)===null||n===void 0)&&n.test(r)?1:0))||0)*(((u=this.config)===null||u===void 0?void 0:u.indentUnit)||0)}b(s,"indent");const p={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},m={Document:[t("{"),i("Entry",t(",")),t("}")],Entry:[l("String","def"),t(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[l("Number","number")],StringValue:[l("String","string")],BooleanValue:[l("Keyword","builtin")],NullValue:[l("Keyword","keyword")],ListValue:[t("["),i("Value",t(",")),t("]")],ObjectValue:[t("{"),i("ObjectField",t(",")),t("}")],ObjectField:[l("String","property"),t(":"),"Value"]};
@@ -1 +1 @@
1
- import{C as b}from"./codemirror.es-fM7kqYGL.js";import{_ as t,$ as i,a0 as s,a1 as n}from"./index-CIFB0zK6.js";import{o as m}from"./onlineParser.es-DI_N_VZ6.js";import"./index-B6qhr4Vv.js";var p=Object.defineProperty,c=(e,a)=>p(e,"name",{value:a,configurable:!0});b.defineMode("graphql-variables",e=>{const a=m({eatWhitespace:r=>r.eatSpace(),lexRules:V,parseRules:v,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:a.startState,token:a.token,indent:d,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});function d(e,a){var r,u;const l=e.levels;return((!l||l.length===0?e.indentLevel:l[l.length-1]-(!((r=this.electricInput)===null||r===void 0)&&r.test(a)?1:0))||0)*(((u=this.config)===null||u===void 0?void 0:u.indentUnit)||0)}c(d,"indent");const V={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},v={Document:[t("{"),i("Variable",s(t(","))),t("}")],Variable:[o("variable"),t(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[n("Number","number")],StringValue:[n("String","string")],BooleanValue:[n("Keyword","builtin")],NullValue:[n("Keyword","keyword")],ListValue:[t("["),i("Value",s(t(","))),t("]")],ObjectValue:[t("{"),i("ObjectField",s(t(","))),t("}")],ObjectField:[o("attribute"),t(":"),"Value"]};function o(e){return{style:e,match:a=>a.kind==="String",update(a,r){a.name=r.value.slice(1,-1)}}}c(o,"namedKey");
1
+ import{C as b}from"./codemirror.es-DmoQbR9T.js";import{_ as t,$ as i,a0 as s,a1 as n}from"./index-D2cgpNGA.js";import{o as m}from"./onlineParser.es-BUsBjG_x.js";import"./index-CkI554oc.js";var p=Object.defineProperty,c=(e,a)=>p(e,"name",{value:a,configurable:!0});b.defineMode("graphql-variables",e=>{const a=m({eatWhitespace:r=>r.eatSpace(),lexRules:V,parseRules:v,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:a.startState,token:a.token,indent:d,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});function d(e,a){var r,u;const l=e.levels;return((!l||l.length===0?e.indentLevel:l[l.length-1]-(!((r=this.electricInput)===null||r===void 0)&&r.test(a)?1:0))||0)*(((u=this.config)===null||u===void 0?void 0:u.indentUnit)||0)}c(d,"indent");const V={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},v={Document:[t("{"),i("Variable",s(t(","))),t("}")],Variable:[o("variable"),t(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[n("Number","number")],StringValue:[n("String","string")],BooleanValue:[n("Keyword","builtin")],NullValue:[n("Keyword","keyword")],ListValue:[t("["),i("Value",s(t(","))),t("]")],ObjectValue:[t("{"),i("ObjectField",s(t(","))),t("}")],ObjectField:[o("attribute"),t(":"),"Value"]};function o(e){return{style:e,match:a=>a.kind==="String",update(a,r){a.name=r.value.slice(1,-1)}}}c(o,"namedKey");
@@ -1 +1 @@
1
- import{K as t,s as L,L as A,P}from"./index-CIFB0zK6.js";var b=Object.defineProperty,o=(e,n)=>b(e,"name",{value:n,configurable:!0});function w(e={eatWhitespace:n=>n.eatWhile(L),lexRules:A,parseRules:P,editorConfig:{}}){return{startState(){const n={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return f(e.parseRules,n,t.DOCUMENT),n},token(n,l){return h(n,l,e)}}}o(w,"onlineParser");function h(e,n,l){var i;if(n.inBlockstring)return e.match(/.*"""/)?(n.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:p,parseRules:y,eatWhitespace:m,editorConfig:v}=l;if(n.rule&&n.rule.length===0?d(n):n.needsAdvance&&(n.needsAdvance=!1,c(n,!0)),e.sol()){const r=(v==null?void 0:v.tabSize)||2;n.indentLevel=Math.floor(e.indentation()/r)}if(m(e))return"ws";const u=k(p,e);if(!u)return e.match(/\S+/)||e.match(/\s/),f(a,n,"Invalid"),"invalidchar";if(u.kind==="Comment")return f(a,n,"Comment"),"comment";const R=s({},n);if(u.kind==="Punctuation"){if(/^[{([]/.test(u.value))n.indentLevel!==void 0&&(n.levels=(n.levels||[]).concat(n.indentLevel+1));else if(/^[})\]]/.test(u.value)){const r=n.levels=(n.levels||[]).slice(0,-1);n.indentLevel&&r.length>0&&r[r.length-1]<n.indentLevel&&(n.indentLevel=r[r.length-1])}}for(;n.rule;){let r=typeof n.rule=="function"?n.step===0?n.rule(u,e):null:n.rule[n.step];if(n.needsSeparator&&(r=r==null?void 0:r.separator),r){if(r.ofRule&&(r=r.ofRule),typeof r=="string"){f(y,n,r);continue}if(!((i=r.match)===null||i===void 0)&&i.call(r,u))return r.update&&r.update(n,u),u.kind==="Punctuation"?c(n,!0):n.needsAdvance=!0,r.style}g(n)}return s(n,R),f(a,n,"Invalid"),"invalidchar"}o(h,"getToken");function s(e,n){const l=Object.keys(n);for(let i=0;i<l.length;i++)e[l[i]]=n[l[i]];return e}o(s,"assign");const a={Invalid:[],Comment:[]};function f(e,n,l){if(!e[l])throw new TypeError("Unknown rule: "+l);n.prevState=Object.assign({},n),n.kind=l,n.name=null,n.type=null,n.rule=e[l],n.step=0,n.needsSeparator=!1}o(f,"pushRule");function d(e){e.prevState&&(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState=e.prevState.prevState)}o(d,"popRule");function c(e,n){var l;if(S(e)&&e.rule){const i=e.rule[e.step];if(i.separator){const p=i.separator;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&p.ofRule)return}if(n)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)d(e),e.rule&&(S(e)?!((l=e.rule)===null||l===void 0)&&l[e.step].separator&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}o(c,"advanceRule");function S(e){const n=Array.isArray(e.rule)&&typeof e.rule[e.step]!="string"&&e.rule[e.step];return n&&n.isList}o(S,"isList");function g(e){for(;e.rule&&!(Array.isArray(e.rule)&&e.rule[e.step].ofRule);)d(e);e.rule&&c(e,!1)}o(g,"unsuccessful");function k(e,n){const l=Object.keys(e);for(let i=0;i<l.length;i++){const p=n.match(e[l[i]]);if(p&&p instanceof Array)return{kind:l[i],value:p[0]}}}o(k,"lex");export{w as o};
1
+ import{K as t,s as L,L as A,P}from"./index-D2cgpNGA.js";var b=Object.defineProperty,o=(e,n)=>b(e,"name",{value:n,configurable:!0});function w(e={eatWhitespace:n=>n.eatWhile(L),lexRules:A,parseRules:P,editorConfig:{}}){return{startState(){const n={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return f(e.parseRules,n,t.DOCUMENT),n},token(n,l){return h(n,l,e)}}}o(w,"onlineParser");function h(e,n,l){var i;if(n.inBlockstring)return e.match(/.*"""/)?(n.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:p,parseRules:y,eatWhitespace:m,editorConfig:v}=l;if(n.rule&&n.rule.length===0?d(n):n.needsAdvance&&(n.needsAdvance=!1,c(n,!0)),e.sol()){const r=(v==null?void 0:v.tabSize)||2;n.indentLevel=Math.floor(e.indentation()/r)}if(m(e))return"ws";const u=k(p,e);if(!u)return e.match(/\S+/)||e.match(/\s/),f(a,n,"Invalid"),"invalidchar";if(u.kind==="Comment")return f(a,n,"Comment"),"comment";const R=s({},n);if(u.kind==="Punctuation"){if(/^[{([]/.test(u.value))n.indentLevel!==void 0&&(n.levels=(n.levels||[]).concat(n.indentLevel+1));else if(/^[})\]]/.test(u.value)){const r=n.levels=(n.levels||[]).slice(0,-1);n.indentLevel&&r.length>0&&r[r.length-1]<n.indentLevel&&(n.indentLevel=r[r.length-1])}}for(;n.rule;){let r=typeof n.rule=="function"?n.step===0?n.rule(u,e):null:n.rule[n.step];if(n.needsSeparator&&(r=r==null?void 0:r.separator),r){if(r.ofRule&&(r=r.ofRule),typeof r=="string"){f(y,n,r);continue}if(!((i=r.match)===null||i===void 0)&&i.call(r,u))return r.update&&r.update(n,u),u.kind==="Punctuation"?c(n,!0):n.needsAdvance=!0,r.style}g(n)}return s(n,R),f(a,n,"Invalid"),"invalidchar"}o(h,"getToken");function s(e,n){const l=Object.keys(n);for(let i=0;i<l.length;i++)e[l[i]]=n[l[i]];return e}o(s,"assign");const a={Invalid:[],Comment:[]};function f(e,n,l){if(!e[l])throw new TypeError("Unknown rule: "+l);n.prevState=Object.assign({},n),n.kind=l,n.name=null,n.type=null,n.rule=e[l],n.step=0,n.needsSeparator=!1}o(f,"pushRule");function d(e){e.prevState&&(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState=e.prevState.prevState)}o(d,"popRule");function c(e,n){var l;if(S(e)&&e.rule){const i=e.rule[e.step];if(i.separator){const p=i.separator;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&p.ofRule)return}if(n)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)d(e),e.rule&&(S(e)?!((l=e.rule)===null||l===void 0)&&l[e.step].separator&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}o(c,"advanceRule");function S(e){const n=Array.isArray(e.rule)&&typeof e.rule[e.step]!="string"&&e.rule[e.step];return n&&n.isList}o(S,"isList");function g(e){for(;e.rule&&!(Array.isArray(e.rule)&&e.rule[e.step].ofRule);)d(e);e.rule&&c(e,!1)}o(g,"unsuccessful");function k(e,n){const l=Object.keys(e);for(let i=0;i<l.length;i++){const p=n.match(e[l[i]]);if(p&&p instanceof Array)return{kind:l[i],value:p[0]}}}o(k,"lex");export{w as o};
@@ -1,4 +1,4 @@
1
- import{ba as K,H as le,aJ as ce,aK as de,j as e,cK as mt,dA as ut,P as r,aT as ze,q as E,r as S,bk as U,e as pt,b as Re,J as ft,ax as F,C as H,ad as G,A as O,gs as ht,g as Fe,gt as xt,gu as gt,gv as yt,gw as jt,gx as vt,X as bt,v as me,gy as Me,gz as Dt,gA as wt,O as h,m as I,gB as Ct,aR as St,V as Ee,i as At,x as Tt,av as It,dv as Pe,c5 as Be,S as Oe,B as V,aM as kt,aC as Rt,a9 as Et,a_ as Ue,a$ as We,b0 as He,k as Pt,b1 as _e,aZ as _t,bG as Ve,n as Qe,cc as Lt,gC as Ke,b2 as $t,gD as Nt,M as J,aN as qt,b3 as Je,a2 as zt,W as B,cF as Ft,at as Mt,T as Bt}from"./index-B6qhr4Vv.js";import{I as Ge}from"./index-B_hJh8p2.js";import{u as ue}from"./team-hCJdZoCR.js";import{D as Le,B as Ot}from"./url-evaluation-CpLQCS2C.js";import{d as Ut}from"./Add-BxRt9WAM.js";import{d as Wt}from"./LockIcon-D_Uy157g.js";import{E as Ht}from"./index-BIi9UAUe.js";import{d as Vt,a as Ye}from"./Https-Bv4vNlzR.js";import{d as Qt}from"./InfoOutlined-BcGJkJJl.js";import{r as Kt}from"./index-ANhJ54Qu.js";import"./api-D8MiIqQL.js";import{p as $e}from"./util-BSjBcY1Q.js";import{T as Jt}from"./TextField-PSikz4cm.js";import{L as Gt}from"./LoadingButton-BeuL1wF-.js";import{d as Ze}from"./Delete-DDy4lv2l.js";import{A as Yt}from"./actions-BRgdN5cj.js";import"./tag-CibAXXt2.js";import"./Select-BDtCsGy7.js";import"./InputLabel-Cag35T0N.js";function Zt({key:n="sm"}){const t=K();return le(t.breakpoints.down(n))}var pe={},Xt=de;Object.defineProperty(pe,"__esModule",{value:!0});var Xe=pe.default=void 0,en=Xt(ce()),tn=e;Xe=pe.default=(0,en.default)((0,tn.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew");var fe={},nn=de;Object.defineProperty(fe,"__esModule",{value:!0});var he=fe.default=void 0,on=nn(ce()),sn=e;he=fe.default=(0,on.default)((0,sn.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var xe={},rn=de;Object.defineProperty(xe,"__esModule",{value:!0});var oe=xe.default=void 0,an=rn(ce()),ln=e;oe=xe.default=(0,an.default)((0,ln.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");class cn{constructor(t,o,s){this.name=t,this.prefix=o,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class dn{constructor(t,o,s){if(this.name=t,this.prefix=o,o.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return et(this,t)}}class mn{constructor(t){this.decoders=t}or(t){return et(this,t)}decode(t){const o=t[0],s=this.decoders[o];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const et=(n,t)=>new mn({...n.decoders||{[n.prefix]:n},...t.decoders||{[t.prefix]:t}});class un{constructor(t,o,s,a){this.name=t,this.prefix=o,this.baseEncode=s,this.baseDecode=a,this.encoder=new cn(t,o,s),this.decoder=new dn(t,o,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const pn=({name:n,prefix:t,encode:o,decode:s})=>new un(n,t,o,s),fn=(n,t,o,s)=>{const a={};for(let u=0;u<t.length;++u)a[t[u]]=u;let l=n.length;for(;n[l-1]==="=";)--l;const i=new Uint8Array(l*o/8|0);let c=0,d=0,p=0;for(let u=0;u<l;++u){const g=a[n[u]];if(g===void 0)throw new SyntaxError(`Non-${s} character`);d=d<<o|g,c+=o,c>=8&&(c-=8,i[p++]=255&d>>c)}if(c>=o||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return i},hn=(n,t,o)=>{const s=t[t.length-1]==="=",a=(1<<o)-1;let l="",i=0,c=0;for(let d=0;d<n.length;++d)for(c=c<<8|n[d],i+=8;i>o;)i-=o,l+=t[a&c>>i];if(i&&(l+=t[a&c<<o-i]),s)for(;l.length*o&7;)l+="=";return l},N=({name:n,prefix:t,bitsPerChar:o,alphabet:s})=>pn({prefix:t,name:n,encode(a){return hn(a,s,o)},decode(a){return fn(a,s,o,n)}}),xn=N({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gn=N({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yn=N({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jn=N({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),vn=N({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),bn=N({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Dn=N({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wn=N({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Cn=N({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Sn=Object.freeze(Object.defineProperty({__proto__:null,base32:xn,base32hex:vn,base32hexpad:Dn,base32hexpadupper:wn,base32hexupper:bn,base32pad:yn,base32padupper:jn,base32upper:gn,base32z:Cn},Symbol.toStringTag,{value:"Module"})),An=mt(Sn),{toBuffer:Tn,toAddress:In,toBase58:kn,toHex:Rn}=ut,{base32:tt}=An,En=n=>{if(!n)return n;const t=Tn(In(n));return tt.encode(t)},Pn=n=>{if(!n)return n;const t=tt.decode(n),o=kn(t);return o.length>30?o:Rn(t)};var _n={encode:En,decode:Pn};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var v,w;const{t}=E(),[o,s]=S.useState(!1),{inService:a}=U(),[l,i]=S.useState(null),{siteId:c,domain:d,onAdd:p,children:u,did:g}=n,[P,j]=S.useState(!1),{api:C,ws:{useSubscription:k}}=U(),{mode:R,actions:{refreshDomainStatus:f}}=ue(),b=pt(async()=>{const{cert:y}=await C.findCertificateByDomain({input:{domain:d,did:g}});return y}),A=(y,L)=>{y.domain===d&&(j(!1),s(!1),a&&R!=="setup"&&(L==="success"?O.success(t("setup.domain.genCertSuccess",{domain:y.domain})):L==="error"&&O.error(t("setup.domain.genCertFailed",{domain:y.domain,message:y.message}))))};if(S.useEffect(()=>{var y;b.loading||j(Ln((y=b.value)==null?void 0:y.status))},[b.loading,(v=b.value)==null?void 0:v.status]),k(Re.BlockletEvents.certError,y=>A(y,"error")),k(Re.BlockletEvents.certIssued,y=>{b.retry(),f(y.domain),A(y,"success")}),b.loading||((w=b.value)==null?void 0:w.status)==="normal")return"";const D=()=>{s(!1),i(null)},m=async()=>{s(!0);try{await C.issueLetsEncryptCert({input:{siteId:c,domain:d,did:g,inBlockletSetup:R==="setup"}}),p(),j(!0)}catch(y){console.error(y),j(!1)}finally{s(!1),i(null)}},_={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ft,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:m,onCancel:D},W=y=>{y.stopPropagation(),i(_)};return e.jsxs(e.Fragment,{children:[P?e.jsx(F,{title:t("router.cert.issuing"),children:e.jsx(H,{size:12})}):u({loading:o,open:W}),l&&e.jsx(G,{color:"primary",title:l.title,description:l.description,confirm:l.confirm,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ge.propTypes={domain:r.string.isRequired,did:r.string.isRequired,siteId:r.string.isRequired,onAdd:r.func,children:r.any};ge.defaultProps={onAdd:()=>{},children:null};function ye(n){const{domain:t,domainStatus:o,...s}=n;return!ze(t)||o!=null&&o.isHttps?"":e.jsx(ge,{domain:t,...s})}ye.propTypes={domain:r.string.isRequired,domainStatus:r.shape({isHttps:r.bool}).isRequired,did:r.string.isRequired,onAdd:r.func,children:r.any};ye.defaultProps={onAdd:()=>{},children:null};var $n=ht;function Nn(n,t){for(var o=-1,s=n.length;++o<s&&$n(t,n[o],0)>-1;);return o}var qn=Nn,zn=xt,Fn=gt,Mn=yt,Bn=jt,On=qn,Ne=vt,Un=bt;function Wn(n,t,o){if(n=Un(n),n&&(o||t===void 0))return Fn(n);if(!n||!(t=zn(t)))return n;var s=Ne(n),a=Ne(t),l=On(s,a),i=Bn(s,a)+1;return Mn(s,l,i).join("")}var Hn=Wn;const nt=Fe(Hn),ot=S.createContext({}),{Provider:Vn,Consumer:Ro}=ot;function Qn({children:n}){const[t,o]=me({domain:"",error:null}),{locale:s}=E(),a={error:t.error,domain:t.domain,setError:l=>{o({error:l})},setDomain:l=>{const i=nt(l),c=Me(i,s);o({domain:i,error:c})}};return e.jsx(Vn,{value:{value:a},children:n})}function Kn(){const{value:n}=S.useContext(ot);return n}const qe=Dt,Jn=wt,st="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Gn=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:o}=await Jn.get(t.toString()),s=(c=o==null?void 0:o.componentMountPoints)==null?void 0:c.find(d=>d.did===st),a=new URL(n);a.pathname=s==null?void 0:s.mountPoint;const l=a.toString(),i=qe(l,"/api");return{base:l,api:i,domain:qe(i,"/domains")}};var Yn={DID_DOMAIN_SERVICE_DID:st,getDidDomainServiceURL:Gn},Y={exports:{}};const Zn=Kt,Xn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class it extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const eo=(n,t,o)=>{const s=o.retries-(t-1);return n.attemptNumber=t,n.retriesLeft=s,n},to=n=>Xn.includes(n),rt=(n,t)=>new Promise((o,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=Zn.operation(t);a.attempt(async l=>{try{o(await n(l))}catch(i){if(!(i instanceof Error)){s(new TypeError(`Non-error was thrown: "${i}". You should only throw errors.`));return}if(i instanceof it)a.stop(),s(i.originalError);else if(i instanceof TypeError&&!to(i.message))a.stop(),s(i);else{eo(i,l,t);try{await t.onFailedAttempt(i)}catch(c){s(c);return}a.retry(i)||s(a.mainError())}}})});Y.exports=rt;Y.exports.default=rt;Y.exports.AbortError=it;var no=Y.exports;const oo=Fe(no);function je({domain:n,resolvedTarget:t,...o}){const{t:s,locale:a}=E();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...o,children:[e.jsxs(h,{display:"flex",children:[s("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),s("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(se,{label:s("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(se,{label:s("router.domain.setup.recordValue"),value:t,locale:a})]})]})}je.propTypes={domain:r.string,resolvedTarget:r.string.isRequired};je.defaultProps={domain:""};function se({locale:n,label:t,value:o}){const s=le(l=>l.breakpoints.down("md")),a=K();return e.jsx(Ge,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(I,{component:"span",color:"primary.main",overflow:"auto",sx:s?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:o}),e.jsx(Ct,{content:o,locale:n,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}se.propTypes={locale:r.string.isRequired,label:r.string.isRequired,value:r.string.isRequired};function ve({siteId:n,teamDid:t,cnameDomain:o,defaultCustomDomain:s,onInputDomain:a,appId:l,appPk:i,onSuccess:c,onError:d,disabled:p,autoFocus:u,inBlockletSetup:g,shouldCheckDomain:P,onStateChange:j,currentIp:C,resolveDomain:k,...R}){const{t:f,locale:b}=E(),{api:A,info:D}=U(),m=Kn(),_=K(),W=Zt({key:"sm"}),[v,w]=me({submittingDomain:!1,domain:s,error:null,type:D!=null&&D.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),y=St(()=>Yn.getDidDomainServiceURL(D==null?void 0:D.nftDomainUrl));if(D!=null&&D.nftDomainUrl&&y.loading)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:e.jsx(H,{})})});if(y.error)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:y.error.message})});const L=y.value,at=()=>{w({invalidDNSDomain:null})},ee=async x=>{j(f("setup.domain.addingDomain")),await A.addDomainAlias({input:{id:n,domainAlias:x,teamDid:t,inBlockletSetup:!0}}),w({submittingDomain:!1}),c({domain:x,type:"inputDomain"})},Ae=async({domain:x,type:T,nftDid:M,chainHost:$})=>{try{if(!P){if(T==="inputDomain"){await ee(x);return}c({domain:x,type:T,nftDid:M,chainHost:$});return}j({text:f("setup.domain.checkingResolvable")});let q=30;const te=3e3,dt=q*1e3/te,Ie=setInterval(()=>{if(q<=0){clearInterval(Ie);return}j({text:`${f("setup.domain.checkingResolvable")} (${q--}s)`})},1e3),ke=await oo(async()=>{const{data:z}=await k(x);if(!z.address)throw new Error("Cannot resolve domain");return z.address},{retries:dt,minTimeout:te,maxTimeout:te,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Ie),!ke){const z=f("setup.domain.cannotResolve",{domain:x});if(T==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:T,submittingDomain:!1});return}if(ke!==C){const z=f("setup.domain.resolvedAddressError",{domain:x,curDomain:window.location.hostname});if(T==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:T,submittingDomain:!1});return}if(T==="nftDomain"){c({domain:x,type:"nftDomain"});return}await ee(x)}catch(q){O.error(q.message),j({text:""}),w({submittingDomain:!1})}},lt=async({domain:x,nftDid:T,chainHost:M})=>{try{const $=$e(x);w({submittingDomain:!0}),await A.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:$,nftDid:T,chainHost:M,teamDid:t,inBlockletSetup:g}});const q="nftDomain";w({showNFTDomainAuth:!1,type:q}),await Ae({domain:$,type:q,nftDid:T,chainHost:M})}catch($){O.error($.message)}finally{w({showNFTDomainAuth:!1,submittingDomain:!1})}},ct=async()=>{try{w({submittingDomain:!0});const x=$e(v.domain);if(D.nftDomainUrl&&L&&(await A.isDidDomain({input:{domain:x}})).value===!0){w({showNFTDomainAuth:!0});return}await Ae({domain:x,type:v.type})}catch(x){w({submittingDomain:!1}),m.setError(x.message)}},Te=m.error||v.error;return e.jsx(h,{...R,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[D.nftDomainUrl&&L&&e.jsxs(h,{sx:{color:_.palette.text.primary},children:[e.jsx(I,{children:f("router.domainAlias.addDomainNFT.tips")}),e.jsxs(I,{component:"div",children:[f("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(At,{href:L.base,sx:{display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:f("router.domainAlias.addDomainNFT.buy")}),e.jsx(Xe,{fontSize:"small"})]})]})]}),e.jsx(Jt,{sx:{display:"block",marginTop:"8px"},label:f("router.domainAlias.add.domainDescription"),helperText:v.type==="inputDomain"&&Te||f("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:p,value:v.domain,size:"small",variant:"outlined",error:!!Te&&v.type==="inputDomain",onChange:x=>{var $;const T=nt(($=x.target)==null?void 0:$.value);m.setDomain(T);const M=Me(T,b);w({domain:T,error:M,type:"inputDomain"}),a({domain:T,error:M,type:"inputDomain"})},autoFocus:u,onBlur:()=>{m.domain||(w({error:null}),m.setError(null))}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Gt,{"data-cy":"confirm-add-domain",fullWidth:W,variant:"contained",loading:v.submittingDomain,onClick:ct,children:f("common.add")})}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:_.palette.primary.main},onClick:()=>w({showDnsTip:!v.showDnsTip}),children:[e.jsx(Qt,{fontSize:"1em"}),f("router.domainAlias.showTipHint")]}),v.showDnsTip&&e.jsx(je,{domain:v.domain,resolvedTarget:o,style:{marginTop:"4px"}})]}),v.invalidDNSDomain&&e.jsx(G,{title:f("common.reminder"),description:f("setup.domain.invalidDNSReminder",{error:v.invalidDNSDomain.error}),color:"primary",confirm:f("setup.domain.continueAdd"),onConfirm:()=>ee(v.invalidDNSDomain.domain,v.type),onCancel:at}),L&&e.jsx(Tt,{open:v.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:L.api,checkFn:It.create({baseURL:L.api}).get,extraParams:{delegatee:l,delegateePk:i,domain:v.domain},onSuccess:lt,onClose:()=>w({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:f("router.domainAlias.addDomainNFT.connect.title"),scan:f("router.domainAlias.addDomainNFT.connect.scan"),confirm:f("router.domainAlias.addDomainNFT.connect.confirm"),success:f("router.domainAlias.addDomainNFT.connect.success")}})]})})}ve.propTypes={siteId:r.string.isRequired,currentIp:r.string,teamDid:r.string.isRequired,cnameDomain:r.string.isRequired,defaultCustomDomain:r.string,onInputDomain:r.func,onSuccess:r.func,appId:r.string,appPk:r.string,disabled:r.bool,autoFocus:r.bool,inBlockletSetup:r.bool,shouldCheckDomain:r.bool,onStateChange:r.func,resolveDomain:r.func,onError:r.func};ve.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Pe,onSuccess:Pe,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function be({id:n,children:t,title:o,teamDid:s,systemDomains:a,appId:l,appPk:i}){const{t:c}=E(),[d,p]=me({loading:!1,confirmSetting:null}),u=a.find(C=>Be.isDidDomain(C)),g=()=>{p({loading:!1,confirmSetting:null})},P={title:o||c("router.domainAlias.add.title"),description:function(k,R,f){return e.jsx(ve,{siteId:n,teamDid:s,cnameDomain:u,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:b,type:A,error:D})=>{R({...k,domain:b,type:A,__disableConfirm:!!D}),f(D)},appId:l,appPk:i})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:g},j=C=>{C.stopPropagation(),p({confirmSetting:P})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:d.loading,open:j}):e.jsxs(Oe,{onClick:j,className:"rule-action","data-cy":"action-add-domain-alias",children:[d.loading?e.jsx(H,{size:16}):e.jsx(Vt,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),d.confirmSetting&&e.jsx(G,{title:d.confirmSetting.title,description:d.confirmSetting.description,confirm:d.confirmSetting.confirm,cancel:d.confirmSetting.cancel,params:d.confirmSetting.params,onCancel:d.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:d.loading,maxWidth:"sm"})]})}be.propTypes={id:r.string.isRequired,children:r.any,title:r.string,teamDid:r.string,systemDomains:r.arrayOf(r.string).isRequired,appId:r.string,appPk:r.string.isRequired};be.defaultProps={children:null,title:"",teamDid:"",appId:null};function so(n){return e.jsx(Qn,{children:e.jsx(be,{...n})})}function De(n){const{t}=E(),[o,s]=S.useState(!1),[a,l]=S.useState(null),{id:i,domain:c,children:d,teamDid:p}=n,{api:u}=U(),g=()=>{s(!1),l(null)},P=async()=>{s(!0);try{await u.deleteDomainAlias({input:{id:i,domainAlias:c,teamDid:p}}),await kt(2e3)}catch(k){O.error(k.message)}finally{l(null),s(!1)}},j={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:P,onCancel:g},C=k=>{k.stopPropagation(),l(j)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:o,open:C}):e.jsxs(V,{edge:"end",onClick:C,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[o?e.jsx(H,{size:16}):e.jsx(Ze,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(G,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}De.propTypes={id:r.string.isRequired,domain:r.string.isRequired,children:r.any,teamDid:r.string};De.defaultProps={children:null,teamDid:""};function we({site:n,domain:t,blocklet:o}){const{t:s}=E(),a=t.value===window.location.hostname;return e.jsx(Yt,{"data-cy":"domain-actions",size:"large",actions:[({close:l})=>{var i;return e.jsx(De,{id:n.id,domain:t.value,teamDid:(i=o==null?void 0:o.meta)==null?void 0:i.did,children:({open:c})=>e.jsx(F,{title:a?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:t.isProtected||a,dense:!0,onClick:d=>{l(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Rt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ze,{})}),e.jsx(Et,{primary:s("common.delete")})]},"remove")})})})}]})}we.propTypes={site:r.object.isRequired,domain:r.object.isRequired,blocklet:r.object.isRequired};we.defaultProps={};const Z=r.shape({href:r.string,accessibility:r.shape({loading:r.bool,accessible:r.bool}),domainStatus:r.shape({isHttps:r.bool,matchedCert:r.object}),dns:r.shape({resolved:r.bool,ip:r.string})});function Ce({certificate:n}){const[t,o]=S.useState(null),s=U(),{t:a,locale:l}=E(),i=p=>{o(p.currentTarget)},c=()=>{o(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Ye,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:i,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Ue,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(We,{children:e.jsxs(He,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${s.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(I,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(I,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(I,{component:"div",children:`${a("common.issuer")}: ${Pt(n,"issuer.commonName","")}`}),e.jsx(I,{component:"div",children:`${a("router.cert.issuedOn")}: ${_e(n.validFrom,l)}`}),e.jsx(I,{component:"div",children:`${a("router.cert.expiryOn")}: ${_e(n.validTo,l)}`})]})]})})})]})}Ce.propTypes={certificate:r.object};Ce.defaultProps={certificate:{}};function Q({domain:n,filters:t}){const{t:o}=E(),{value:s,domainStatus:a}=n;if(!ze(s))return null;let l=null,i=null;const{isHttps:c,matchedCert:d}=a;if(!_t(s)){const{dns:{resolved:u,ip:g}={}}=a;u||g==="127.0.0.1"?l=e.jsx(F,{title:o("router.domain.verify.ok"),children:e.jsx(Le,{color:"success"})}):l=e.jsx(F,{title:o("router.domain.verify.notResolved"),children:e.jsx(Le,{color:"error"})})}c?i=e.jsx(Ce,{certificate:d}):i=e.jsx(F,{title:o("router.domain.https.bad"),children:e.jsx(Ye,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const p=t.map(u=>u==="domain"?l:u==="http"?i:null);return S.createElement(S.Fragment,null,...p)}Q.propTypes={domain:Z.isRequired,filters:r.array};Q.defaultProps={filters:["domain","http"]};const io=Ve(X,"mutate_blocklets"),ro=Ve(X,"",Lt);function Se(n){const{inService:t}=U(),{blocklet:o,loadingRuntimeInfo:s}=ue();let a=io;return t&&(a=ro),e.jsx(a,{...n,blocklet:o,inService:t,loadingRuntimeInfo:s})}Se.propTypes={listOnly:r.bool};Se.defaultProps={listOnly:!1};function X({hasPermission:n,blocklet:t,loadingRuntimeInfo:o,inService:s,listOnly:a}){var f,b,A,D;const{t:l}=E(),[i,c]=S.useState(!1),d=le(m=>m.breakpoints.down("md")),p=S.useMemo(()=>{let m=n;return Ke(t)&&(m=m&&s),m},[n,s,t]),{site:u}=t,g=S.useMemo(()=>{var m;return $t((m=t.site)==null?void 0:m.domainAliases)},[(f=t.site)==null?void 0:f.domainAliases]),P=[],j=[],C=_n.encode(t.appPid),k=(A=(b=t.environments)==null?void 0:b.find(m=>m.key==="BLOCKLET_APP_PK"))==null?void 0:A.value,R=Nt(g);return g.forEach(m=>{const _=m.value||"";Be.isDidDomain(_)&&!_.startsWith(C)?j.push(m):P.push(m)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:l("common.domain")}),p&&e.jsx(so,{id:u.id,title:l("router.domain.add.title"),teamDid:(D=t.meta)==null?void 0:D.did,appId:t.appPid,appPk:k,systemDomains:R==null?void 0:R.map(m=>m.value),children:({open:m})=>e.jsxs(V,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:m,disabled:J.isInProgress(t.status),children:[e.jsx(Ut,{style:{fontSize:"1.3em",marginRight:4}}),l("common.add")]})})]}),J.isAccessible(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(qt,{severity:"warning",children:l("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(i?g:P).map(m=>{var W,v;const _=m.value;return e.jsxs(S.Fragment,{children:[d&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(ae,{siteId:(W=t.site)==null?void 0:W.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]})]},_),!d&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsx(ae,{siteId:(v=t.site)==null?void 0:v.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]},_)]},_)})}),j.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(V,{endIcon:i?e.jsx(he,{}):e.jsx(Je,{}),onClick:()=>c(!i),children:l(i?"common.collapseAll":"blocklet.router.showAllDomains")})}),!g.length&&(o?e.jsx(H,{size:16}):e.jsx(Ht,{children:l("common.empty")}))]})}X.propTypes={hasPermission:r.bool,blocklet:r.object.isRequired,loadingRuntimeInfo:r.bool,inService:r.bool.isRequired,listOnly:r.bool};X.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function ie({domain:n,children:t,...o}){const{t:s}=E(),{href:a,accessibility:l}=n;return!l||l.loading?e.jsxs(ne,{...o,children:[t,e.jsx(F,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(H,{size:12})})})]}):l.accessible?e.jsx(ne,{...o,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(ne,{...o,children:e.jsx(F,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}ie.propTypes={domain:Z.isRequired,children:r.any.isRequired};const ne=Qe.span`
1
+ import{ba as K,H as le,aJ as ce,aK as de,j as e,cK as mt,dA as ut,P as r,aT as ze,q as E,r as S,bk as U,e as pt,b as Re,J as ft,ax as F,C as H,ad as G,A as O,gs as ht,g as Fe,gt as xt,gu as gt,gv as yt,gw as jt,gx as vt,X as bt,v as me,gy as Me,gz as Dt,gA as wt,O as h,m as I,gB as Ct,aR as St,V as Ee,i as At,x as Tt,av as It,dv as Pe,c5 as Be,S as Oe,B as V,aM as kt,aC as Rt,a9 as Et,a_ as Ue,a$ as We,b0 as He,k as Pt,b1 as _e,aZ as _t,bG as Ve,n as Qe,cc as Lt,gC as Ke,b2 as $t,gD as Nt,M as J,aN as qt,b3 as Je,a2 as zt,W as B,cF as Ft,at as Mt,T as Bt}from"./index-CkI554oc.js";import{I as Ge}from"./index-Ca7UJIsi.js";import{u as ue}from"./team-CrNp0IgF.js";import{D as Le,B as Ot}from"./url-evaluation-asC5XTLH.js";import{d as Ut}from"./Add-DEou6OQu.js";import{d as Wt}from"./LockIcon-BMilDbx1.js";import{E as Ht}from"./index-CfOOBUnf.js";import{d as Vt,a as Ye}from"./Https-B3P9JJiw.js";import{d as Qt}from"./InfoOutlined-B4lqtuRU.js";import{r as Kt}from"./index-CiaQ1OoK.js";import"./api-Ce74sKYG.js";import{p as $e}from"./util-BC42zb0j.js";import{T as Jt}from"./TextField-BD0it3d0.js";import{L as Gt}from"./LoadingButton-DrVP9tt_.js";import{d as Ze}from"./Delete-BGOcGa_D.js";import{A as Yt}from"./actions-CL-Y8Eer.js";import"./tag-CdoBHuxB.js";import"./Select-DJl6HmRs.js";import"./InputLabel-CdW9MyDY.js";function Zt({key:n="sm"}){const t=K();return le(t.breakpoints.down(n))}var pe={},Xt=de;Object.defineProperty(pe,"__esModule",{value:!0});var Xe=pe.default=void 0,en=Xt(ce()),tn=e;Xe=pe.default=(0,en.default)((0,tn.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew");var fe={},nn=de;Object.defineProperty(fe,"__esModule",{value:!0});var he=fe.default=void 0,on=nn(ce()),sn=e;he=fe.default=(0,on.default)((0,sn.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var xe={},rn=de;Object.defineProperty(xe,"__esModule",{value:!0});var oe=xe.default=void 0,an=rn(ce()),ln=e;oe=xe.default=(0,an.default)((0,ln.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond");class cn{constructor(t,o,s){this.name=t,this.prefix=o,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class dn{constructor(t,o,s){if(this.name=t,this.prefix=o,o.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=o.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return et(this,t)}}class mn{constructor(t){this.decoders=t}or(t){return et(this,t)}decode(t){const o=t[0],s=this.decoders[o];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const et=(n,t)=>new mn({...n.decoders||{[n.prefix]:n},...t.decoders||{[t.prefix]:t}});class un{constructor(t,o,s,a){this.name=t,this.prefix=o,this.baseEncode=s,this.baseDecode=a,this.encoder=new cn(t,o,s),this.decoder=new dn(t,o,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const pn=({name:n,prefix:t,encode:o,decode:s})=>new un(n,t,o,s),fn=(n,t,o,s)=>{const a={};for(let u=0;u<t.length;++u)a[t[u]]=u;let l=n.length;for(;n[l-1]==="=";)--l;const i=new Uint8Array(l*o/8|0);let c=0,d=0,p=0;for(let u=0;u<l;++u){const g=a[n[u]];if(g===void 0)throw new SyntaxError(`Non-${s} character`);d=d<<o|g,c+=o,c>=8&&(c-=8,i[p++]=255&d>>c)}if(c>=o||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return i},hn=(n,t,o)=>{const s=t[t.length-1]==="=",a=(1<<o)-1;let l="",i=0,c=0;for(let d=0;d<n.length;++d)for(c=c<<8|n[d],i+=8;i>o;)i-=o,l+=t[a&c>>i];if(i&&(l+=t[a&c<<o-i]),s)for(;l.length*o&7;)l+="=";return l},N=({name:n,prefix:t,bitsPerChar:o,alphabet:s})=>pn({prefix:t,name:n,encode(a){return hn(a,s,o)},decode(a){return fn(a,s,o,n)}}),xn=N({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gn=N({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yn=N({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jn=N({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),vn=N({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),bn=N({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Dn=N({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wn=N({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Cn=N({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Sn=Object.freeze(Object.defineProperty({__proto__:null,base32:xn,base32hex:vn,base32hexpad:Dn,base32hexpadupper:wn,base32hexupper:bn,base32pad:yn,base32padupper:jn,base32upper:gn,base32z:Cn},Symbol.toStringTag,{value:"Module"})),An=mt(Sn),{toBuffer:Tn,toAddress:In,toBase58:kn,toHex:Rn}=ut,{base32:tt}=An,En=n=>{if(!n)return n;const t=Tn(In(n));return tt.encode(t)},Pn=n=>{if(!n)return n;const t=tt.decode(n),o=kn(t);return o.length>30?o:Rn(t)};var _n={encode:En,decode:Pn};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var v,w;const{t}=E(),[o,s]=S.useState(!1),{inService:a}=U(),[l,i]=S.useState(null),{siteId:c,domain:d,onAdd:p,children:u,did:g}=n,[P,j]=S.useState(!1),{api:C,ws:{useSubscription:k}}=U(),{mode:R,actions:{refreshDomainStatus:f}}=ue(),b=pt(async()=>{const{cert:y}=await C.findCertificateByDomain({input:{domain:d,did:g}});return y}),A=(y,L)=>{y.domain===d&&(j(!1),s(!1),a&&R!=="setup"&&(L==="success"?O.success(t("setup.domain.genCertSuccess",{domain:y.domain})):L==="error"&&O.error(t("setup.domain.genCertFailed",{domain:y.domain,message:y.message}))))};if(S.useEffect(()=>{var y;b.loading||j(Ln((y=b.value)==null?void 0:y.status))},[b.loading,(v=b.value)==null?void 0:v.status]),k(Re.BlockletEvents.certError,y=>A(y,"error")),k(Re.BlockletEvents.certIssued,y=>{b.retry(),f(y.domain),A(y,"success")}),b.loading||((w=b.value)==null?void 0:w.status)==="normal")return"";const D=()=>{s(!1),i(null)},m=async()=>{s(!0);try{await C.issueLetsEncryptCert({input:{siteId:c,domain:d,did:g,inBlockletSetup:R==="setup"}}),p(),j(!0)}catch(y){console.error(y),j(!1)}finally{s(!1),i(null)}},_={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ft,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:m,onCancel:D},W=y=>{y.stopPropagation(),i(_)};return e.jsxs(e.Fragment,{children:[P?e.jsx(F,{title:t("router.cert.issuing"),children:e.jsx(H,{size:12})}):u({loading:o,open:W}),l&&e.jsx(G,{color:"primary",title:l.title,description:l.description,confirm:l.confirm,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}ge.propTypes={domain:r.string.isRequired,did:r.string.isRequired,siteId:r.string.isRequired,onAdd:r.func,children:r.any};ge.defaultProps={onAdd:()=>{},children:null};function ye(n){const{domain:t,domainStatus:o,...s}=n;return!ze(t)||o!=null&&o.isHttps?"":e.jsx(ge,{domain:t,...s})}ye.propTypes={domain:r.string.isRequired,domainStatus:r.shape({isHttps:r.bool}).isRequired,did:r.string.isRequired,onAdd:r.func,children:r.any};ye.defaultProps={onAdd:()=>{},children:null};var $n=ht;function Nn(n,t){for(var o=-1,s=n.length;++o<s&&$n(t,n[o],0)>-1;);return o}var qn=Nn,zn=xt,Fn=gt,Mn=yt,Bn=jt,On=qn,Ne=vt,Un=bt;function Wn(n,t,o){if(n=Un(n),n&&(o||t===void 0))return Fn(n);if(!n||!(t=zn(t)))return n;var s=Ne(n),a=Ne(t),l=On(s,a),i=Bn(s,a)+1;return Mn(s,l,i).join("")}var Hn=Wn;const nt=Fe(Hn),ot=S.createContext({}),{Provider:Vn,Consumer:Ro}=ot;function Qn({children:n}){const[t,o]=me({domain:"",error:null}),{locale:s}=E(),a={error:t.error,domain:t.domain,setError:l=>{o({error:l})},setDomain:l=>{const i=nt(l),c=Me(i,s);o({domain:i,error:c})}};return e.jsx(Vn,{value:{value:a},children:n})}function Kn(){const{value:n}=S.useContext(ot);return n}const qe=Dt,Jn=wt,st="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Gn=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:o}=await Jn.get(t.toString()),s=(c=o==null?void 0:o.componentMountPoints)==null?void 0:c.find(d=>d.did===st),a=new URL(n);a.pathname=s==null?void 0:s.mountPoint;const l=a.toString(),i=qe(l,"/api");return{base:l,api:i,domain:qe(i,"/domains")}};var Yn={DID_DOMAIN_SERVICE_DID:st,getDidDomainServiceURL:Gn},Y={exports:{}};const Zn=Kt,Xn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class it extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const eo=(n,t,o)=>{const s=o.retries-(t-1);return n.attemptNumber=t,n.retriesLeft=s,n},to=n=>Xn.includes(n),rt=(n,t)=>new Promise((o,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=Zn.operation(t);a.attempt(async l=>{try{o(await n(l))}catch(i){if(!(i instanceof Error)){s(new TypeError(`Non-error was thrown: "${i}". You should only throw errors.`));return}if(i instanceof it)a.stop(),s(i.originalError);else if(i instanceof TypeError&&!to(i.message))a.stop(),s(i);else{eo(i,l,t);try{await t.onFailedAttempt(i)}catch(c){s(c);return}a.retry(i)||s(a.mainError())}}})});Y.exports=rt;Y.exports.default=rt;Y.exports.AbortError=it;var no=Y.exports;const oo=Fe(no);function je({domain:n,resolvedTarget:t,...o}){const{t:s,locale:a}=E();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...o,children:[e.jsxs(h,{display:"flex",children:[s("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),s("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(se,{label:s("router.domain.setup.recordType"),value:"CNAME",locale:a}),e.jsx(se,{label:s("router.domain.setup.recordValue"),value:t,locale:a})]})]})}je.propTypes={domain:r.string,resolvedTarget:r.string.isRequired};je.defaultProps={domain:""};function se({locale:n,label:t,value:o}){const s=le(l=>l.breakpoints.down("md")),a=K();return e.jsx(Ge,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(I,{component:"span",color:"primary.main",overflow:"auto",sx:s?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:o}),e.jsx(Ct,{content:o,locale:n,style:{marginLeft:"4px",color:a.palette.text.secondary}})]})})}se.propTypes={locale:r.string.isRequired,label:r.string.isRequired,value:r.string.isRequired};function ve({siteId:n,teamDid:t,cnameDomain:o,defaultCustomDomain:s,onInputDomain:a,appId:l,appPk:i,onSuccess:c,onError:d,disabled:p,autoFocus:u,inBlockletSetup:g,shouldCheckDomain:P,onStateChange:j,currentIp:C,resolveDomain:k,...R}){const{t:f,locale:b}=E(),{api:A,info:D}=U(),m=Kn(),_=K(),W=Zt({key:"sm"}),[v,w]=me({submittingDomain:!1,domain:s,error:null,type:D!=null&&D.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),y=St(()=>Yn.getDidDomainServiceURL(D==null?void 0:D.nftDomainUrl));if(D!=null&&D.nftDomainUrl&&y.loading)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:e.jsx(H,{})})});if(y.error)return e.jsx(h,{...R,children:e.jsx(Ee,{relative:"parent",children:y.error.message})});const L=y.value,at=()=>{w({invalidDNSDomain:null})},ee=async x=>{j(f("setup.domain.addingDomain")),await A.addDomainAlias({input:{id:n,domainAlias:x,teamDid:t,inBlockletSetup:!0}}),w({submittingDomain:!1}),c({domain:x,type:"inputDomain"})},Ae=async({domain:x,type:T,nftDid:M,chainHost:$})=>{try{if(!P){if(T==="inputDomain"){await ee(x);return}c({domain:x,type:T,nftDid:M,chainHost:$});return}j({text:f("setup.domain.checkingResolvable")});let q=30;const te=3e3,dt=q*1e3/te,Ie=setInterval(()=>{if(q<=0){clearInterval(Ie);return}j({text:`${f("setup.domain.checkingResolvable")} (${q--}s)`})},1e3),ke=await oo(async()=>{const{data:z}=await k(x);if(!z.address)throw new Error("Cannot resolve domain");return z.address},{retries:dt,minTimeout:te,maxTimeout:te,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Ie),!ke){const z=f("setup.domain.cannotResolve",{domain:x});if(T==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:T,submittingDomain:!1});return}if(ke!==C){const z=f("setup.domain.resolvedAddressError",{domain:x,curDomain:window.location.hostname});if(T==="nftDomain"){O.error(z),c({domain:x,type:"nftDomain"});return}j({text:""}),w({invalidDNSDomain:{domain:x,error:z},domain:x,type:T,submittingDomain:!1});return}if(T==="nftDomain"){c({domain:x,type:"nftDomain"});return}await ee(x)}catch(q){O.error(q.message),j({text:""}),w({submittingDomain:!1})}},lt=async({domain:x,nftDid:T,chainHost:M})=>{try{const $=$e(x);w({submittingDomain:!0}),await A.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:$,nftDid:T,chainHost:M,teamDid:t,inBlockletSetup:g}});const q="nftDomain";w({showNFTDomainAuth:!1,type:q}),await Ae({domain:$,type:q,nftDid:T,chainHost:M})}catch($){O.error($.message)}finally{w({showNFTDomainAuth:!1,submittingDomain:!1})}},ct=async()=>{try{w({submittingDomain:!0});const x=$e(v.domain);if(D.nftDomainUrl&&L&&(await A.isDidDomain({input:{domain:x}})).value===!0){w({showNFTDomainAuth:!0});return}await Ae({domain:x,type:v.type})}catch(x){w({submittingDomain:!1}),m.setError(x.message)}},Te=m.error||v.error;return e.jsx(h,{...R,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[D.nftDomainUrl&&L&&e.jsxs(h,{sx:{color:_.palette.text.primary},children:[e.jsx(I,{children:f("router.domainAlias.addDomainNFT.tips")}),e.jsxs(I,{component:"div",children:[f("router.domainAlias.addDomainNFT.buyTip"),e.jsxs(At,{href:L.base,sx:{display:"inline-flex",alignItems:"center"},target:"_blank",children:[e.jsx("i",{children:f("router.domainAlias.addDomainNFT.buy")}),e.jsx(Xe,{fontSize:"small"})]})]})]}),e.jsx(Jt,{sx:{display:"block",marginTop:"8px"},label:f("router.domainAlias.add.domainDescription"),helperText:v.type==="inputDomain"&&Te||f("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:p,value:v.domain,size:"small",variant:"outlined",error:!!Te&&v.type==="inputDomain",onChange:x=>{var $;const T=nt(($=x.target)==null?void 0:$.value);m.setDomain(T);const M=Me(T,b);w({domain:T,error:M,type:"inputDomain"}),a({domain:T,error:M,type:"inputDomain"})},autoFocus:u,onBlur:()=>{m.domain||(w({error:null}),m.setError(null))}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Gt,{"data-cy":"confirm-add-domain",fullWidth:W,variant:"contained",loading:v.submittingDomain,onClick:ct,children:f("common.add")})}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:_.palette.primary.main},onClick:()=>w({showDnsTip:!v.showDnsTip}),children:[e.jsx(Qt,{fontSize:"1em"}),f("router.domainAlias.showTipHint")]}),v.showDnsTip&&e.jsx(je,{domain:v.domain,resolvedTarget:o,style:{marginTop:"4px"}})]}),v.invalidDNSDomain&&e.jsx(G,{title:f("common.reminder"),description:f("setup.domain.invalidDNSReminder",{error:v.invalidDNSDomain.error}),color:"primary",confirm:f("setup.domain.continueAdd"),onConfirm:()=>ee(v.invalidDNSDomain.domain,v.type),onCancel:at}),L&&e.jsx(Tt,{open:v.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:L.api,checkFn:It.create({baseURL:L.api}).get,extraParams:{delegatee:l,delegateePk:i,domain:v.domain},onSuccess:lt,onClose:()=>w({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:f("router.domainAlias.addDomainNFT.connect.title"),scan:f("router.domainAlias.addDomainNFT.connect.scan"),confirm:f("router.domainAlias.addDomainNFT.connect.confirm"),success:f("router.domainAlias.addDomainNFT.connect.success")}})]})})}ve.propTypes={siteId:r.string.isRequired,currentIp:r.string,teamDid:r.string.isRequired,cnameDomain:r.string.isRequired,defaultCustomDomain:r.string,onInputDomain:r.func,onSuccess:r.func,appId:r.string,appPk:r.string,disabled:r.bool,autoFocus:r.bool,inBlockletSetup:r.bool,shouldCheckDomain:r.bool,onStateChange:r.func,resolveDomain:r.func,onError:r.func};ve.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Pe,onSuccess:Pe,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function be({id:n,children:t,title:o,teamDid:s,systemDomains:a,appId:l,appPk:i}){const{t:c}=E(),[d,p]=me({loading:!1,confirmSetting:null}),u=a.find(C=>Be.isDidDomain(C)),g=()=>{p({loading:!1,confirmSetting:null})},P={title:o||c("router.domainAlias.add.title"),description:function(k,R,f){return e.jsx(ve,{siteId:n,teamDid:s,cnameDomain:u,onSuccess:()=>p({confirmSetting:null}),onInputDomain:({domain:b,type:A,error:D})=>{R({...k,domain:b,type:A,__disableConfirm:!!D}),f(D)},appId:l,appPk:i})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:g},j=C=>{C.stopPropagation(),p({confirmSetting:P})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:d.loading,open:j}):e.jsxs(Oe,{onClick:j,className:"rule-action","data-cy":"action-add-domain-alias",children:[d.loading?e.jsx(H,{size:16}):e.jsx(Vt,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),d.confirmSetting&&e.jsx(G,{title:d.confirmSetting.title,description:d.confirmSetting.description,confirm:d.confirmSetting.confirm,cancel:d.confirmSetting.cancel,params:d.confirmSetting.params,onCancel:d.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:d.loading,maxWidth:"sm"})]})}be.propTypes={id:r.string.isRequired,children:r.any,title:r.string,teamDid:r.string,systemDomains:r.arrayOf(r.string).isRequired,appId:r.string,appPk:r.string.isRequired};be.defaultProps={children:null,title:"",teamDid:"",appId:null};function so(n){return e.jsx(Qn,{children:e.jsx(be,{...n})})}function De(n){const{t}=E(),[o,s]=S.useState(!1),[a,l]=S.useState(null),{id:i,domain:c,children:d,teamDid:p}=n,{api:u}=U(),g=()=>{s(!1),l(null)},P=async()=>{s(!0);try{await u.deleteDomainAlias({input:{id:i,domainAlias:c,teamDid:p}}),await kt(2e3)}catch(k){O.error(k.message)}finally{l(null),s(!1)}},j={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:P,onCancel:g},C=k=>{k.stopPropagation(),l(j)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:o,open:C}):e.jsxs(V,{edge:"end",onClick:C,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[o?e.jsx(H,{size:16}):e.jsx(Ze,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),a&&e.jsx(G,{title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}De.propTypes={id:r.string.isRequired,domain:r.string.isRequired,children:r.any,teamDid:r.string};De.defaultProps={children:null,teamDid:""};function we({site:n,domain:t,blocklet:o}){const{t:s}=E(),a=t.value===window.location.hostname;return e.jsx(Yt,{"data-cy":"domain-actions",size:"large",actions:[({close:l})=>{var i;return e.jsx(De,{id:n.id,domain:t.value,teamDid:(i=o==null?void 0:o.meta)==null?void 0:i.did,children:({open:c})=>e.jsx(F,{title:a?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:t.isProtected||a,dense:!0,onClick:d=>{l(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Rt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ze,{})}),e.jsx(Et,{primary:s("common.delete")})]},"remove")})})})}]})}we.propTypes={site:r.object.isRequired,domain:r.object.isRequired,blocklet:r.object.isRequired};we.defaultProps={};const Z=r.shape({href:r.string,accessibility:r.shape({loading:r.bool,accessible:r.bool}),domainStatus:r.shape({isHttps:r.bool,matchedCert:r.object}),dns:r.shape({resolved:r.bool,ip:r.string})});function Ce({certificate:n}){const[t,o]=S.useState(null),s=U(),{t:a,locale:l}=E(),i=p=>{o(p.currentTarget)},c=()=>{o(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Ye,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:i,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(Ue,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(We,{children:e.jsxs(He,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${s.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(I,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(I,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(I,{component:"div",children:`${a("common.issuer")}: ${Pt(n,"issuer.commonName","")}`}),e.jsx(I,{component:"div",children:`${a("router.cert.issuedOn")}: ${_e(n.validFrom,l)}`}),e.jsx(I,{component:"div",children:`${a("router.cert.expiryOn")}: ${_e(n.validTo,l)}`})]})]})})})]})}Ce.propTypes={certificate:r.object};Ce.defaultProps={certificate:{}};function Q({domain:n,filters:t}){const{t:o}=E(),{value:s,domainStatus:a}=n;if(!ze(s))return null;let l=null,i=null;const{isHttps:c,matchedCert:d}=a;if(!_t(s)){const{dns:{resolved:u,ip:g}={}}=a;u||g==="127.0.0.1"?l=e.jsx(F,{title:o("router.domain.verify.ok"),children:e.jsx(Le,{color:"success"})}):l=e.jsx(F,{title:o("router.domain.verify.notResolved"),children:e.jsx(Le,{color:"error"})})}c?i=e.jsx(Ce,{certificate:d}):i=e.jsx(F,{title:o("router.domain.https.bad"),children:e.jsx(Ye,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const p=t.map(u=>u==="domain"?l:u==="http"?i:null);return S.createElement(S.Fragment,null,...p)}Q.propTypes={domain:Z.isRequired,filters:r.array};Q.defaultProps={filters:["domain","http"]};const io=Ve(X,"mutate_blocklets"),ro=Ve(X,"",Lt);function Se(n){const{inService:t}=U(),{blocklet:o,loadingRuntimeInfo:s}=ue();let a=io;return t&&(a=ro),e.jsx(a,{...n,blocklet:o,inService:t,loadingRuntimeInfo:s})}Se.propTypes={listOnly:r.bool};Se.defaultProps={listOnly:!1};function X({hasPermission:n,blocklet:t,loadingRuntimeInfo:o,inService:s,listOnly:a}){var f,b,A,D;const{t:l}=E(),[i,c]=S.useState(!1),d=le(m=>m.breakpoints.down("md")),p=S.useMemo(()=>{let m=n;return Ke(t)&&(m=m&&s),m},[n,s,t]),{site:u}=t,g=S.useMemo(()=>{var m;return $t((m=t.site)==null?void 0:m.domainAliases)},[(f=t.site)==null?void 0:f.domainAliases]),P=[],j=[],C=_n.encode(t.appPid),k=(A=(b=t.environments)==null?void 0:b.find(m=>m.key==="BLOCKLET_APP_PK"))==null?void 0:A.value,R=Nt(g);return g.forEach(m=>{const _=m.value||"";Be.isDidDomain(_)&&!_.startsWith(C)?j.push(m):P.push(m)}),e.jsxs(e.Fragment,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:l("common.domain")}),p&&e.jsx(so,{id:u.id,title:l("router.domain.add.title"),teamDid:(D=t.meta)==null?void 0:D.did,appId:t.appPid,appPk:k,systemDomains:R==null?void 0:R.map(m=>m.value),children:({open:m})=>e.jsxs(V,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:m,disabled:J.isInProgress(t.status),children:[e.jsx(Ut,{style:{fontSize:"1.3em",marginRight:4}}),l("common.add")]})})]}),J.isAccessible(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(qt,{severity:"warning",children:l("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(i?g:P).map(m=>{var W,v;const _=m.value;return e.jsxs(S.Fragment,{children:[d&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(ae,{siteId:(W=t.site)==null?void 0:W.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]})]},_),!d&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Q,{domain:m,filters:["domain"]},`${m.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(ie,{domain:m,target:"_blank",children:m.value})}),e.jsx(ae,{siteId:(v=t.site)==null?void 0:v.id,domain:m,blocklet:t,hasMutatePermission:p})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:p,site:u,domain:m,blocklet:t})})]},_)]},_)})}),j.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(V,{endIcon:i?e.jsx(he,{}):e.jsx(Je,{}),onClick:()=>c(!i),children:l(i?"common.collapseAll":"blocklet.router.showAllDomains")})}),!g.length&&(o?e.jsx(H,{size:16}):e.jsx(Ht,{children:l("common.empty")}))]})}X.propTypes={hasPermission:r.bool,blocklet:r.object.isRequired,loadingRuntimeInfo:r.bool,inService:r.bool.isRequired,listOnly:r.bool};X.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function ie({domain:n,children:t,...o}){const{t:s}=E(),{href:a,accessibility:l}=n;return!l||l.loading?e.jsxs(ne,{...o,children:[t,e.jsx(F,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(H,{size:12})})})]}):l.accessible?e.jsx(ne,{...o,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:t})}):e.jsx(ne,{...o,children:e.jsx(F,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})})})}ie.propTypes={domain:Z.isRequired,children:r.any.isRequired};const ne=Qe.span`
2
2
  &,
3
3
  & > * {
4
4
  color: #222;
@@ -1,5 +1,5 @@
1
- const __vite__fileDeps=["./index-SNuwf_Y1.js","./index-B6qhr4Vv.js","./index-D7K8de1w.css","./TextField-PSikz4cm.js","./Select-BDtCsGy7.js","./InputLabel-Cag35T0N.js","./url-evaluation-CpLQCS2C.js","./Delete-DDy4lv2l.js","./tag-CibAXXt2.js","./Slider-zMdqR1_D.js","./Skeleton-D9CMhdYr.js","./Close-TuMd444H.js","./index-huf_vvxX.js","./preact.module-B1z5cdvs.js","./index-ANhJ54Qu.js","./index-DFgkZLyi.js","./memoize-one.esm-BdPwpGay.js","./index-DWB-NUab.js","./resource-dialog-Dwu2vad3.js","./index-B-DkREsH.js","./index-BViEd1Qy.js","./index-BIi9UAUe.js","./index-BdfhWOrS.js","./index-neNekbhs.js","./FilterList-dxewgEr3.js","./LastPage-CHLGEMPh.js","./index-BIT8HWlC.js","./redux-DJbvHHJc.js","./Search-DbENMUmJ.js","./MoreVert-DCY4R0I6.js","./toUpper-DN83jaGL.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- var Rd=Object.defineProperty;var Dd=(i,e,t)=>e in i?Rd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Oe=(i,e,t)=>(Dd(i,typeof e!="symbol"?e+"":e,t),t);import{bK as Ad,j as Le,hE as Ud,dq as Id,f7 as Nd,g as lt,hF as Bd,hG as Mc,hH as Md,hI as Ld,cN as _o,di as ja,dz as St,hJ as Ts,P as D,r as ie,cP as yr,c6 as xr,a1 as Eo,hK as jd,bn as Lc,cn as zd,H as $d,hL as wr,h6 as qd,dH as Hd,O as jc,a2 as Vd,hM as Wd,fd as Gd,dn as Kd}from"./index-B6qhr4Vv.js";import{p as Xd,u as Yd}from"./index-huf_vvxX.js";import{N as Sr,y as d,b as Pt,l as Os,g as At,$ as _t,_ as Qd,B as zc}from"./preact.module-B1z5cdvs.js";import{a as Jd}from"./index-ANhJ54Qu.js";import{c as Ce}from"./index-DFgkZLyi.js";import{m as Pr}from"./memoize-one.esm-BdPwpGay.js";import"./index-DWB-NUab.js";import{W as Zd}from"./resource-dialog-Dwu2vad3.js";import"./index-BViEd1Qy.js";import"./index-BIi9UAUe.js";import"./index-BdfhWOrS.js";import"./index-neNekbhs.js";import{u as $c,t as eh}from"./toUpper-DN83jaGL.js";const th=Ad(Le.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function ih(i,e,t,n){for(var a=-1,s=i==null?0:i.length;++a<s;){var o=i[a];e(n,o,t(o),i)}return n}var nh=ih,ah=Ud;function sh(i,e,t,n){return ah(i,function(a,s,o){e(n,a,t(a),o)}),n}var oh=sh,rh=nh,lh=oh,ch=Id,uh=Nd;function ph(i,e){return function(t,n){var a=uh(t)?rh:lh,s=e?e():{};return a(t,i,ch(n),s)}}var dh=ph,hh=Bd,mh=dh,fh=mh(function(i,e,t){hh(i,t,e)}),gh=fh;const qc=lt(gh);function An(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var vh=0;function Hc(i){return"__private_"+vh+++"_"+i}function bh(i,e,t){const n=[];return i.forEach(a=>typeof a!="string"?n.push(a):e[Symbol.split](a).forEach((s,o,r)=>{s!==""&&n.push(s),o<r.length-1&&n.push(t)})),n}/**
1
+ const __vite__fileDeps=["./index-BD7uC7gm.js","./index-CkI554oc.js","./index-D7K8de1w.css","./TextField-BD0it3d0.js","./Select-DJl6HmRs.js","./InputLabel-CdW9MyDY.js","./url-evaluation-asC5XTLH.js","./Delete-BGOcGa_D.js","./tag-CdoBHuxB.js","./Slider-DRCfqhU1.js","./Skeleton-CSyuj2cV.js","./Close-DGnER_ve.js","./index-Bzs05ai8.js","./preact.module-B1z5cdvs.js","./index-CiaQ1OoK.js","./index-CE4mBIM_.js","./memoize-one.esm-BdPwpGay.js","./index-Dc48oA1e.js","./resource-dialog-CIpxrG7w.js","./index-BoZhSN8h.js","./index-BNulkcXj.js","./index-CfOOBUnf.js","./index-sNR67yJ2.js","./index-Cj3s4CtX.js","./FilterList-RGEuYf_e.js","./LastPage-dDlMsztV.js","./index-aVpXIXlo.js","./redux-BBckwmBz.js","./Search-J7ilvWof.js","./MoreVert-BL42DjcZ.js","./toUpper-C7enqaxL.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ var Rd=Object.defineProperty;var Dd=(i,e,t)=>e in i?Rd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Oe=(i,e,t)=>(Dd(i,typeof e!="symbol"?e+"":e,t),t);import{bK as Ad,j as Le,hE as Ud,dq as Id,f7 as Nd,g as lt,hF as Bd,hG as Mc,hH as Md,hI as Ld,cN as _o,di as ja,dz as St,hJ as Ts,P as D,r as ie,cP as yr,c6 as xr,a1 as Eo,hK as jd,bn as Lc,cn as zd,H as $d,hL as wr,h6 as qd,dH as Hd,O as jc,a2 as Vd,hM as Wd,fd as Gd,dn as Kd}from"./index-CkI554oc.js";import{p as Xd,u as Yd}from"./index-Bzs05ai8.js";import{N as Sr,y as d,b as Pt,l as Os,g as At,$ as _t,_ as Qd,B as zc}from"./preact.module-B1z5cdvs.js";import{a as Jd}from"./index-CiaQ1OoK.js";import{c as Ce}from"./index-CE4mBIM_.js";import{m as Pr}from"./memoize-one.esm-BdPwpGay.js";import"./index-Dc48oA1e.js";import{W as Zd}from"./resource-dialog-CIpxrG7w.js";import"./index-BNulkcXj.js";import"./index-CfOOBUnf.js";import"./index-sNR67yJ2.js";import"./index-Cj3s4CtX.js";import{u as $c,t as eh}from"./toUpper-C7enqaxL.js";const th=Ad(Le.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function ih(i,e,t,n){for(var a=-1,s=i==null?0:i.length;++a<s;){var o=i[a];e(n,o,t(o),i)}return n}var nh=ih,ah=Ud;function sh(i,e,t,n){return ah(i,function(a,s,o){e(n,a,t(a),o)}),n}var oh=sh,rh=nh,lh=oh,ch=Id,uh=Nd;function ph(i,e){return function(t,n){var a=uh(t)?rh:lh,s=e?e():{};return a(t,i,ch(n),s)}}var dh=ph,hh=Bd,mh=dh,fh=mh(function(i,e,t){hh(i,t,e)}),gh=fh;const qc=lt(gh);function An(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var vh=0;function Hc(i){return"__private_"+vh+++"_"+i}function bh(i,e,t){const n=[];return i.forEach(a=>typeof a!="string"?n.push(a):e[Symbol.split](a).forEach((s,o,r)=>{s!==""&&n.push(s),o<r.length-1&&n.push(t)})),n}/**
3
3
  * Takes a string with placeholder variables like `%{smart_count} file selected`
4
4
  * and replaces it with values from options `{smart_count: 5}`
5
5
  *
@@ -57,5 +57,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
57
57
  <div class="uppy-ProviderBrowserItem-inner uploaded-add-item">
58
58
  <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>
59
59
  </div>
60
- `,n.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(n,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));Oe(this,"convertImgToObject",Ts(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(n=>{var l;if(!(n!=null&&n.src))return;const{src:a}=n,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(c=>c.previewUrl===a),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=bw(s.originalname),[".mp4",".webm"].find(c=>{var u;return((u=n.src)==null?void 0:u.indexOf(c))>-1})){const c=document.createElement("video");c.src=n.src,c.width=n.width,c.height=n.height,c.autoplay=!0,c.setAttribute("playsinline","playsinline"),c.muted=!0,c.loop=!0,c.style="pointer-events: none;",o.appendChild(c)}else{const c=document.createElement("object");c.data=a,c.type=s.mimetype||"image/png",c.alt=s.originalname,c.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",c.loading="lazy",o.appendChild(c)}o.appendChild(r),n.parentNode.replaceChild(o,n)}),this.canConvertImgToObject=!1)},{wait:200}));Oe(this,"resetState",()=>{this.uploadedAPIData={...Rc},this.uploaded.setPluginState({...Dc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...Rc},this.addUploadItemFlag=!0,this.icon=()=>de("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[de("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),de("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),de("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),de("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var n;return!this.uploadedAPIData.loading&&((n=this.uploadedAPIData.files)==null?void 0:n.length)===0&&this.queryUploadedFromMediaKit(),de("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new Uo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...Dc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(n,a)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===a._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==a._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,a]}))},this.view.donePicking=()=>{const{currentSelection:n}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",n),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=n=>{const{scrollHeight:a,scrollTop:s,offsetHeight:o}=n.target;a-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const ww=xw,Ac={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,folderId:"",componentDid:"",components:[]},Uc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},Td={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},Sw={...Td,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class Pw extends ge{constructor(t,n){super(t,n);Oe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await Pi.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=$c([...t.resources.map(n=>{let a="file";const{filename:s}=n,o=Ca(s);return a=Ca(s,400),{filename:s,_id:s,id:s,name:s,icon:a,previewUrl:a,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});Oe(this,"resetState",()=>{this.apiData={...Ac},this.resources.setPluginState({...Uc})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Ac},this.icon=()=>de("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[de("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),de("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),de("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),de("div",{id:"resources",className:"uploaded",children:[de("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(n=>de("button",{style:this.apiData.componentDid===n.did?Sw:Td,id:n.componentDid,onClick:()=>{this.apiData.componentDid!==n.did&&(this.apiData.componentDid=n.did,this.queryResources())},children:eh(n.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new Uo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...Uc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(n,a)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===a.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==a.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,a]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:n}=this.resources.getPluginState();this.uppy.emit("uploaded:selected",n),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}const Fw=Pw;var Cw=jd();const _w=lt(Cw);class Ew extends ge{constructor(t,n){super(t,{...{},...n});Oe(this,"setHashFileName",async t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:s}=a,o=1024*1024*5,r=s.slice(0,o),l=_w.createHash("md5").update(await r.text()).digest("hex"),c=Po(a),u=`${l}${c?`.${c}`:""}`;this.uppy.setFileState(n,{hashFileName:u})}});Oe(this,"setMetaData",async t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:{relativePath:s,name:o},hashFileName:r}=a,l=s||o||r;this.uppy.setFileMeta(n,{relativePath:l,name:l})}});Oe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.setMetaData(t)});Oe(this,"tryDownloadRemoteFile",async t=>{var R,A;const{type:n,name:a,preview:s,source:o,isRemote:r,isDownloading:l,id:c,isLoading:u,remote:p,meta:h,errorCount:g=0}=t,m=!u&&r,x=`uploader:${c}:downloaded`,v=Po(t),b=(R=a==null?void 0:a.split("?"))==null?void 0:R[0],F=(()=>{const y=["jpg","jpeg"];return y.includes(v)&&y.some(S=>b==null?void 0:b.endsWith(S))?!0:b==null?void 0:b.endsWith(v)})()?b:`${b}${v?`.${v}`:""}`;if(m){const y=hw(s||((A=p==null?void 0:p.body)==null?void 0:A.url));if(g>=3)throw new Error("Download remote file failure");this.uppy.setFileState(c,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await Pi.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:y}}).then(S=>S==null?void 0:S.data).then(async S=>{const k=pw(S,F);this.uppy.setFileState(c,{name:F,extension:v,type:n,data:k,preview:s||kc(k),source:o,size:k.size,isDownloading:!1,isRemote:!1,meta:{...h,name:F,filename:F}}),this.uppy.getFile(c),this.uppy.emit(x,c)}).catch(async S=>{console.error("Axios download remote file error: ",S),this.uppy.setFileState(c,{isRemote:!0,isLoading:!1,errorCount:g+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(c))})}else l&&await(async()=>new Promise(S=>{this.uppy.once(x,async()=>{S()})}))()});Oe(this,"getPreviewFromData",t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:s,type:o,preview:r}=a;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(n,{preview:kc(s)})},o.indexOf("gif")>-1?1e3:0)}});Oe(this,"prepareUpload",t=>{const n=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),a=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(n).then(a)});this.id=this.opts.id||"DownloadRemoteFiles",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}const kw=Ew;class Tw extends ge{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>de("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:de("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[de("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),de("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return de("div",{id:"ai-image",className:"ai-image",children:de("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const Ow=Tw,Rw="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Dw=ie.lazy(()=>Lc(()=>import("./index-SNuwf_Y1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)),Ic="uploader-container",Xn="uploader-dashboard",Fo=localStorage.getItem("uppy_debug"),Aw=i=>{var r;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:n}=i,a=kd(e==null?void 0:e.companion),s=async l=>(await Pi.post("/api/image/generations",l)).data,o={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Fp,options:{quality:1},alwayUse:!0},(Fo||un()&&!Tc())&&{id:"Uploaded",plugin:ww,options:{params:n==null?void 0:n.params}},(Fo||un()&&!Tc())&&{id:"Resources",plugin:Fw,options:{params:n==null?void 0:n.params}},un()&&mw()&&t.AIImage&&{id:"AIImage",plugin:Ow,options:{companionUrl:a},onShowPanel:l=>{function c(){setTimeout(()=>{var p,h;const u=document.getElementById("ai-image");u?Gd(u).render(Le.jsx(Dw,{api:s,restrictions:o,i18n:(h=(p=l.current)==null?void 0:p.getUploader())==null?void 0:h.i18n,onSelect:g=>{const m=l.current.getUploader();m==null||m.emit("ai-image:selected",g),g.forEach((x,v)=>{const b=`AI Image [${v+1}].png`,C={name:b,type:"image/png",data:dw(x,b),source:"AIImage",isRemote:!1};m==null||m.addFile(C)})}})):c()},100)}c()}},{id:"Url",plugin:En,options:{companionUrl:a}},{id:"Webcam",plugin:au,options:{}},!!((r=window==null?void 0:window.blocklet)!=null&&r.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Fu,options:{companionUrl:a,companionHeaders:{},companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:kw,options:{companionUrl:a},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:zo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function vr(i){const{id:e,plugins:t,locale:n,onAfterResponse:a,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:c,pluginList:u,restrictions:p}=i,h=qc(u,"id"),g=kd(r==null?void 0:r.uploader);let m=new eu({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Fo||""),locale:y0[n||"en"],...o,restrictions:p}).use(Qp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:g,async onBeforeRequest(x,v){var y;const{hashFileName:b,id:C,meta:F}=v,R=Po(v);x.setHeader("x-uploader-file-name",`${b}`),x.setHeader("x-uploader-file-id",`${C}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",g),x.setHeader("x-uploader-metadata",JSON.stringify(F,(S,k)=>typeof k=="string"?encodeURIComponent(k):k));const A=(window==null?void 0:window.uploaderComponentId)||((y=window==null?void 0:window.blocklet)==null?void 0:y.componentId);A&&x.setHeader("x-component-did",(A||"").split("/").pop())},onAfterResponse:async(x,v)=>{const b={},C=x.getUnderlyingObject();try{C.response&&(b.data=JSON.parse(C.response))}catch{b.data={}}b.method=x.getMethod().toUpperCase(),b.url=x.getURL(),b.status=C.status,b.headers={...x._headers};const F=C.getAllResponseHeaders();if(F&&F.split(`\r
60
+ `,n.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(n,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));Oe(this,"convertImgToObject",Ts(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(n=>{var l;if(!(n!=null&&n.src))return;const{src:a}=n,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(c=>c.previewUrl===a),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=bw(s.originalname),[".mp4",".webm"].find(c=>{var u;return((u=n.src)==null?void 0:u.indexOf(c))>-1})){const c=document.createElement("video");c.src=n.src,c.width=n.width,c.height=n.height,c.autoplay=!0,c.setAttribute("playsinline","playsinline"),c.muted=!0,c.loop=!0,c.style="pointer-events: none;",o.appendChild(c)}else{const c=document.createElement("object");c.data=a,c.type=s.mimetype||"image/png",c.alt=s.originalname,c.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",c.loading="lazy",o.appendChild(c)}o.appendChild(r),n.parentNode.replaceChild(o,n)}),this.canConvertImgToObject=!1)},{wait:200}));Oe(this,"resetState",()=>{this.uploadedAPIData={...Rc},this.uploaded.setPluginState({...Dc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...Rc},this.addUploadItemFlag=!0,this.icon=()=>de("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[de("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),de("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),de("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),de("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var n;return!this.uploadedAPIData.loading&&((n=this.uploadedAPIData.files)==null?void 0:n.length)===0&&this.queryUploadedFromMediaKit(),de("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new Uo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...Dc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(n,a)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===a._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==a._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,a]}))},this.view.donePicking=()=>{const{currentSelection:n}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",n),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=n=>{const{scrollHeight:a,scrollTop:s,offsetHeight:o}=n.target;a-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const ww=xw,Ac={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,folderId:"",componentDid:"",components:[]},Uc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},Td={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},Sw={...Td,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class Pw extends ge{constructor(t,n){super(t,n);Oe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await Pi.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=$c([...t.resources.map(n=>{let a="file";const{filename:s}=n,o=Ca(s);return a=Ca(s,400),{filename:s,_id:s,id:s,name:s,icon:a,previewUrl:a,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});Oe(this,"resetState",()=>{this.apiData={...Ac},this.resources.setPluginState({...Uc})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Ac},this.icon=()=>de("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[de("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),de("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),de("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),de("div",{id:"resources",className:"uploaded",children:[de("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(n=>de("button",{style:this.apiData.componentDid===n.did?Sw:Td,id:n.componentDid,onClick:()=>{this.apiData.componentDid!==n.did&&(this.apiData.componentDid=n.did,this.queryResources())},children:eh(n.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new Uo(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...Uc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(n,a)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===a.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==a.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,a]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:n}=this.resources.getPluginState();this.uppy.emit("uploaded:selected",n),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}const Fw=Pw;var Cw=jd();const _w=lt(Cw);class Ew extends ge{constructor(t,n){super(t,{...{},...n});Oe(this,"setHashFileName",async t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:s}=a,o=1024*1024*5,r=s.slice(0,o),l=_w.createHash("md5").update(await r.text()).digest("hex"),c=Po(a),u=`${l}${c?`.${c}`:""}`;this.uppy.setFileState(n,{hashFileName:u})}});Oe(this,"setMetaData",async t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:{relativePath:s,name:o},hashFileName:r}=a,l=s||o||r;this.uppy.setFileMeta(n,{relativePath:l,name:l})}});Oe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.setMetaData(t)});Oe(this,"tryDownloadRemoteFile",async t=>{var R,A;const{type:n,name:a,preview:s,source:o,isRemote:r,isDownloading:l,id:c,isLoading:u,remote:p,meta:h,errorCount:g=0}=t,m=!u&&r,x=`uploader:${c}:downloaded`,v=Po(t),b=(R=a==null?void 0:a.split("?"))==null?void 0:R[0],F=(()=>{const y=["jpg","jpeg"];return y.includes(v)&&y.some(S=>b==null?void 0:b.endsWith(S))?!0:b==null?void 0:b.endsWith(v)})()?b:`${b}${v?`.${v}`:""}`;if(m){const y=hw(s||((A=p==null?void 0:p.body)==null?void 0:A.url));if(g>=3)throw new Error("Download remote file failure");this.uppy.setFileState(c,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await Pi.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:y}}).then(S=>S==null?void 0:S.data).then(async S=>{const k=pw(S,F);this.uppy.setFileState(c,{name:F,extension:v,type:n,data:k,preview:s||kc(k),source:o,size:k.size,isDownloading:!1,isRemote:!1,meta:{...h,name:F,filename:F}}),this.uppy.getFile(c),this.uppy.emit(x,c)}).catch(async S=>{console.error("Axios download remote file error: ",S),this.uppy.setFileState(c,{isRemote:!0,isLoading:!1,errorCount:g+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(c))})}else l&&await(async()=>new Promise(S=>{this.uppy.once(x,async()=>{S()})}))()});Oe(this,"getPreviewFromData",t=>{const{id:n}=t,a=this.uppy.getFile(n);if(a){const{data:s,type:o,preview:r}=a;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(n,{preview:kc(s)})},o.indexOf("gif")>-1?1e3:0)}});Oe(this,"prepareUpload",t=>{const n=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),a=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(n).then(a)});this.id=this.opts.id||"DownloadRemoteFiles",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}const kw=Ew;class Tw extends ge{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>de("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:de("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[de("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),de("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return de("div",{id:"ai-image",className:"ai-image",children:de("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const Ow=Tw,Rw="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Dw=ie.lazy(()=>Lc(()=>import("./index-BD7uC7gm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)),Ic="uploader-container",Xn="uploader-dashboard",Fo=localStorage.getItem("uppy_debug"),Aw=i=>{var r;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:n}=i,a=kd(e==null?void 0:e.companion),s=async l=>(await Pi.post("/api/image/generations",l)).data,o={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Fp,options:{quality:1},alwayUse:!0},(Fo||un()&&!Tc())&&{id:"Uploaded",plugin:ww,options:{params:n==null?void 0:n.params}},(Fo||un()&&!Tc())&&{id:"Resources",plugin:Fw,options:{params:n==null?void 0:n.params}},un()&&mw()&&t.AIImage&&{id:"AIImage",plugin:Ow,options:{companionUrl:a},onShowPanel:l=>{function c(){setTimeout(()=>{var p,h;const u=document.getElementById("ai-image");u?Gd(u).render(Le.jsx(Dw,{api:s,restrictions:o,i18n:(h=(p=l.current)==null?void 0:p.getUploader())==null?void 0:h.i18n,onSelect:g=>{const m=l.current.getUploader();m==null||m.emit("ai-image:selected",g),g.forEach((x,v)=>{const b=`AI Image [${v+1}].png`,C={name:b,type:"image/png",data:dw(x,b),source:"AIImage",isRemote:!1};m==null||m.addFile(C)})}})):c()},100)}c()}},{id:"Url",plugin:En,options:{companionUrl:a}},{id:"Webcam",plugin:au,options:{}},!!((r=window==null?void 0:window.blocklet)!=null&&r.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Fu,options:{companionUrl:a,companionHeaders:{},companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:kw,options:{companionUrl:a},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:zo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function vr(i){const{id:e,plugins:t,locale:n,onAfterResponse:a,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:c,pluginList:u,restrictions:p}=i,h=qc(u,"id"),g=kd(r==null?void 0:r.uploader);let m=new eu({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Fo||""),locale:y0[n||"en"],...o,restrictions:p}).use(Qp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:g,async onBeforeRequest(x,v){var y;const{hashFileName:b,id:C,meta:F}=v,R=Po(v);x.setHeader("x-uploader-file-name",`${b}`),x.setHeader("x-uploader-file-id",`${C}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",g),x.setHeader("x-uploader-metadata",JSON.stringify(F,(S,k)=>typeof k=="string"?encodeURIComponent(k):k));const A=(window==null?void 0:window.uploaderComponentId)||((y=window==null?void 0:window.blocklet)==null?void 0:y.componentId);A&&x.setHeader("x-component-did",(A||"").split("/").pop())},onAfterResponse:async(x,v)=>{const b={},C=x.getUnderlyingObject();try{C.response&&(b.data=JSON.parse(C.response))}catch{b.data={}}b.method=x.getMethod().toUpperCase(),b.url=x.getURL(),b.status=C.status,b.headers={...x._headers};const F=C.getAllResponseHeaders();if(F&&F.split(`\r
61
61
  `).forEach(S=>{const[k,N]=S.split(": ");k&&N&&(b.headers[k]=N)}),["PATCH","POST"].includes(b.method)&&[200,500].includes(b.status)){const y=[!0,"true"].includes(b.headers["x-uploader-file-exist"]),S=gw(b.url,b.headers["x-uploader-file-name"]),k=m.getFile(b.headers["x-uploader-file-id"]);b.file=k,b.uploadURL=S,y&&k&&(b.method==="POST"&&m.pauseResume(k.id),m.emit("upload-success",k,{uploadURL:S}),m.calculateTotalProgress()),b.status===200&&(await(s==null?void 0:s(b)),m.emitUploadSuccess(k,b))}a&&await(a==null?void 0:a(C));const R=m.getState().totalProgress===100,A=m.getFiles().every(y=>y.source==="DropTarget");R&&A&&m.close()},...l});return c&&m.use(lp,{target:document.body,onDrop:x=>{var v;(v=m==null?void 0:m.open)==null||v.call(m)},...c}),t==null||t.forEach(x=>{if(x){const{plugin:v,options:b}=h[x]||{};v&&m.use(v,b)}}),vw(m),m}const Co=ie.forwardRef((i,e)=>{const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,...i==null?void 0:i.apiPathProps},n=zd({open:!1,uppy:null,availablePluginMap:{},restrictions:{}}),a=Aw({...i,apiPathProps:t,availablePluginMap:n.availablePluginMap,restrictions:n.restrictions}),{plugins:s=a.map(y=>y.id),id:o="Uploader",popup:r=!1,uploadedProps:l,onOpen:c,onClose:u,locale:p,installerProps:h}=i,g=qc(a,"id"),m=$d(y=>{var S;return(S=y==null?void 0:y.breakpoints)==null?void 0:S.down("md")}),x=wr([...s,...a.filter(y=>y.alwayUse).map(y=>y.id)]);ie.useLayoutEffect(()=>{un()&&!t.disableMediaKitPrefix&&Pi.get("/api/uploader/status").then(({data:y})=>{var k,N,j,G,Y;n.availablePluginMap=y.availablePluginMap;const S=(qd((k=i==null?void 0:i.coreProps)==null?void 0:k.restrictions)?y.restrictions:(N=i==null?void 0:i.coreProps)==null?void 0:N.restrictions)||{};!((j=S==null?void 0:S.allowedFileTypes)!=null&&j.length)&&(S!=null&&S.allowedFileExts)&&(S.allowedFileTypes=wr((Y=(G=(typeof(S==null?void 0:S.allowedFileExts)=="string"?S==null?void 0:S.allowedFileExts.split(","):S==null?void 0:S.allowedFileExts)||[])==null?void 0:G.map(H=>Zi.lookup((H==null?void 0:H.replaceAll(" ",""))||"")))==null?void 0:Y.filter(H=>H)),delete S.allowedFileExts),S.maxFileSize&&typeof S.maxFileSize=="string"&&(S.maxFileSize=X.parseSize(S.maxFileSize,{iec:!1})||void 0),n.restrictions=S})},[]),Yd("esc",y=>{n.open&&(y.stopPropagation(),y.preventDefault(),C())},{useCapture:!0}),ie.useEffect(()=>{n.uppy=vr({...i,id:o,plugins:x,apiPathProps:t,pluginList:a,restrictions:n.restrictions}),n.uppy.open=b,n.uppy.close=C,n.uppy.openPlugin=v,n.uppy.on("dashboard:show-panel",y=>{const{onShowPanel:S}=g[y];S==null||S(e)}),(x.includes("Uploaded")||x.includes("Resources"))&&(n.uppy.off("uploaded:selected"),n.uppy.on("uploaded:selected",y=>{var S;y.forEach(k=>{n.uppy.emitUploadSuccess({id:k._id},{data:k,isMock:!0})}),(S=l==null?void 0:l.onSelectedFiles)==null||S.call(l,y),C()}))},[JSON.stringify({id:o,plugins:x,apiPathProps:t,locale:p,restrictions:n.restrictions})]);function v(y){var S,k,N;if(y=y.replace(/\s/g,""),["MyDevice",...x].map(j=>j.toLowerCase()).includes(y.toLowerCase())){let j=`div[data-uppy-acquirer-id="${y}"] > button`;(N=(k=(S=document==null?void 0:document.getElementById(Xn))==null?void 0:S.querySelector(j))==null?void 0:k.click)==null||N.call(k)}}function b(y){var k,N,j,G;n.open=!0,y&&setTimeout(()=>{v(y)},200),n.uppy.emitOpen(),c==null||c(),(N=(k=document.activeElement)==null?void 0:k.blur)==null||N.call(k);const S=n.uppy.getPlugin(Xn).el;(j=S==null?void 0:S.focus)==null||j.call(S),(G=S==null?void 0:S.click)==null||G.call(S)}function C(){var y;(y=n.uppy.getPlugin(Xn))==null||y.hideAllPanels(),n.open=!1,n.uppy.emitClose(),u==null||u(),setTimeout(()=>{n.uppy.getState().totalProgress===100&&(n.uppy.setState({files:{},currentUploads:{}}),n.uppy.calculateTotalProgress())},500)}ie.useImperativeHandle(e,()=>({getUploader:()=>n.uppy,open:b,close:C})),ie.useEffect(()=>{fw(t.disableMediaKitPrefix)},[t.disableMediaKitPrefix]);const F=r?Wd:ie.Fragment,R=r?{sx:{zIndex:99999999999,background:"rgba(0,0,0,0.5)","& > *":{display:n.open?"block":"none"}},invisible:!0,open:n.open,onClick:y=>{document.activeElement===document.body&&(y.stopPropagation(),C())},...i.wrapperProps}:{...i.wrapperProps},A=m?"42px":"40px";return Le.jsx(F,{...R,children:Le.jsxs(Zd,{onClose:C,did:Rw,...h,children:[Le.jsx(Hd,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),Le.jsxs(jc,{id:Ic,onClick:y=>y.stopPropagation(),sx:{position:"relative",width:m?"90vw":720,".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{background:"repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px !important"},".uploaded-add-item":{background:"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:"rgba(0,0,0,0.13)"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{background:"#fff",height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}}},children:[Le.jsx(Vd,{"aria-label":"close",onClick:C,sx:{color:"#fafafa",position:"absolute",...m?{bottom:`calc(0px - ${A} - 16px)`,left:`calc(50vw - ${A} - 8px)`}:{right:`calc(0px - ${A} - 16px)`,top:-12}},children:Le.jsx(th,{sx:{fontSize:A}})}),n.uppy&&Le.jsx(Ju,{inline:!0,target:`#${Ic}`,id:Xn,uppy:n.uppy,plugins:x,fileManagerSelectionType:"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,note:"",doneButtonHandler:C,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),Uw=Object.freeze(Object.defineProperty({__proto__:null,Uploader:Co,default:Co,initUploader:vr},Symbol.toStringTag,{value:"Module"})),Iw=ie.lazy(()=>Lc(()=>Promise.resolve().then(()=>Uw),void 0,import.meta.url).then(i=>({default:i.Uploader}))),br=ie.createContext(null);function Od(){const i=ie.useContext(br);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function Nw({onChange:i,children:e,...t}){const n=Od(),a=()=>{var o;const s=(o=n==null?void 0:n.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return Le.jsx(jc,{onClick:a,...t,children:e})}function Bw({children:i,...e}){const t=ie.useRef(null);return Le.jsxs(br.Provider,{value:t,children:[i,Kd.createPortal(Le.jsx(Iw,{ref:t,popup:!0,...e},"uploader"),document.body)]})}const n3=Object.freeze(Object.defineProperty({__proto__:null,Uploader:Co,UploaderContext:br,UploaderProvider:Bw,UploaderTrigger:Nw,initUploader:vr,useUploaderContext:Od},Symbol.toStringTag,{value:"Module"}));export{mw as g,n3 as r};
@@ -1 +1 @@
1
- import{dU as S}from"./index-B6qhr4Vv.js";function I(r,t,n){return t=S(t),t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function h(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter(function(u){return Object.getOwnPropertyDescriptor(r,u).enumerable})),n.push.apply(n,e)}return n}function m(r){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(e){I(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function i(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var E=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),v=function(){return Math.random().toString(36).substring(7).split("").join(".")},P={INIT:"@@redux/INIT"+v(),REPLACE:"@@redux/REPLACE"+v(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+v()}};function R(r){if(typeof r!="object"||r===null)return!1;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function T(r,t,n){var e;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(i(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(i(1));return n(T)(r,t)}if(typeof r!="function")throw new Error(i(2));var u=r,a=t,p=[],c=p,f=!1;function w(){c===p&&(c=p.slice())}function g(){if(f)throw new Error(i(3));return a}function O(o){if(typeof o!="function")throw new Error(i(4));if(f)throw new Error(i(5));var l=!0;return w(),c.push(o),function(){if(l){if(f)throw new Error(i(6));l=!1,w();var s=c.indexOf(o);c.splice(s,1),p=null}}}function y(o){if(!R(o))throw new Error(i(7));if(typeof o.type>"u")throw new Error(i(8));if(f)throw new Error(i(9));try{f=!0,a=u(a,o)}finally{f=!1}for(var l=p=c,b=0;b<l.length;b++){var s=l[b];s()}return o}function N(o){if(typeof o!="function")throw new Error(i(10));u=o,y({type:P.REPLACE})}function A(){var o,l=O;return o={subscribe:function(s){if(typeof s!="object"||s===null)throw new Error(i(11));function d(){s.next&&s.next(g())}d();var x=l(d);return{unsubscribe:x}}},o[E]=function(){return this},o}return y({type:P.INIT}),e={dispatch:y,subscribe:O,getState:g,replaceReducer:N},e[E]=A,e}function j(r,t){return function(){return t(r.apply(this,arguments))}}function K(r,t){if(typeof r=="function")return j(r,t);if(typeof r!="object"||r===null)throw new Error(i(16));var n={};for(var e in r){var u=r[e];typeof u=="function"&&(n[e]=j(u,t))}return n}function L(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,u){return function(){return e(u.apply(void 0,arguments))}})}function M(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return function(e){return function(){var u=e.apply(void 0,arguments),a=function(){throw new Error(i(15))},p={getState:u.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=t.map(function(f){return f(p)});return a=L.apply(void 0,c)(u.dispatch),m(m({},u),{},{dispatch:a})}}}export{I as _,M as a,K as b,T as c,L as d};
1
+ import{dU as S}from"./index-CkI554oc.js";function I(r,t,n){return t=S(t),t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function h(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter(function(u){return Object.getOwnPropertyDescriptor(r,u).enumerable})),n.push.apply(n,e)}return n}function m(r){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(e){I(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function i(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var E=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),v=function(){return Math.random().toString(36).substring(7).split("").join(".")},P={INIT:"@@redux/INIT"+v(),REPLACE:"@@redux/REPLACE"+v(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+v()}};function R(r){if(typeof r!="object"||r===null)return!1;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function T(r,t,n){var e;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(i(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(i(1));return n(T)(r,t)}if(typeof r!="function")throw new Error(i(2));var u=r,a=t,p=[],c=p,f=!1;function w(){c===p&&(c=p.slice())}function g(){if(f)throw new Error(i(3));return a}function O(o){if(typeof o!="function")throw new Error(i(4));if(f)throw new Error(i(5));var l=!0;return w(),c.push(o),function(){if(l){if(f)throw new Error(i(6));l=!1,w();var s=c.indexOf(o);c.splice(s,1),p=null}}}function y(o){if(!R(o))throw new Error(i(7));if(typeof o.type>"u")throw new Error(i(8));if(f)throw new Error(i(9));try{f=!0,a=u(a,o)}finally{f=!1}for(var l=p=c,b=0;b<l.length;b++){var s=l[b];s()}return o}function N(o){if(typeof o!="function")throw new Error(i(10));u=o,y({type:P.REPLACE})}function A(){var o,l=O;return o={subscribe:function(s){if(typeof s!="object"||s===null)throw new Error(i(11));function d(){s.next&&s.next(g())}d();var x=l(d);return{unsubscribe:x}}},o[E]=function(){return this},o}return y({type:P.INIT}),e={dispatch:y,subscribe:O,getState:g,replaceReducer:N},e[E]=A,e}function j(r,t){return function(){return t(r.apply(this,arguments))}}function K(r,t){if(typeof r=="function")return j(r,t);if(typeof r!="object"||r===null)throw new Error(i(16));var n={};for(var e in r){var u=r[e];typeof u=="function"&&(n[e]=j(u,t))}return n}function L(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,u){return function(){return e(u.apply(void 0,arguments))}})}function M(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return function(e){return function(){var u=e.apply(void 0,arguments),a=function(){throw new Error(i(15))},p={getState:u.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=t.map(function(f){return f(p)});return a=L.apply(void 0,c)(u.dispatch),m(m({},u),{},{dispatch:a})}}}export{I as _,M as a,K as b,T as c,L as d};
@@ -1,4 +1,4 @@
1
- import{P as x,j as c,O as S,d2 as F,fP as re,dM as be,r as D,bJ as Me,cC as ot,q as nt,ci as We,fx as rt,fz as at,fU as st,dO as lt,fQ as ct,dN as dt,a2 as Ue,f8 as Be,g1 as ut,av as we,n as qe,cP as pt,g as Et,fa as bt,g2 as _t}from"./index-B6qhr4Vv.js";import"./index-B-DkREsH.js";function Te({optionalComponent:i,index:t,installStatus:a,hasPermission:l,t:b}){const _=()=>{window.open(i==null?void 0:i.installUrl,"_blank")},T=()=>{window.open(i==null?void 0:i.storeUrl,"_blank")},h=()=>{window.location.reload()},v=a==="stopped"||a==="running",I=60;return c.jsxs(S,{children:[t===0?null:c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",paddingTop:.5,marginTop:2,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[c.jsx("img",{style:{width:I,height:I,minWidth:I,minHeight:I},src:i.logoUrl,alt:i.meta.title}),c.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",marginLeft:2},children:[c.jsxs(S,{sx:{fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var O;return T((O=i.meta)==null?void 0:O.did)},children:[i.meta.title,c.jsxs(S,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[i.meta.version,c.jsx(re,{className:"link-icon",icon:"fluent:open-20-filled",style:{color:F.primaryBase,fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.3s"}})]})]}),c.jsx(S,{sx:{marginTop:0,opacity:.7},children:i.meta.description}),c.jsx(S,{sx:{display:l?"flex":"none",flexDirection:"row",gap:1},children:a?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:v?c.jsx(be,{variant:"contained",onClick:h,children:b("componentInstallerRefresh")},"refresh"):c.jsx(be,{disabled:!0,sx:{color:"#333"},startIcon:c.jsx(re,{icon:"line-md:loading-loop",style:{color:"#333",fontSize:16}}),variant:"contained",children:a},"status")}):c.jsx(be,{sx:{marginTop:2},variant:"contained",className:"button",onClick:()=>{var O;return _((O=i.meta)==null?void 0:O.did)},children:b("componentInstallerInstall")},"install")}),v?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:b("componentInstallerSuccessInstalled")}):null]})]})]})}Te.propTypes={t:x.func.isRequired,optionalComponent:x.object.isRequired,index:x.number.isRequired,installStatus:x.string,hasPermission:x.bool.isRequired};Te.defaultProps={installStatus:""};const mt={zh:{componentInstallerTitle:"缺少组件",componentInstallerInstall:"安装",componentInstallerClose:"关闭",componentInstallerRefresh:"重载页面",componentInstallerSuccessInstalled:"安装成功,请重载页面查看变化。",componentInstallerSuggestions:"请联系系统管理员安装该组件。",componentInstallerNoDefinedInBlockletYML:"组件未在 blocklet.yml 中定义"},en:{componentInstallerTitle:"Missing component",componentInstallerInstall:"Install",componentInstallerClose:"Close",componentInstallerRefresh:"Refresh",componentInstallerSuccessInstalled:"Successfully installed, please refresh the page to see the changes.",componentInstallerSuggestions:"Please contact the system administrator to install the component.",componentInstallerNoDefinedInBlockletYML:"The component is not defined in blocklet.yml"}},_e=i=>typeof i=="string"?new Set(i.split(";;")):new Set(i);function ft({did:i,onInstalled:t,onError:a}){const l=Array.isArray(i)?i.join(";;"):i,[b,_]=D.useState({}),T=D.useRef({onInstalled:t,onError:a});T.current={onInstalled:t,onError:a};const{optionalComponents:h,componentMountPoints:v}=window.blocklet,I=D.useMemo(()=>{var r;if(!h||!h.length)return[];const m=_e(l),e=h.filter(o=>m.has(o.meta.did));return(r=e?T.current.onError:T.current.onInstalled)==null||r(e),e},[l,h]),O=D.useMemo(()=>{if(I.length)return!0;const m=_e(l);return(v||[]).find(e=>m.has(e.did))},[I,v,l]);return I.forEach(m=>{m.storeUrl=Me(m.meta.homepage,"blocklets",m.meta.did),m.installUrl=Me(window.blocklet.appUrl,ot,`/admin/components?install-component=${m.meta.did}`)}),D.useEffect(()=>{const m=e=>{var r,o,n,s,L;if(e.origin===window.blocklet.appUrl&&((r=e.data)==null?void 0:r.kind)==="component-installer"&&(n=(o=e.data)==null?void 0:o.blocklet)!=null&&n.children){let k=!1;const u=_e(l);(L=(s=e.data)==null?void 0:s.blocklet)==null||L.children.forEach(d=>{var N;u.has((N=d.meta)==null?void 0:N.did)&&(k=!0,_(C=>{var B;return{...C,[(B=d.meta)==null?void 0:B.did]:d.status||"waiting"}}))}),k||_({})}};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m)}},[l]),{optComponents:I,installed:!I.length&&O,installStatus:b,setInstallStatus:_,definedInBlockletYML:O}}function W({warnIcon:i,did:t,noPermissionMute:a,onInstalled:l,onError:b,children:_,closeByOutSize:T,onClose:h,fallback:v,disabled:I,roles:O=["owner","admin"]}){const{locale:m}=nt(),e=We((u,d={})=>rt(mt,u,m,"en",d)),{installed:r,optComponents:o,installStatus:n,definedInBlockletYML:s}=ft({did:t,onInstalled:l,onError:b}),L=D.useContext(at),k=()=>{h==null||h(!1)};return I?_:c.jsx(st,{session:L==null?void 0:L.session,roles:O,children:({hasPermission:u})=>r?_:a&&!u?v||null:typeof _=="function"?c.jsxs(c.Fragment,{children:[v,_({hasPermission:u,optComponents:o,installStatus:n})]}):c.jsxs(c.Fragment,{children:[v,c.jsx(lt,{onClickAway:d=>{d.preventDefault(),d.stopPropagation(),T&&k()},children:c.jsx(ct,{in:!0,timeout:350,children:c.jsx(dt,{variant:"outlined",sx:{position:"fixed",top:20,right:20,zIndex:3e3,borderRadius:3,width:400,maxWidth:"90vw",borderColor:F.lineStep,border:"0 !important",fontSize:"14px",textAlign:"left",boxShadow:`0px 8px 16px 0px ${F.gray6}, 0px 0px 0px 1px ${F.gray6}`},children:s?c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{maxHeight:"70vh",overflowY:"auto"},children:o.map((d,N)=>{var C,B;return c.jsx(Te,{t:e,hasPermission:u,index:N,optionalComponent:d,installStatus:n[(C=d.meta)==null?void 0:C.did]},((B=d.meta)==null?void 0:B.did)||N)})}),u?null:c.jsxs(c.Fragment,{children:[c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{padding:"20px 24px"},children:c.jsx(S,{sx:{opacity:1},children:e("componentInstallerSuggestions")})})]})]}):c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",marginTop:0},children:[e("componentInstallerNoDefinedInBlockletYML"),": ",t]})]})})})})]})})}W.propTypes={disabled:x.bool,warnIcon:x.node,did:x.oneOfType([x.string,x.arrayOf(x.string)]).isRequired,noPermissionMute:x.bool,onInstalled:x.func,onError:x.func,children:x.any.isRequired,closeByOutSize:x.bool,onClose:x.func,fallback:x.node,roles:x.array};W.defaultProps={disabled:!1,warnIcon:null,noPermissionMute:!1,onInstalled:null,onError:null,closeByOutSize:!1,onClose:null,fallback:null,roles:["owner","admin"]};function Ye(i){return window.blocklet?c.jsx(W,{...i}):i.children}Ye.propTypes={...W.propTypes,children:x.any.isRequired};Ye.defaultProps={...W.defaultProps};var ge={};Object.defineProperty(ge,"__esModule",{value:!0});var wt=ge.default=void 0;Tt(D);var je=c;function Tt(i){return i&&i.__esModule?i:{default:i}}function Fe(i,t){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);t&&(l=l.filter(function(b){return Object.getOwnPropertyDescriptor(i,b).enumerable})),a.push.apply(a,l)}return a}function Ke(i){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(a),!0).forEach(function(l){gt(i,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):Fe(Object(a)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(a,l))})}return i}function gt(i,t,a){return t=ht(t),t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function ht(i){var t=Ot(i,"string");return typeof t=="symbol"?t:String(t)}function Ot(i,t){if(typeof i!="object"||!i)return i;var a=i[Symbol.toPrimitive];if(a!==void 0){var l=a.call(i,t||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}var he=function(t){return(0,je.jsx)("svg",Ke(Ke({},t),{},{children:(0,je.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10a6.75 6.75 0 1 1 13.5 0 6.75 6.75 0 0 1-13.5 0zM10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5zM8.03 6.97a.75.75 0 0 0-1.06 1.06l5 5a.75.75 0 1 0 1.06-1.06l-5-5z"})}))};he.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};he.displayName="revoke";wt=ge.default=he;x.any.isRequired,x.any.isRequired,x.string.isRequired,x.func.isRequired,x.any,x.any,x.number;D.createContext({});const Oe=Object.freeze({AUTH:"auth",AUTH_SERVICE:"@abtnode/auth-service"}),Rt=Object.freeze({AUTH_SERVICE:`/.service/${Oe.AUTH_SERVICE}`}),Re=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),w=Object.freeze({...Re,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),Xe=[w.BLOCKLET_OWNER,w.BLOCKLET_ADMIN,w.BLOCKLET_MEMBER,w.BLOCKLET_SDK],St=i=>i&&Xe.includes(i),xt={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},vt={roles:Object.freeze([{name:w.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:w.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:w.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:w.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:w.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:w.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:w.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:w.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:w.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:w.BLOCKLET_SDK,title:"Blocklet SDK"},{name:w.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:w.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0},{name:Oe.AUTH_SERVICE,title:"Auth Service"}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[w.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[w.MEMBER]:[w.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[w.ADMIN]:[w.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[w.OWNER]:[Re.ADMIN],[w.CI]:["query_blocklets","mutate_blocklets"],[w.CERTIFICATE]:["query_certificate","mutate_certificate"],[w.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[w.BLOCKLET_OWNER]:[w.BLOCKLET_ADMIN],[w.BLOCKLET_ADMIN]:[w.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[w.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[w.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[w.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},ze=24*60*60*1e3,At={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},It={OWNER:"owner",INVITED:"invited",ALL:"all"},He="https://store.blocklet.dev",Ge="https://dev.store.blocklet.dev",Nt="https://main.abtnetwork.io/api/",Lt=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),kt={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ct={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ze=10,yt=86400/Ze,Dt={SYNC_LIMIT:3},Pt=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],Mt=Object.freeze({created:0,selected:10,connected:20,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,expired:60,terminated:70,timeout:80,transferred:90});var U=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:He,BLOCKLET_STORE_URL_DEV:Ge,BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:He,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:Ge,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:ze,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*ze,ROUTING_RESPONSE_TYPES:Pt,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:Re,SERVER_ROLES:w,BLOCKLET_ROLES:Xe,isBlockletRole:St,AUTH_CERT_TYPE:xt,RBAC_CONFIG:vt,genPermissionName:(i,t="access")=>`${t}_${i.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:Oe,NODE_SERVICES_PREFIX:Rt,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:At,WHO_CAN_ACCESS:It,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:Nt,USER_TYPE:Lt,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:kt,CHECK_UPDATE:Ct,MONITOR_HISTORY_LENGTH:yt,MONITOR_RECORD_INTERVAL_SEC:Ze,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:Dt,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",LAUNCH_SESSION_STATUS:Mt,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store"});/*! js-cookie v3.0.5 | MIT */function ie(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)i[l]=a[l]}return i}var Ut={read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(i,t){function a(b,_,T){if(!(typeof document>"u")){T=ie({},t,T),typeof T.expires=="number"&&(T.expires=new Date(Date.now()+T.expires*864e5)),T.expires&&(T.expires=T.expires.toUTCString()),b=encodeURIComponent(b).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var h="";for(var v in T)T[v]&&(h+="; "+v,T[v]!==!0&&(h+="="+T[v].split(";")[0]));return document.cookie=b+"="+i.write(_,b)+h}}function l(b){if(!(typeof document>"u"||arguments.length&&!b)){for(var _=document.cookie?document.cookie.split("; "):[],T={},h=0;h<_.length;h++){var v=_[h].split("="),I=v.slice(1).join("=");try{var O=decodeURIComponent(v[0]);if(T[O]=i.read(I,O),b===O)break}catch{}}return b?T[b]:T}}return Object.create({set:a,get:l,remove:function(b,_){a(b,"",ie({},_,{expires:-1}))},withAttributes:function(b){return me(this.converter,ie({},this.attributes,b))},withConverter:function(b){return me(ie({},this.converter,b),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(i)}})}var ne=me(Ut,{path:"/"}),Bt=Object.defineProperty,jt=(i,t,a)=>t in i?Bt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Ft=(i,t,a)=>(jt(i,typeof t!="symbol"?t+"":t,a),a);class Kt{constructor({api:t}){Ft(this,"api"),this.api=t}async getUserPublicInfo({did:t}){const{data:a}=await this.api.get("/api/user",{params:{did:t}});return a}async getUserPrivacyConfig({did:t}){const{data:a}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return a}async saveUserPrivacyConfig(t){const{data:a}=await this.api.post("/api/user/privacy/config",t);return a}async getUserNotificationConfig(){const{data:t}=await this.api.get("/api/user/notification/config");return t}async saveUserNotificationConfig(t){const{data:a}=await this.api.post("/api/user/notification/config",t);return a}async testNotificationWebhook(t){const{data:a}=await this.api.put("/api/user/notification/webhook",t);return a}async getProfileUrl({did:t,locale:a}){const l=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return ut(l,{did:t,locale:a})}async logout({visitorId:t}){const{data:a}=await this.api.post("/api/user/logout",{visitorId:t});return a}}class zt{getSessionToken(){return ne.get(U.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(t){ne.set(U.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){ne.remove(U.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(U.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(U.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(U.REFRESH_TOKEN_STORAGE_KEY)}}var Ht=Object.defineProperty,Gt=(i,t,a)=>t in i?Ht(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Vt=(i,t,a)=>(Gt(i,typeof t!="symbol"?t+"":t,a),a);class Wt{constructor({api:t}){Vt(this,"api"),this.api=t}async getUserSessions({did:t}){const{data:a}=await this.api.get("/api/user-session",{params:{userDid:t}});return a}}const qt="1.16.26",Yt=(i=0)=>new Promise(t=>{setTimeout(()=>{t()},i)}),Je=i=>`Bearer ${encodeURIComponent(i)}`,Xt="__visitor_id",Zt=()=>localStorage.getItem(Xt);async function Ve(i,t=300){i.metaData.endTime=+new Date;const{startTime:a,endTime:l}=i.metaData,b=l-a;b<t&&await Yt(t-b),delete i.metaData}const $e=(i,t)=>{const a={...i==null?void 0:i.headers,"x-blocklet-js-sdk-version":qt},l=Zt();[void 0,null].includes(l)||(a["x-blocklet-visitor-id"]=l);const b=we.create({...i,headers:a});return t!=null&&t.lazy&&(b.interceptors.request.use(_=>(_.metaData={startTime:+new Date},_),_=>Promise.reject(_)),b.interceptors.response.use(async _=>(await Ve(_.config,t==null?void 0:t.lazyTime),_),async _=>(await Ve(_.response.config,t==null?void 0:t.lazyTime),Promise.reject(_)))),b};async function Jt(i){if(!i)throw new Error("Refresh token not found");const t=$e({baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,headers:{authorization:Je(i)}}),{data:a}=await t.post("/api/did/refreshSession");return a}function $t({getSessionToken:i,setSessionToken:t,removeSessionToken:a,getRefreshToken:l,setRefreshToken:b,removeRefreshToken:_,onRefreshTokenError:T,onRefreshTokenSuccess:h},v,I){let O=null;const m=$e({timeout:30*1e3,...v},I);return m.interceptors.request.use(async e=>{if(!ne.get(U.SESSION_TOKEN_STORAGE_KEY)){const r=i();r&&(e.headers.authorization=Je(r))}return O&&await O,e},e=>Promise.reject(e)),m.interceptors.response.use(e=>e,async e=>{var o;const r=e.config;if(r.headers={...r==null?void 0:r.headers},((o=e==null?void 0:e.response)==null?void 0:o.status)===401&&!r._retry){r._retry=!0;try{O||(O=Jt(l()));const n=await O;return t(n.nextToken),b(n.nextRefreshToken),typeof h=="function"&&h(n),m(r)}catch(n){return a(),_(),typeof T=="function"&&T(n),Promise.reject(e)}finally{O=null}}return Promise.reject(e)}),m}var Qt=Object.defineProperty,ei=(i,t,a)=>t in i?Qt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,oe=(i,t,a)=>(ei(i,typeof t!="symbol"?t+"":t,a),a);class ti{constructor(){oe(this,"api"),oe(this,"user"),oe(this,"userSession"),oe(this,"token");const t=new zt,a=$t({getSessionToken:t.getSessionToken,setSessionToken:t.setSessionToken,removeSessionToken:t.removeSessionToken,getRefreshToken:t.getRefreshToken,setRefreshToken:t.setRefreshToken,removeRefreshToken:t.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new Kt({api:a}),this.userSession=new Wt({api:a}),this.token=t,this.api=a}}const ai=new ti;we.defaults.timeout=10*1e3;we.create();qe(S)`
1
+ import{P as x,j as c,O as S,d2 as F,fP as re,dM as be,r as D,bJ as Me,cC as ot,q as nt,ci as We,fx as rt,fz as at,fU as st,dO as lt,fQ as ct,dN as dt,a2 as Ue,f8 as Be,g1 as ut,av as we,n as qe,cP as pt,g as Et,fa as bt,g2 as _t}from"./index-CkI554oc.js";import"./index-BoZhSN8h.js";function Te({optionalComponent:i,index:t,installStatus:a,hasPermission:l,t:b}){const _=()=>{window.open(i==null?void 0:i.installUrl,"_blank")},T=()=>{window.open(i==null?void 0:i.storeUrl,"_blank")},h=()=>{window.location.reload()},v=a==="stopped"||a==="running",I=60;return c.jsxs(S,{children:[t===0?null:c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",paddingTop:.5,marginTop:2,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[c.jsx("img",{style:{width:I,height:I,minWidth:I,minHeight:I},src:i.logoUrl,alt:i.meta.title}),c.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",marginLeft:2},children:[c.jsxs(S,{sx:{fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var O;return T((O=i.meta)==null?void 0:O.did)},children:[i.meta.title,c.jsxs(S,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[i.meta.version,c.jsx(re,{className:"link-icon",icon:"fluent:open-20-filled",style:{color:F.primaryBase,fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.3s"}})]})]}),c.jsx(S,{sx:{marginTop:0,opacity:.7},children:i.meta.description}),c.jsx(S,{sx:{display:l?"flex":"none",flexDirection:"row",gap:1},children:a?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:v?c.jsx(be,{variant:"contained",onClick:h,children:b("componentInstallerRefresh")},"refresh"):c.jsx(be,{disabled:!0,sx:{color:"#333"},startIcon:c.jsx(re,{icon:"line-md:loading-loop",style:{color:"#333",fontSize:16}}),variant:"contained",children:a},"status")}):c.jsx(be,{sx:{marginTop:2},variant:"contained",className:"button",onClick:()=>{var O;return _((O=i.meta)==null?void 0:O.did)},children:b("componentInstallerInstall")},"install")}),v?c.jsx(S,{sx:{marginTop:2,opacity:.7},children:b("componentInstallerSuccessInstalled")}):null]})]})]})}Te.propTypes={t:x.func.isRequired,optionalComponent:x.object.isRequired,index:x.number.isRequired,installStatus:x.string,hasPermission:x.bool.isRequired};Te.defaultProps={installStatus:""};const mt={zh:{componentInstallerTitle:"缺少组件",componentInstallerInstall:"安装",componentInstallerClose:"关闭",componentInstallerRefresh:"重载页面",componentInstallerSuccessInstalled:"安装成功,请重载页面查看变化。",componentInstallerSuggestions:"请联系系统管理员安装该组件。",componentInstallerNoDefinedInBlockletYML:"组件未在 blocklet.yml 中定义"},en:{componentInstallerTitle:"Missing component",componentInstallerInstall:"Install",componentInstallerClose:"Close",componentInstallerRefresh:"Refresh",componentInstallerSuccessInstalled:"Successfully installed, please refresh the page to see the changes.",componentInstallerSuggestions:"Please contact the system administrator to install the component.",componentInstallerNoDefinedInBlockletYML:"The component is not defined in blocklet.yml"}},_e=i=>typeof i=="string"?new Set(i.split(";;")):new Set(i);function ft({did:i,onInstalled:t,onError:a}){const l=Array.isArray(i)?i.join(";;"):i,[b,_]=D.useState({}),T=D.useRef({onInstalled:t,onError:a});T.current={onInstalled:t,onError:a};const{optionalComponents:h,componentMountPoints:v}=window.blocklet,I=D.useMemo(()=>{var r;if(!h||!h.length)return[];const m=_e(l),e=h.filter(o=>m.has(o.meta.did));return(r=e?T.current.onError:T.current.onInstalled)==null||r(e),e},[l,h]),O=D.useMemo(()=>{if(I.length)return!0;const m=_e(l);return(v||[]).find(e=>m.has(e.did))},[I,v,l]);return I.forEach(m=>{m.storeUrl=Me(m.meta.homepage,"blocklets",m.meta.did),m.installUrl=Me(window.blocklet.appUrl,ot,`/admin/components?install-component=${m.meta.did}`)}),D.useEffect(()=>{const m=e=>{var r,o,n,s,L;if(e.origin===window.blocklet.appUrl&&((r=e.data)==null?void 0:r.kind)==="component-installer"&&(n=(o=e.data)==null?void 0:o.blocklet)!=null&&n.children){let k=!1;const u=_e(l);(L=(s=e.data)==null?void 0:s.blocklet)==null||L.children.forEach(d=>{var N;u.has((N=d.meta)==null?void 0:N.did)&&(k=!0,_(C=>{var B;return{...C,[(B=d.meta)==null?void 0:B.did]:d.status||"waiting"}}))}),k||_({})}};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m)}},[l]),{optComponents:I,installed:!I.length&&O,installStatus:b,setInstallStatus:_,definedInBlockletYML:O}}function W({warnIcon:i,did:t,noPermissionMute:a,onInstalled:l,onError:b,children:_,closeByOutSize:T,onClose:h,fallback:v,disabled:I,roles:O=["owner","admin"]}){const{locale:m}=nt(),e=We((u,d={})=>rt(mt,u,m,"en",d)),{installed:r,optComponents:o,installStatus:n,definedInBlockletYML:s}=ft({did:t,onInstalled:l,onError:b}),L=D.useContext(at),k=()=>{h==null||h(!1)};return I?_:c.jsx(st,{session:L==null?void 0:L.session,roles:O,children:({hasPermission:u})=>r?_:a&&!u?v||null:typeof _=="function"?c.jsxs(c.Fragment,{children:[v,_({hasPermission:u,optComponents:o,installStatus:n})]}):c.jsxs(c.Fragment,{children:[v,c.jsx(lt,{onClickAway:d=>{d.preventDefault(),d.stopPropagation(),T&&k()},children:c.jsx(ct,{in:!0,timeout:350,children:c.jsx(dt,{variant:"outlined",sx:{position:"fixed",top:20,right:20,zIndex:3e3,borderRadius:3,width:400,maxWidth:"90vw",borderColor:F.lineStep,border:"0 !important",fontSize:"14px",textAlign:"left",boxShadow:`0px 8px 16px 0px ${F.gray6}, 0px 0px 0px 1px ${F.gray6}`},children:s?c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{maxHeight:"70vh",overflowY:"auto"},children:o.map((d,N)=>{var C,B;return c.jsx(Te,{t:e,hasPermission:u,index:N,optionalComponent:d,installStatus:n[(C=d.meta)==null?void 0:C.did]},((B=d.meta)==null?void 0:B.did)||N)})}),u?null:c.jsxs(c.Fragment,{children:[c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsx(S,{sx:{padding:"20px 24px"},children:c.jsx(S,{sx:{opacity:1},children:e("componentInstallerSuggestions")})})]})]}):c.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[c.jsxs(S,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"flex-start"},children:[i||c.jsx(re,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),c.jsx(S,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:e("componentInstallerTitle")}),c.jsx(S,{sx:{flex:1}}),h?c.jsx(Ue,{variant:"outlined",className:"button",onClick:k,children:c.jsx(Be,{})}):null]}),c.jsx(S,{sx:{width:"100%",height:"1px",backgroundColor:F.gray6}}),c.jsxs(S,{sx:{padding:"20px 24px",marginTop:0},children:[e("componentInstallerNoDefinedInBlockletYML"),": ",t]})]})})})})]})})}W.propTypes={disabled:x.bool,warnIcon:x.node,did:x.oneOfType([x.string,x.arrayOf(x.string)]).isRequired,noPermissionMute:x.bool,onInstalled:x.func,onError:x.func,children:x.any.isRequired,closeByOutSize:x.bool,onClose:x.func,fallback:x.node,roles:x.array};W.defaultProps={disabled:!1,warnIcon:null,noPermissionMute:!1,onInstalled:null,onError:null,closeByOutSize:!1,onClose:null,fallback:null,roles:["owner","admin"]};function Ye(i){return window.blocklet?c.jsx(W,{...i}):i.children}Ye.propTypes={...W.propTypes,children:x.any.isRequired};Ye.defaultProps={...W.defaultProps};var ge={};Object.defineProperty(ge,"__esModule",{value:!0});var wt=ge.default=void 0;Tt(D);var je=c;function Tt(i){return i&&i.__esModule?i:{default:i}}function Fe(i,t){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);t&&(l=l.filter(function(b){return Object.getOwnPropertyDescriptor(i,b).enumerable})),a.push.apply(a,l)}return a}function Ke(i){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(a),!0).forEach(function(l){gt(i,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):Fe(Object(a)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(a,l))})}return i}function gt(i,t,a){return t=ht(t),t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function ht(i){var t=Ot(i,"string");return typeof t=="symbol"?t:String(t)}function Ot(i,t){if(typeof i!="object"||!i)return i;var a=i[Symbol.toPrimitive];if(a!==void 0){var l=a.call(i,t||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}var he=function(t){return(0,je.jsx)("svg",Ke(Ke({},t),{},{children:(0,je.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10a6.75 6.75 0 1 1 13.5 0 6.75 6.75 0 0 1-13.5 0zM10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5zM8.03 6.97a.75.75 0 0 0-1.06 1.06l5 5a.75.75 0 1 0 1.06-1.06l-5-5z"})}))};he.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};he.displayName="revoke";wt=ge.default=he;x.any.isRequired,x.any.isRequired,x.string.isRequired,x.func.isRequired,x.any,x.any,x.number;D.createContext({});const Oe=Object.freeze({AUTH:"auth",AUTH_SERVICE:"@abtnode/auth-service"}),Rt=Object.freeze({AUTH_SERVICE:`/.service/${Oe.AUTH_SERVICE}`}),Re=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),w=Object.freeze({...Re,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),Xe=[w.BLOCKLET_OWNER,w.BLOCKLET_ADMIN,w.BLOCKLET_MEMBER,w.BLOCKLET_SDK],St=i=>i&&Xe.includes(i),xt={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},vt={roles:Object.freeze([{name:w.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:w.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:w.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:w.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:w.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:w.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:w.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:w.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:w.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:w.BLOCKLET_SDK,title:"Blocklet SDK"},{name:w.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:w.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0},{name:Oe.AUTH_SERVICE,title:"Auth Service"}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[w.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[w.MEMBER]:[w.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[w.ADMIN]:[w.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[w.OWNER]:[Re.ADMIN],[w.CI]:["query_blocklets","mutate_blocklets"],[w.CERTIFICATE]:["query_certificate","mutate_certificate"],[w.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[w.BLOCKLET_OWNER]:[w.BLOCKLET_ADMIN],[w.BLOCKLET_ADMIN]:[w.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[w.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[w.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[w.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},ze=24*60*60*1e3,At={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},It={OWNER:"owner",INVITED:"invited",ALL:"all"},He="https://store.blocklet.dev",Ge="https://dev.store.blocklet.dev",Nt="https://main.abtnetwork.io/api/",Lt=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),kt={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ct={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},Ze=10,yt=86400/Ze,Dt={SYNC_LIMIT:3},Pt=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],Mt=Object.freeze({created:0,selected:10,connected:20,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,expired:60,terminated:70,timeout:80,transferred:90});var U=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:He,BLOCKLET_STORE_URL_DEV:Ge,BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:He,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:Ge,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:ze,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*ze,ROUTING_RESPONSE_TYPES:Pt,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:Re,SERVER_ROLES:w,BLOCKLET_ROLES:Xe,isBlockletRole:St,AUTH_CERT_TYPE:xt,RBAC_CONFIG:vt,genPermissionName:(i,t="access")=>`${t}_${i.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:Oe,NODE_SERVICES_PREFIX:Rt,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:At,WHO_CAN_ACCESS:It,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:Nt,USER_TYPE:Lt,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:kt,CHECK_UPDATE:Ct,MONITOR_HISTORY_LENGTH:yt,MONITOR_RECORD_INTERVAL_SEC:Ze,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:Dt,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",LAUNCH_SESSION_STATUS:Mt,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store"});/*! js-cookie v3.0.5 | MIT */function ie(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)i[l]=a[l]}return i}var Ut={read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(i,t){function a(b,_,T){if(!(typeof document>"u")){T=ie({},t,T),typeof T.expires=="number"&&(T.expires=new Date(Date.now()+T.expires*864e5)),T.expires&&(T.expires=T.expires.toUTCString()),b=encodeURIComponent(b).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var h="";for(var v in T)T[v]&&(h+="; "+v,T[v]!==!0&&(h+="="+T[v].split(";")[0]));return document.cookie=b+"="+i.write(_,b)+h}}function l(b){if(!(typeof document>"u"||arguments.length&&!b)){for(var _=document.cookie?document.cookie.split("; "):[],T={},h=0;h<_.length;h++){var v=_[h].split("="),I=v.slice(1).join("=");try{var O=decodeURIComponent(v[0]);if(T[O]=i.read(I,O),b===O)break}catch{}}return b?T[b]:T}}return Object.create({set:a,get:l,remove:function(b,_){a(b,"",ie({},_,{expires:-1}))},withAttributes:function(b){return me(this.converter,ie({},this.attributes,b))},withConverter:function(b){return me(ie({},this.converter,b),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(i)}})}var ne=me(Ut,{path:"/"}),Bt=Object.defineProperty,jt=(i,t,a)=>t in i?Bt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Ft=(i,t,a)=>(jt(i,typeof t!="symbol"?t+"":t,a),a);class Kt{constructor({api:t}){Ft(this,"api"),this.api=t}async getUserPublicInfo({did:t}){const{data:a}=await this.api.get("/api/user",{params:{did:t}});return a}async getUserPrivacyConfig({did:t}){const{data:a}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return a}async saveUserPrivacyConfig(t){const{data:a}=await this.api.post("/api/user/privacy/config",t);return a}async getUserNotificationConfig(){const{data:t}=await this.api.get("/api/user/notification/config");return t}async saveUserNotificationConfig(t){const{data:a}=await this.api.post("/api/user/notification/config",t);return a}async testNotificationWebhook(t){const{data:a}=await this.api.put("/api/user/notification/webhook",t);return a}async getProfileUrl({did:t,locale:a}){const l=`${U.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return ut(l,{did:t,locale:a})}async logout({visitorId:t}){const{data:a}=await this.api.post("/api/user/logout",{visitorId:t});return a}}class zt{getSessionToken(){return ne.get(U.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(t){ne.set(U.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){ne.remove(U.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(U.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(U.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(U.REFRESH_TOKEN_STORAGE_KEY)}}var Ht=Object.defineProperty,Gt=(i,t,a)=>t in i?Ht(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,Vt=(i,t,a)=>(Gt(i,typeof t!="symbol"?t+"":t,a),a);class Wt{constructor({api:t}){Vt(this,"api"),this.api=t}async getUserSessions({did:t}){const{data:a}=await this.api.get("/api/user-session",{params:{userDid:t}});return a}}const qt="1.16.26",Yt=(i=0)=>new Promise(t=>{setTimeout(()=>{t()},i)}),Je=i=>`Bearer ${encodeURIComponent(i)}`,Xt="__visitor_id",Zt=()=>localStorage.getItem(Xt);async function Ve(i,t=300){i.metaData.endTime=+new Date;const{startTime:a,endTime:l}=i.metaData,b=l-a;b<t&&await Yt(t-b),delete i.metaData}const $e=(i,t)=>{const a={...i==null?void 0:i.headers,"x-blocklet-js-sdk-version":qt},l=Zt();[void 0,null].includes(l)||(a["x-blocklet-visitor-id"]=l);const b=we.create({...i,headers:a});return t!=null&&t.lazy&&(b.interceptors.request.use(_=>(_.metaData={startTime:+new Date},_),_=>Promise.reject(_)),b.interceptors.response.use(async _=>(await Ve(_.config,t==null?void 0:t.lazyTime),_),async _=>(await Ve(_.response.config,t==null?void 0:t.lazyTime),Promise.reject(_)))),b};async function Jt(i){if(!i)throw new Error("Refresh token not found");const t=$e({baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,headers:{authorization:Je(i)}}),{data:a}=await t.post("/api/did/refreshSession");return a}function $t({getSessionToken:i,setSessionToken:t,removeSessionToken:a,getRefreshToken:l,setRefreshToken:b,removeRefreshToken:_,onRefreshTokenError:T,onRefreshTokenSuccess:h},v,I){let O=null;const m=$e({timeout:30*1e3,...v},I);return m.interceptors.request.use(async e=>{if(!ne.get(U.SESSION_TOKEN_STORAGE_KEY)){const r=i();r&&(e.headers.authorization=Je(r))}return O&&await O,e},e=>Promise.reject(e)),m.interceptors.response.use(e=>e,async e=>{var o;const r=e.config;if(r.headers={...r==null?void 0:r.headers},((o=e==null?void 0:e.response)==null?void 0:o.status)===401&&!r._retry){r._retry=!0;try{O||(O=Jt(l()));const n=await O;return t(n.nextToken),b(n.nextRefreshToken),typeof h=="function"&&h(n),m(r)}catch(n){return a(),_(),typeof T=="function"&&T(n),Promise.reject(e)}finally{O=null}}return Promise.reject(e)}),m}var Qt=Object.defineProperty,ei=(i,t,a)=>t in i?Qt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,oe=(i,t,a)=>(ei(i,typeof t!="symbol"?t+"":t,a),a);class ti{constructor(){oe(this,"api"),oe(this,"user"),oe(this,"userSession"),oe(this,"token");const t=new zt,a=$t({getSessionToken:t.getSessionToken,setSessionToken:t.setSessionToken,removeSessionToken:t.removeSessionToken,getRefreshToken:t.getRefreshToken,setRefreshToken:t.setRefreshToken,removeRefreshToken:t.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new Kt({api:a}),this.userSession=new Wt({api:a}),this.token=t,this.api=a}}const ai=new ti;we.defaults.timeout=10*1e3;we.create();qe(S)`
2
2
  .selected-container {
3
3
  position: absolute;
4
4
  right: 0px;
@@ -1 +1 @@
1
- import{j as e,G as y,P as s,n as b,m as p,q as k,r as x,M as h,O as u,l as v,p as B,o as R}from"./index-B6qhr4Vv.js";import{D as U}from"./index-neNekbhs.js";import{u as L}from"./team-hCJdZoCR.js";import{C as M,M as C}from"./memory-COJcMqTu.js";import{B as D}from"./bundle-avatar-DsCsmlpx.js";import"./FilterList-dxewgEr3.js";import"./Select-BDtCsGy7.js";import"./Delete-DDy4lv2l.js";import"./InputLabel-Cag35T0N.js";import"./TextField-PSikz4cm.js";import"./LastPage-CHLGEMPh.js";import"./index-BIT8HWlC.js";import"./redux-DJbvHHJc.js";import"./Search-DbENMUmJ.js";import"./index-BIi9UAUe.js";import"./MoreVert-DCY4R0I6.js";import"./chart-CD97eKtM.js";function g({blocklet:r,cpuHistory:i,memoryHistory:n,...m}){const l=r.appRuntimeInfo||{};return e.jsx(N,{component:"div",...m,children:e.jsxs(y,{className:"page-metrics",container:!0,spacing:5,children:[e.jsx(y,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!i.length&&e.jsx(M,{currentLoad:l.cpuUsage||0,history:i,style:{height:150}})},"cpu"),e.jsx(y,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!n.length&&e.jsx(C,{used:l.memoryUsage||0,history:n,style:{height:150}})},"memory")]})})}g.propTypes={blocklet:s.object.isRequired,cpuHistory:s.arrayOf(s.shape({date:s.number,value:s.number})),memoryHistory:s.arrayOf(s.shape({date:s.number,value:s.number}))};g.defaultProps={cpuHistory:[],memoryHistory:[]};const N=b(p)``;function P(){const{t:r,locale:i}=k(),{blocklet:n,runtimeHistory:m,actions:{refreshBlocklet:l}}=L(),a=x.useMemo(()=>{const t=[];return h.forEachBlockletSync(n,(o,{ancestors:f,id:d,level:c})=>{o.runtimeInfo&&t.push({type:"blocklet",groupId:n.meta.did,groupName:h.getDisplayName(n),id:d,name:h.getDisplayName(o,!0),blocklet:n,component:o,level:c-1>=0?c-1:0,runtimeInfo:o.runtimeInfo,ancestors:f})}),t},[n]);x.useEffect(()=>{const t=setInterval(()=>{l()},1e4);return()=>{clearInterval(t)}},[]);const I=t=>B(Number(t||0),{locale:R(i)}),j=[{label:r("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:o,component:f,level:d,ancestors:c}=a[t];return e.jsxs(u,{display:"flex",alignItems:"center",pl:d*2,children:[e.jsx(D,{size:14,blocklet:f,ancestors:c}),e.jsx(u,{ml:1,children:o})]})}}},{label:r("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return I(o.uptime)}}},{label:r("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return v((o==null?void 0:o.memoryUsage)||0)}}},{label:r("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return`${(o.cpuUsage||0).toFixed(1)}%`}}},{label:r("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:r("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return e.jsxs(H,{component:"div",children:[e.jsx(p,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:r("analytics.trend")}),n.status==="running"?[e.jsx(u,{children:e.jsx(g,{blocklet:n,cpuHistory:m.cpu,memoryHistory:m.memory})}),e.jsx(u,{mt:3,children:e.jsx(U,{title:r("analytics.detail"),className:"monitor-table",locale:i,data:a,columns:j,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]:e.jsx(p,{children:r("blocklet.runtimeInfo.noRunning")})]})}P.propTypes={};const H=b(p)``;export{P as default};
1
+ import{j as e,G as y,P as s,n as b,m as p,q as k,r as x,M as h,O as u,l as v,p as B,o as R}from"./index-CkI554oc.js";import{D as U}from"./index-Cj3s4CtX.js";import{u as L}from"./team-CrNp0IgF.js";import{C as M,M as C}from"./memory-dGmMptAO.js";import{B as D}from"./bundle-avatar-C_2wXttj.js";import"./FilterList-RGEuYf_e.js";import"./Select-DJl6HmRs.js";import"./Delete-BGOcGa_D.js";import"./InputLabel-CdW9MyDY.js";import"./TextField-BD0it3d0.js";import"./LastPage-dDlMsztV.js";import"./index-aVpXIXlo.js";import"./redux-BBckwmBz.js";import"./Search-J7ilvWof.js";import"./index-CfOOBUnf.js";import"./MoreVert-BL42DjcZ.js";import"./chart-sF6tbndw.js";function g({blocklet:r,cpuHistory:i,memoryHistory:n,...m}){const l=r.appRuntimeInfo||{};return e.jsx(N,{component:"div",...m,children:e.jsxs(y,{className:"page-metrics",container:!0,spacing:5,children:[e.jsx(y,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!i.length&&e.jsx(M,{currentLoad:l.cpuUsage||0,history:i,style:{height:150}})},"cpu"),e.jsx(y,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!n.length&&e.jsx(C,{used:l.memoryUsage||0,history:n,style:{height:150}})},"memory")]})})}g.propTypes={blocklet:s.object.isRequired,cpuHistory:s.arrayOf(s.shape({date:s.number,value:s.number})),memoryHistory:s.arrayOf(s.shape({date:s.number,value:s.number}))};g.defaultProps={cpuHistory:[],memoryHistory:[]};const N=b(p)``;function P(){const{t:r,locale:i}=k(),{blocklet:n,runtimeHistory:m,actions:{refreshBlocklet:l}}=L(),a=x.useMemo(()=>{const t=[];return h.forEachBlockletSync(n,(o,{ancestors:f,id:d,level:c})=>{o.runtimeInfo&&t.push({type:"blocklet",groupId:n.meta.did,groupName:h.getDisplayName(n),id:d,name:h.getDisplayName(o,!0),blocklet:n,component:o,level:c-1>=0?c-1:0,runtimeInfo:o.runtimeInfo,ancestors:f})}),t},[n]);x.useEffect(()=>{const t=setInterval(()=>{l()},1e4);return()=>{clearInterval(t)}},[]);const I=t=>B(Number(t||0),{locale:R(i)}),j=[{label:r("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:o,component:f,level:d,ancestors:c}=a[t];return e.jsxs(u,{display:"flex",alignItems:"center",pl:d*2,children:[e.jsx(D,{size:14,blocklet:f,ancestors:c}),e.jsx(u,{ml:1,children:o})]})}}},{label:r("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return I(o.uptime)}}},{label:r("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return v((o==null?void 0:o.memoryUsage)||0)}}},{label:r("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:o}=a[t];return`${(o.cpuUsage||0).toFixed(1)}%`}}},{label:r("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:r("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return e.jsxs(H,{component:"div",children:[e.jsx(p,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:r("analytics.trend")}),n.status==="running"?[e.jsx(u,{children:e.jsx(g,{blocklet:n,cpuHistory:m.cpu,memoryHistory:m.memory})}),e.jsx(u,{mt:3,children:e.jsx(U,{title:r("analytics.detail"),className:"monitor-table",locale:i,data:a,columns:j,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]:e.jsx(p,{children:r("blocklet.runtimeInfo.noRunning")})]})}P.propTypes={};const H=b(p)``;export{P as default};
@@ -1,2 +1,2 @@
1
- import{a as L}from"./codemirror.es-fM7kqYGL.js";import{a as K}from"./searchcursor.es-CbJjnyZ6.js";import{a as U}from"./dialog.es-COYIW3n4.js";import"./index-CIFB0zK6.js";import"./index-B6qhr4Vv.js";var k=Object.defineProperty,i=(x,w)=>k(x,"name",{value:w,configurable:!0});function V(x,w){return w.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(d){if(d!=="default"&&!(d in x)){var O=Object.getOwnPropertyDescriptor(a,d);Object.defineProperty(x,d,O.get?O:{enumerable:!0,get:function(){return a[d]}})}})}),Object.freeze(x)}i(V,"_mergeNamespaces");var z={exports:{}};(function(x,w){(function(a){a(L.exports,K.exports,U.exports)})(function(a){a.defineOption("search",{bottom:!1});function d(e,t){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(n){e.lastIndex=n.pos;var o=e.exec(n.string);if(o&&o.index==n.pos)return n.pos+=o[0].length||1,"searching";o?n.pos=o.index:n.skipToEnd()}}}i(d,"searchOverlay");function O(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}i(O,"SearchState");function S(e){return e.state.search||(e.state.search=new O)}i(S,"getSearchState");function N(e){return typeof e=="string"&&e==e.toLowerCase()}i(N,"queryCaseInsensitive");function m(e,t,n){return e.getSearchCursor(t,n,{caseFold:N(t),multiline:!0})}i(m,"getSearchCursor");function $(e,t,n,o,r){e.openDialog(t,o,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(e)},onKeyDown:r,bottom:e.options.search.bottom})}i($,"persistentDialog");function P(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(n,o))}i(P,"dialog");function F(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}i(F,"confirmDialog");function _(e){return e.replace(/\\([nrt\\])/g,function(t,n){return n=="n"?`
1
+ import{a as L}from"./codemirror.es-DmoQbR9T.js";import{a as K}from"./searchcursor.es-CxYOh1mB.js";import{a as U}from"./dialog.es-CFWHh6H2.js";import"./index-D2cgpNGA.js";import"./index-CkI554oc.js";var k=Object.defineProperty,i=(x,w)=>k(x,"name",{value:w,configurable:!0});function V(x,w){return w.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(d){if(d!=="default"&&!(d in x)){var O=Object.getOwnPropertyDescriptor(a,d);Object.defineProperty(x,d,O.get?O:{enumerable:!0,get:function(){return a[d]}})}})}),Object.freeze(x)}i(V,"_mergeNamespaces");var z={exports:{}};(function(x,w){(function(a){a(L.exports,K.exports,U.exports)})(function(a){a.defineOption("search",{bottom:!1});function d(e,t){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(n){e.lastIndex=n.pos;var o=e.exec(n.string);if(o&&o.index==n.pos)return n.pos+=o[0].length||1,"searching";o?n.pos=o.index:n.skipToEnd()}}}i(d,"searchOverlay");function O(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}i(O,"SearchState");function S(e){return e.state.search||(e.state.search=new O)}i(S,"getSearchState");function N(e){return typeof e=="string"&&e==e.toLowerCase()}i(N,"queryCaseInsensitive");function m(e,t,n){return e.getSearchCursor(t,n,{caseFold:N(t),multiline:!0})}i(m,"getSearchCursor");function $(e,t,n,o,r){e.openDialog(t,o,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(e)},onKeyDown:r,bottom:e.options.search.bottom})}i($,"persistentDialog");function P(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(n,o))}i(P,"dialog");function F(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}i(F,"confirmDialog");function _(e){return e.replace(/\\([nrt\\])/g,function(t,n){return n=="n"?`
2
2
  `:n=="r"?"\r":n=="t"?" ":n=="\\"?"\\":t})}i(_,"parseString");function C(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch{}else e=_(e);return(typeof e=="string"?e=="":e.test(""))&&(e=/x^/),e}i(C,"parseQuery");function R(e,t,n){t.queryText=n,t.query=C(n),e.removeOverlay(t.overlay,N(t.query)),t.overlay=d(t.query,N(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,N(t.query)))}i(R,"startSearch");function y(e,t,n,o){var r=S(e);if(r.query)return D(e,t);var s=e.getSelection()||r.lastQuery;if(s instanceof RegExp&&s.source=="x^"&&(s=null),n&&e.openDialog){var c=null,p=i(function(f,v){a.e_stop(v),f&&(f!=r.queryText&&(R(e,r,f),r.posFrom=r.posTo=e.getCursor()),c&&(c.style.opacity=1),D(e,v.shiftKey,function(h,g){var u;g.line<3&&document.querySelector&&(u=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&u.getBoundingClientRect().bottom-4>e.cursorCoords(g,"window").top&&((c=u).style.opacity=.4)}))},"searchNext");$(e,Q(e),s,p,function(f,v){var h=a.keyName(f),g=e.getOption("extraKeys"),u=g&&g[h]||a.keyMap[e.getOption("keyMap")][h];u=="findNext"||u=="findPrev"||u=="findPersistentNext"||u=="findPersistentPrev"?(a.e_stop(f),R(e,S(e),v),e.execCommand(u)):(u=="find"||u=="findPersistent")&&(a.e_stop(f),p(v,f))}),o&&s&&(R(e,r,s),D(e,t))}else P(e,Q(e),"Search for:",s,function(f){f&&!r.query&&e.operation(function(){R(e,r,f),r.posFrom=r.posTo=e.getCursor(),D(e,t)})})}i(y,"doSearch");function D(e,t,n){e.operation(function(){var o=S(e),r=m(e,o.query,t?o.posFrom:o.posTo);!r.find(t)&&(r=m(e,o.query,t?a.Pos(e.lastLine()):a.Pos(e.firstLine(),0)),!r.find(t))||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()},20),o.posFrom=r.from(),o.posTo=r.to(),n&&n(r.from(),r.to()))})}i(D,"findNext");function b(e){e.operation(function(){var t=S(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}i(b,"clearSearch");function l(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var o in t)n[o]=t[o];for(var r=2;r<arguments.length;r++){var s=arguments[r];n.appendChild(typeof s=="string"?document.createTextNode(s):s)}return n}i(l,"el");function Q(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Search:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}i(Q,"getQueryDialog");function j(e){return l("",null," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}i(j,"getReplaceQueryDialog");function A(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}i(A,"getReplacementQueryDialog");function I(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",l("button",{},e.phrase("Yes"))," ",l("button",{},e.phrase("No"))," ",l("button",{},e.phrase("All"))," ",l("button",{},e.phrase("Stop")))}i(I,"getDoReplaceConfirm");function T(e,t,n){e.operation(function(){for(var o=m(e,t);o.findNext();)if(typeof t!="string"){var r=e.getRange(o.from(),o.to()).match(t);o.replace(n.replace(/\$(\d)/g,function(s,c){return r[c]}))}else o.replace(n)})}i(T,"replaceAll");function E(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||S(e).lastQuery,o=t?e.phrase("Replace all:"):e.phrase("Replace:"),r=l("",null,l("span",{className:"CodeMirror-search-label"},o),j(e));P(e,r,o,n,function(s){s&&(s=C(s),P(e,A(e),e.phrase("Replace with:"),"",function(c){if(c=_(c),t)T(e,s,c);else{b(e);var p=m(e,s,e.getCursor("from")),f=i(function(){var h=p.from(),g;!(g=p.findNext())&&(p=m(e,s),!(g=p.findNext())||h&&p.from().line==h.line&&p.from().ch==h.ch)||(e.setSelection(p.from(),p.to()),e.scrollIntoView({from:p.from(),to:p.to()}),F(e,I(e),e.phrase("Replace?"),[function(){v(g)},f,function(){T(e,s,c)}]))},"advance"),v=i(function(h){p.replace(typeof s=="string"?c:c.replace(/\$(\d)/g,function(g,u){return h[u]})),f()},"doReplace");f()}}))})}}i(E,"replace"),a.commands.find=function(e){b(e),y(e)},a.commands.findPersistent=function(e){b(e),y(e,!1,!0)},a.commands.findPersistentNext=function(e){y(e,!1,!0,!0)},a.commands.findPersistentPrev=function(e){y(e,!0,!0,!0)},a.commands.findNext=y,a.commands.findPrev=function(e){y(e,!0)},a.commands.clearSearch=b,a.commands.replace=E,a.commands.replaceAll=function(e){E(e,!0)}})})();var B=z.exports,X=Object.freeze(V({__proto__:null,[Symbol.toStringTag]:"Module",default:B},[z.exports]));export{X as s};
@@ -1,4 +1,4 @@
1
- import{a as M}from"./codemirror.es-fM7kqYGL.js";import"./index-CIFB0zK6.js";import"./index-B6qhr4Vv.js";var $=Object.defineProperty,g=(F,P)=>$(F,"name",{value:P,configurable:!0});function D(F,P){return P.forEach(function(u){u&&typeof u!="string"&&!Array.isArray(u)&&Object.keys(u).forEach(function(s){if(s!=="default"&&!(s in F)){var L=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(F,s,L.get?L:{enumerable:!0,get:function(){return u[s]}})}})}),Object.freeze(F)}g(D,"_mergeNamespaces");var A={exports:{}};(function(F,P){(function(u){u(M.exports)})(function(u){var s=u.Pos;function L(t){var e=t.flags;return e??(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}g(L,"regexpFlags");function O(t,e){for(var n=L(t),r=n,l=0;l<e.length;l++)r.indexOf(e.charAt(l))==-1&&(r+=e.charAt(l));return n==r?t:new RegExp(t.source,r)}g(O,"ensureFlags");function R(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}g(R,"maybeMultiline");function _(t,e,n){e=O(e,"g");for(var r=n.line,l=n.ch,a=t.lastLine();r<=a;r++,l=0){e.lastIndex=l;var i=t.getLine(r),f=e.exec(i);if(f)return{from:s(r,f.index),to:s(r,f.index+f[0].length),match:f}}}g(_,"searchRegexpForward");function z(t,e,n){if(!R(e))return _(t,e,n);e=O(e,"gm");for(var r,l=1,a=n.line,i=t.lastLine();a<=i;){for(var f=0;f<l&&!(a>i);f++){var d=t.getLine(a++);r=r==null?d:r+`
1
+ import{a as M}from"./codemirror.es-DmoQbR9T.js";import"./index-D2cgpNGA.js";import"./index-CkI554oc.js";var $=Object.defineProperty,g=(F,P)=>$(F,"name",{value:P,configurable:!0});function D(F,P){return P.forEach(function(u){u&&typeof u!="string"&&!Array.isArray(u)&&Object.keys(u).forEach(function(s){if(s!=="default"&&!(s in F)){var L=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(F,s,L.get?L:{enumerable:!0,get:function(){return u[s]}})}})}),Object.freeze(F)}g(D,"_mergeNamespaces");var A={exports:{}};(function(F,P){(function(u){u(M.exports)})(function(u){var s=u.Pos;function L(t){var e=t.flags;return e??(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}g(L,"regexpFlags");function O(t,e){for(var n=L(t),r=n,l=0;l<e.length;l++)r.indexOf(e.charAt(l))==-1&&(r+=e.charAt(l));return n==r?t:new RegExp(t.source,r)}g(O,"ensureFlags");function R(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}g(R,"maybeMultiline");function _(t,e,n){e=O(e,"g");for(var r=n.line,l=n.ch,a=t.lastLine();r<=a;r++,l=0){e.lastIndex=l;var i=t.getLine(r),f=e.exec(i);if(f)return{from:s(r,f.index),to:s(r,f.index+f[0].length),match:f}}}g(_,"searchRegexpForward");function z(t,e,n){if(!R(e))return _(t,e,n);e=O(e,"gm");for(var r,l=1,a=n.line,i=t.lastLine();a<=i;){for(var f=0;f<l&&!(a>i);f++){var d=t.getLine(a++);r=r==null?d:r+`
2
2
  `+d}l=l*2,e.lastIndex=n.ch;var o=e.exec(r);if(o){var h=r.slice(0,o.index).split(`
3
3
  `),c=o[0].split(`
4
4
  `),v=n.line+h.length-1,m=h[h.length-1].length;return{from:s(v,m),to:s(v+c.length-1,c.length==1?m+c[0].length:c[c.length-1].length),match:o}}}}g(z,"searchRegexpForwardMultiline");function j(t,e,n){for(var r,l=0;l<=t.length;){e.lastIndex=l;var a=e.exec(t);if(!a)break;var i=a.index+a[0].length;if(i>t.length-n)break;(!r||i>r.index+r[0].length)&&(r=a),l=a.index+1}return r}g(j,"lastMatchIn");function k(t,e,n){e=O(e,"g");for(var r=n.line,l=n.ch,a=t.firstLine();r>=a;r--,l=-1){var i=t.getLine(r),f=j(i,e,l<0?0:i.length-l);if(f)return{from:s(r,f.index),to:s(r,f.index+f[0].length),match:f}}}g(k,"searchRegexpBackward");function B(t,e,n){if(!R(e))return k(t,e,n);e=O(e,"gm");for(var r,l=1,a=t.getLine(n.line).length-n.ch,i=n.line,f=t.firstLine();i>=f;){for(var d=0;d<l&&i>=f;d++){var o=t.getLine(i--);r=r==null?o:o+`
@@ -0,0 +1 @@
1
+ import{r as m,f as l,M as s,j as o,P as a}from"./index-CkI554oc.js";import{T as c,M as n,t as u}from"./table-icons-DjAM1A7C.js";import"./FilterList-RGEuYf_e.js";import"./Select-DJl6HmRs.js";import"./Delete-BGOcGa_D.js";import"./InputLabel-CdW9MyDY.js";import"./TextField-BD0it3d0.js";import"./LastPage-dDlMsztV.js";import"./slicedToArray-Pwxti1pp.js";import"./Search-J7ilvWof.js";import"./actions-Dx15LaaC.js";import"./useLocalStorage-DRS65jti.js";import"./MoreVert-BL42DjcZ.js";import"./ButtonGroup-BbRXyWVe.js";import"./getValidReactChildren-DKO9kPop.js";import"./url-evaluation-asC5XTLH.js";import"./tag-CdoBHuxB.js";import"./ChevronLeft-Bc2acyen.js";import"./Edit-B0yxTPMe.js";import"./ChevronRight-Bcko4z80.js";import"./DeleteOutline-C7JmRduW.js";import"./redux-BBckwmBz.js";import"./Skeleton-CSyuj2cV.js";import"./InputAdornment-BzCm_2kz.js";import"./index-BNulkcXj.js";import"./memoize-one.esm-BdPwpGay.js";import"./Add-DEou6OQu.js";import"./ArrowDropDown-B8q6yJii.js";function d({blocklet:i,...r}){const{t}=m.useContext(l),e=s.getBlockletServices(i);if(e.length===0)return o.jsx("div",{children:t("blocklet.noService")});const p=[{title:t("common.name"),field:"name"},{title:t("common.protocol"),field:"protocol"},{title:t("common.port"),field:"port"},{title:t("blocklet.upstreamPort"),field:"upstreamPort"}];return o.jsx(c,{...r,children:o.jsx(n,{columns:p,icons:{...u},options:{sorting:!1,emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",search:!1,pageSize:1e3,pageSizeOptions:[1e3]},localization:{body:{emptyDataSourceMessage:t("blocklet.noService")}},data:e})})}d.propTypes={blocklet:a.object.isRequired};export{d as default};