@abtnode/blocklet-services 1.16.38-beta-20250120-112111-55c032e8 → 1.16.38-beta-20250123-083218-c7ea9693

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 (197) hide show
  1. package/api/routes/user-session.js +23 -4
  2. package/api/services/auth/session.js +1 -1
  3. package/api/services/studio/index.js +2 -0
  4. package/dist/assets/Add-CbZXB9BN.js +1 -0
  5. package/dist/assets/ArrowDropDown-CCP1plk6.js +1 -0
  6. package/dist/assets/CheckCircle-DhGEqk47.js +1 -0
  7. package/dist/assets/ChevronLeft-md-2eRHz.js +1 -0
  8. package/dist/assets/ChevronRight-DAi6_yC8.js +1 -0
  9. package/dist/assets/DeleteOutline-mNy4Y7aW.js +1 -0
  10. package/dist/assets/Done-BW0pdQ5b.js +1 -0
  11. package/dist/assets/Download-Dn7Gxwef.js +1 -0
  12. package/dist/assets/Error-bTFr7mrN.js +1 -0
  13. package/dist/assets/Google-Df86UadJ.js +27 -0
  14. package/dist/assets/InfoOutlined-CD_kKD1R.js +1 -0
  15. package/dist/assets/Launch-C4oayzSh.js +1 -0
  16. package/dist/assets/LaunchOutlined-o-scAjX1.js +1 -0
  17. package/dist/assets/Loop-CgXdPi-b.js +1 -0
  18. package/dist/assets/MoreHoriz-CE_TiTTu.js +1 -0
  19. package/dist/assets/PlayArrow-CNURzidt.js +1 -0
  20. package/dist/assets/ViewList-BK6mc3zl.js +1 -0
  21. package/dist/assets/access-control-C_TECevI.js +13 -0
  22. package/dist/assets/{actions-Ca8zHti6.js → actions-DQhRPM_-.js} +1 -1
  23. package/dist/assets/add-component-core-ZKcNoEdg.js +765 -0
  24. package/dist/assets/add-resource-DeyN_YP2.js +1 -0
  25. package/dist/assets/{addon-CD5JNqbI.js → addon-BQVku5Pw.js} +1 -1
  26. package/dist/assets/analytics-CABOV3VR.js +47 -0
  27. package/dist/assets/api-hLQrqHOJ.js +1 -0
  28. package/dist/assets/{ar-4M8AtNpp.js → ar-D1VagXPW.js} +1 -1
  29. package/dist/assets/{audit-logs-BKvkrneR.js → audit-logs-DfI45rXd.js} +1 -1
  30. package/dist/assets/{base32-uGF9kxBw.js → base32-DwpD8kXz.js} +1 -1
  31. package/dist/assets/branding-B9FP7-vo.js +40 -0
  32. package/dist/assets/bundle-avatar-Fs8xar2D.js +1 -0
  33. package/dist/assets/button-DkniumtB.js +1 -0
  34. package/dist/assets/{click-to-copy-DSvEXBYz.js → click-to-copy-BK1KcsDP.js} +1 -1
  35. package/dist/assets/cloneDeep-gFMzIJP-.js +1 -0
  36. package/dist/assets/{complete-DOx-lUao.js → complete-C8dsbaZL.js} +2 -2
  37. package/dist/assets/{component-DuXXl9Wb.js → component-CY2siZu6.js} +58 -58
  38. package/dist/assets/{config-BY9NHNw2.js → config-DefjxKJo.js} +2 -2
  39. package/dist/assets/config-navigation-D5ZGtEAj.js +26 -0
  40. package/dist/assets/config-oy6r1Urw.js +1 -0
  41. package/dist/assets/config-space-B3_Fcx4w.js +1 -0
  42. package/dist/assets/{confirm-DUAXonUU.js → confirm-BoaULvDn.js} +1 -1
  43. package/dist/assets/connect-BLZbqoZH.js +5 -0
  44. package/dist/assets/connect-o0-zMzhz.js +1 -0
  45. package/dist/assets/connect-to-CLRCxFvc.js +1 -0
  46. package/dist/assets/dashboard-BsuKKhWa.js +86 -0
  47. package/dist/assets/{de-D7CG0ov1.js → de-CvDV7d-6.js} +1 -1
  48. package/dist/assets/{did-address-BD4xjcb5.js → did-address-lZEH-yVL.js} +1 -1
  49. package/dist/assets/domain-CL1k3ZX_.js +9 -0
  50. package/dist/assets/domain-list-Hq4lMkF7.js +15 -0
  51. package/dist/assets/{email-Bne33m4E.js → email-BEAIuGC5.js} +2 -2
  52. package/dist/assets/{es-DDr-aesw.js → es-DGK_gDT-.js} +1 -1
  53. package/dist/assets/exchange-passport-mOSW3xXw.js +1 -0
  54. package/dist/assets/form-text-input-CKzsC-YU.js +11 -0
  55. package/dist/assets/{fr-CsECkLCu.js → fr-BuGbCF-_.js} +1 -1
  56. package/dist/assets/fuel-e3tdVb--.js +32 -0
  57. package/dist/assets/{fullpage-Dd-4ilXd.js → fullpage-CkKHaYU0.js} +1 -1
  58. package/dist/assets/{get-safe-url-CWTjw4O_.js → get-safe-url-C4tgGDKq.js} +1 -1
  59. package/dist/assets/{get-safe-url-g5s2_Tjs.js → get-safe-url-C_f_ODLw.js} +1 -1
  60. package/dist/assets/hi-w7-Xo0pj.js +1 -0
  61. package/dist/assets/{home-Cy8ZPRh3.js → home-BNIXkVh5.js} +1 -1
  62. package/dist/assets/{id-PvpxFUDg.js → id-DfsK8869.js} +1 -1
  63. package/dist/assets/{iframe-B1rCM9Eo.js → iframe-SU3hkiQZ.js} +1 -1
  64. package/dist/assets/{index-BEw2AyDT.js → index-96CXu6nL.js} +7 -7
  65. package/dist/assets/{index-Bj0uuh8o.js → index-B1LvzL9_.js} +3 -3
  66. package/dist/assets/{index-C73dl7Hb.js → index-B2Tt5B_m.js} +1 -1
  67. package/dist/assets/{index-C1Xq6XBK.js → index-BDDBFVc2.js} +1 -1
  68. package/dist/assets/{index-D2ZJq7sT.js → index-CV6rNC-Y.js} +9 -9
  69. package/dist/assets/index-CV9CYyTl.js +104 -0
  70. package/dist/assets/index-CbOZ5xd2.js +144 -0
  71. package/dist/assets/{index-wVbkSf51.js → index-D3LlfacS.js} +1 -1
  72. package/dist/assets/index-DZkcShk4.js +2 -0
  73. package/dist/assets/index-Dg_5HpPS.js +5 -0
  74. package/dist/assets/{index-BnIb4VTf.js → index-Dh7hy74S.js} +2 -2
  75. package/dist/assets/{index-Dtif7RsI.js → index-Dkwa_Vhl.js} +1 -1
  76. package/dist/assets/{index-0YXNPVgm.js → index-Dyaz7ZHB.js} +41 -41
  77. package/dist/assets/{index-DKA7-XNE.js → index-HmBDrYyO.js} +1 -1
  78. package/dist/assets/{index-D5GvmQYq.js → index-XcirhJQa.js} +22 -22
  79. package/dist/assets/{index-HfngL4ZQ.js → index-jQnnlRfC.js} +2 -2
  80. package/dist/assets/{invitation-HSZrTxov.js → invitation-B0m5kk5c.js} +7 -7
  81. package/dist/assets/invite-RA9kQH1W.js +5 -0
  82. package/dist/assets/issue-passport-DHpO_ACu.js +1 -0
  83. package/dist/assets/item-BieIEWMb.js +2 -0
  84. package/dist/assets/{ja-B9wMKQOb.js → ja-CQJHpvK1.js} +1 -1
  85. package/dist/assets/{ko-C_Flkwn-.js → ko-9oNzTJow.js} +1 -1
  86. package/dist/assets/{layout-C4CjSZo6.js → layout-BG2jsdXo.js} +1 -1
  87. package/dist/assets/{list-header-DH99VXjo.js → list-header-CiUgmzBx.js} +1 -1
  88. package/dist/assets/localization-BhAxNGA4.js +1 -0
  89. package/dist/assets/{log-DURqeXoL.js → log-C6bNY6ja.js} +11 -11
  90. package/dist/assets/login-Cvj7T07b.js +1 -0
  91. package/dist/assets/login-bg-BMPVKR1k.svg +5 -0
  92. package/dist/assets/login-oauth-callback-Di8KYSE_.js +1 -0
  93. package/dist/assets/logo-uploader-CdOV1A5h.js +133 -0
  94. package/dist/assets/{lost-passport-BSTbRq2w.js → lost-passport-DUSDA_sN.js} +3 -3
  95. package/dist/assets/{open-window-CbZilAH2.js → open-window-DF6F9kh-.js} +1 -1
  96. package/dist/assets/overview-16UWFtH0.js +12 -0
  97. package/dist/assets/{page-header-CjQ-ywzU.js → page-header-D0CahNv0.js} +1 -1
  98. package/dist/assets/{permission-7KeKIEKG.js → permission-CKZlVSQ7.js} +1 -1
  99. package/dist/assets/{preferences-BvdZgVe4.js → preferences-DHuTV8VO.js} +1 -1
  100. package/dist/assets/pt-DMLN8oh9.js +1 -0
  101. package/dist/assets/{publish-resource-DKGi8v_y.js → publish-resource-CAkJ3GaW.js} +1 -1
  102. package/dist/assets/{react-beautiful-dnd.esm-1AJr8vv6.js → react-beautiful-dnd.esm-CfBtdMfF.js} +1 -1
  103. package/dist/assets/{relative-time-DXGmoAYD.js → relative-time-BMfPIJBi.js} +1 -1
  104. package/dist/assets/ru-CGG1vu9C.js +1 -0
  105. package/dist/assets/sdk-CBXPdpcP.js +1 -0
  106. package/dist/assets/session-BTTqSeVf.js +1 -0
  107. package/dist/assets/setup-bES2Uf5W.js +19 -0
  108. package/dist/assets/start-MoamILfR.js +187 -0
  109. package/dist/assets/{step-actions-BF4Z-WD4.js → step-actions-CuwaxH_E.js} +1 -1
  110. package/dist/assets/studio-CO68-4Oq.js +6 -0
  111. package/dist/assets/{switch-control-Df6SSLH9.js → switch-control-BpWvMK7z.js} +1 -1
  112. package/dist/assets/th-D-lApkQp.js +1 -0
  113. package/dist/assets/transfer-DzCBkPdX.js +16 -0
  114. package/dist/assets/unsubscribe-DnKJ4RoU.js +1 -0
  115. package/dist/assets/{useAsync-D2wKH3Wq.js → useAsync-DCGc7Pdb.js} +1 -1
  116. package/dist/assets/{useAsyncRetry-B87-aW-H.js → useAsyncRetry-0k7mm5ej.js} +1 -1
  117. package/dist/assets/{useLocalStorage-Dsxa7zZV.js → useLocalStorage-BGtJBKln.js} +1 -1
  118. package/dist/assets/user-center-BkJieuxf.js +232 -0
  119. package/dist/assets/util-DQVMHOUo.js +1 -0
  120. package/dist/assets/{vendor-arcblock-D-SOxQ_x.js → vendor-arcblock-CwZ35cSm.js} +47 -47
  121. package/dist/assets/vendor-hooks-DWAhU9cy.js +7 -0
  122. package/dist/assets/vendor-utils-u2ViqIqX.js +11 -0
  123. package/dist/assets/vi-D45dg9B_.js +1 -0
  124. package/dist/assets/wrap-locale-DTfWnUqX.js +1 -0
  125. package/dist/assets/{zh-D0JQ3A7z.js → zh-CcLxBIl6.js} +1 -1
  126. package/dist/assets/{zh-tw-CnxtpiBO.js → zh-tw-Bqy7j8qE.js} +1 -1
  127. package/dist/index.html +4 -4
  128. package/dist/service-worker.js +1 -1
  129. package/package.json +22 -21
  130. package/dist/assets/Add-DwDyMZjP.js +0 -1
  131. package/dist/assets/ArrowDropDown-6xgUlX8W.js +0 -1
  132. package/dist/assets/CheckCircle-D3qBEHQS.js +0 -1
  133. package/dist/assets/ChevronLeft-DgLREh72.js +0 -1
  134. package/dist/assets/ChevronRight-IFh5bkgF.js +0 -1
  135. package/dist/assets/DeleteOutline-DQMkPBvg.js +0 -1
  136. package/dist/assets/Done-DLCsccPu.js +0 -1
  137. package/dist/assets/Download-DTpNGuLl.js +0 -1
  138. package/dist/assets/Error-UtB5QYSZ.js +0 -1
  139. package/dist/assets/Google-BOAVI-Xc.js +0 -27
  140. package/dist/assets/InfoOutlined-DQLlyyVh.js +0 -1
  141. package/dist/assets/Launch-Dh_xOrs9.js +0 -1
  142. package/dist/assets/LaunchOutlined-foAf5c3n.js +0 -1
  143. package/dist/assets/Loop-C4-HT3aE.js +0 -1
  144. package/dist/assets/MoreHoriz-CUpIy534.js +0 -1
  145. package/dist/assets/PlayArrow-DXnaLQNG.js +0 -1
  146. package/dist/assets/ViewList-CRla7mfM.js +0 -1
  147. package/dist/assets/_createAggregator-B36dTDyD.js +0 -1
  148. package/dist/assets/access-control-vt3SOToF.js +0 -13
  149. package/dist/assets/add-component-core-CacRzL5C.js +0 -716
  150. package/dist/assets/add-resource-ZEGylpES.js +0 -1
  151. package/dist/assets/analytics-hNGjKcAT.js +0 -47
  152. package/dist/assets/api-CjgpDSsI.js +0 -1
  153. package/dist/assets/branding-BfuJue_R.js +0 -40
  154. package/dist/assets/bundle-avatar-BkNNM9he.js +0 -1
  155. package/dist/assets/button-6RO042tO.js +0 -1
  156. package/dist/assets/config-_Ff2iSUC.js +0 -1
  157. package/dist/assets/config-navigation-m1gKN3Qh.js +0 -26
  158. package/dist/assets/config-space-DFc6Pvuv.js +0 -1
  159. package/dist/assets/connect-B8cD_Man.js +0 -1
  160. package/dist/assets/connect-CywmqoEu.js +0 -5
  161. package/dist/assets/connect-to-DrkQpX8j.js +0 -1
  162. package/dist/assets/dashboard-ChoAkepn.js +0 -86
  163. package/dist/assets/domain-C3fxr6Yg.js +0 -9
  164. package/dist/assets/domain-list-Do_JR9rl.js +0 -15
  165. package/dist/assets/exchange-passport-De6icZUJ.js +0 -1
  166. package/dist/assets/form-text-input-BCHcrKD9.js +0 -11
  167. package/dist/assets/fuel-BCXVQ7L0.js +0 -32
  168. package/dist/assets/hi-Bojespkc.js +0 -1
  169. package/dist/assets/index-3ytyTrcC.js +0 -2
  170. package/dist/assets/index-BJ7_xt0j.js +0 -104
  171. package/dist/assets/index-CWMVCzCZ.js +0 -144
  172. package/dist/assets/index-CfrumxV3.js +0 -5
  173. package/dist/assets/invite-Bq0wk8ts.js +0 -5
  174. package/dist/assets/issue-passport-CVJgqjoO.js +0 -1
  175. package/dist/assets/item-ClsWGBWW.js +0 -2
  176. package/dist/assets/localization-CBcpjiaX.js +0 -1
  177. package/dist/assets/login-Bspf2QPd.js +0 -1
  178. package/dist/assets/login-oauth-callback-C_wyWhiQ.js +0 -1
  179. package/dist/assets/logo-uploader-Dd2aFjos.js +0 -133
  180. package/dist/assets/overview-fXNI1ek4.js +0 -12
  181. package/dist/assets/pt-BqEVlA-1.js +0 -1
  182. package/dist/assets/ru-u0x_icQc.js +0 -1
  183. package/dist/assets/sdk-iUaLet3q.js +0 -1
  184. package/dist/assets/session-Cz3pOVxP.js +0 -1
  185. package/dist/assets/setup-BoMrIrRo.js +0 -19
  186. package/dist/assets/start-DbCciQyK.js +0 -187
  187. package/dist/assets/studio-DJOlNVRZ.js +0 -6
  188. package/dist/assets/th-BX_96cb2.js +0 -1
  189. package/dist/assets/toUpper-BYBs387H.js +0 -1
  190. package/dist/assets/transfer-CoIJ2-Fh.js +0 -16
  191. package/dist/assets/unsubscribe-DHlZPuAs.js +0 -1
  192. package/dist/assets/user-center-BY7PdrGc.js +0 -203
  193. package/dist/assets/util-DzhfzPwC.js +0 -1
  194. package/dist/assets/vendor-hooks-CAfthYak.js +0 -7
  195. package/dist/assets/vendor-utils-B7sI0FpJ.js +0 -11
  196. package/dist/assets/vi-7r8InJhP.js +0 -1
  197. package/dist/assets/wrap-locale-CjCBeQlY.js +0 -1
@@ -1,716 +0,0 @@
1
- import{a1 as ar,j as i,E as P,a2 as ht,aa as Ke,a3 as Z,T as pe,t as Nt,aN as Hr,bJ as Xr,I as Uo,bK as Wo,bL as zo,z as qo,aJ as Ca,bn as Ko,bM as Ia,M as lr,bt as _a,bu as Pa,bv as La,br as Na,ad as Vo,L as Aa,bm as Da,aw as Ma,al as Yr,e as Gn,x as Hn,R as Go,V as Ho,ar as Xo,bH as Yo,ac as yt,aF as Fa,as as zt,bN as Xi,A as Yi,Z as Ba,P as $a,G as Ua,v as Wa,$ as za,D as qa,K as Ji,a4 as Ka,bp as Va}from"./vendor-mui-core-jh6OMVvU.js";import{r as N,g as cr,u as Ga,k as Ha,a as Jr,e as Ee,b as Xa,l as Ya}from"./vendor-react-D-afvo_7.js";import{j as Jo,d as Ja,S as Qa,s as Qo,A as Za}from"./item-ClsWGBWW.js";import{ad as ur,ag as at,al as Qr,bl as st,U as Zo,bm as Qi,d as es,g as pt,bn as Dt,F as el,D as tl,E as dr,bo as nl,s as rl,ao as il,ab as ts,bp as Zi,bq as ol,z as Zr,C as sl,br as ns,bs as pn,ai as al,Q as ei,bt as ll,bu as cl,f as eo,bv as rs,bw as rr,bx as ti,aD as is,a6 as hr,by as wr,bz as ul,v as Un,bA as os,b6 as dl,bB as hl,bC as $r,bD as pl,ak as fl,bE as ml,aj as gl,$ as vl,bF as yl}from"./vendor-arcblock-D-SOxQ_x.js";import{f as At,y as Cn,Y as bl,Z as xl,h as Ot,C as wl,$ as El,a0 as Sl,a1 as Tl,B as pr,a2 as ss,U as jl,W as Ol,a3 as kl,a4 as Rl,a5 as Cl,a6 as Qn,a7 as to,a8 as Il}from"./index-BJ7_xt0j.js";import{L as no}from"./launch-result-message-CeThGm85.js";import{P as as}from"./page-header-CjQ-ywzU.js";import{u as _l,C as Pl}from"./config-space-DFc6Pvuv.js";import{R as Er}from"./logo-uploader-Dd2aFjos.js";import{S as Ll}from"./index-HfngL4ZQ.js";import{s as ls,h as Nl,w as Al,f as Dl,a as Ml,b as Fl,c as Bl,M as $l}from"./index-CzV3SmGK.js";import{B as Xn,o as Ul,k as Wl,q as cs,K as zl}from"./vendor-hooks-CAfthYak.js";import{g as ql}from"./get-safe-url-CWTjw4O_.js";import{p as Kl,B as Vl,a as ro,j as qn,w as ni,q as Gl,s as Hl,t as Xl,u as Yl}from"./vendor-utils-B7sI0FpJ.js";import{p as Jl}from"./index-Dtif7RsI.js";import{I as io}from"./index-BnIb4VTf.js";import{u as Ql}from"./session-Cz3pOVxP.js";import{W as Zl}from"./did-address-BD4xjcb5.js";import{_ as us}from"./useLocalStorage-Dsxa7zZV.js";import{f as ds}from"./format-error-C0Ke3VXF.js";import{a as oo}from"./api-CjgpDSsI.js";import{d as ec,v as tc,e as nc}from"./util-DzhfzPwC.js";import{u as hs}from"./use-mobile-DoeLOxx6.js";import{C as rc}from"./content-layout-DAGIv17a.js";import{C as ic,D as oc,a as sc}from"./connect-to-DrkQpX8j.js";import{d as ac}from"./ArrowDropDown-6xgUlX8W.js";import{d as lc}from"./ChevronLeft-DgLREh72.js";import{d as cc}from"./ChevronRight-IFh5bkgF.js";const cf="blocklet-add-component-registry",uf="server-add-registry",df=e=>`resource-${e}-add-registry`;var ri={},uc=ar;Object.defineProperty(ri,"__esModule",{value:!0});var ps=ri.default=void 0,dc=uc(ur()),hc=i;ps=ri.default=(0,dc.default)((0,hc.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function ii({disabled:e,children:t,onConfirm:n}){return N.useEffect(()=>{if(e)return()=>{};const r=o=>{o.code==="Enter"&&(o.metaKey===!0||o.ctrlKey===!0)&&(o.preventDefault(),o.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}ii.propTypes={disabled:P.bool,children:P.any.isRequired,onConfirm:P.func.isRequired};ii.defaultProps={disabled:!1};function oi({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[c,p]=N.useState(!1),d=()=>p(x=>!x);return i.jsxs(i.Fragment,{children:[i.jsx(pc,{children:i.jsxs(ii,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:d,children:r.listenName}),i.jsx(at,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(ht,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(Qr,{open:c,title:r.listenName,onClose:()=>p(!1),children:o})]})}oi.propTypes={onContinue:P.func.isRequired,nextDisabled:P.bool,launching:P.bool,description:P.any,texts:P.object};oi.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const pc=Ke.div`
2
- margin: 0 auto;
3
- display: flex;
4
- justify-content: space-between;
5
- align-items: center;
6
-
7
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
8
- flex-direction: column;
9
- }
10
-
11
- .eula-trigger {
12
- cursor: pointer;
13
- text-decoration: underline;
14
- ${e=>e.theme.breakpoints.up("md")} {
15
- padding-right: 24px;
16
- }
17
- ${e=>e.theme.breakpoints.down("md")} {
18
- padding: 16px;
19
- }
20
- font-size: 14px;
21
- white-space: nowrap;
22
- &:hover {
23
- color: ${e=>e.theme.palette.primary.main};
24
- }
25
- }
26
-
27
- .next-button {
28
- min-width: 200px;
29
- }
30
- `;var si={exports:{}},so=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,fc=/\n/g,mc=/^\s*/,gc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vc=/^:\s*/,yc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,bc=/^[;\s]*/,xc=/^\s+|\s+$/g,wc=`
31
- `,ao="/",lo="*",an="",Ec="comment",Sc="declaration",Tc=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(S){var k=S.match(fc);k&&(n+=k.length);var L=S.lastIndexOf(wc);r=~L?S.length-L:r+S.length}function c(){var S={line:n,column:r};return function(k){return k.position=new p(S),w(),k}}function p(S){this.start=S,this.end={line:n,column:r},this.source=t.source}p.prototype.content=e;function d(S){var k=new Error(t.source+":"+n+":"+r+": "+S);if(k.reason=S,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function x(S){var k=S.exec(e);if(k){var L=k[0];return o(L),e=e.slice(L.length),k}}function w(){x(mc)}function s(S){var k;for(S=S||[];k=a();)k!==!1&&S.push(k);return S}function a(){var S=c();if(!(ao!=e.charAt(0)||lo!=e.charAt(1))){for(var k=2;an!=e.charAt(k)&&(lo!=e.charAt(k)||ao!=e.charAt(k+1));)++k;if(k+=2,an===e.charAt(k-1))return d("End of comment missing");var L=e.slice(2,k-2);return r+=2,o(L),e=e.slice(k),r+=2,S({type:Ec,comment:L})}}function O(){var S=c(),k=x(gc);if(k){if(a(),!x(vc))return d("property missing ':'");var L=x(yc),A=S({type:Sc,property:co(k[0].replace(so,an)),value:L?co(L[0].replace(so,an)):an});return x(bc),A}}function b(){var S=[];s(S);for(var k;k=O();)k!==!1&&(S.push(k),s(S));return S}return w(),b()};function co(e){return e?e.replace(xc,an):an}var jc=Tc;function fs(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=jc(e),c=typeof t=="function",p,d,x=0,w=o.length;x<w;x++)r=o[x],p=r.property,d=r.value,c?t(p,d,r):d&&(n||(n={}),n[p]=d);return n}si.exports=fs;si.exports.default=fs;var Oc=si.exports;const kc=cr(Oc),Rc={}.hasOwnProperty;function Cc(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=_c(e),o=Nc(e),c=Lc(e);let p,d;if(typeof n=="string"||typeof n=="boolean"?(p=n,n={}):(n||(n={}),p=n.prefix),t&&t.type==="root"){const x=t.children[0];d=t.children.length===1&&x.type==="element"?x:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")d=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ms(e,d,{schema:n.space==="svg"?ls:Nl,prefix:p==null?r||o||c?"h-":void 0:typeof p=="string"?p:p?"h-":void 0,key:0,react:r,vue:o,vdom:c,hyperscript:Pc(e)})}function ms(e,t,n){const r=n.schema;let o=r,c=t.tagName;const p={},d=[];let x=-1,w;r.space==="html"&&c.toLowerCase()==="svg"&&(o=ls,n.schema=o);for(w in t.properties)t.properties&&Rc.call(t.properties,w)&&Ic(p,w,t.properties[w],n,c);if(n.vdom&&(o.space==="html"?c=c.toUpperCase():o.space&&(p.namespace=Al[o.space])),n.prefix&&(n.key++,p.key=n.prefix+n.key),t.children)for(;++x<t.children.length;){const s=t.children[x];s.type==="element"?d.push(ms(e,s,n)):s.type==="text"&&d.push(s.value)}return n.schema=r,d.length>0?e.call(t,c,p,d):e.call(t,c,p)}function Ic(e,t,n,r,o){const c=Dl(r.schema,t);let p;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&c.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=c.commaSeparated?Ml(n):Fl(n)),c.boolean&&r.hyperscript&&(n=""),c.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Ac(n,o)),r.vue?c.property!=="style"&&(p="attrs"):c.mustUseProperty||(r.vdom?c.property!=="style"&&(p="attributes"):r.hyperscript&&(p="attrs")),p?e[p]=Object.assign(e[p]||{},{[c.attribute]:n}):c.space&&r.react?e[Bl[c.property]||c.property]=n:e[c.attribute]=n)}function _c(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Pc(e){return"context"in e&&"cleanup"in e}function Lc(e){return e("div",{}).type==="VirtualNode"}function Nc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Ac(e,t){const n={};try{kc(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(c,p)=>p.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var Dc=gs;function gs(e){if(typeof e=="string")return $c(e);if(e==null)return Uc;if(typeof e=="object")return("length"in e?Bc:Fc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Mc(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=gs(e[r]);return t}function Fc(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Bc(e){var t=Mc(e),n=t.length;return r;function r(){for(var o=-1;++o<n;)if(t[o].apply(this,arguments))return!0;return!1}}function $c(e){return t;function t(n){return!!(n&&n.type===e)}}function Uc(){return!0}var Wc=fr,zc=Dc,vs=!0,ys="skip",ir=!1;fr.CONTINUE=vs;fr.SKIP=ys;fr.EXIT=ir;function fr(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=zc(t),c(e,null,[]);function c(d,x,w){var s=[],a;return(!t||o(d,x,w[w.length-1]||null))&&(s=uo(n(d,w)),s[0]===ir)?s:d.children&&s[0]!==ys?(a=uo(p(d.children,w.concat(d))),a[0]===ir?a:s):s}function p(d,x){for(var w=-1,s=r?-1:1,a=(r?d.length:w)+s,O;a>w&&a<d.length;){if(O=c(d[a],a,x),O[0]===ir)return O;a=typeof O[1]=="number"?O[1]:a+s}}}function uo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[vs,e]:[e]}var qc=gr,mr=Wc,Kc=mr.CONTINUE,Vc=mr.SKIP,Gc=mr.EXIT;gr.CONTINUE=Kc;gr.SKIP=Vc;gr.EXIT=Gc;function gr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),mr(e,t,o,r);function o(c,p){var d=p[p.length-1],x=d?d.children.indexOf(c):null;return n(c,x,d)}}var Hc=qc,Xc=Object.prototype.hasOwnProperty,Sr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Yc=function(t){return Hc(t,"element",Jc),t};function Jc(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Sr)!Xc.call(Sr,t)||e.properties[t]===void 0||(n=Sr[t],Qc(e,n,e.properties[t]),delete e.properties[t])}}function Qc(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var o=r+t+": "+n+";";e.properties.style=o}const Zc=cr(Yc);function eu(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const tu={}.hasOwnProperty,nu=new Set(["table","thead","tbody","tfoot","tr"]);function ru(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(c){let p=Cc(o,n?Zc(c):c,e.prefix);return c.type==="root"?(p=p&&typeof p=="object"&&"type"in p&&"props"in p&&p.type==="div"&&(c.children.length!==1||c.children[0].type!=="element")?p.props.children:[p],t(e.Fragment||"div",{},p)):p}function o(c,p,d){if(d&&nu.has(c)&&(d=d.filter(x=>!eu(x))),e.components&&tu.call(e.components,c)){const x=e.components[c];return e.passNode&&typeof x=="function"&&(p=Object.assign({node:this},p)),t(x,p,d)}return t(c,p,d)}}function ai({children:e}){return i.jsx(iu,{children:e})}const ho="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",iu=Ke(Z)`
32
- .highlight pre,
33
- pre {
34
- border-radius: 5px;
35
- }
36
- code {
37
- font-family: ${ho};
38
- }
39
- pre code {
40
- font-size: 14px;
41
- font-family: ${ho};
42
- }
43
-
44
- h1,
45
- h2,
46
- h3,
47
- h4,
48
- h5,
49
- h6 {
50
- font-weight: 700 !important;
51
- font-size: 1.2rem !important;
52
- line-height: 1.5 !important;
53
- margin-bottom: 16px;
54
- margin-top: 24px;
55
- border-bottom: initial !important;
56
- }
57
-
58
- .CodeMirror pre {
59
- background: #f6f8fa !important;
60
- }
61
-
62
- .anchor {
63
- display: none;
64
- }
65
- `;ai.propTypes={children:P.any.isRequired};ai.defaultProps={};function bs({infoList:e=[]}){return i.jsx(Z,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>i.jsxs(i.Fragment,{children:[i.jsx(Z,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(Z,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}bs.propTypes={infoList:P.arrayOf(P.shape({key:P.string,value:P.string}))};const ou=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,su=new ru({createElement:N.createElement}).Compiler,jt={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function li({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:c}=r,p=At.getDisplayName({meta:r}),d=Xn(()=>o&&c?fetch(Qi(o,"/api/blocklets",c,"readme")).then(S=>S.json()):null,{refreshDeps:[o,c]}),x=Ul(()=>d.data?d.data[t]||d.data.en||d.data[Object.keys(d.data)[0]]:"",[d]),w=r&&r.htmlAst?su(r.htmlAst):"",s=ou(r);let a=st(r,"owner.fullName");if(a){const S=st(r,"owner.did");S&&(a=i.jsxs(Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[a,i.jsx(Zo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else a=st(r,"author.name");const O=[{key:st(jt[t],"appinfo.name"),value:At.getDisplayName({meta:r})},{key:st(jt[t],"appinfo.version"),value:r.version},{key:st(jt[t],"appinfo.author"),value:a},{type:"description",key:st(jt[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:st(jt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:st(jt[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:st(jt[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:st(jt[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),w&&O.push({key:st(jt[t],"appinfo.overview"),value:""});let b;return t==="zh"?b=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["您可以免费使用 ",i.jsx("b",{children:p}),";"]}):i.jsxs("p",{children:["您需要购买才能使用 ",i.jsx("b",{children:p}),";"]}),i.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),i.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),i.jsx("p",{children:"下面为该应用的信息:"})]}):b=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["You can use ",i.jsx("b",{children:p})," for free;"]}):i.jsxs("p",{children:["You need to purchase before launch ",i.jsx("b",{children:p}),";"]}),i.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),i.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),i.jsx("p",{children:"Below is the information for the blocklet: "})]}),i.jsxs(lu,{children:[n||b,i.jsx(bs,{infoList:O}),x?i.jsxs("div",{className:"app-overview",children:[i.jsx(pe,{variant:"h5",gutterBottom:!0,children:st(jt[t],"appinfo.overview")}),i.jsx(ai,{children:i.jsx(au,{component:"div",className:"content-wrapper post-content",children:i.jsx($l,{source:x,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,k,L)=>S.startsWith("/")?Qi(o,S):S})})})]}):w?i.jsx("div",{className:"app-overview",children:w}):null]})}const au=Ke(pe)`
66
- width: 100%;
67
- word-wrap: break-word;
68
- word-break: break-word;
69
- line-height: 1.5em;
70
- min-height: 10vh;
71
- margin-bottom: 40px !important;
72
-
73
- .alert-content {
74
- max-width: 100%;
75
- p:last-of-type {
76
- margin-bottom: 0;
77
- }
78
- }
79
-
80
- iframe {
81
- width: 100% !important;
82
- }
83
- `,lu=Ke.div`
84
- .info-table {
85
- a {
86
- word-break: break-all;
87
- }
88
- }
89
- .app-overview {
90
- font-size: 16px;
91
- margin: 16px 0 0 16px;
92
- h1 {
93
- margin: 8px 0;
94
- font-size: 20px;
95
- }
96
- h2 {
97
- margin: 8px 0;
98
- font-size: 18px;
99
- }
100
- ul {
101
- display: block;
102
- list-style-type: disc;
103
- padding-left: 2em;
104
- li {
105
- display: list-item;
106
- list-style: disc;
107
- }
108
- }
109
- blockquote {
110
- margin-left: 2em;
111
- }
112
- }
113
- `;li.propTypes={blockletMeta:P.object.isRequired,locale:P.string.isRequired,handleDescEle:P.node};li.defaultProps={handleDescEle:""};function cu({...e}){return i.jsxs("div",{...e,style:{width:"100%"},children:[i.jsx("h3",{children:"End User License Agreement for Application"}),i.jsxs("p",{children:["Blocklet Server License Agreement ",es.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function uu(e){var t,n,r,o;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(o=e.meta)==null?void 0:o.version}`}function ci({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:c}){const{t:p}=pt(),d=Nt(a=>a.breakpoints.down("md"));if(!n)return null;const x=!c&&o.length===0,w=!c&&o.length!==0,s=40;return i.jsxs(Qr,{title:p("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(a,O)=>{O!=="backdropClick"&&r(!1)},PaperProps:{style:d?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[c&&i.jsx(Z,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(Z,{sx:{fontSize:32},color:"primary.main",component:Dt,icon:"line-md:loading-loop"})}),x&&i.jsx(Z,{sx:{textAlign:"center"},children:p("blocklet.component.noDependencies",{name:t.title})}),w&&i.jsx(Z,{sx:{marginBottom:2},children:o.map(a=>{if(!a.meta)return null;const{required:O}=a;let b;return e||O?b=1:b=.5,i.jsxs(Z,{sx:{opacity:b,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[i.jsx("img",{style:{width:s,height:s,minWidth:s,minHeight:s},src:uu(a),alt:a.meta.title}),i.jsxs(Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var S;window.open(ql(`${((S=a.bundleSource)==null?void 0:S.store)||a.meta.homepage}/blocklets/${a.meta.did}`,{allowDomains:null}),"_blank")},children:[a.meta.title,i.jsx(Z,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:p("blocklet.component.required")}),i.jsxs(Z,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[a.meta.version,i.jsx(Z,{className:"link-icon",icon:"fluent:open-20-filled",component:Dt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(Z,{sx:{marginTop:0,opacity:.7},children:a.meta.description})]})]},a.meta.did)})})]})}ci.propTypes={meta:P.object,show:P.bool,onClose:P.func.isRequired,installRelated:P.func,components:P.array.isRequired,loading:P.bool.isRequired};ci.defaultProps={meta:null,show:!1,installRelated:!1};function du(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function hu(e){const{api:t}=Cn(),[n]=Ga(),r=n.get("blocklet_meta_url")||du(e),[o,c]=N.useState([]),[p,d]=N.useState(!1);return N.useEffect(()=>{!r||e!=null&&e.inputUrl||(d(!0),t.getDynamicComponents({input:{url:r}}).then(x=>{c(x.components)}).finally(()=>{d(!1)}))},[r]),{components:o,loading:p}}function xs(e){const{info:t}=Cn();return N.useMemo(()=>{var n,r,o;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((o=e.docker)!=null&&o.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function ui({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const c=Ha(),{t:p,locale:d}=pt(),[x,w]=N.useState(!1),{components:s,loading:a}=hu(n),O=xs(n),b=r||(()=>{c(`/launch-blocklet/install${window.location.search}`)}),S=()=>{w(!0)},k=()=>{w(!1)};return i.jsxs(pu,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:O?i.jsx(li,{blockletMeta:{data:n},locale:d,handleDescEle:o}):i.jsx(Z,{sx:{p:3},children:i.jsx(pe,{children:p("launchBlocklet.dockerBlockletCantInstall")})})})})}),i.jsxs(Z,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[a?i.jsx(Dt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,O&&t&&(s!=null&&s.length)?i.jsxs(Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(Hr,{sx:{mr:.5},checked:e,onChange:L=>t(L.currentTarget.checked),control:i.jsx(Xr,{}),label:i.jsx("span",{children:p("launchBlocklet.installRelatedComponents")})}),i.jsx(Z,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx(Uo,{size:"small",onClick:S,children:i.jsx(Dt,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:O?i.jsx(oi,{onContinue:b,description:i.jsx(cu,{}),texts:{listenName:p("launchBlocklet.license"),buttonNext:p("launchBlocklet.next")}}):null})]}),i.jsx(ci,{installRelated:e,meta:n,show:x,onClose:k,components:s,loading:a})]})}ui.propTypes={meta:P.object.isRequired,onClickNext:P.func,handleDescEle:P.node,installRelated:P.bool,onChangeInstallRelated:P.func};ui.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const pu=Ke.div`
114
- display: flex;
115
- flex-direction: column;
116
- align-items: center;
117
- width: 100%;
118
- height: 100%;
119
- flex: 1;
120
- .app-content {
121
- padding: 2px 24px 24px;
122
- ${e=>e.theme.breakpoints.down("md")} {
123
- padding-top: 10px;
124
- }
125
- width: 100%;
126
- flex: 1;
127
- letter-spacing: normal;
128
- }
129
- .agreement {
130
- position: relative;
131
- display: flex;
132
- flex-direction: column;
133
- width: 100%;
134
- height: 100%;
135
- border: 1px solid ${e=>e.theme.palette.grey[100]};
136
- border-radius: 12px;
137
- ${e=>e.theme.breakpoints.up("md")} {
138
- margin-top: 24px;
139
- }
140
- ${e=>e.theme.breakpoints.down("md")} {
141
- margin-top: 16px;
142
- }
143
- .agreement-content {
144
- position: absolute;
145
- left: 0;
146
- top: 0;
147
- width: 100%;
148
- height: 100%;
149
- font-size: 14px;
150
- overflow-y: auto;
151
- ${e=>e.theme.breakpoints.up("md")} {
152
- padding: 0 24px;
153
- }
154
- ${e=>e.theme.breakpoints.down("md")} {
155
- padding: 0 16px;
156
- }
157
- &:after {
158
- display: block;
159
- content: '';
160
- height: 24px;
161
- }
162
- }
163
- }
164
- .agreement-bottom {
165
- display: flex;
166
- width: 100%;
167
- padding: 24px;
168
- ${e=>e.theme.breakpoints.up("md")} {
169
- flex-direction: row;
170
- align-items: center;
171
- margin-left: auto;
172
- }
173
- ${e=>e.theme.breakpoints.down("md")} {
174
- flex-direction: column;
175
- align-items: center;
176
- padding-top: 0;
177
- padding-bottom: 16px;
178
- }
179
- }
180
- .button-container {
181
- ${e=>e.theme.breakpoints.up("md")} {
182
- margin-left: auto;
183
- }
184
- ${e=>e.theme.breakpoints.down("md")} {
185
- padding-top: 0;
186
- padding-bottom: 16px;
187
- }
188
- }
189
- `;var ws={},di={exports:{}},Es={exports:{}},Mn=Es.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+Ss(e)}}},po={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ss};Object.keys(Mn).forEach(function(e){Object.keys(po).forEach(function(t){Mn[e][t]||(Mn[e][t]=po[t])}),Mn[e].protocols_re=RegExp("^("+Mn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ss(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Ts=Es.exports,fo=Ts,On=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let o=r.length;for(;o--;)t[r[o]]=n[r[o]];return t},fu=Xe;function Xe(e,t,n,r,o,c,p){var d=this;d.type=e,Object.keys(fo[e]).forEach(function(x){d[x]=fo[e][x]}),d.user=t,d.auth=n,d.project=r,d.committish=o,d.default=c,d.opts=p||{}}Xe.prototype.hash=function(){return this.committish?"#"+this.committish:""};Xe.prototype._fill=function(e,t){if(e){var n=On({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=On(On({},this.opts),t);var r=this;Object.keys(this).forEach(function(s){r[s]!=null&&n[s]==null&&(n[s]=r[s])});var o=n.auth,c=n.committish,p=n.fragment,d=n.path,x=n.project;Object.keys(n).forEach(function(s){var a=n[s];(s==="path"||s==="project")&&typeof a=="string"?n[s]=a.split("/").map(function(O){return encodeURIComponent(O)}).join("/"):s!=="domain"&&(n[s]=encodeURIComponent(a))}),n["auth@"]=o?o+"@":"",n["#fragment"]=p?"#"+this.hashformat(p):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=d?"#"+this.hashformat(d):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=x.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=c?"#"+c:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var w=e;return Object.keys(n).forEach(function(s){w=w.replace(new RegExp("[{]"+s+"[}]","g"),n[s])}),t.noGitPlus?w.replace(/^git[+]/,""):w}};Xe.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Xe.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Xe.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,On({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Xe.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Xe.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Xe.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Xe.prototype.git=function(e){return this._fill(this.gittemplate,e)};Xe.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Xe.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Xe.prototype.tarball=function(e){var t=On({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Xe.prototype.file=function(e,t){return this._fill(this.filetemplate,On({path:e},t))};Xe.prototype.getDefaultRepresentation=function(){return this.default};Xe.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Tr,mo;function mu(){return mo||(mo=1,Tr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Tr}var gu=ve;ve.Node=un;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ve.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ve.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ve.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)yu(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)bu(this,arguments[e]);return this.length};ve.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ve.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ve.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ve.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ve.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ve.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;r!==null;o++)n=e(n,r.value,o),r=r.next;return n};ve.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;r!==null;o--)n=e(n,r.value,o),r=r.prev;return n};ve.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ve.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ve.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(;o!==null&&r<t;r++,o=o.next)n.push(o.value);return n};ve.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;o!==null&&r>t;r--)o=o.prev;for(;o!==null&&r>e;r--,o=o.prev)n.push(o.value);return n};ve.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(var c=[],r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var r=0;r<n.length;r++)o=vu(this,o,n[r]);return c};ve.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function vu(e,t,n){var r=t===e.head?new un(n,null,t,e):new un(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function yu(e,t){e.tail=new un(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function bu(e,t){e.head=new un(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function un(e,t,n,r){if(!(this instanceof un))return new un(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{mu()(ve)}catch{}const xu=gu,ln=Symbol("max"),Lt=Symbol("length"),jn=Symbol("lengthCalculator"),Wn=Symbol("allowStale"),cn=Symbol("maxAge"),Pt=Symbol("dispose"),go=Symbol("noDisposeOnSet"),$e=Symbol("lruList"),gt=Symbol("cache"),js=Symbol("updateAgeOnGet"),jr=()=>1;class wu{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[ln]=t.max||1/0;const n=t.length||jr;if(this[jn]=typeof n!="function"?jr:n,this[Wn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[cn]=t.maxAge||0,this[Pt]=t.dispose,this[go]=t.noDisposeOnSet||!1,this[js]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[ln]=t||1/0,Fn(this)}get max(){return this[ln]}set allowStale(t){this[Wn]=!!t}get allowStale(){return this[Wn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[cn]=t,Fn(this)}get maxAge(){return this[cn]}set lengthCalculator(t){typeof t!="function"&&(t=jr),t!==this[jn]&&(this[jn]=t,this[Lt]=0,this[$e].forEach(n=>{n.length=this[jn](n.value,n.key),this[Lt]+=n.length})),Fn(this)}get lengthCalculator(){return this[jn]}get length(){return this[Lt]}get itemCount(){return this[$e].length}rforEach(t,n){n=n||this;for(let r=this[$e].tail;r!==null;){const o=r.prev;vo(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[$e].head;r!==null;){const o=r.next;vo(this,t,r,n),r=o}}keys(){return this[$e].toArray().map(t=>t.key)}values(){return this[$e].toArray().map(t=>t.value)}reset(){this[Pt]&&this[$e]&&this[$e].length&&this[$e].forEach(t=>this[Pt](t.key,t.value)),this[gt]=new Map,this[$e]=new xu,this[Lt]=0}dump(){return this[$e].map(t=>or(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[$e]}set(t,n,r){if(r=r||this[cn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,c=this[jn](n,t);if(this[gt].has(t)){if(c>this[ln])return kn(this,this[gt].get(t)),!1;const x=this[gt].get(t).value;return this[Pt]&&(this[go]||this[Pt](t,x.value)),x.now=o,x.maxAge=r,x.value=n,this[Lt]+=c-x.length,x.length=c,this.get(t),Fn(this),!0}const p=new Eu(t,n,c,o,r);return p.length>this[ln]?(this[Pt]&&this[Pt](t,n),!1):(this[Lt]+=p.length,this[$e].unshift(p),this[gt].set(t,this[$e].head),Fn(this),!0)}has(t){if(!this[gt].has(t))return!1;const n=this[gt].get(t).value;return!or(this,n)}get(t){return Or(this,t,!0)}peek(t){return Or(this,t,!1)}pop(){const t=this[$e].tail;return t?(kn(this,t),t.value):null}del(t){kn(this,this[gt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],c=o.e||0;if(c===0)this.set(o.k,o.v);else{const p=c-n;p>0&&this.set(o.k,o.v,p)}}}prune(){this[gt].forEach((t,n)=>Or(this,n,!1))}}const Or=(e,t,n)=>{const r=e[gt].get(t);if(r){const o=r.value;if(or(e,o)){if(kn(e,r),!e[Wn])return}else n&&(e[js]&&(r.value.now=Date.now()),e[$e].unshiftNode(r));return o.value}},or=(e,t)=>{if(!t||!t.maxAge&&!e[cn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[cn]&&n>e[cn]},Fn=e=>{if(e[Lt]>e[ln])for(let t=e[$e].tail;e[Lt]>e[ln]&&t!==null;){const n=t.prev;kn(e,t),t=n}},kn=(e,t)=>{if(t){const n=t.value;e[Pt]&&e[Pt](n.key,n.value),e[Lt]-=n.length,e[gt].delete(n.key),e[$e].removeNode(t)}};class Eu{constructor(t,n,r,o,c){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=c||0}}const vo=(e,t,n,r)=>{let o=n.value;or(e,o)&&(kn(e,n),e[Wn]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var Su=wu,Ur=bl,yo=Ts,Tu=di.exports=fu,ju=Su,kr=new ju({max:1e3}),Ou={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function ku(e){return Ou[e]||e.slice(0,-1)}var Ru={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};di.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return kr.has(n)||kr.set(n,Cu(e,t)),kr.get(n)}};function Cu(e,t){if(!(e==null||e==="")){var n=_u(Iu(e)?"github:"+e:e),r=Pu(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(yo).map(function(p){try{var d=yo[p],x=null;r.auth&&Ru[r.protocol]&&(x=r.auth);var w=r.hash?decodeURIComponent(r.hash.substr(1)):null,s=null,a=null,O=null;if(o&&o[1]===p)s=o[2]&&decodeURIComponent(o[2]),a=decodeURIComponent(o[3].replace(/\.git$/,"")),O="shortcut";else{if(r.host&&r.host!==d.domain&&r.host.replace(/^www[.]/,"")!==d.domain||!d.protocols_re.test(r.protocol)||!r.path)return;var b=d.pathmatch,S=r.path.match(b);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),a=decodeURIComponent(S[2]),O=ku(r.protocol)}return new Tu(p,s,x,a,w,O,t)}catch(k){if(!(k instanceof URIError))throw k}}).filter(function(p){return p});if(c.length===1)return c[0]}}function Iu(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function _u(e){var t=Ur.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Pu(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=Ur.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new Ur.URL(o[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var Lu=di.exports,dn={},Q={},Nu=null;const Au=Object.freeze(Object.defineProperty({__proto__:null,default:Nu},Symbol.toStringTag,{value:"Module"})),Os=Jr(Au),Du=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Mu=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Fu={charsWide:Du,charsFullWidth:Mu};const{charsWide:Bu,charsFullWidth:$u}=Fu,ks=new RegExp(`[${Bu.join("")}${$u.join("")}]`,"g"),Uu=e=>e.replace(ks,"xx").length;var Wu={default:Uu,charsRegex:ks};/*!
190
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
- *
192
- * Copyright (c) 2014-2016, Jon Schlinkert.
193
- * Licensed under the MIT License.
194
- */var zu=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
195
- * is-glob <https://github.com/jonschlinkert/is-glob>
196
- *
197
- * Copyright (c) 2014-2017, Jon Schlinkert.
198
- * Released under the MIT License.
199
- */var qu=zu,Rs={"{":"}","(":")","[":"]"},Ku=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,c=-2,p=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(p===-1||p>r||(p=e.indexOf("\\",t),p===-1||p>r)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(p=e.indexOf("\\",t),p===-1||p>o))||c!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(c=e.indexOf(")",t),c>t&&(p=e.indexOf("\\",t),p===-1||p>c))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(c=e.indexOf(")",n),c>n&&(p=e.indexOf("\\",n),p===-1||p>c))))return!0;if(e[t]==="\\"){var d=e[t+1];t+=2;var x=Rs[d];if(x){var w=e.indexOf(x,t);w!==-1&&(t=w+1)}if(e[t]==="!")return!0}else t++}return!1},Vu=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=Rs[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Gu=function(t,n){if(typeof t!="string"||t==="")return!1;if(qu(t))return!0;var r=Ku;return n&&n.strict===!1&&(r=Vu),r(t)},Wr={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof Kl=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var l=Array.prototype.slice.call(arguments,0);l.unshift("SEMVER"),console.log.apply(console,l)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=256,c=Number.MAX_SAFE_INTEGER||9007199254740991,p=16,d=o-6,x=t.re=[],w=t.safeRe=[],s=t.src=[],a=t.tokens={},O=0;function b(l){a[l]=O++}var S="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",o],[S,d]];function L(l){for(var h=0;h<k.length;h++){var y=k[h][0],R=k[h][1];l=l.split(y+"*").join(y+"{0,"+R+"}").split(y+"+").join(y+"{1,"+R+"}")}return l}b("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",b("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="\\d+",b("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",b("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",b("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",b("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",b("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",b("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",b("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",b("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]=S+"+",b("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",b("FULL"),b("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",b("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",b("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",b("GTLT"),s[a.GTLT]="((?:<|>)?=?)",b("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",b("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",b("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",b("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",b("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",b("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",b("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,"+p+"})(?:\\.(\\d{1,"+p+"}))?(?:\\.(\\d{1,"+p+"}))?(?:$|[^\\d])",b("COERCERTL"),x[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),w[a.COERCERTL]=new RegExp(L(s[a.COERCE]),"g"),b("LONETILDE"),s[a.LONETILDE]="(?:~>?)",b("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",x[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g"),w[a.TILDETRIM]=new RegExp(L(s[a.TILDETRIM]),"g");var A="$1~";b("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",b("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",b("LONECARET"),s[a.LONECARET]="(?:\\^)",b("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",x[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g"),w[a.CARETTRIM]=new RegExp(L(s[a.CARETTRIM]),"g");var K="$1^";b("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",b("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",b("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",b("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",b("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",x[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g"),w[a.COMPARATORTRIM]=new RegExp(L(s[a.COMPARATORTRIM]),"g");var U="$1$2$3";b("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",b("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",b("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var ee=0;ee<O;ee++)r(ee,s[ee]),x[ee]||(x[ee]=new RegExp(s[ee]),w[ee]=new RegExp(L(s[ee])));t.parse=j;function j(l,h){if((!h||typeof h!="object")&&(h={loose:!!h,includePrerelease:!1}),l instanceof $)return l;if(typeof l!="string"||l.length>o)return null;var y=h.loose?w[a.LOOSE]:w[a.FULL];if(!y.test(l))return null;try{return new $(l,h)}catch{return null}}t.valid=W;function W(l,h){var y=j(l,h);return y?y.version:null}t.clean=J;function J(l,h){var y=j(l.trim().replace(/^[=v]+/,""),h);return y?y.version:null}t.SemVer=$;function $(l,h){if((!h||typeof h!="object")&&(h={loose:!!h,includePrerelease:!1}),l instanceof $){if(l.loose===h.loose)return l;l=l.version}else if(typeof l!="string")throw new TypeError("Invalid Version: "+l);if(l.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof $))return new $(l,h);r("SemVer",l,h),this.options=h,this.loose=!!h.loose;var y=l.trim().match(h.loose?w[a.LOOSE]:w[a.FULL]);if(!y)throw new TypeError("Invalid Version: "+l);if(this.raw=l,this.major=+y[1],this.minor=+y[2],this.patch=+y[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");y[4]?this.prerelease=y[4].split(".").map(function(R){if(/^[0-9]+$/.test(R)){var _=+R;if(_>=0&&_<c)return _}return R}):this.prerelease=[],this.build=y[5]?y[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(l){return r("SemVer.compare",this.version,this.options,l),l instanceof $||(l=new $(l,this.options)),this.compareMain(l)||this.comparePre(l)},$.prototype.compareMain=function(l){return l instanceof $||(l=new $(l,this.options)),ke(this.major,l.major)||ke(this.minor,l.minor)||ke(this.patch,l.patch)},$.prototype.comparePre=function(l){if(l instanceof $||(l=new $(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;var h=0;do{var y=this.prerelease[h],R=l.prerelease[h];if(r("prerelease compare",h,y,R),y===void 0&&R===void 0)return 0;if(R===void 0)return 1;if(y===void 0)return-1;if(y===R)continue;return ke(y,R)}while(++h)},$.prototype.compareBuild=function(l){l instanceof $||(l=new $(l,this.options));var h=0;do{var y=this.build[h],R=l.build[h];if(r("prerelease compare",h,y,R),y===void 0&&R===void 0)return 0;if(R===void 0)return 1;if(y===void 0)return-1;if(y===R)continue;return ke(y,R)}while(++h)},$.prototype.inc=function(l,h){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h),this.inc("pre",h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h),this.inc("pre",h);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var y=this.prerelease.length;--y>=0;)typeof this.prerelease[y]=="number"&&(this.prerelease[y]++,y=-2);y===-1&&this.prerelease.push(0)}h&&(this.prerelease[0]===h?isNaN(this.prerelease[1])&&(this.prerelease=[h,0]):this.prerelease=[h,0]);break;default:throw new Error("invalid increment argument: "+l)}return this.format(),this.raw=this.version,this},t.inc=le;function le(l,h,y,R){typeof y=="string"&&(R=y,y=void 0);try{return new $(l,y).inc(h,R).version}catch{return null}}t.diff=me;function me(l,h){if(Rt(l,h))return null;var y=j(l),R=j(h),_="";if(y.prerelease.length||R.prerelease.length){_="pre";var z="prerelease"}for(var G in y)if((G==="major"||G==="minor"||G==="patch")&&y[G]!==R[G])return _+G;return z}t.compareIdentifiers=ke;var ae=/^[0-9]+$/;function ke(l,h){var y=ae.test(l),R=ae.test(h);return y&&R&&(l=+l,h=+h),l===h?0:y&&!R?-1:R&&!y?1:l<h?-1:1}t.rcompareIdentifiers=Ue;function Ue(l,h){return ke(h,l)}t.major=Ye;function Ye(l,h){return new $(l,h).major}t.minor=tt;function tt(l,h){return new $(l,h).minor}t.patch=Y;function Y(l,h){return new $(l,h).patch}t.compare=he;function he(l,h,y){return new $(l,y).compare(new $(h,y))}t.compareLoose=q;function q(l,h){return he(l,h,!0)}t.compareBuild=Se;function Se(l,h,y){var R=new $(l,y),_=new $(h,y);return R.compare(_)||R.compareBuild(_)}t.rcompare=re;function re(l,h,y){return he(h,l,y)}t.sort=ct;function ct(l,h){return l.sort(function(y,R){return t.compareBuild(y,R,h)})}t.rsort=we;function we(l,h){return l.sort(function(y,R){return t.compareBuild(R,y,h)})}t.gt=Je;function Je(l,h,y){return he(l,h,y)>0}t.lt=We;function We(l,h,y){return he(l,h,y)<0}t.eq=Rt;function Rt(l,h,y){return he(l,h,y)===0}t.neq=Kt;function Kt(l,h,y){return he(l,h,y)!==0}t.gte=Mt;function Mt(l,h,y){return he(l,h,y)>=0}t.lte=Vt;function Vt(l,h,y){return he(l,h,y)<=0}t.cmp=Ie;function Ie(l,h,y,R){switch(h){case"===":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l===y;case"!==":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l!==y;case"":case"=":case"==":return Rt(l,y,R);case"!=":return Kt(l,y,R);case">":return Je(l,y,R);case">=":return Mt(l,y,R);case"<":return We(l,y,R);case"<=":return Vt(l,y,R);default:throw new TypeError("Invalid operator: "+h)}}t.Comparator=_e;function _e(l,h){if((!h||typeof h!="object")&&(h={loose:!!h,includePrerelease:!1}),l instanceof _e){if(l.loose===!!h.loose)return l;l=l.value}if(!(this instanceof _e))return new _e(l,h);l=l.trim().split(/\s+/).join(" "),r("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===je?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var je={};_e.prototype.parse=function(l){var h=this.options.loose?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],y=l.match(h);if(!y)throw new TypeError("Invalid comparator: "+l);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new $(y[2],this.options.loose):this.semver=je},_e.prototype.toString=function(){return this.value},_e.prototype.test=function(l){if(r("Comparator.test",l,this.options.loose),this.semver===je||l===je)return!0;if(typeof l=="string")try{l=new $(l,this.options)}catch{return!1}return Ie(l,this.operator,this.semver,this.options)},_e.prototype.intersects=function(l,h){if(!(l instanceof _e))throw new TypeError("a Comparator is required");(!h||typeof h!="object")&&(h={loose:!!h,includePrerelease:!1});var y;if(this.operator==="")return this.value===""?!0:(y=new ye(l.value,h),Ve(this.value,y,h));if(l.operator==="")return l.value===""?!0:(y=new ye(this.value,h),Ve(l.semver,y,h));var R=(this.operator===">="||this.operator===">")&&(l.operator===">="||l.operator===">"),_=(this.operator==="<="||this.operator==="<")&&(l.operator==="<="||l.operator==="<"),z=this.semver.version===l.semver.version,G=(this.operator===">="||this.operator==="<=")&&(l.operator===">="||l.operator==="<="),ce=Ie(this.semver,"<",l.semver,h)&&(this.operator===">="||this.operator===">")&&(l.operator==="<="||l.operator==="<"),ie=Ie(this.semver,">",l.semver,h)&&(this.operator==="<="||this.operator==="<")&&(l.operator===">="||l.operator===">");return R||_||z&&G||ce||ie},t.Range=ye;function ye(l,h){if((!h||typeof h!="object")&&(h={loose:!!h,includePrerelease:!1}),l instanceof ye)return l.loose===!!h.loose&&l.includePrerelease===!!h.includePrerelease?l:new ye(l.raw,h);if(l instanceof _e)return new ye(l.value,h);if(!(this instanceof ye))return new ye(l,h);if(this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease,this.raw=l.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(y){return this.parseRange(y.trim())},this).filter(function(y){return y.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ye.prototype.format=function(){return this.range=this.set.map(function(l){return l.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(l){var h=this.options.loose,y=h?w[a.HYPHENRANGELOOSE]:w[a.HYPHENRANGE];l=l.replace(y,ft),r("hyphen replace",l),l=l.replace(w[a.COMPARATORTRIM],U),r("comparator trim",l,w[a.COMPARATORTRIM]),l=l.replace(w[a.TILDETRIM],A),l=l.replace(w[a.CARETTRIM],K),l=l.split(/\s+/).join(" ");var R=h?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],_=l.split(" ").map(function(z){return Ht(z,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(_=_.filter(function(z){return!!z.match(R)})),_=_.map(function(z){return new _e(z,this.options)},this),_},ye.prototype.intersects=function(l,h){if(!(l instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(y){return Ct(y,h)&&l.set.some(function(R){return Ct(R,h)&&y.every(function(_){return R.every(function(z){return _.intersects(z,h)})})})})};function Ct(l,h){for(var y=!0,R=l.slice(),_=R.pop();y&&R.length;)y=R.every(function(z){return _.intersects(z,h)}),_=R.pop();return y}t.toComparators=Gt;function Gt(l,h){return new ye(l,h).set.map(function(y){return y.map(function(R){return R.value}).join(" ").trim().split(" ")})}function Ht(l,h){return r("comp",l,h),l=gn(l,h),r("caret",l),l=Xt(l,h),r("tildes",l),l=Qe(l,h),r("xrange",l),l=xt(l,h),r("stars",l),l}function ge(l){return!l||l.toLowerCase()==="x"||l==="*"}function Xt(l,h){return l.trim().split(/\s+/).map(function(y){return mn(y,h)}).join(" ")}function mn(l,h){var y=h.loose?w[a.TILDELOOSE]:w[a.TILDE];return l.replace(y,function(R,_,z,G,ce){r("tilde",l,R,_,z,G,ce);var ie;return ge(_)?ie="":ge(z)?ie=">="+_+".0.0 <"+(+_+1)+".0.0":ge(G)?ie=">="+_+"."+z+".0 <"+_+"."+(+z+1)+".0":ce?(r("replaceTilde pr",ce),ie=">="+_+"."+z+"."+G+"-"+ce+" <"+_+"."+(+z+1)+".0"):ie=">="+_+"."+z+"."+G+" <"+_+"."+(+z+1)+".0",r("tilde return",ie),ie})}function gn(l,h){return l.trim().split(/\s+/).map(function(y){return Yt(y,h)}).join(" ")}function Yt(l,h){r("caret",l,h);var y=h.loose?w[a.CARETLOOSE]:w[a.CARET];return l.replace(y,function(R,_,z,G,ce){r("caret",l,R,_,z,G,ce);var ie;return ge(_)?ie="":ge(z)?ie=">="+_+".0.0 <"+(+_+1)+".0.0":ge(G)?_==="0"?ie=">="+_+"."+z+".0 <"+_+"."+(+z+1)+".0":ie=">="+_+"."+z+".0 <"+(+_+1)+".0.0":ce?(r("replaceCaret pr",ce),_==="0"?z==="0"?ie=">="+_+"."+z+"."+G+"-"+ce+" <"+_+"."+z+"."+(+G+1):ie=">="+_+"."+z+"."+G+"-"+ce+" <"+_+"."+(+z+1)+".0":ie=">="+_+"."+z+"."+G+"-"+ce+" <"+(+_+1)+".0.0"):(r("no pr"),_==="0"?z==="0"?ie=">="+_+"."+z+"."+G+" <"+_+"."+z+"."+(+G+1):ie=">="+_+"."+z+"."+G+" <"+_+"."+(+z+1)+".0":ie=">="+_+"."+z+"."+G+" <"+(+_+1)+".0.0"),r("caret return",ie),ie})}function Qe(l,h){return r("replaceXRanges",l,h),l.split(/\s+/).map(function(y){return bt(y,h)}).join(" ")}function bt(l,h){l=l.trim();var y=h.loose?w[a.XRANGELOOSE]:w[a.XRANGE];return l.replace(y,function(R,_,z,G,ce,ie){r("xRange",l,R,_,z,G,ce,ie);var Ae=ge(z),Fe=Ae||ge(G),Re=Fe||ge(ce),De=Re;return _==="="&&De&&(_=""),ie=h.includePrerelease?"-0":"",Ae?_===">"||_==="<"?R="<0.0.0-0":R="*":_&&De?(Fe&&(G=0),ce=0,_===">"?(_=">=",Fe?(z=+z+1,G=0,ce=0):(G=+G+1,ce=0)):_==="<="&&(_="<",Fe?z=+z+1:G=+G+1),R=_+z+"."+G+"."+ce+ie):Fe?R=">="+z+".0.0"+ie+" <"+(+z+1)+".0.0"+ie:Re&&(R=">="+z+"."+G+".0"+ie+" <"+z+"."+(+G+1)+".0"+ie),r("xRange return",R),R})}function xt(l,h){return r("replaceStars",l,h),l.trim().replace(w[a.STAR],"")}function ft(l,h,y,R,_,z,G,ce,ie,Ae,Fe,Re,De){return ge(y)?h="":ge(R)?h=">="+y+".0.0":ge(_)?h=">="+y+"."+R+".0":h=">="+h,ge(ie)?ce="":ge(Ae)?ce="<"+(+ie+1)+".0.0":ge(Fe)?ce="<"+ie+"."+(+Ae+1)+".0":Re?ce="<="+ie+"."+Ae+"."+Fe+"-"+Re:ce="<="+ce,(h+" "+ce).trim()}ye.prototype.test=function(l){if(!l)return!1;if(typeof l=="string")try{l=new $(l,this.options)}catch{return!1}for(var h=0;h<this.set.length;h++)if(wt(this.set[h],l,this.options))return!0;return!1};function wt(l,h,y){for(var R=0;R<l.length;R++)if(!l[R].test(h))return!1;if(h.prerelease.length&&!y.includePrerelease){for(R=0;R<l.length;R++)if(r(l[R].semver),l[R].semver!==je&&l[R].semver.prerelease.length>0){var _=l[R].semver;if(_.major===h.major&&_.minor===h.minor&&_.patch===h.patch)return!0}return!1}return!0}t.satisfies=Ve;function Ve(l,h,y){try{h=new ye(h,y)}catch{return!1}return h.test(l)}t.maxSatisfying=Ne;function Ne(l,h,y){var R=null,_=null;try{var z=new ye(h,y)}catch{return null}return l.forEach(function(G){z.test(G)&&(!R||_.compare(G)===-1)&&(R=G,_=new $(R,y))}),R}t.minSatisfying=Jt;function Jt(l,h,y){var R=null,_=null;try{var z=new ye(h,y)}catch{return null}return l.forEach(function(G){z.test(G)&&(!R||_.compare(G)===1)&&(R=G,_=new $(R,y))}),R}t.minVersion=Qt;function Qt(l,h){l=new ye(l,h);var y=new $("0.0.0");if(l.test(y)||(y=new $("0.0.0-0"),l.test(y)))return y;y=null;for(var R=0;R<l.set.length;++R){var _=l.set[R];_.forEach(function(z){var G=new $(z.semver.version);switch(z.operator){case">":G.prerelease.length===0?G.patch++:G.prerelease.push(0),G.raw=G.format();case"":case">=":(!y||Je(y,G))&&(y=G);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+z.operator)}})}return y&&l.test(y)?y:null}t.validRange=Zt;function Zt(l,h){try{return new ye(l,h).range||"*"}catch{return null}}t.ltr=en;function en(l,h,y){return I(l,h,"<",y)}t.gtr=Ft;function Ft(l,h,y){return I(l,h,">",y)}t.outside=I;function I(l,h,y,R){l=new $(l,R),h=new ye(h,R);var _,z,G,ce,ie;switch(y){case">":_=Je,z=Vt,G=We,ce=">",ie=">=";break;case"<":_=We,z=Mt,G=Je,ce="<",ie="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ve(l,h,R))return!1;for(var Ae=0;Ae<h.set.length;++Ae){var Fe=h.set[Ae],Re=null,De=null;if(Fe.forEach(function(Ge){Ge.semver===je&&(Ge=new _e(">=0.0.0")),Re=Re||Ge,De=De||Ge,_(Ge.semver,Re.semver,R)?Re=Ge:G(Ge.semver,De.semver,R)&&(De=Ge)}),Re.operator===ce||Re.operator===ie||(!De.operator||De.operator===ce)&&z(l,De.semver))return!1;if(De.operator===ie&&G(l,De.semver))return!1}return!0}t.prerelease=ut;function ut(l,h){var y=j(l,h);return y&&y.prerelease.length?y.prerelease:null}t.intersects=tn;function tn(l,h,y){return l=new ye(l,y),h=new ye(h,y),l.intersects(h)}t.coerce=nn;function nn(l,h){if(l instanceof $)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;h=h||{};var y=null;if(!h.rtl)y=l.match(w[a.COERCE]);else{for(var R;(R=w[a.COERCERTL].exec(l))&&(!y||y.index+y[0].length!==l.length);)(!y||R.index+R[0].length!==y.index+y[0].length)&&(y=R),w[a.COERCERTL].lastIndex=R.index+R[1].length+R[2].length;w[a.COERCERTL].lastIndex=-1}return y===null?null:j(y[2]+"."+(y[3]||"0")+"."+(y[4]||"0"),h)}})(Wr,Wr.exports);var Hu=Wr.exports;const Cs=Jo,kt=Hu,Be="semver",Xu={base:Cs.string(),type:"semverRange",validate:function(e,{error:t}){return kt.validRange(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver range"}},fn={};fn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return kt[r](e,n)?e:t.error(`${Be}.${r}`,{exp:n})},args:[{name:"exp",assert:kt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});fn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return kt.cmp(e,n,r)?e:t.error(`${Be}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:kt.valid,message:"needs to be a valid semver expression"}]};fn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return kt[r](e,n)?e:t.error(`${Be}.${r}`,{rng:n})},args:[{name:"rng",assert:kt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});fn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return kt.outside(e,r,n)?e:t.error(`${Be}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:kt.validRange,message:"needs to be a valid semver range"}]};const Yu={base:Cs.string(),type:"semver",validate:function(e,{error:t}){return kt.valid(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Be}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Be}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Be}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Be}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Be}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Be}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Be}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Be}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Be}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Be}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Be}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:fn};var Ju={semver:Yu,semverRange:Xu};/*!
200
- * is-var-name | ISC (c) Shinnosuke Watanabe
201
- * https://github.com/shinnn/is-var-name
202
- */function Qu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const Zu=Object.freeze(Object.defineProperty({__proto__:null,default:Qu},Symbol.toStringTag,{value:"Module"})),ed=Jr(Zu),td=Jr(Ja),nd=el,rd=tl,bo=dr,id=e=>{if((0,bo.isValid)(e))return e;const t=(0,rd.toHex)(Vl.from(typeof e=="string"?e.trim():e));return(0,bo.fromPublicKey)(t,{role:nd.types.RoleType.ROLE_ANY})};var od=id,hn={},Is=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hn,"__esModule",{value:!0});hn.didExtension=hn.fileExtension=void 0;const xo=Is(Os),sd=Is(Jl),ad=dr,_s=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>xo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:o}={}){if(typeof o=="function"&&o(r,t))return t;try{return xo.default.statSync(sd.default.join(r,t)),t}catch(c){switch(c.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:c.message})}}}}});hn.fileExtension=_s;const Ps=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,ad.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});hn.didExtension=Ps;hn.default={fileExtension:_s,didExtension:Ps};var hi={},Ls={exports:{}};const ld=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var Ns=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),cd=ld,ud=["node_modules","favicon.ico"],dd=Ls.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Bn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Bn(t,n);if(typeof e!="string")return n.push("name must be a string"),Bn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),ud.forEach(function(p){e.toLowerCase()===p&&n.push(p+" is a blacklisted name")}),cd.forEach(function(p){e.toLowerCase()===p&&t.push(p+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(Ns);if(r){var o=r[1],c=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(c)===c)return Bn(t,n)}n.push("name can only contain URL-friendly characters")}return Bn(t,n)};dd.scopedPackagePattern=Ns;var Bn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},hd=Ls.exports;(function(e){var t=Ee&&Ee.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=dr,r=t(hd),o=32,c=d=>{if((0,n.toTypeInfo)(d).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=c;const p=(d,{checkDid:x=!0}={})=>{if((0,n.isValid)(d))x&&(0,e.validateNewDid)(d);else{const{validForNewPackages:w,errors:s=[],warnings:a=[]}=(0,r.default)(d);if(!w)throw new Error(s[0]||a[0]);if(d.length>o)throw new Error("Blocklet name is too long")}};e.validateName=p,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(hi);var pd=Ee&&Ee.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),fd=Ee&&Ee.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),md=Ee&&Ee.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[r.length]=o);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&pd(n,t,r[o]);return fd(n,t),n}}(),In=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q,"__esModule",{value:!0});Q.Joi=Q.installBlockletDescriptionSchema=Q.installBlockletTitleSchema=Q.resourceBundleSchema=Q.authConfigSchema=Q.cacheableSchema=Q.statsSchema=Q.titleSchema=Q.themeSchema=Q.signatureSchema=Q.serviceSchema=Q.scriptsSchema=Q.personSchema=Q.navigationSchema=Q.navigationItemSchema=Q.updateMountPointSchema=Q.mountPointSchema=Q.logoSchema=Q.interfaceSchema=Q.environmentNameSchema=Q.environmentSchema=Q.engineSchema=Q.endpointSchema=Q.distSchema=Q.descriptionSchema=Q.createBlockletSchema=Q.componentSchema=Q.blockletNameSchema=Q.blockletMetaSchema=void 0;const gd=In(Os),vd=In(Jo),yd=In(Wu),bd=In(Gu),wo=Ju,xd=In(ed),Eo=es,wd=dr,Ed=td,Le=Ot,Sd=In(od),So=hn,zr=hi,pi=md(xl),Td=yd.default.default,To="/.well-known",u=vd.default.extend(wo.semver).extend(wo.semverRange).extend(So.fileExtension).extend(So.didExtension);Q.Joi=u;const jo=(e,t)=>(0,pi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
-
204
- A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
- - /en/home
206
- - /zh/home
207
- - https://www.arcblock.io
208
- `),jd=(e,t)=>!e||(0,xd.default)(e)?e:t.message(`Invalid navigation id: ${e}
209
-
210
- A valid navigation id is should follow the rules of javascript variables, such as:
211
- - foo
212
- - fooBar
213
- - foo123
214
-
215
- see detail in https://www.npmjs.com/package/is-var-name
216
- `),vr=u.string().trim().min(1).custom(e=>{if(Td(e)>Le.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Le.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);if(e.includes("."))throw new Error('title cannot contain "."');return e}).meta({className:"TTitle"});Q.titleSchema=vr;const yr=u.string().trim().min(3).max(160).meta({className:"TDescription"});Q.descriptionSchema=yr;const As=u.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});Q.installBlockletTitleSchema=As;const Ds=u.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});Q.installBlockletDescriptionSchema=Ds;const Ms=u.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Eo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Eo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});Q.logoSchema=Ms;const Fs=u.string().trim().min(1),fi=Fs.meta({className:"TMountPoint"}).custom((e,t)=>(0,pi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));Q.mountPointSchema=fi;const Bs=Fs.meta({className:"TUpdateMountPoint"}).custom(e=>(0,pi.default)(e));Q.updateMountPointSchema=Bs;const Rn=u.string().custom(e=>((0,zr.validateName)(e),e)).meta({className:"TBlockletName"});Q.blockletNameSchema=Rn;const Od=[],mi=u.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Od.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});Q.environmentNameSchema=mi;const gi=u.object({name:mi.required(),description:u.string().trim().required(),default:u.string().optional().allow("").default(""),required:u.boolean().default(!1),secure:u.boolean().default(!1),validation:u.string().optional(),shared:u.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});Q.environmentSchema=gi;const vi=u.object({dev:u.string().trim().min(1),e2eDev:u.string().trim().min(1),preFlight:u.string().trim().min(1),preInstall:u.string().trim().min(1),postInstall:u.string().trim().min(1),preStart:u.string().trim().min(1),postStart:u.string().trim().min(1),preStop:u.string().trim().min(1),preUninstall:u.string().trim().min(1),preConfig:u.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});Q.scriptsSchema=vi;const yi=u.object({name:u.string().required().trim(),config:u.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});Q.serviceSchema=yi;const bi=u.object({type:u.string().trim(!0).min(1).required(),path:u.string().required(),meta:u.object({vcType:u.string(),payable:u.boolean(),params:u.array().items({name:u.string().required().trim(),description:u.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});Q.endpointSchema=bi;const $s=u.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});Q.cacheableSchema=$s;const xi=u.object({type:u.string().lowercase().valid(...Le.BLOCKLET_INTERFACE_TYPES).required(),name:u.string().trim().required(),path:u.string().trim().default("/"),prefix:u.string().trim().min(1).default(Le.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:u.number().port().optional(),hostIP:u.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:u.string().lowercase().valid(...Le.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:u.alternatives().try(u.string().uppercase().default(Le.BLOCKLET_DEFAULT_PORT_NAME),u.object({internal:u.string().uppercase().required(),external:u.number().port().required()})).default(Le.BLOCKLET_DEFAULT_PORT_NAME),cacheable:u.array().items($s).unique(),services:u.array().items(yi).unique("name"),endpoints:u.array().items(bi).unique("type"),pageGroups:u.array().items(u.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});Q.interfaceSchema=xi;const kd=u.alternatives().try(u.string().required(),u.object({url:u.string().uri({scheme:["http","https","file"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),qr=u.object({platform:u.string().valid(...Le.BLOCKLET_PLATFORMS).optional(),interpreter:u.string().valid("binary","node","blocklet").default("node"),source:kd,args:u.array().items(u.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});Q.engineSchema=qr;const zn=u.object({name:u.string().min(1).required(),email:u.string().email({tlds:!1}).optional(),url:u.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});Q.personSchema=zn;const Kn=u.object({tarball:u.alternatives().try(u.string().uri(),u.string()).required(),integrity:u.string().required(),size:u.number().optional()}).meta({className:"TDist",unknownType:"any"});Q.distSchema=Kn;const Us=u.object({downloads:u.number().integer().greater(-1),star:u.number().default(0),purchases:u.number().default(0)}).meta({className:"TStats",unknownType:"any"});Q.statsSchema=Us;const Rd=u.alternatives().try(u.object({url:u.alternatives().try(u.string().uri(),u.array().items(u.string().uri()).min(1)).required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),Ws={source:Rd.required(),required:u.boolean(),title:vr,description:yr,mountPoint:fi,name:Rn},zs=(e,t)=>u.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),wi=zs(Ws).meta({className:"TComponent",unknownType:"any"});Q.componentSchema=wi;const Cd=zs(Ws,!0),qs=({checkStore:e}={})=>{const t=[wi,Cd];return u.array().items(e?t[0]:t[1]).optional().default([])},Ks=u.object({type:u.string().required(),name:u.string().required(),signer:u.string().required(),pk:u.string().required(),created:u.string().isoDate().required(),sig:u.string().required(),excludes:u.array().items(u.string()).optional(),appended:u.array().items(u.string()).optional(),delegatee:u.string(),delegateePk:u.string(),delegation:u.string()}).meta({className:"TSignature",unknownType:"any"});Q.signatureSchema=Ks;const Oo=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],ko={id:u.string().custom(jd),title:u.alternatives().try(u.string().min(1).max(Le.MAX_TITLE_LENGTH),u.object().min(1).pattern(u.string().valid(...Oo),u.string().min(1).max(Le.MAX_TITLE_LENGTH))).required(),link:u.alternatives().try(u.string().custom(jo),u.object().min(1).pattern(u.string().valid(...Oo),u.string().custom(jo))),component:u.string().min(1),section:u.array().items(u.string().min(1)).single(),role:u.array().items(u.string().min(1)).single(),icon:u.string().min(1),visible:u.boolean()},Vs=u.object({...ko,items:u.array().items(u.object({...ko}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});Q.navigationItemSchema=Vs;const Ei=u.array().items(Vs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});Q.navigationSchema=Ei;const Si=u.object({background:u.alternatives().try(u.string().min(1),u.object({header:u.string().min(1),footer:u.string().min(1),default:u.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});Q.themeSchema=Si;const Gs=u.object({whoCanAccess:u.string().valid("owner","invited","all"),profileFields:u.array().items(u.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:u.array().items(u.string().min(1)),allowSwitchProfile:u.boolean(),blockUnauthenticated:u.boolean(),blockUnauthorized:u.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});Q.authConfigSchema=Gs;const Id=u.object({type:u.string().trim().min(1).required(),description:u.string().trim().min(1)}),Ti=u.object({did:u.DID().trim().required(),type:u.string().trim().min(1).required(),public:u.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});Q.resourceBundleSchema=Ti;const Hs={did:u.DID().trim().required(),version:u.semver().valid().required(),name:u.string().optional(),description:yr.required(),group:u.string().valid(...Le.BLOCKLET_GROUPS),main:u.string().trim(),title:vr.optional().allow(""),logo:u.string().trim().optional(),specVersion:u.semver().valid().gte("1.0.0").optional(),author:zn.optional(),contributors:u.array().items(zn).optional(),maintainers:u.array().items(zn).optional(),community:u.string().uri().optional().allow("").default(""),documentation:u.string().uri().optional().allow("").default(""),homepage:u.string().uri().optional().allow("").default(""),license:u.string().optional().allow("").default(""),support:u.alternatives().try(u.string().uri(),u.string().email({tlds:!1})).optional(),nftFactory:u.DID().optional().allow("").default(""),payment:u.object({price:u.array().max(1).items(u.object({value:u.number().greater(0).required(),address:u.DID().required()})).default([]),share:u.array().max(4).items(u.object({name:u.string().required(),address:u.DID().required(),value:u.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:u.array().items(u.object({parentPriceRange:u.array().items(u.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:u.string().valid("fixed","percentage").required(),value:u.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),tags:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),gitHash:u.string().optional().allow(""),repository:u.alternatives().try(u.string().min(1),u.object({type:u.string().valid("git","https","svn").required(),url:u.string().uri().required(),directory:u.string()})).optional(),timeout:u.object({start:u.number().min(10).max(600),script:u.number().min(1).max(1800)}).default({start:60}),requirements:u.object({abtnode:u.semverRange().valid(),server:u.semverRange().valid(),os:u.alternatives().try(u.string().valid("*",...Le.BLOCKLET_PLATFORMS),u.array().items(u.string().valid(...Le.BLOCKLET_PLATFORMS)).min(1)),cpu:u.alternatives().try(u.string().valid("*",...Le.BLOCKLET_ARCHITECTURES),u.array().items(u.string().valid(...Le.BLOCKLET_ARCHITECTURES)).min(1)),fuels:u.array().items(u.object({endpoint:u.string().trim().required(),address:u.string().trim(),value:u.string().trim().required(),reason:u.string().trim().required()})),nodejs:u.semverRange().valid()}).default({server:Le.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:u.array().items(xi).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===Le.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Le.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===Le.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(To))return t.message(`Wellknown path prefix must start with: ${To}`);return e}).default([]),environments:u.array().items(gi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(c=>c.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:vi,capabilities:u.object({clusterMode:u.boolean(),didSpace:u.string().valid(...Object.values(Le.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:u.boolean().default(!0),serverless:u.boolean().optional(),component:u.boolean(),sitemap:u.boolean().optional()}).default({}),files:u.array().items(u.string().trim()).optional(),resource:u.object({exportApi:u.string().trim(),bundles:u.array().items(Ti),types:u.array().items(Id).max(10)}),engine:u.alternatives().try(qr,u.array().items(qr)).optional(),screenshots:u.array().items(u.string().min(1)).optional().default([]),videos:u.array().items(u.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:u.string().optional().allow(""),dist:Kn.optional(),stats:Us.optional(),htmlAst:u.any().optional(),path:u.string().optional(),signatures:u.array().items(Ks).optional(),lastPublishedAt:u.string().isoDate().optional().allow(null),components:qs(),navigation:Ei,theme:Si,copyright:u.object({owner:u.string().min(1),year:u.alternatives().try(u.string(),u.number())}),bundleName:u.string(),bundleDid:u.DID().trim(),storeId:u.string()},_d=u.object(Hs).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});Q.blockletMetaSchema=_d;const Xs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,...p}={})=>((!e||!gd.default.existsSync(e))&&(t=!1),u.object({...Hs,owner:u.object({avatar:u.string().optional(),did:u.DID().trim().required(),fullName:u.string().trim().required(),email:u.string().optional().allow(null).empty("").default("")}).optional(),logo:t?u.file().trim().exists({baseDir:e}).optional():u.string().trim().optional(),files:u.array().items(t?u.file().exists({baseDir:e,canSkip:(d,x)=>[Le.BLOCKLET_ENTRY_FILE,Le.BLOCKLET_BUNDLE_FILE].includes(x)||(0,bd.default)(x)}):u.string().trim()).optional(),dist:n?Kn.required():Kn.optional(),components:qs({checkStore:r}),name:o?u.string().optional():u.string().required(),egress:u.boolean().optional().default(!0),docker:Ed.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...p}).rename("children","components").custom((d,x)=>{const{did:w,name:s,docker:a}=d;if(a){const{image:b,dockerfile:S,network:k}=a;if(!b&&!S)return x.message("Image or dockerfile must be set");if(b&&S)return x.message("Image and dockerfile cannot be set at the same time");if(k)return x.message("ExportPorts and network cannot be set at the same time");if(S&&(d.files||(d.files=[]),d.files.push(S)),a.volumes)for(const L of a.volumes){if(!L.startsWith("$BLOCKLET_APP_DIR/")&&!L.startsWith("$BLOCKLET_DATA_DIR/"))return x.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(L.indexOf("..")>-1)return x.message('Volume cannot contain ".."')}}let O;if((0,wd.isValid)(w))try{return(0,zr.validateNewDid)(w),d}catch(b){O=b}if(s){(0,zr.validateName)(s,{checkDid:!c});const b=(0,Sd.default)(s);return b!==w?x.message(`The did of name "${s}" should be "${b}"`):d}return O?x.message(O.message):d}));Q.createBlockletSchema=Xs;Q.default={blockletNameSchema:Rn,componentSchema:wi,endpointSchema:bi,serviceSchema:yi,createBlockletSchema:Xs,interfaceSchema:xi,environmentSchema:gi,environmentNameSchema:mi,scriptsSchema:vi,personSchema:zn,distSchema:Kn,titleSchema:vr,descriptionSchema:yr,logoSchema:Ms,navigationSchema:Ei,themeSchema:Si,mountPointSchema:fi,updateMountPointSchema:Bs,authConfigSchema:Gs,resourceBundleSchema:Ti,installBlockletTitleSchema:As,installBlockletDescriptionSchema:Ds,Joi:u};var vt={},Pd=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});vt.setService=vt.findService=vt.getDefaultServiceConfig=vt.getServiceConfig=void 0;const Ld=Pd(nl),Nd=Q,Ys={},ji=e=>{Ys[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};vt.setService=ji;ji({name:"auth",schema:Nd.authConfigSchema,default:{}});const Js=e=>{if(!e)throw new Error("service name should not be empty");const t=Ys[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Qs=(e,t,{validate:n}={})=>{const r=Js(e),o=(0,Ld.default)(t||{}),{value:c,error:p}=r.validate(o);if(n&&p)throw new Error(`Invalid blocklet service config: ${p.details.map(d=>d.message).join(", ")}`);return c};vt.getServiceConfig=Qs;const Zs=e=>{const{defaultConfig:t}=Js(e);return t};vt.getDefaultServiceConfig=Zs;const ea=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};vt.findService=ea;vt.default={getServiceConfig:Qs,getDefaultServiceConfig:Zs,findService:ea,setService:ji};Object.defineProperty(dn,"__esModule",{value:!0});dn.fixAndValidateService=dn.validateMeta=void 0;const Ad=Q,Dd=vt,Md=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Dd.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);dn.fixAndValidateService=Md;const ta=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,schemaOptions:p={}}={})=>{const d=(0,Ad.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:c,...p}),{value:x,error:w}=d.validate(e);if(w)throw new Error(`Invalid blocklet meta: ${w.details.map(s=>s.message).join(", ")}`);return x};dn.validateMeta=ta;dn.default=ta;(function(e){var t=Ee&&Ee.__createBinding||(Object.create?function(j,W,J,$){$===void 0&&($=J);var le=Object.getOwnPropertyDescriptor(W,J);(!le||("get"in le?!W.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return W[J]}}),Object.defineProperty(j,$,le)}:function(j,W,J,$){$===void 0&&($=J),j[$]=W[J]}),n=Ee&&Ee.__setModuleDefault||(Object.create?function(j,W){Object.defineProperty(j,"default",{enumerable:!0,value:W})}:function(j,W){j.default=W}),r=Ee&&Ee.__importStar||function(){var j=function(W){return j=Object.getOwnPropertyNames||function(J){var $=[];for(var le in J)Object.prototype.hasOwnProperty.call(J,le)&&($[$.length]=le);return $},j(W)};return function(W){if(W&&W.__esModule)return W;var J={};if(W!=null)for(var $=j(W),le=0;le<$.length;le++)$[le]!=="default"&&t(J,W,$[le]);return n(J,W),J}}(),o=Ee&&Ee.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const c=o(rl),p=r(Lu),d=Ot,x=dn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return x.fixAndValidateService}});const w=hi,s=(j,W)=>{j.description||(j.description=`Blocklet from ${W}`),j.version||(j.version=d.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=s;const a=j=>{if(j.repository&&(typeof j.repository=="string"&&(j.repository={type:"git",url:j.repository}),j.repository.url)){const W=p.fromUrl(j.repository.url);W&&(j.repository.url=W.getDefaultRepresentation()==="shortcut"?W.https():W.toString())}};e.fixRepository=a;const O=j=>{Array.isArray(j.files)?j.files&&(j.files=j.files.filter(W=>!(!W||typeof W!="string"))):delete j.files};e.fixFiles=O;const b=j=>{typeof j.keywords=="string"&&(j.keywords=j.keywords.split(/,\s+/)),j.keywords&&!Array.isArray(j.keywords)?delete j.keywords:j.keywords&&(j.keywords=j.keywords.filter(W=>!(typeof W!="string"||!W)))};e.fixKeywords=b;const S=j=>{typeof j.tags=="string"&&(j.tags=j.tags.split(/,\s+/)),j.tags&&!Array.isArray(j.tags)?delete j.tags:j.tags&&(j.tags=j.tags.filter(W=>!(typeof W!="string"||!W)))};e.fixTags=S;const k=(j,W)=>(j.author&&(j.author=W(j.author)),["maintainers","contributors"].forEach(J=>{Array.isArray(j[J])&&(j[J]=j[J].map(W))}),j),L=j=>{if(!j)return"";if(typeof j=="string")return j;const W=j.name||"",J=j.url||j.web,$=J?` (${J})`:"",le=j.email||j.mail,me=le?` <${le}>`:"";return W+me+$};e.formatPerson=L;const A=j=>{if(typeof j!="string")return j;const W=j.match(/^([^(<]+)/),J=j.match(/\(([^)]+)\)/),$=j.match(/<([^>]+)>/),le={};return W&&W[0].trim()&&(le.name=W[0].trim()),$&&([,le.email]=$),J&&([,le.url]=J),le};e.parsePerson=A;const K=j=>(k(j,L),k(j,A),j);e.fixPerson=K;const U=(j,W=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(me=>{me.type===d.BLOCKLET_INTERFACE_TYPE_WEB&&(me.protocol="http")}),j;const $=(0,c.default)(j,"capabilities.dynamicPathPrefix",!0)?d.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:me="web",name:ae,path:ke="/",protocol:Ue="http",port:Ye=d.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:me,name:ae,path:ke,prefix:$,port:Ye,protocol:Ue})};return[d.BLOCKLET_INTERFACE_PUBLIC].forEach(me=>{j[me]&&le({name:me,path:j[me]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(me=>{le({type:"service",name:me.protocol,protocol:me.protocol,port:{internal:`BLOCKLET_${me.protocol}_PORT`.toUpperCase(),external:me.port}})}),W&&(delete j.publicUrl,delete j.adminUrl,delete j.configUrl,delete j.docUrl,delete j.exposeServices,j.capabilities&&delete j.capabilities.dynamicPathPrefix),j};e.fixInterfaces=U;const ee=j=>{const{did:W}=j;try{(0,w.validateNewDid)(W),j.name=W}catch{}return j};e.fixName=ee,e.default={fixRequired:s,fixRepository:a,fixFiles:O,fixKeywords:b,fixPerson:K,fixTags:S,fixName:ee,formatPerson:L,parsePerson:A,fixInterfaces:U,fixService:x.fixAndValidateService}})(ws);function na({owner:e,locale:t}){return i.jsxs(Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(Zo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}na.propTypes={owner:P.object.isRequired,locale:P.string.isRequired};const Fd="install-blocklet-from-URL",ra=()=>{const[e,t]=us(Fd,"[]",{raw:!0}),n=o=>{const c=o.trim(),p=JSON.parse(e),d=p.findIndex(x=>x===c);d!==0&&(d>0&&p.splice(d,1),p.length>=10&&p.splice(9),p.unshift(c),t(JSON.stringify(p)))},r=o=>{if(!o)return;const c=JSON.parse(e),p=o.trim(),d=c.findIndex(x=>x===p);d>-1&&(c.splice(d,1),t(JSON.stringify(c)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Bd=Wo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Oi(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:c,removeUrlRecord:p}=ra(),d=(w,s)=>{w.preventDefault(),w.stopPropagation(),p(s)},x=Bd();return i.jsxs(Z,{children:[i.jsx(zo,{freeSolo:!0,options:c,inputValue:t,onInputChange:(w,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:w=>Xa.cloneElement(r,{...w}),renderOption:(w,s)=>N.createElement(qo,{...w,key:s,secondaryAction:i.jsx(Uo,{edge:"end","aria-label":"delete",onClick:a=>d(a,s),children:i.jsx(il,{})})},i.jsx(Ca,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(Ko,{primary:s,className:x.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(Ia,{style:{margin:0},children:o})]})}Oi.propTypes={onValueChange:P.func,children:P.node,value:P.string,helperText:P.string};Oi.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function ki({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:c}){const{api:p}=Cn(),{api:d}=Ql(),[x,w]=N.useState(!1),[s,a]=N.useState(""),{t:O,locale:b}=pt(),S={dist:{}},[k,L]=N.useState(e),[A,K]=N.useState(e?1:0),[U,ee]=N.useState(S),[j,W]=N.useState(!1),[J,$]=N.useState({}),le=o==="component",me=le?!0:!e,{addUrlRecord:ae}=ra(),ke=async()=>{ee(S),a(null),w(!0);let re=k.trim();!re.startsWith("https://")&&!re.startsWith("http://")&&!re.startsWith("file://")&&(re=`file://${re}`);try{const ct=decodeURIComponent(re);try{new URL(ct)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:We}=await p.getBlockletMetaFromUrl({input:{url:ct}});ee(we),$({inStore:Je,registryUrl:We,inputUrl:re}),ae(re)}catch(ct){console.error(ct);const we=`Blocklet Install failed: ${ds(ct)}`;a(we),r(ct)}finally{w(!1)}},Ue=()=>{if(le){n({meta:U,...J}),t();return}w(!0),W(!0)},Ye=()=>{w(!1),W(!1),n({meta:U,...J}),t()},tt=()=>{w(!1),W(!1)};N.useEffect(()=>{e&&ke()},[e]);const Y=[{name:O("common.name"),value:At.getDisplayName({meta:U},!0)},{name:O("common.version"),value:U.version},{name:O("common.did"),value:U.did?i.jsx(Zl,{did:U.did}):null},{name:O("common.author"),value:U.owner?i.jsx(na,{owner:U.owner,locale:b}):ws.formatPerson(U.author)},{name:O("blocklet.dist.downloadLink"),value:U.dist.tarball}],he=()=>x?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(ht,{})}):U.did?i.jsx("div",{style:{paddingLeft:"10%"},children:Y.map(re=>re.name===O("common.did")?i.jsx(io,{valueComponent:"div",nameWidth:120,name:re.name,nameFormatter:()=>O("common.did"),children:re.value},re.name):i.jsx(io,{valueComponent:"div",nameWidth:120,name:re.name,children:re.value},re.name))}):null,q=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(pe,{component:"div",children:i.jsx(Oi,{style:{marginBottom:32},value:k,helperText:O("blocklet.fromUrl.description"),onValueChange:re=>{a(null),L(re)},children:i.jsx(lr,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:k,onChange:re=>{a(null),L(re.target.value)},disabled:x,onKeyPress:re=>{re.key==="Enter"&&(re.preventDefault(),ke(),K(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{ke(),K(1)}},{label:O("blocklet.fromUrl.step1"),body:he(),cancel:O(me?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{me?K(re=>re-1):t()},onConfirm:()=>{Ue()}}],Se=q[A];return i.jsxs(i.Fragment,{children:[i.jsxs(Qr,{title:(c==null?void 0:c.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Se.onCancel(),showCloseButton:A===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[Se.cancel&&i.jsx(at,{onClick:re=>{re.stopPropagation(),a(null),Se.onCancel()},color:"inherit",children:Se.cancel||O("common.cancel")}),i.jsxs(at,{onClick:re=>{re.stopPropagation(),Se.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:x||!k||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[x&&A===0&&i.jsx(ht,{size:16}),Se.confirm]})]}),children:[me&&i.jsx(_a,{alternativeLabel:!0,activeStep:A,children:q.map(({label:re})=>i.jsx(Pa,{children:i.jsx(La,{children:re})},re))}),i.jsx(Na,{component:"div",style:{marginTop:24},children:Se.body}),!!s&&i.jsx(Vo,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),U&&j&&i.jsx(ts,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:Ye,extraParams:{title:U.title,wt:wl(U),blockletMetaUrl:decodeURIComponent(k.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:tt})]})}ki.propTypes={defaultUrl:P.string,onCancel:P.func.isRequired,onSuccess:P.func.isRequired,onError:P.func,mode:P.oneOf(["install","component"]),handleText:P.object};ki.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};var Ri={},$d=ar;Object.defineProperty(Ri,"__esModule",{value:!0});var ia=Ri.default=void 0,Ud=$d(ur()),Wd=i;ia=Ri.default=(0,Ud.default)((0,Wd.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const zd={meta:P.object.isRequired,onCancel:P.func.isRequired},qd=Wo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function oa({action:e,onSelect:t,onNext:n}){const r=qd(),{t:o}=pt(),c=[{action:"purchase",title:o("store.purchase.purchase.title"),description:o("store.purchase.purchase.description")},{action:"verify",title:o("store.purchase.verify.title"),description:o("store.purchase.verify.description")}];return i.jsxs(i.Fragment,{children:[i.jsx(Aa,{className:r.tabPanel,children:c.map(p=>i.jsxs(qo,{button:!0,selected:e===p.action,onClick:()=>t(p.action),children:[i.jsx(Da,{className:r.iconRoot,children:p.action==="purchase"?i.jsx(ec,{style:{color:e==="purchase"?Zi.primary.main:"#AAA",fontSize:32}}):i.jsx(ia,{style:{color:e==="verify"?Zi.primary.main:"#AAA",fontSize:32}})}),i.jsx(Ko,{primary:p.title,secondary:p.description})]},p.action))}),n&&i.jsx(at,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}oa.propTypes={action:P.oneOf(["both","purchase","verify"]).isRequired,onSelect:P.func.isRequired,onNext:P.func.isRequired};function Ci({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:c}=pt(),{info:p}=Cn(),d=El(p),[x,w]=N.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,a=At.getDisplayName({meta:e}),O=async(S,k)=>{const L=({downloadTokenList:U})=>{r({downloadTokenList:U})},A=U=>{Zr.error(U),t(U)};function K(U){return ol(()=>oo.get(U).then(async({data:ee})=>{const j=ee==null?void 0:ee.downloadTokenList;if(ee.status==="succeed"){if(j&&j.length)await L({downloadTokenList:j});else return await A(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return ee.status==="error"?(console.error("vc error: ",ee),await A(ee==null?void 0:ee.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&x){const{statusUrl:U}=Sl(x);await K(U)}else await L({downloadTokenList:S.downloadTokenList&&k(S.downloadTokenList)})};if(N.useEffect(()=>{if(n==="purchase"){const S=new URL(s);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",p.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{oo.get(S.href).then(({data:k})=>{const L=`${k.url}`;w(L)})}catch(k){console.error("get next workflow url error: ",k)}}return()=>{w(null)}},[n]),n==="purchase"&&!x)return"";const b={verify:{action:"verify-purchase-blocklet",checkFn:ro.create({baseURL:s}).get,extraParams:{serverDid:p.did,blockletDid:e==null?void 0:e.did},messages:{title:o("store.purchase.verify.auth.title",{name:a}),scan:o("store.purchase.verify.auth.scan"),confirm:o("store.purchase.verify.auth.confirm"),success:o("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:ro.create({baseURL:qn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:x},messages:{title:o("store.purchase.auth.title",{name:a}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:o("store.purchase.auth.success")}),i.jsx("p",{children:o("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return i.jsx(ts,{open:!0,locale:c,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:d,disableClose:!0,showDownload:!1,...b[n]})}Ci.propTypes={...zd,handlePaySuccess:P.func,mode:P.oneOf(["verify","purchase"]).isRequired};Ci.defaultProps={handlePaySuccess:()=>{}};const Ii=N.forwardRef(({mode:e,...t},n)=>{const[r,o]=N.useState(e!=="both"?e:"verify"),[c,p]=N.useState(e!=="both"?2:1),d=w=>{w!==r&&o(w)},x=()=>{r&&c!==2&&p(2)};return N.useImperativeHandle(n,()=>({onNext:x,getCurrentStep:()=>c})),c===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(oa,{action:r,onNext:null,onSelect:d})}):i.jsx(Ci,{...t,mode:r})});Ii.propTypes={mode:P.oneOf(["both","verify","purchase"]).isRequired,ref:P.any};Ii.defaultProps={ref:{}};const Kd=Ii;function Vd({...e}){return i.jsx(at,{className:"bottom-button",variant:"contained",color:"primary",...e})}function _i({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=pt(),c=hs();return!e||Tl(e.meta)?i.jsx(Gd,{children:n}):i.jsxs(Hd,{isMobile:c,children:[i.jsx(Vd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(Z,{display:"flex",alignItems:"center",children:n})]})}_i.propTypes={blocklet:P.object,onStartNow:P.func,children:P.any,disabled:P.bool};_i.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Gd=Ke(Z)`
217
- width: 100%;
218
- margin-top: auto;
219
- padding-top: 24px;
220
- display: flex;
221
- align-items: center;
222
- justify-content: center;
223
- .bottom-button {
224
- min-width: 200px;
225
- }
226
- ${e=>e.theme.breakpoints.down("md")} {
227
- .bottom-button {
228
- width: 100%;
229
- }
230
- }
231
- `,Hd=Ke(Z)`
232
- padding-top: 24px;
233
- margin-top: auto;
234
- width: 100%;
235
- display: flex;
236
- align-items: center;
237
- justify-content: space-between;
238
- .start-now {
239
- min-width: 140px;
240
- }
241
- .bottom-button {
242
- min-width: 120px;
243
- }
244
- ${e=>e.theme.breakpoints.down("lg")} {
245
- width: 100%;
246
- }
247
-
248
- ${e=>e.theme.breakpoints.down("md")} {
249
- .start-now {
250
- min-width: inherit;
251
- }
252
- .bottom-button {
253
- min-width: 100px;
254
- }
255
- }
256
-
257
- ${e=>e.isMobile} {
258
- justify-content: space-between;
259
- gap: '32px',
260
- }}
261
- `;function Pi({blockletMeta:e,onEndpointUpdate:t}){var d;const n=hs(),{blocklet:r}=pr(),{updateSpaceGateway:o,loading:c,hasStorageEndpoint:p}=_l();return N.useEffect(()=>{t==null||t()},[r]),c?i.jsx(sl,{relative:"parent",children:i.jsx(ht,{})}):i.jsxs(Xd,{children:[i.jsx(Z,{width:n?"360px":"720px",children:p?i.jsx(ic,{}):i.jsx(oc,{})}),((d=e==null?void 0:e.capabilities)==null?void 0:d.didSpace)==="required"&&i.jsx(_i,{mt:8,children:i.jsx(sc,{onConnect:o})})]})}Pi.propTypes={blockletMeta:P.any.isRequired,onEndpointUpdate:Ma.func};Pi.defaultProps={onEndpointUpdate:()=>{}};const Xd=Ke(rc)`
262
- height: 100%;
263
- overflow-y: auto;
264
- padding-bottom: 32px;
265
- overflow-x: hidden;
266
- `;function Li({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:c}){const{t:p}=pt(),{info:d,inService:x}=Cn(),{blocklet:w}=pr(),[s,a]=N.useState(!1),O=N.useRef(null),[b,S]=N.useState(),[k,L]=us(c||"tmp"),[A,K]=c?[k,L]:[b,S],{storeList:U,teamDid:ee}=ss({fromBlocklet:x,blocklet:w,nodeInfo:d}),j=ns([...o.map(J=>({...J,protected:!0})),...U],"url"),W=A&&j.find(J=>A===J.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Yd,{children:[i.jsx(at,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(ac,{color:"primary"}),onClick:()=>{a(!0)},style:{padding:"0 2px"},children:i.jsx(pe,{color:"primary",children:W.name})}),i.jsx(pe,{color:"primary",children:r})]}),i.jsxs(lr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:p("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:W,autoFocus:!0,onChange:J=>{const $=J.target.value;K($.url),e($)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:J=>J==null?void 0:J.name,onClose:()=>{a(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(J=>i.jsx(Yr,{sx:{width:"400px",maxWidth:"90vw"},value:J,"data-cy":J.url,children:i.jsx(Qa,{teamDid:ee,store:J,onDelete:()=>{var $;A===J.url&&K(($=j[0])==null?void 0:$.url)}})},J.url)),!Qo.isInServerlessMode(d)&&i.jsx(Za,{disabled:t,storeList:j,teamDid:ee,onAdd:J=>{K(J)}})]}),n({currentRegistry:W})]})}Li.propTypes={onChange:P.func,loading:P.bool,children:P.any.isRequired,extra:P.node,storageKey:P.string,stores:P.arrayOf(P.shape({name:P.string.isRequired,url:P.string.isRequired}))};Li.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Yd=Ke.div`
267
- display: flex;
268
- justify-content: space-between;
269
- align-items: center;
270
- margin-bottom: 16px;
271
-
272
- span {
273
- font-size: 16px;
274
- color: ${e=>e.theme.palette.common.black};
275
- // font-weight: bold;
276
- }
277
- `,Jd=pn("div")`
278
- background-color: transparent !important;
279
- & > :not(.Mui-disabled) {
280
- position: relative;
281
- z-index: 1;
282
- &::before {
283
- content: '';
284
- position: absolute;
285
- height: 100%;
286
- width: 100%;
287
- left: 0;
288
- top: 0;
289
- transition: opacity 0.3s;
290
- }
291
- &:hover::before {
292
- opacity: 0;
293
- }
294
- &::after {
295
- content: '';
296
- position: absolute;
297
- height: 100%;
298
- width: 100%;
299
- top: 0;
300
- left: 0;
301
- border-radius: 2px;
302
- background-color: ${e=>e.theme.palette.primary.main};
303
- transform: scale(0.1);
304
- opacity: 0;
305
- z-index: -1;
306
- transition:
307
- transform 0.3s,
308
- opacity 0.3s,
309
- background-color 0.3s;
310
- }
311
- &:hover::after {
312
- opacity: 1;
313
- transform-origin: center;
314
- transform: scale(1);
315
- }
316
- }
317
- & > :not(.Mui-disabled) {
318
- background-color: transparent !important;
319
- color: ${e=>e.theme.palette.primary.main}!important;
320
- }
321
- & > :not(.Mui-disabled) {
322
- &:hover {
323
- color: ${e=>e.theme.palette.common.white}!important;
324
- }
325
- }
326
- `,Ro=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Qd=pn("div")`
327
- &.arcblock-blocklet {
328
- padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
329
- ${e=>e.theme.spacing(2)};
330
- }
331
- .arcblock-blocklet__content {
332
- cursor: pointer;
333
- display: flex;
334
- ${e=>e.theme.breakpoints.up("sm")} {
335
- align-items: center;
336
- }
337
- }
338
- .arcblock-blocklet__cover {
339
- width: 64px;
340
- height: 64px;
341
- margin-right: ${e=>e.theme.spacing(2)};
342
- overflow: hidden;
343
- border-radius: 12px;
344
- /* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
345
- transform: translateZ(0);
346
- ${e=>e.theme.breakpoints.up("sm")} {
347
- width: 80px;
348
- height: 80px;
349
- margin-bottom: 12px;
350
- }
351
- }
352
- .arcblock-blocklet__button--hover {
353
- &:not(.Mui-disabled) {
354
- position: relative;
355
- z-index: 1;
356
- &::before {
357
- content: '';
358
- position: absolute;
359
- height: 100%;
360
- width: 100%;
361
- left: 0;
362
- top: 0;
363
- transition: opacity 0.3s;
364
- }
365
- &:hover::before {
366
- opacity: 0;
367
- }
368
- &::after {
369
- content: '';
370
- position: absolute;
371
- height: 100%;
372
- width: 100%;
373
- background-color: ${e=>e.theme.palette.primary.main};
374
- transform: scale(0.1);
375
- opacity: 0;
376
- z-index: -1;
377
- transition:
378
- transform 0.3s,
379
- opacity 0.3s,
380
- background-color 0.3s;
381
- }
382
- &:hover::after {
383
- opacity: 1;
384
- transform-origin: center;
385
- transform: scale(1);
386
- }
387
- }
388
-
389
- &:not(.Mui-disabled) {
390
- background-color: transparent !important;
391
- color: ${e=>e.theme.palette.primary.main};
392
- }
393
- &:not(.Mui-disabled) {
394
- &:hover {
395
- color: ${e=>e.theme.palette.common.white};
396
- }
397
- }
398
- }
399
- .arcblock-blocklet__info {
400
- flex: 1;
401
- overflow: hidden;
402
- border-bottom: 1px solid ${e=>e.theme.palette.divider};
403
- padding-bottom: ${e=>e.theme.spacing(2)};
404
- }
405
- .arcblock-blocklet__text {
406
- height: 65px;
407
- overflow: hidden;
408
- }
409
- /* 设置多行文本溢出显示省略号 兼容fireFox、safari */
410
- .arcblock-blocklet__title {
411
- margin: 0;
412
- font-size: 16px;
413
- font-weight: 500;
414
- overflow: hidden;
415
- text-overflow: ellipsis;
416
- white-space: nowrap;
417
- }
418
- .arcblock-blocklet__describe {
419
- margin-top: ${e=>e.theme.spacing(.5)};
420
- color: ${e=>e.theme.palette.grey[600]};
421
- font-size: 14px;
422
- font-weight: 500;
423
- line-height: 17px;
424
- max-height: 34px;
425
- overflow: hidden;
426
- text-overflow: ellipsis;
427
- display: -webkit-box;
428
- -webkit-line-clamp: 2;
429
- -webkit-box-orient: vertical;
430
- word-break: break-word;
431
- }
432
- .arcblock-blocklet__version {
433
- color: ${e=>e.theme.palette.grey[600]};
434
- font-size: 12px;
435
- }
436
- `;function Ni({title:e,did:t,description:n,cover:r,version:o,button:c,buttonText:p,buttonDisabled:d,buttonLoading:x,onButtonClick:w,onMainClick:s,className:a,...O}){const b=(U,ee=()=>!1)=>(j,...W)=>{ee()?(j.preventDefault(),j.stopPropagation()):U instanceof Function&&(j.preventDefault(),j.stopPropagation(),U(...W))},S=b(w,()=>!!(c||d||x)),k=Gn(),L=Nt(k.breakpoints.up("sm")),A=b(s),K=L?80:64;return i.jsx(Qd,{className:`${a} arcblock-blocklet`,...O,children:i.jsxs("div",{className:"arcblock-blocklet__content",onClick:A,children:[r?i.jsx("div",{className:"arcblock-blocklet__cover",children:i.jsx(al,{src:r})}):t&&i.jsx("div",{className:"arcblock-blocklet__cover",children:i.jsx(ei,{did:t,size:K})}),i.jsxs("div",{className:"arcblock-blocklet__info",children:[i.jsxs("div",{className:"arcblock-blocklet__text",children:[N.isValidElement(e)?i.jsx(pe,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",children:e}):i.jsx(pe,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",title:Ro(e),dangerouslySetInnerHTML:{__html:e}}),N.isValidElement(n)?i.jsx(pe,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",children:n}):i.jsx(pe,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",title:Ro(n),dangerouslySetInnerHTML:{__html:n}})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"10px",flexFlow:"wrap"},children:[i.jsx("div",{onClick:S,style:{marginRight:"12px"},children:c||w&&i.jsxs(at,{className:"arcblock-blocklet__button--hover",variant:"outlined",color:"primary",size:"small",disabled:d||x,style:{padding:"3px 6px",fontSize:"14px",minWidth:"92px",textAlign:"center"},children:[x&&i.jsx(ht,{size:15,style:{marginRight:3,color:"inherit"}}),p]})}),i.jsx("div",{className:"arcblock-blocklet__version",children:o&&`v${o}`})]})]})]})})}Ni.propTypes={title:P.string||P.node,did:P.string,description:P.string||P.node,cover:P.string,buttonText:P.string,buttonDisabled:P.bool,buttonLoading:P.bool,button:P.element,version:P.string,onButtonClick:P.func,onMainClick:P.func,className:P.string};Ni.defaultProps={title:"",description:"",cover:null,did:null,buttonText:"Install",buttonDisabled:!1,buttonLoading:!1,button:null,version:null,onButtonClick:null,onMainClick:null,className:null};const Zd={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var eh=ll,Co=cl;function th(e,t,n,r){return e==null?[]:(Co(t)||(t=t==null?[]:[t]),n=r?void 0:n,Co(n)||(n=n==null?[]:[n]),eh(e,t,n))}var nh=th;const rh=cr(nh);var Ai={},ih=ar;Object.defineProperty(Ai,"__esModule",{value:!0});var sa=Ai.default=void 0,oh=ih(ur()),sh=i;sa=Ai.default=(0,oh.default)((0,sh.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const ah={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};var aa={exports:{}};(function(e,t){(function(n,r){e.exports=r(N)})(Ee,n=>(()=>{var r={703:(d,x,w)=>{var s=w(414);function a(){}function O(){}O.resetWarningCache=a,d.exports=function(){function b(L,A,K,U,ee,j){if(j!==s){var W=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw W.name="Invariant Violation",W}}function S(){return b}b.isRequired=b;var k={array:b,bool:b,func:b,number:b,object:b,string:b,symbol:b,any:b,arrayOf:S,element:b,elementType:b,instanceOf:S,node:b,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:a};return k.PropTypes=k,k}},697:(d,x,w)=>{d.exports=w(703)()},414:d=>{d.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:d=>{var x=typeof Element<"u",w=typeof Map=="function",s=typeof Set=="function",a=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(b,S){if(b===S)return!0;if(b&&S&&typeof b=="object"&&typeof S=="object"){if(b.constructor!==S.constructor)return!1;var k,L,A,K;if(Array.isArray(b)){if((k=b.length)!=S.length)return!1;for(L=k;L--!=0;)if(!O(b[L],S[L]))return!1;return!0}if(w&&b instanceof Map&&S instanceof Map){if(b.size!==S.size)return!1;for(K=b.entries();!(L=K.next()).done;)if(!S.has(L.value[0]))return!1;for(K=b.entries();!(L=K.next()).done;)if(!O(L.value[1],S.get(L.value[0])))return!1;return!0}if(s&&b instanceof Set&&S instanceof Set){if(b.size!==S.size)return!1;for(K=b.entries();!(L=K.next()).done;)if(!S.has(L.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(b)&&ArrayBuffer.isView(S)){if((k=b.length)!=S.length)return!1;for(L=k;L--!=0;)if(b[L]!==S[L])return!1;return!0}if(b.constructor===RegExp)return b.source===S.source&&b.flags===S.flags;if(b.valueOf!==Object.prototype.valueOf)return b.valueOf()===S.valueOf();if(b.toString!==Object.prototype.toString)return b.toString()===S.toString();if((k=(A=Object.keys(b)).length)!==Object.keys(S).length)return!1;for(L=k;L--!=0;)if(!Object.prototype.hasOwnProperty.call(S,A[L]))return!1;if(x&&b instanceof Element)return!1;for(L=k;L--!=0;)if((A[L]!=="_owner"&&A[L]!=="__v"&&A[L]!=="__o"||!b.$$typeof)&&!O(b[A[L]],S[A[L]]))return!1;return!0}return b!=b&&S!=S}d.exports=function(b,S){try{return O(b,S)}catch(k){if((k.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw k}}},359:d=>{d.exports=n}},o={};function c(d){var x=o[d];if(x!==void 0)return x.exports;var w=o[d]={exports:{}};return r[d](w,w.exports,c),w.exports}c.n=d=>{var x=d&&d.__esModule?()=>d.default:()=>d;return c.d(x,{a:x}),x},c.d=(d,x)=>{for(var w in x)c.o(x,w)&&!c.o(d,w)&&Object.defineProperty(d,w,{enumerable:!0,get:x[w]})},c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c.o=(d,x)=>Object.prototype.hasOwnProperty.call(d,x),c.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var p={};return(()=>{function d(v){var f,E,T="";if(typeof v=="string"||typeof v=="number")T+=v;else if(typeof v=="object")if(Array.isArray(v))for(f=0;f<v.length;f++)v[f]&&(E=d(v[f]))&&(T&&(T+=" "),T+=E);else for(f in v)v[f]&&(T&&(T+=" "),T+=f);return T}function x(){for(var v,f,E=0,T="";E<arguments.length;)(v=arguments[E++])&&(f=d(v))&&(T&&(T+=" "),T+=f);return T}c.r(p),c.d(p,{default:()=>ka});var w=c(359),s=c.n(w);const a=function(v){var f=typeof v;return v!=null&&(f=="object"||f=="function")},O=typeof Ee=="object"&&Ee&&Ee.Object===Object&&Ee;var b=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||b||Function("return this")(),k=function(){return S.Date.now()};var L=/\s/,A=/^\s+/;const K=function(v){return v&&v.slice(0,function(f){for(var E=f.length;E--&&L.test(f.charAt(E)););return E}(v)+1).replace(A,"")},U=S.Symbol;var ee=Object.prototype,j=ee.hasOwnProperty,W=ee.toString,J=U?U.toStringTag:void 0,$=Object.prototype.toString,le=U?U.toStringTag:void 0;const me=function(v){return v==null?v===void 0?"[object Undefined]":"[object Null]":le&&le in Object(v)?function(f){var E=j.call(f,J),T=f[J];try{f[J]=void 0;var F=!0}catch{}var te=W.call(f);return F&&(E?f[J]=T:delete f[J]),te}(v):function(f){return $.call(f)}(v)};var ae=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Ue=/^0o[0-7]+$/i,Ye=parseInt;const tt=function(v){if(typeof v=="number")return v;if(function(T){return typeof T=="symbol"||function(F){return F!=null&&typeof F=="object"}(T)&&me(T)=="[object Symbol]"}(v))return NaN;if(a(v)){var f=typeof v.valueOf=="function"?v.valueOf():v;v=a(f)?f+"":f}if(typeof v!="string")return v===0?v:+v;v=K(v);var E=ke.test(v);return E||Ue.test(v)?Ye(v.slice(2),E?2:8):ae.test(v)?NaN:+v};var Y=Math.max,he=Math.min;const q=function(v,f,E){var T,F,te,fe,g,m,C=0,D=!1,B=!1,M=!0;if(typeof v!="function")throw new TypeError("Expected a function");function se(ne){var de=T,be=F;return T=F=void 0,C=ne,fe=v.apply(be,de)}function oe(ne){return C=ne,g=setTimeout(V,f),D?se(ne):fe}function ue(ne){var de=ne-m;return m===void 0||de>=f||de<0||B&&ne-C>=te}function V(){var ne=k();if(ue(ne))return H(ne);g=setTimeout(V,function(de){var be=f-(de-m);return B?he(be,te-(de-C)):be}(ne))}function H(ne){return g=void 0,M&&T?se(ne):(T=F=void 0,fe)}function X(){var ne=k(),de=ue(ne);if(T=arguments,F=this,m=ne,de){if(g===void 0)return oe(m);if(B)return clearTimeout(g),g=setTimeout(V,f),se(m)}return g===void 0&&(g=setTimeout(V,f)),fe}return f=tt(f)||0,a(E)&&(D=!!E.leading,te=(B="maxWait"in E)?Y(tt(E.maxWait)||0,f):te,M="trailing"in E?!!E.trailing:M),X.cancel=function(){g!==void 0&&clearTimeout(g),C=0,T=m=F=g=void 0},X.flush=function(){return g===void 0?fe:H(k())},X},Se=function(v,f,E){var T=!0,F=!0;if(typeof v!="function")throw new TypeError("Expected a function");return a(E)&&(T="leading"in E?!!E.leading:T,F="trailing"in E?!!E.trailing:F),q(v,f,{leading:T,maxWait:f,trailing:F})};var re=c(590),ct=c.n(re),we=function(){if(typeof Map<"u")return Map;function v(f,E){var T=-1;return f.some(function(F,te){return F[0]===E&&(T=te,!0)}),T}return function(){function f(){this.__entries__=[]}return Object.defineProperty(f.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),f.prototype.get=function(E){var T=v(this.__entries__,E),F=this.__entries__[T];return F&&F[1]},f.prototype.set=function(E,T){var F=v(this.__entries__,E);~F?this.__entries__[F][1]=T:this.__entries__.push([E,T])},f.prototype.delete=function(E){var T=this.__entries__,F=v(T,E);~F&&T.splice(F,1)},f.prototype.has=function(E){return!!~v(this.__entries__,E)},f.prototype.clear=function(){this.__entries__.splice(0)},f.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var F=0,te=this.__entries__;F<te.length;F++){var fe=te[F];E.call(T,fe[1],fe[0])}},f}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,We=c.g!==void 0&&c.g.Math===Math?c.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Rt=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(We):function(v){return setTimeout(function(){return v(Date.now())},1e3/60)},Kt=["top","right","bottom","left","width","height","size","weight"],Mt=typeof MutationObserver<"u",Vt=function(){function v(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(f,E){var T=!1,F=!1,te=0;function fe(){T&&(T=!1,f()),F&&m()}function g(){Rt(fe)}function m(){var C=Date.now();if(T){if(C-te<2)return;F=!0}else T=!0,F=!1,setTimeout(g,20);te=C}return m}(this.refresh.bind(this))}return v.prototype.addObserver=function(f){~this.observers_.indexOf(f)||this.observers_.push(f),this.connected_||this.connect_()},v.prototype.removeObserver=function(f){var E=this.observers_,T=E.indexOf(f);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},v.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},v.prototype.updateObservers_=function(){var f=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return f.forEach(function(E){return E.broadcastActive()}),f.length>0},v.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Mt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},v.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},v.prototype.onTransitionEnd_=function(f){var E=f.propertyName,T=E===void 0?"":E;Kt.some(function(F){return!!~T.indexOf(F)})&&this.refresh()},v.getInstance=function(){return this.instance_||(this.instance_=new v),this.instance_},v.instance_=null,v}(),Ie=function(v,f){for(var E=0,T=Object.keys(f);E<T.length;E++){var F=T[E];Object.defineProperty(v,F,{value:f[F],enumerable:!1,writable:!1,configurable:!0})}return v},_e=function(v){return v&&v.ownerDocument&&v.ownerDocument.defaultView||We},je=ge(0,0,0,0);function ye(v){return parseFloat(v)||0}function Ct(v){for(var f=[],E=1;E<arguments.length;E++)f[E-1]=arguments[E];return f.reduce(function(T,F){return T+ye(v["border-"+F+"-width"])},0)}var Gt=typeof SVGGraphicsElement<"u"?function(v){return v instanceof _e(v).SVGGraphicsElement}:function(v){return v instanceof _e(v).SVGElement&&typeof v.getBBox=="function"};function Ht(v){return Je?Gt(v)?function(f){var E=f.getBBox();return ge(0,0,E.width,E.height)}(v):function(f){var E=f.clientWidth,T=f.clientHeight;if(!E&&!T)return je;var F=_e(f).getComputedStyle(f),te=function(M){for(var se={},oe=0,ue=["top","right","bottom","left"];oe<ue.length;oe++){var V=ue[oe],H=M["padding-"+V];se[V]=ye(H)}return se}(F),fe=te.left+te.right,g=te.top+te.bottom,m=ye(F.width),C=ye(F.height);if(F.boxSizing==="border-box"&&(Math.round(m+fe)!==E&&(m-=Ct(F,"left","right")+fe),Math.round(C+g)!==T&&(C-=Ct(F,"top","bottom")+g)),!function(M){return M===_e(M).document.documentElement}(f)){var D=Math.round(m+fe)-E,B=Math.round(C+g)-T;Math.abs(D)!==1&&(m-=D),Math.abs(B)!==1&&(C-=B)}return ge(te.left,te.top,m,C)}(v):je}function ge(v,f,E,T){return{x:v,y:f,width:E,height:T}}var Xt=function(){function v(f){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ge(0,0,0,0),this.target=f}return v.prototype.isActive=function(){var f=Ht(this.target);return this.contentRect_=f,f.width!==this.broadcastWidth||f.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var f=this.contentRect_;return this.broadcastWidth=f.width,this.broadcastHeight=f.height,f},v}(),mn=function(v,f){var E,T,F,te,fe,g,m,C=(T=(E=f).x,F=E.y,te=E.width,fe=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Ie(m,{x:T,y:F,width:te,height:fe,top:F,right:T+te,bottom:fe+F,left:T}),m);Ie(this,{target:v,contentRect:C})},gn=function(){function v(f,E,T){if(this.activeObservations_=[],this.observations_=new we,typeof f!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=f,this.controller_=E,this.callbackCtx_=T}return v.prototype.observe=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof _e(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)||(E.set(f,new Xt(f)),this.controller_.addObserver(this),this.controller_.refresh())}},v.prototype.unobserve=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof _e(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)&&(E.delete(f),E.size||this.controller_.removeObserver(this))}},v.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},v.prototype.gatherActive=function(){var f=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&f.activeObservations_.push(E)})},v.prototype.broadcastActive=function(){if(this.hasActive()){var f=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new mn(T.target,T.broadcastRect())});this.callback_.call(f,E,f),this.clearActive()}},v.prototype.clearActive=function(){this.activeObservations_.splice(0)},v.prototype.hasActive=function(){return this.activeObservations_.length>0},v}(),Yt=typeof WeakMap<"u"?new WeakMap:new we,Qe=function v(f){if(!(this instanceof v))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Vt.getInstance(),T=new gn(f,E,this);Yt.set(this,T)};["observe","unobserve","disconnect"].forEach(function(v){Qe.prototype[v]=function(){var f;return(f=Yt.get(this))[v].apply(f,arguments)}});const bt=We.ResizeObserver!==void 0?We.ResizeObserver:Qe,xt="Left",ft="Right",wt="Up",Ve="Down",Ne={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Jt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Qt="mousemove",Zt="mouseup";function en(v,f){if(f===0)return v;const E=Math.PI/180*f;return[v[0]*Math.cos(E)+v[1]*Math.sin(E),v[1]*Math.cos(E)-v[0]*Math.sin(E)]}function Ft(v){const{trackMouse:f}=v,E=w.useRef(Object.assign({},Jt)),T=w.useRef(Object.assign({},Ne)),F=w.useRef(Object.assign({},T.current));let te;for(te in F.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},Ne),v),Ne)T.current[te]===void 0&&(T.current[te]=Ne[te]);const[fe,g]=w.useMemo(()=>function(m,C){const D=V=>{const H="touches"in V;H&&V.touches.length>1||m((X,ne)=>{ne.trackMouse&&!H&&(document.addEventListener(Qt,B),document.addEventListener(Zt,se));const{clientX:de,clientY:be}=H?V.touches[0]:V,Pe=en([de,be],ne.rotationAngle);return ne.onTouchStartOrOnMouseDown&&ne.onTouchStartOrOnMouseDown({event:V}),Object.assign(Object.assign(Object.assign({},X),Jt),{initial:Pe.slice(),xy:Pe,start:V.timeStamp||0})})},B=V=>{m((H,X)=>{const ne="touches"in V;if(ne&&V.touches.length>1)return H;if(V.timeStamp-H.start>X.swipeDuration)return H.swiping?Object.assign(Object.assign({},H),{swiping:!1}):H;const{clientX:de,clientY:be}=ne?V.touches[0]:V,[Pe,it]=en([de,be],X.rotationAngle),Ze=Pe-H.xy[0],ze=it-H.xy[1],Ce=Math.abs(Ze),xe=Math.abs(ze),Wt=(V.timeStamp||0)-H.start,Ln=Math.sqrt(Ce*Ce+xe*xe)/(Wt||1),Nn=[Ze/(Wt||1),ze/(Wt||1)],_t=function(An,Tn,Dn,ot){return An>Tn?Dn>0?ft:xt:ot>0?Ve:wt}(Ce,xe,Ze,ze),on=typeof X.delta=="number"?X.delta:X.delta[_t.toLowerCase()]||Ne.delta;if(Ce<on&&xe<on&&!H.swiping)return H;const Tt={absX:Ce,absY:xe,deltaX:Ze,deltaY:ze,dir:_t,event:V,first:H.first,initial:H.initial,velocity:Ln,vxvy:Nn};Tt.first&&X.onSwipeStart&&X.onSwipeStart(Tt),X.onSwiping&&X.onSwiping(Tt);let Sn=!1;return(X.onSwiping||X.onSwiped||X[`onSwiped${_t}`])&&(Sn=!0),Sn&&X.preventScrollOnSwipe&&X.trackTouch&&V.cancelable&&V.preventDefault(),Object.assign(Object.assign({},H),{first:!1,eventData:Tt,swiping:!0})})},M=V=>{m((H,X)=>{let ne;if(H.swiping&&H.eventData){if(V.timeStamp-H.start<X.swipeDuration){ne=Object.assign(Object.assign({},H.eventData),{event:V}),X.onSwiped&&X.onSwiped(ne);const de=X[`onSwiped${ne.dir}`];de&&de(ne)}}else X.onTap&&X.onTap({event:V});return X.onTouchEndOrOnMouseUp&&X.onTouchEndOrOnMouseUp({event:V}),Object.assign(Object.assign(Object.assign({},H),Jt),{eventData:ne})})},se=V=>{document.removeEventListener(Qt,B),document.removeEventListener(Zt,se),M(V)},oe=(V,H)=>{let X=()=>{};if(V&&V.addEventListener){const ne=Object.assign(Object.assign({},Ne.touchEventOptions),H.touchEventOptions),de=[["touchstart",D,ne],["touchmove",B,Object.assign(Object.assign({},ne),H.preventScrollOnSwipe?{passive:!1}:{})],["touchend",M,ne]];de.forEach(([be,Pe,it])=>V.addEventListener(be,Pe,it)),X=()=>de.forEach(([be,Pe])=>V.removeEventListener(be,Pe))}return X},ue={ref:V=>{V!==null&&m((H,X)=>{if(H.el===V)return H;const ne={};return H.el&&H.el!==V&&H.cleanUpTouch&&(H.cleanUpTouch(),ne.cleanUpTouch=void 0),X.trackTouch&&V&&(ne.cleanUpTouch=oe(V,X)),Object.assign(Object.assign(Object.assign({},H),{el:V}),ne)})}};return C.trackMouse&&(ue.onMouseDown=D),[ue,oe]}(m=>E.current=m(E.current,T.current),{trackMouse:f}),[f]);return E.current=function(m,C,D,B){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==D.preventScrollOnSwipe||C.touchEventOptions.passive!==D.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:B(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:B(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,T.current,F.current,g),fe}var I=c(697);function ut(v){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},ut(v)}function tn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function nn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?tn(Object(E),!0).forEach(function(T){l(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):tn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function l(v,f,E){return(f=function(T){var F=function(te,fe){if(ut(te)!=="object"||te===null)return te;var g=te[Symbol.toPrimitive];if(g!==void 0){var m=g.call(te,fe);if(ut(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(te)}(T,"string");return ut(F)==="symbol"?F:String(F)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var h={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},y=s().memo(function(v){var f=nn(nn({},h),v),E=f.description,T=f.fullscreen,F=f.handleImageLoaded,te=f.isFullscreen,fe=f.onImageError,g=f.original,m=f.originalAlt,C=f.originalHeight,D=f.originalWidth,B=f.originalTitle,M=f.sizes,se=f.srcSet,oe=f.loading,ue=te&&T||g;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:ue,alt:m,srcSet:se,height:C,width:D,sizes:M,title:B,onLoad:function(V){return F(V,g)},onError:fe,loading:oe}),E&&s().createElement("span",{className:"image-gallery-description"},E))});y.displayName="Item",y.propTypes={description:I.string,fullscreen:I.string,handleImageLoaded:I.func.isRequired,isFullscreen:I.bool,onImageError:I.func.isRequired,original:I.string.isRequired,originalAlt:I.string,originalHeight:I.string,originalWidth:I.string,originalTitle:I.string,sizes:I.string,srcSet:I.string,loading:I.string};const R=y;function _(v){return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},_(v)}function z(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function G(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?z(Object(E),!0).forEach(function(T){ce(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):z(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function ce(v,f,E){return(f=function(T){var F=function(te,fe){if(_(te)!=="object"||te===null)return te;var g=te[Symbol.toPrimitive];if(g!==void 0){var m=g.call(te,fe);if(_(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(te)}(T,"string");return _(F)==="symbol"?F:String(F)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var ie={left:s().createElement("polyline",{points:"15 18 9 12 15 6"}),right:s().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:s().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:s().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:s().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:s().createElement(s().Fragment,null,s().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),s().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ae={strokeWidth:1,viewBox:"0 0 24 24"},Fe=function(v){var f=G(G({},Ae),v),E=f.strokeWidth,T=f.viewBox,F=f.icon;return s().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:T,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ie[F])};Fe.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Re=Fe;var De=s().memo(function(v){var f=v.isFullscreen,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(Re,{strokeWidth:2,icon:f?"minimize":"maximize"}))});De.displayName="Fullscreen",De.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const Ge=De;var He=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:f,onClick:E,"aria-label":"Previous Slide"},s().createElement(Re,{icon:"left",viewBox:"6 0 12 24"}))});He.displayName="LeftNav",He.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const vn=He;var Et=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:f,onClick:E,"aria-label":"Next Slide"},s().createElement(Re,{icon:"right",viewBox:"6 0 12 24"}))});Et.displayName="RightNav",Et.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const Bt=Et;var nt=s().memo(function(v){var f=v.isPlaying,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},s().createElement(Re,{strokeWidth:2,icon:f?"pause":"play"}))});nt.displayName="PlayPause",nt.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const $t=nt;function It(v){return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},It(v)}function Ut(){return Ut=Object.assign?Object.assign.bind():function(v){for(var f=1;f<arguments.length;f++){var E=arguments[f];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(v[T]=E[T])}return v},Ut.apply(this,arguments)}function _n(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function Pn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?_n(Object(E),!0).forEach(function(T){Yn(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):_n(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Yn(v,f,E){return(f=function(T){var F=function(te,fe){if(It(te)!=="object"||te===null)return te;var g=te[Symbol.toPrimitive];if(g!==void 0){var m=g.call(te,fe);if(It(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(te)}(T,"string");return It(F)==="symbol"?F:String(F)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var rt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},yn=function(v){var f=Pn(Pn({},rt),v),E=f.children,T=f.className,F=Ft({delta:f.delta,onSwiping:f.onSwiping,onSwiped:f.onSwiped});return s().createElement("div",Ut({},F,{className:T}),E)};yn.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const rn=yn;function mt(v){return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},mt(v)}function bn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(v,F).enumerable})),E.push.apply(E,T)}return E}function xn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?bn(Object(E),!0).forEach(function(T){Ki(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):bn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Jn(v,f){for(var E=0;E<f.length;E++){var T=f[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,Vi(T.key),T)}}function St(v,f){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},St(v,f)}function wn(v,f){if(f&&(mt(f)==="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Te(v)}function Te(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function En(v){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},En(v)}function Ki(v,f,E){return(f=Vi(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}function Vi(v){var f=function(E,T){if(mt(E)!=="object"||E===null)return E;var F=E[Symbol.toPrimitive];if(F!==void 0){var te=F.call(E,T);if(mt(te)!=="object")return te;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(v,"string");return mt(f)==="symbol"?f:String(f)}var Gi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Oa=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function Hi(v){var f=parseInt(v.keyCode||v.which||0,10);return f===66||f===62}var xr=function(v){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&St(g,m)})(fe,v);var f,E,T,F,te=(T=fe,F=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=En(T);if(F){var C=En(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return wn(this,g)});function fe(g){var m;return function(C,D){if(!(C instanceof D))throw new TypeError("Cannot call a class as a function")}(this,fe),Ki(Te(m=te.call(this,g)),"onBulletClick",function(C,D){var B=m.props,M=B.onBulletClick,se=B.items,oe=m.state.currentIndex;C.target.blur(),oe!==D&&(se.length===2?m.slideToIndexWithStyleReset(D,C):m.slideToIndex(D,C)),M&&M(C,D)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=s().createRef(),m.thumbnailsWrapper=s().createRef(),m.thumbnails=s().createRef(),m.imageGallerySlideWrapper=s().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Te(m)),m.handleKeyDown=m.handleKeyDown.bind(Te(m)),m.handleMouseDown=m.handleMouseDown.bind(Te(m)),m.handleResize=m.handleResize.bind(Te(m)),m.handleTouchMove=m.handleTouchMove.bind(Te(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Te(m)),m.handleScreenChange=m.handleScreenChange.bind(Te(m)),m.handleSwiping=m.handleSwiping.bind(Te(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Te(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Te(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Te(m)),m.handleImageError=m.handleImageError.bind(Te(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Te(m)),m.renderThumbInner=m.renderThumbInner.bind(Te(m)),m.renderItem=m.renderItem.bind(Te(m)),m.slideLeft=m.slideLeft.bind(Te(m)),m.slideRight=m.slideRight.bind(Te(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Te(m)),m.togglePlay=m.togglePlay.bind(Te(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=Se(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return f=fe,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,D=C.items,B=C.lazyLoad,M=C.slideDuration,se=C.slideInterval,oe=C.startIndex,ue=C.thumbnailPosition,V=C.showThumbnails,H=C.useWindowKeyDown,X=this.state,ne=X.currentIndex,de=X.isPlaying,be=g.items.length!==D.length,Pe=!ct()(g.items,D),it=g.startIndex!==oe,Ze=g.thumbnailPosition!==ue,ze=g.showThumbnails!==V;se===g.slideInterval&&M===g.slideDuration||de&&(this.pause(),this.play()),Ze&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),ze&&V&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),ze&&!V&&this.removeThumbnailsResizeObserver(),(be||ze)&&this.handleResize(),m.currentIndex!==ne&&this.slideThumbnailBar(),g.slideDuration!==M&&(this.slideToIndex=Se(this.unthrottledSlideToIndex,M,{trailing:!1})),!B||g.lazyLoad&&!Pe||(this.lazyLoaded=[]),H!==g.useWindowKeyDown&&(H?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(it||Pe)&&this.setState({currentIndex:oe,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,D=m.isTransitioning,B=this.props,M=B.onSlide,se=B.slideDuration;this.transitionTimer=window.setTimeout(function(){D&&(g.setState({isTransitioning:!D,isSwipingThumbnail:!1}),M&&M(C))},se+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,D=C.onThumbnailClick,B=C.items,M=this.state.currentIndex;g.target.parentNode.parentNode.blur(),M!==m&&(B.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),D&&D(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,D=C.disableThumbnailScroll,B=C.items,M=this.state,se=M.thumbnailsWrapperWidth,oe=M.thumbnailsWrapperHeight,ue=this.thumbnails&&this.thumbnails.current;if(D)return 0;if(ue){if(this.isThumbnailVertical()){if(ue.scrollHeight<=oe)return 0;m=ue.scrollHeight-oe}else{if(ue.scrollWidth<=se||se<=0)return 0;m=ue.scrollWidth-se}return g*(m/(B.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,D=C.infinite,B=C.items,M="",se="image-gallery-left",oe="image-gallery-right";switch(g){case m-1:M=" ".concat(se);break;case m:M=" ".concat("image-gallery-center");break;case m+1:M=" ".concat(oe)}return B.length>=3&&D&&(g===0&&m===B.length-1?M=" ".concat(oe):g===B.length-1&&m===0&&(M=" ".concat(se))),M}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,B=m.previousIndex,M=C!==B,se=g===0&&B===0,oe=g===1&&B===1,ue=g===0&&C===1,V=g===1&&C===0,H=D===0,X=-100*C+100*g+D;return D>0?this.direction="left":D<0&&(this.direction="right"),V&&D>0&&(X=-100+D),ue&&D<0&&(X=100+D),M?se&&H&&this.direction==="left"?X=100:oe&&H&&this.direction==="right"&&(X=-100):(V&&H&&this.direction==="left"&&(X=-100),ue&&H&&this.direction==="right"&&(X=100)),X}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,B=m.slideStyle,M=this.props,se=M.infinite,oe=M.items,ue=M.useTranslate3D,V=M.isRTL,H=-100*C,X=oe.length-1,ne=(H+100*g)*(V?-1:1)+D;se&&oe.length>2&&(C===0&&g===X?ne=-100*(V?-1:1)+D:C===X&&g===0&&(ne=100*(V?-1:1)+D)),se&&oe.length===2&&(ne=this.getTranslateXForTwoSlide(g));var de="translate(".concat(ne,"%, 0)");return ue&&(de="translate3d(".concat(ne,"%, 0, 0)")),xn({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:de,MozTransform:de,msTransform:de,OTransform:de,transform:de},B)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,D=m.isRTL,B=this.state,M=B.thumbsTranslate,se=B.thumbsStyle,oe=D?-1*M:M;return this.isThumbnailVertical()?(g="translate(0, ".concat(M,"px)"),C&&(g="translate3d(0, ".concat(M,"px, 0)"))):(g="translate(".concat(oe,"px, 0)"),C&&(g="translate3d(".concat(oe,"px, 0, 0)"))),xn({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},se)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,D=C.items,B=C.slideOnThumbnailOver,M=C.onClick,se=C.lazyLoad,oe=C.onTouchMove,ue=C.onTouchEnd,V=C.onTouchStart,H=C.onMouseOver,X=C.onMouseLeave,ne=C.renderItem,de=C.renderThumbInner,be=C.showThumbnails,Pe=C.showBullets,it=[],Ze=[],ze=[];return D.forEach(function(Ce,xe){var Wt=g.getAlignmentClassName(xe),Ln=Ce.originalClass?" ".concat(Ce.originalClass):"",Nn=Ce.thumbnailClass?" ".concat(Ce.thumbnailClass):"",_t=Ce.renderItem||ne||g.renderItem,on=Ce.renderThumbInner||de||g.renderThumbInner,Tt=!se||Wt||g.lazyLoaded[xe];Tt&&se&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var Sn=g.getSlideStyle(xe),An=s().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Ln),style:Sn,onClick:M,onKeyUp:g.handleSlideKeyUp,onTouchMove:oe,onTouchEnd:ue,onTouchStart:V,onMouseOver:H,onFocus:H,onMouseLeave:X,role:"button"},Tt?_t(Ce):s().createElement("div",{style:{height:"100%"}}));if(it.push(An),be&&Ce.thumbnail){var Tn=x("image-gallery-thumbnail",Nn,{active:m===xe});Ze.push(s().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:Tn,onMouseLeave:B?g.onThumbnailMouseLeave:null,onMouseOver:function(ot){return g.handleThumbnailMouseOver(ot,xe)},onFocus:function(ot){return g.handleThumbnailMouseOver(ot,xe)},onKeyUp:function(ot){return g.handleThumbnailKeyUp(ot,xe)},onClick:function(ot){return g.onThumbnailClick(ot,xe)}},on(Ce)))}if(Pe){var Dn=x("image-gallery-bullet",Ce.bulletClass,{active:m===xe});ze.push(s().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Dn,onClick:function(ot){return g.onBulletClick(ot,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:it,thumbnails:Ze,bullets:ze}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,D=m.currentIndex,B=g.length-1;return Math.abs(C-D)>1&&!(C===0&&D===B)&&!(C===B&&D===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,D=m.previousIndex,B=m.currentIndex;return C&&!(g===D||g===B)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,D=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:D,thumbsSwipedTranslate:D}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,D=g.dir,B=this.props,M=B.disableSwipe,se=B.stopPropagation,oe=this.state,ue=oe.galleryWidth,V=oe.isTransitioning,H=oe.swipingUpDown,X=oe.swipingLeftRight;if(D!==wt&&D!==Ve&&!H||X){if(D!==xt&&D!==ft||X||this.setState({swipingLeftRight:!0}),!M){var ne=this.props.swipingTransitionDuration;if(se&&m.preventDefault(),V)this.setState({currentSlideOffset:0});else{var de=D===ft?1:-1,be=C/ue*100;Math.abs(be)>=100&&(be=100);var Pe={transition:"transform ".concat(ne,"ms ease-out")};this.setState({currentSlideOffset:de*be,slideStyle:Pe})}}}else H||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,D=g.absY,B=g.dir,M=this.props,se=M.stopPropagation,oe=M.swipingThumbnailTransitionDuration,ue=this.state,V=ue.thumbsSwipedTranslate,H=ue.thumbnailsWrapperHeight,X=ue.thumbnailsWrapperWidth,ne=ue.swipingUpDown,de=ue.swipingLeftRight;if(this.isThumbnailVertical()){if((B===xt||B===ft||de)&&!ne)return void(de||this.setState({swipingLeftRight:!0}));B!==wt&&B!==Ve||ne||this.setState({swipingUpDown:!0})}else{if((B===wt||B===Ve||ne)&&!de)return void(ne||this.setState({swipingUpDown:!0}));B!==xt&&B!==ft||de||this.setState({swipingLeftRight:!0})}var be,Pe,it,Ze,ze,Ce=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=V+(B===Ve?D:-D),Pe=Ce.scrollHeight-H+20,it=Math.abs(be)>Pe,Ze=be>20,ze=Ce.scrollHeight<=H):(be=V+(B===ft?C:-C),Pe=Ce.scrollWidth-X+20,it=Math.abs(be)>Pe,Ze=be>20,ze=Ce.scrollWidth<=X),!ze&&(B!==xt&&B!==wt||!it)&&(B!==ft&&B!==Ve||!Ze)){se&&m.stopPropagation();var xe={transition:"transform ".concat(oe,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,D=g.velocity,B=this.props,M=B.disableSwipe,se=B.stopPropagation,oe=B.flickThreshold;if(!M){var ue=this.props.isRTL;se&&m.stopPropagation(),this.resetSwipingDirection();var V=(C===xt?1:-1)*(ue?-1:1),H=D>oe&&!(C===wt||C===Ve);this.handleOnSwipedTo(V,H)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,D=C.currentIndex,B=C.isTransitioning,M=D;!this.sufficientSwipe()&&!m||B||(M+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(M=D),this.unthrottledSlideToIndex(M)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,D=m.useBrowserFullscreen,B=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:B&&!D&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new bt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperWidth:D.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new bt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperHeight:D.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,D=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,B=this.imageGallery.current===D;m&&m(B),C&&this.setState({isFullscreen:B})}},{key:"slideToIndex",value:function(g,m){var C=this.state,D=C.currentIndex,B=C.isTransitioning,M=this.props,se=M.items,oe=M.slideDuration,ue=M.onBeforeSlide;if(!B){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var V=se.length-1,H=g;g<0?H=V:g>V&&(H=0),ue&&H!==D&&ue(H),this.setState({previousIndex:D,currentIndex:H,isTransitioning:H!==D,currentSlideOffset:0,slideStyle:{transition:"all ".concat(oe,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,D=C.currentIndex,B=C.isTransitioning,M=this.props.items,se=D+(m==="left"?-1:1);B||(M.length===2?this.slideToIndexWithStyleReset(se,g):this.slideToIndex(se,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,D=this.state,B=D.currentIndex,M=D.currentSlideOffset;this.setState({currentSlideOffset:M+(B>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){Hi(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){Hi(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;Gi.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;Gi.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,D=m.slideInterval,B=m.slideDuration,M=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(D,B)),C&&g&&C(M))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return s().createElement(R,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return s().createElement("span",{className:"image-gallery-thumbnail-inner"},s().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&s().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,D=g.modalFullscreen,B=g.isPlaying,M=this.props,se=M.additionalClass,oe=M.disableThumbnailSwipe,ue=M.indexSeparator,V=M.isRTL,H=M.items,X=M.thumbnailPosition,ne=M.renderFullscreenButton,de=M.renderCustomControls,be=M.renderLeftNav,Pe=M.renderRightNav,it=M.showBullets,Ze=M.showFullscreenButton,ze=M.showIndex,Ce=M.showThumbnails,xe=M.showNav,Wt=M.showPlayButton,Ln=M.renderPlayPauseButton,Nn=this.getThumbnailStyle(),_t=this.getSlideItems(),on=_t.slides,Tt=_t.thumbnails,Sn=_t.bullets,An=x("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(X),{"image-gallery-rtl":V}),Tn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:An},de&&de(),this.canSlide()?s().createElement(s().Fragment,null,xe&&s().createElement(s().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Pe(this.slideRight,!this.canSlideRight())),s().createElement(rn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},on))):s().createElement("div",{className:"image-gallery-slides"},on),Wt&&Ln(this.togglePlay,B),it&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},Sn)),Ze&&ne(this.toggleFullScreen,C),ze&&s().createElement("div",{className:"image-gallery-index"},s().createElement("span",{className:"image-gallery-index-current"},m+1),s().createElement("span",{className:"image-gallery-index-separator"},ue),s().createElement("span",{className:"image-gallery-index-total"},H.length))),Dn=x("image-gallery",se,{"fullscreen-modal":D}),ot=x("image-gallery-content",this.getThumbnailPositionClassName(X),{fullscreen:C}),Ra=x("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(X),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&V},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!oe},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!oe});return s().createElement("div",{ref:this.imageGallery,className:Dn,"aria-live":"polite"},s().createElement("div",{className:ot},(X==="bottom"||X==="right")&&Tn,Ce&&Tt.length>0?s().createElement(rn,{className:Ra,delta:0,onSwiping:!oe&&this.handleThumbnailSwiping,onSwiped:!oe&&this.handleOnThumbnailSwiped},s().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},s().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Nn,"aria-label":"Thumbnail Navigation"},Tt))):null,(X==="top"||X==="left")&&Tn))}}],E&&Jn(f.prototype,E),Object.defineProperty(f,"prototype",{writable:!1}),fe}(s().Component);xr.propTypes={flickThreshold:I.number,items:(0,I.arrayOf)((0,I.shape)({bulletClass:I.string,bulletOnClick:I.func,description:I.string,original:I.string,originalHeight:I.number,originalWidth:I.number,loading:I.string,thumbnailHeight:I.number,thumbnailWidth:I.number,thumbnailLoading:I.string,fullscreen:I.string,originalAlt:I.string,originalTitle:I.string,thumbnail:I.string,thumbnailAlt:I.string,thumbnailLabel:I.string,thumbnailTitle:I.string,originalClass:I.string,thumbnailClass:I.string,renderItem:I.func,renderThumbInner:I.func,imageSet:Oa,srcSet:I.string,sizes:I.string})).isRequired,showNav:I.bool,autoPlay:I.bool,lazyLoad:I.bool,infinite:I.bool,showIndex:I.bool,showBullets:I.bool,showThumbnails:I.bool,showPlayButton:I.bool,showFullscreenButton:I.bool,disableThumbnailScroll:I.bool,disableKeyDown:I.bool,disableSwipe:I.bool,disableThumbnailSwipe:I.bool,useBrowserFullscreen:I.bool,onErrorImageURL:I.string,indexSeparator:I.string,thumbnailPosition:(0,I.oneOf)(["top","bottom","left","right"]),startIndex:I.number,slideDuration:I.number,slideInterval:I.number,slideOnThumbnailOver:I.bool,swipeThreshold:I.number,swipingTransitionDuration:I.number,swipingThumbnailTransitionDuration:I.number,onSlide:I.func,onBeforeSlide:I.func,onScreenChange:I.func,onPause:I.func,onPlay:I.func,onClick:I.func,onImageLoad:I.func,onImageError:I.func,onTouchMove:I.func,onTouchEnd:I.func,onTouchStart:I.func,onMouseOver:I.func,onMouseLeave:I.func,onBulletClick:I.func,onThumbnailError:I.func,onThumbnailClick:I.func,renderCustomControls:I.func,renderLeftNav:I.func,renderRightNav:I.func,renderPlayPauseButton:I.func,renderFullscreenButton:I.func,renderItem:I.func,renderThumbInner:I.func,stopPropagation:I.bool,additionalClass:I.string,useTranslate3D:I.bool,isRTL:I.bool,useWindowKeyDown:I.bool},xr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(v,f){return s().createElement(vn,{onClick:v,disabled:f})},renderRightNav:function(v,f){return s().createElement(Bt,{onClick:v,disabled:f})},renderPlayPauseButton:function(v,f){return s().createElement($t,{onClick:v,isPlaying:f})},renderFullscreenButton:function(v,f){return s().createElement(Ge,{onClick:v,isFullscreen:f})},useWindowKeyDown:!0};const ka=xr})(),p})())})(aa);var lh=aa.exports;const ch=cr(lh);function uh(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,c=n.threshold,p=e.get(r);p||(p=new Map,e.set(r,p));var d=JSON.stringify({rootMargin:o,threshold:c}),x=p.get(d);if(!x){var w=new Map,s=new IntersectionObserver(function(a){a.forEach(function(O){var b=w.get(O.target);b==null||b(O)})},{root:r,rootMargin:o,threshold:c});x={observer:s,entryCallbacks:w},p.set(d,x)}return{observe:function(O,b){var S,k;(S=x)==null||S.entryCallbacks.set(O,b),(k=x)==null||k.observer.observe(O)},unobserve:function(O){var b,S;(b=x)==null||b.entryCallbacks.delete(O),(S=x)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var dh="0px",hh=[0],ph=uh();function fh(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:dh,o=(n=e==null?void 0:e.threshold)!=null?n:hh,c=N.useRef(null),p=N.useRef(null),d=N.useRef(null),x=N.useState(),w=x[0],s=x[1],a=N.useCallback(function(){var k=c.current;if(!k){s(void 0);return}var L=ph.getObserver({root:p.current,rootMargin:r,threshold:o});L.observe(k,function(A){s(A)}),d.current=L},[r,o]),O=N.useCallback(function(){var k=d.current,L=c.current;L&&(k==null||k.unobserve(L)),d.current=null},[]),b=N.useCallback(function(k){O(),c.current=k,a()},[a,O]),S=N.useCallback(function(k){O(),p.current=k,a()},[a,O]);return[b,{entry:w,rootRef:S}]}function Kr(){return Kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kr.apply(this,arguments)}function mh(e){var t,n=fh(e),r=n[0],o=n[1],c=!!((t=o.entry)!=null&&t.isIntersecting),p=N.useState(c),d=p[0],x=p[1];return c&&!d&&x(!0),[r,Kr({},o,{isVisible:c,wasEverVisible:d})]}var gh=100;function vh(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,c=e.disabled,p=e.delayInMs,d=p===void 0?gh:p,x=mh({rootMargin:o}),w=x[0],s=x[1],a=s.rootRef,O=s.isVisible,b=!c&&!t&&O&&n;return N.useEffect(function(){if(b){var S=setTimeout(function(){r()},d);return function(){clearTimeout(S)}}},[r,b,d]),[w,{rootRef:a}]}const yh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},bh={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var Rr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Cr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function la(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function ca(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function xh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,c=0;c<n.length;c++)r.indexOf(n[c])===-1&&(o=!1);return o}var Di={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Rr?173:189,"=":Rr?61:187,";":Rr?59:186,"'":222,"[":219,"]":221,"\\":220},qt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Vr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},qe={16:!1,18:!1,17:!1,91:!1},Me={};for(var Zn=1;Zn<20;Zn++)Di["f".concat(Zn)]=111+Zn;var Oe=[],Io=!1,ua="all",da=[],br=function(t){return Di[t.toLowerCase()]||qt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ha(e){ua=e||"all"}function Vn(){return ua||"all"}function wh(){return Oe.slice(0)}function Eh(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Sh(e){return typeof e=="string"&&(e=br(e)),Oe.indexOf(e)!==-1}function Th(e,t){var n,r;e||(e=Vn());for(var o in Me)if(Object.prototype.hasOwnProperty.call(Me,o))for(n=Me[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;Vn()===e&&ha(t||"all")}function jh(e){var t=e.keyCode||e.which||e.charCode,n=Oe.indexOf(t);if(n>=0&&Oe.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Oe.splice(0,Oe.length),(t===93||t===224)&&(t=91),t in qe){qe[t]=!1;for(var r in qt)qt[r]===t&&(lt[r]=!1)}}function Oh(e){if(typeof e>"u")Object.keys(Me).forEach(function(p){return delete Me[p]});else if(Array.isArray(e))e.forEach(function(p){p.key&&Ir(p)});else if(typeof e=="object")e.key&&Ir(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],c=n[1];typeof o=="function"&&(c=o,o=""),Ir({key:e,scope:o,method:c,splitKey:"+"})}}var Ir=function(t){var n=t.key,r=t.scope,o=t.method,c=t.splitKey,p=c===void 0?"+":c,d=ca(n);d.forEach(function(x){var w=x.split(p),s=w.length,a=w[s-1],O=a==="*"?"*":br(a);if(Me[O]){r||(r=Vn());var b=s>1?la(qt,w):[];Me[O]=Me[O].filter(function(S){var k=o?S.method===o:!0;return!(k&&S.scope===r&&xh(S.mods,b))})}})};function _o(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var c in qe)Object.prototype.hasOwnProperty.call(qe,c)&&(!qe[c]&&t.mods.indexOf(+c)>-1||qe[c]&&t.mods.indexOf(+c)===-1)&&(o=!1);(t.mods.length===0&&!qe[16]&&!qe[18]&&!qe[17]&&!qe[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function Po(e,t){var n=Me["*"],r=e.keyCode||e.which||e.charCode;if(lt.filter.call(this,e)){if((r===93||r===224)&&(r=91),Oe.indexOf(r)===-1&&r!==229&&Oe.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var k=Vr[S];e[S]&&Oe.indexOf(k)===-1?Oe.push(k):!e[S]&&Oe.indexOf(k)>-1?Oe.splice(Oe.indexOf(k),1):S==="metaKey"&&e[S]&&Oe.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Oe=Oe.slice(Oe.indexOf(k))))}),r in qe){qe[r]=!0;for(var o in qt)qt[o]===r&&(lt[o]=!0);if(!n)return}for(var c in qe)Object.prototype.hasOwnProperty.call(qe,c)&&(qe[c]=e[Vr[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Oe.indexOf(17)===-1&&Oe.push(17),Oe.indexOf(18)===-1&&Oe.push(18),qe[17]=!0,qe[18]=!0);var p=Vn();if(n)for(var d=0;d<n.length;d++)n[d].scope===p&&(e.type==="keydown"&&n[d].keydown||e.type==="keyup"&&n[d].keyup)&&_o(e,n[d],p,t);if(r in Me){for(var x=0;x<Me[r].length;x++)if((e.type==="keydown"&&Me[r][x].keydown||e.type==="keyup"&&Me[r][x].keyup)&&Me[r][x].key){for(var w=Me[r][x],s=w.splitKey,a=w.key.split(s),O=[],b=0;b<a.length;b++)O.push(br(a[b]));O.sort().join("")===Oe.sort().join("")&&_o(e,w,p,t)}}}}function kh(e){return da.indexOf(e)>-1}function lt(e,t,n){Oe=[];var r=ca(e),o=[],c="all",p=document,d=0,x=!1,w=!0,s="+",a=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(c=t.scope),t.element&&(p=t.element),t.keyup&&(x=t.keyup),t.keydown!==void 0&&(w=t.keydown),t.capture!==void 0&&(a=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(c=t);d<r.length;d++)e=r[d].split(s),o=[],e.length>1&&(o=la(qt,e)),e=e[e.length-1],e=e==="*"?"*":br(e),e in Me||(Me[e]=[]),Me[e].push({keyup:x,keydown:w,scope:c,mods:o,shortcut:r[d],method:n,key:r[d],splitKey:s,element:p});typeof p<"u"&&!kh(p)&&window&&(da.push(p),Cr(p,"keydown",function(O){Po(O,p)},a),Io||(Io=!0,Cr(window,"focus",function(){Oe=[]},a)),Cr(p,"keyup",function(O){Po(O,p),jh(O)},a))}function Rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Me).forEach(function(n){var r=Me[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var _r={setScope:ha,getScope:Vn,deleteScope:Th,getPressedKeyCodes:wh,isPressed:Sh,filter:Eh,trigger:Rh,unbind:Oh,keyMap:Di,modifier:qt,modifierMap:Vr};for(var Pr in _r)Object.prototype.hasOwnProperty.call(_r,Pr)&&(lt[Pr]=_r[Pr]);if(typeof window<"u"){var Ch=window.hotkeys;lt.noConflict=function(e){return e&&window.hotkeys===lt&&(window.hotkeys=Ch),lt},window.hotkeys=lt}lt.filter=function(){return!0};var pa=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},Ih=function(t){return pa(t,["INPUT","TEXTAREA","SELECT"])};function _h(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},c=o.enableOnTags,p=o.filter,d=o.keyup,x=o.keydown,w=o.filterPreventDefault,s=w===void 0?!0:w,a=o.enabled,O=a===void 0?!0:a,b=o.enableOnContentEditable,S=b===void 0?!1:b,k=N.useRef(null),L=N.useCallback(function(A,K){var U,ee;return p&&!p(A)?!s:Ih(A)&&!pa(A,c)||(U=A.target)!=null&&U.isContentEditable&&!S?!0:k.current===null||document.activeElement===k.current||(ee=k.current)!=null&&ee.contains(document.activeElement)?(t(A,K),!0):!1},r?[k,c,p].concat(r):[k,c,p]);return N.useEffect(function(){if(!O){lt.unbind(e,L);return}return d&&x!==!0&&(n.keydown=!1),lt(e,n||{},L),function(){return lt.unbind(e,L)}},[L,e,O]),k}lt.isPressed;const fa=N.createContext({open:!1,toggleOpen:e=>{}});function Ph({children:e}){const[t,n]=N.useState(!1),r=c=>{n(c??!c)},o=N.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(fa.Provider,{value:o,children:e})}function Mi(){return N.useContext(fa)}const dt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Lh=e=>Xn(async()=>{const{data:t}=await e.get(dt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Nh(e,t){const n={sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:o=d=>{t.onFilterChange({...n,keyword:d.title})},emptyCategory:c}=t;!n.category&&!c&&(n.category="All");const p=d=>{const x={...n,...d};r(wr(x,w=>w===""||w===void 0))};return{filters:e,cleanFilter:d=>{const x=d?wr(n,(w,s)=>d.includes(s)):{};r(wr(x,w=>w===""||w===void 0))},handleActiveMenu:d=>{d!==e.menu&&r({menu:d})},handleSort:(d,x)=>{p({sortBy:d,sortDirection:x||d==="nameAsc"?"asc":"desc"})},handleKeyword:d=>{p({category:void 0,keyword:d||void 0})},handlePrice:d=>{p({price:d===e.price?void 0:d})},handleCategory:d=>{p({category:d===e.category?"":d})},handleDeveloper:d=>{p({owner:d||void 0})},handlePage:d=>{p({currentPage:d})},handleSwitchShowResources:d=>{p({showResources:d})},handleSearchSelect:d=>{o(d)}}}const Ah=(e,t,n)=>e&&t||!n,ma=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ga=(e,t,n)=>{var r,o;const c=Gl(e),p=Hl(c.search);if((r=Xl(e,{strict:!0}))!=null&&r.endsWith(".gif"))return p.imageFilter?Yl({...c,search:""}):e;if(p.imageFilter)return e;const d=n||((o=window.blocklet)==null?void 0:o.version),{w:x,h:w}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return ni(e,{...x||w?{imageFilter:"resize",w:x,h:w}:{},v:d})},Dh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Mh=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Fh=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Bh=()=>window.innerWidth<=600,$h={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},Uh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Lr={en:eo($h),zh:eo(Uh)},va=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Wh=e=>(t,n)=>{const r=Lr[e]?Lr[e][t]:Lr.en[t];return Fh(r,n)||t},ya={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},ba=N.createContext(ya),{Provider:zh,Consumer:hf}=ba;function qh(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:c=350,queryFilter:p=!0,layout:d={},wrapChildren:x=q=>q,extraFilter:w=q=>q,baseSearch:s=!1,fetchCategoryDelay:a=0,showResourcesSwitch:O=!1,showCategory:b=!0,tagFilters:S=[],children:k,storeVersion:L,onSearchSelect:A=()=>{},endpoint:K,blockletRender:U}=e,ee=va(r,L),j=N.useMemo(()=>rs({baseURL:K,headers:ee}),[K]),W=Nh(n,{onFilterChange:o,emptyCategory:!d.showExplore,onSearchSelect:A}),[J,$]=N.useState(""),{data:le=[],error:me,loading:ae,run:ke}=Lh(j),Ue=N.useMemo(()=>{const q=rh(le,[re=>re.name],["asc"]),Se=q.findIndex(re=>re.name==="All"||re.locales.en==="All");return Se>-1?[{...q[Se],_id:"All"},...q.slice(0,Se),...q.slice(Se+1)]:q},[le]),Ye=N.useCallback(Wh(t),[t]),tt=N.useMemo(()=>Mh(Ue,t),[Ue,t]),Y=Dh(Ye),he={search:W,errors:{fetchCategoriesError:me},loadings:{fetchCategoriesLoading:ae},extraFilter:w,endpoint:K,queryFilter:p,layout:{showExplore:d.showExplore??!1,showCategory:d.showCategory??!0,showTitle:d.showTitle??!0,showSearch:d.showSearch??!0},minItemWidth:c,wrapChildren:x,t:Ye,storeVersion:L,serverVersion:r,selectedCategory:W.filters.category||(d.showExplore?"":"All"),categoryList:Ue,blockletRender:U,locale:t,categoryOptions:tt,priceOptions:Y,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:b,tagFilters:S,onFilterChange:o,getCategoryLocale:q=>{if(!q)return null;const Se=le.find(re=>re._id===q||re.locales.en==="All");return Se?Se.locales[t]||Se.locales.en:null},get developerName(){return J},updateDeveloperName:$};return N.useEffect(()=>{setTimeout(ke,a||0)},[K,ke,a]),i.jsx(zh,{value:he,children:k})}function et(){return N.useContext(ba)||ya}function xa({children:e,onClick:t,size:n=32,...r}){return i.jsx(Hn,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function er(e,t){return e===void 0?t:e}function Fi({xs:e,sm:t,md:n,lg:r,xl:o,exact:c}){const p=Gn(),d=Nt(p.breakpoints.down("sm")),x=Nt(p.breakpoints.between("sm","md")),w=Nt(p.breakpoints.between("md","lg")),s=Nt(p.breakpoints.between("lg","xl"));if(c)return d?e||null:x?t||null:w?n||null:s?r||null:o||null;let a=e;return d||(a=er(t,a),x)||(a=er(n,a),w)||(a=er(r,a),s)?a:er(o,a)}function Kh({children:e}){const{open:t,toggleOpen:n}=Mi();return i.jsx(Fi,{xs:i.jsx(Fa,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(Z,{children:e})})}const Vh=N.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(Hn,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(ht,{size:"1em"})}));function wa({value:e,options:t,onChange:n,placeholder:r,...o}){var c;const p=N.useRef(null),d=Gn(),[x,w]=N.useState(!1),[s,a]=N.useState(e!==null?e:""),O=Nt(d.breakpoints.down("sm"));N.useEffect(()=>{a(e!==null?e:"")},[e]);const b=N.useCallback(()=>{w(!1)},[]),S=N.useCallback(()=>{w(!0)},[]);function k(A){a(A.value),n(A.value),O&&b()}function L(A){return A===s}return i.jsxs(i.Fragment,{children:[i.jsxs(Gh,{ref:p,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Un(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((c=t.find(A=>A.value===s))==null?void 0:c.name)||r,i.jsx(Ba,{className:"my-select__arrowdown",component:sa,sx:{width:18,height:18}})]}),i.jsx($a,{open:x,anchorEl:p.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:A,placement:K})=>i.jsx(Ua,{...A,style:{transformOrigin:K==="bottom"?"center top":"center bottom"},children:i.jsx(Wa,{children:i.jsx(za,{onClickAway:b,children:i.jsx(Hh,{autoFocusItem:x,onMouseEnter:S,onMouseLeave:b,children:t.map(U=>i.jsxs(Yr,{onClick:()=>k(U),sx:{fontSize:14},children:[i.jsx(os,{sx:{mr:1,fontSize:16,visibility:L(U.value)?"visible":"hidden"}}),U.name]},U.value))})})})})})]})}const Gh=pn(Vh)`
437
- border: 1px solid #f0f0f0;
438
- padding: 6px 8px 6px 12px;
439
- font-weight: ${e=>e.theme.typography.fontWeightRegular};
440
- font-size: 14px;
441
- color: #666;
442
- line-height: 1;
443
- text-transform: none;
444
- & + & {
445
- margin-left: 10px;
446
- }
447
- &.my-select__selector--active {
448
- &,
449
- .my-select__arrowdown,
450
- }
451
- .my-select__arrowdown {
452
- color: #999;
453
- font-size: 14px;
454
- margin-left: 6px;
455
- }
456
- .my-select__icon {
457
- font-size: 0;
458
- svg {
459
- color: #999;
460
- font-size: 18px;
461
- margin-right: 3px;
462
- }
463
- }
464
- `,Hh=pn(Xo)`
465
- .my-select__option__icon {
466
- color: transparent;
467
- font-size: 14px;
468
- margin: 0 3px 0 -5px;
469
- }
470
- .my-select__option {
471
- font-size: 14px;
472
- color: #999;
473
- }
474
- .my-select__option--active {
475
- &,
476
- .my-select__option__icon {
477
- color: ${e=>e.theme.palette.primary.main};
478
- }
479
- }
480
- `;function Ea(){const{search:e,t}=et(),{filters:n,handleSort:r,handlePrice:o}=e,c=ma(t);return i.jsxs(yt,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[i.jsx(Hr,{control:i.jsx(Xr,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:p=>o(p.target.checked?"free":"")}),label:t("blocklet.free")}),i.jsx(wa,{value:n.sortBy||c[0].value,options:c,onChange:p=>r(p),placeholder:t("sort.sort")})]})}function Xh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:c,layout:p,baseSearch:d}=et(),{filters:x,handleActiveMenu:w,handleCategory:s,cleanFilter:a}=n,{toggleOpen:O}=Mi();N.useEffect(()=>{O(!1)},[Object.values(x).join("")]);const b=Ah(d,p.showSearch,x.keyword);return p.showCategory?i.jsxs(Kh,{children:[i.jsx(Fi,{xs:i.jsxs(yt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(xa,{onClick:()=>O(!1),children:i.jsx(ti,{})}),i.jsx(pe,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(yt,{visibility:c.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:b?i.jsxs(i.Fragment,{children:[p.showExplore&&i.jsxs(Z,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(Z,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(Dt,{icon:Zd,width:20,height:20}),i.jsx(pe,{variant:"body1",color:!t&&!x.menu?"text.primary":"text.lighter",fontWeight:!t&&!x.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{O(!1),a()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(Z,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(Dt,{icon:S.icon,width:20,height:20}):S.icon,i.jsx(pe,{variant:"body1",color:x.menu===S.key?"text.primary":"text.lighter",fontWeight:x.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var k;O(!1),w(S.key),(k=S.onClick)==null||k.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(yt,{gap:2,children:o.map(S=>i.jsx(pe,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===S.value?a():s(S.value),O(!1)},children:S.name},S.value))})]}):i.jsx(Ea,{})})]}):null}function Bi(){const{endpoint:e,serverVersion:t,storeVersion:n}=et(),r=va(t,n),o=N.useMemo(()=>rs({baseURL:e,headers:r}),[e]);return{get:async c=>{const{data:p}=await o.get(c);return p},post:async(c,p)=>{const{data:d}=await o.post(c,p);return d}}}const Sa=N.memo(function(e){return i.jsx(Z,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(ht,{})})});function Lo({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&i.jsxs(yt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,i.jsx(pe,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Yh=16/9,Nr=292,Gr=189,sr=336;function Jh(){var e,t;const{t:n,search:r}=et(),{get:o}=Bi(),c=Gn(),p=Nt(c.breakpoints.down("md")),d=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:x=[],error:w,loading:s}=Xn(async()=>{const A=await o(ni(dt.blockletsPath,{didList:d.map(K=>K.did).join(",")}));return A!=null&&A.dataList?d.map(K=>A.dataList.find(U=>U.did===K.did)):[]});w&&console.error("Get Banner Blocklets error:",w);const a={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!w&&d.length>0?i.jsxs(i.Fragment,{children:[i.jsx(pe,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),i.jsx(Z,{height:{xs:"auto",md:Nr},minHeight:Nr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(Z,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(zt,{variant:"rounded",height:Gr,width:sr}),i.jsxs(Z,{flex:1,height:"100%",children:[i.jsx(zt,{variant:"text",height:50,width:100}),i.jsx(zt,{variant:"text",height:40,width:"100%"}),i.jsx(zt,{variant:"text",height:40,width:300}),i.jsxs(Z,{display:"flex",gap:1,my:2,children:[i.jsx(zt,{variant:"circular",height:20,width:20}),i.jsx(zt,{variant:"text",height:20,width:50})]}),i.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):i.jsx(ch,{showNav:!0,autoPlay:!0,slideDuration:p?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:A=>i.jsx(Z,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(lc,{sx:{...a,left:5}})}),renderRightNav:A=>i.jsx(Z,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(cc,{sx:{...a,right:5}})}),items:d.map((A,K)=>({original:A.did,renderItem:()=>{var U;const ee=x[K]||{},j=A.cover||Zh(A.did,(U=ee.screenshots)==null?void 0:U[0]),W=ga(j,c.breakpoints.values.md*2);return i.jsxs(yt,{height:{xs:"auto",md:Nr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${W}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(ee),gap:{xs:2,md:5},children:[O(W),i.jsxs(yt,{flex:1,height:"100%",gap:3,children:[i.jsxs(Z,{flex:1,children:[b(A.name||ee.title||A.name),S(A.desc||ee.description)]}),ee.did&&k(ee,A.baseNum),L(ee)]})]})}}))})})]}):null;function O(A){return i.jsx(Z,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:sr},children:i.jsx(ep,{url:A})})}function b(A){return i.jsx(pe,{variant:"h2",width:"100%",children:A})}function S(A){return i.jsx(pe,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:A})}function k(A,K=0){const{did:U,owner:ee,stats:j}=A;return i.jsxs(Z,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Lo,{icon:i.jsx(ei,{src:ee.avatar,did:U,size:20,variant:"circle"}),children:ee.fullName}),i.jsx(Lo,{icon:i.jsx(Dt,{icon:ah}),title:`${j.downloads+K}`,children:Qh(j.downloads+K)})]})}function L(A){return i.jsx(Hn,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(A),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Qh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Zh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function ep({url:e}){const[t,n]=N.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:sr},height:{xs:"auto",md:Gr}}}),i.jsx(Z,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:sr},height:{xs:"auto",md:Gr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Yh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function tp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=et();return i.jsxs(Z,{mt:3,children:[i.jsx(pe,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Xi,{container:!0,spacing:2,children:t.map(o=>i.jsx(Xi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(Z,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function np(){const{get:e}=Bi(),{t}=et(),{data:n=[],error:r,loading:o}=Xn(async()=>{const c=await e(dt.explorePath);return Array.isArray(c)?c:[]});return r?i.jsx(hr,{error:new Error(`Failed to fetch blocklets from ${dt.explorePath}`)}):o?i.jsx(Sa,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Jh,{}),n.map(c=>c.blocklets.length>0?i.jsx(tp,{title:t(`explore.${c.type}`),blocklets:c.blocklets},c.type):null)]})}const Ar="__FREE_TEXT__",No="__NO_RESULT__",Dr=40;function rp({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:c,...p}){const d=N.useRef(null),x=N.useRef(!1),[w,s]=N.useState(!1),[a,O]=N.useState(""),[b,S]=N.useState(!1),k=Bi(),[L,A]=N.useState(!1),K=(p==null?void 0:p.placeholder)||t("common.searchStore"),U=async Y=>{A(!0);const he=await k.get(qn(e,ni(dt.blockletsPath,Y)));return A(!1),he.dataList||[]},{data:ee,run:j}=Xn(Y=>Y?U({sortBy:dt.nameDesc,page:1,pageSize:10,keyword:Y,showResources:"true"}):Promise.resolve([]),{manual:!0});N.useEffect(()=>{A(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),_h("ctrl + k, command + k",Y=>{var he,q;return Y.stopPropagation(),Y.preventDefault(),(q=(he=d.current)==null?void 0:he.querySelector("input"))==null||q.focus(),!1},{enableOnTags:["INPUT"]});const W=cs(Y=>j(Y),{wait:300}),J={name:Ar,title:a,did:""};let $=[];return a&&(L?$=[J]:ee!=null&&ee.length?$=[J,...ee]:$=[{name:No,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(qa,{fullScreen:!0,open:b,sx:{display:{md:"none"}},children:[i.jsxs(Z,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Yo,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:K,className:"bl-autocomplete-input",value:a,onChange:Y=>le(Y.target.value),startAdornment:Ye(b),endAdornment:tt()}),i.jsx(Hn,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Xo,{sx:{p:.5},children:$.map(Y=>ke(Y))})]}),i.jsx(rr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(zo,{ref:d,open:!!a&&w,size:"small",onOpen:()=>s(!0),onClose:(Y,he)=>{s(!1),he==="selectOption"&&!x.current&&o(a)},onKeyDown:Y=>{Y.key==="Enter"&&!a&&me()},disableClearable:!0,inputValue:a,onInputChange:(Y,he)=>le(he),isOptionEqualToValue:(Y,he)=>Y.name===he.name,getOptionLabel:Y=>Y.title,getOptionKey:Y=>Y.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Y=>i.jsx(lr,{...Y,InputProps:{...Y.InputProps,autoFocus:!0,placeholder:K,className:"bl-autocomplete-input",value:a,startAdornment:Ye(w),endAdornment:tt()}}),filterOptions:Y=>Y,...p,options:$,renderOption:(Y,he)=>ke(he),value:J,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(p.sx)?p.sx:[p.sx]]})]});function le(Y){A(!0),O(Y),x.current=!1,W.run(Y)}function me(){S(!1),O(""),le(""),o("")}function ae(Y){Y!=null&&Y.did?(S(!1),x.current=!0,O(""),c(Y)):Y.name===Ar&&(S(!1),o(a))}function ke(Y){var he,q;return i.jsxs(Yr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ae(Y),children:[Ue(Y),i.jsxs(pe,{variant:"body1",children:[i.jsx(pe,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Y.title}),i.jsx(pe,{sx:{color:"text.lighter"},fontSize:"13px",children:((q=(he=Y.category)==null?void 0:he.locales)==null?void 0:q[n||"en"])||""})]})]},Y.did)}function Ue(Y){if([Ar,No].includes(Y.name))return i.jsx(Z,{width:Dr,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(rr,{sx:{fontSize:28}})});let he="";return Y.logo&&(he=qn(e,"assets",Y.did,ga(Y.logo,Dr,Y.version))),i.jsx(ei,{src:he,size:Dr,style:{borderRadius:"8px",overflow:"hidden"}})}function Ye(Y=!0){return i.jsx(Z,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:Y&&a&&L?i.jsx(ht,{color:"inherit",size:16}):i.jsx(rr,{sx:{fontSize:16,cursor:"default"}})})}function tt(){return a?i.jsx(Z,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(ti,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>me()})}):null}}function ip({placeholder:e="Type to search...",...t}){const{search:n}=et(),{filters:r,handleKeyword:o}=n,[c,p]=N.useState(r.keyword||""),d=cs(o,{wait:300}),x=s=>{const{value:a}=s.target;p(a),d.run(a)},w=()=>{p(""),o("")};return N.useEffect(()=>{p(r.keyword||"")},[r.keyword]),i.jsx(op,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(Ji,{position:"start",children:i.jsx(sp,{})}),onChange:x,placeholder:e,value:c,title:e,"data-cy":"search",endAdornment:c&&i.jsx(Ji,{position:"end",children:i.jsx(ap,{"data-cy":"search-delete",onClick:w})}),...t})}const op=pn(Yo)`
481
- background-color: ${e=>e.theme.palette.grey[50]};
482
- font-size: 14px;
483
- border-radius: 6px;
484
- width: 100%;
485
- .MuiInputBase-input {
486
- padding: 8px 0 8px 10px;
487
- }
488
- .MuiOutlinedInput-notchedOutline {
489
- border: none;
490
- }
491
- .Mui-focused {
492
- background-color: #f6f6f6;
493
- .MuiInputBase-input::placeholder {
494
- color: transparent;
495
- }
496
- }
497
- `,sp=pn(rr)`
498
- color: ${e=>e.theme.palette.grey[500]};
499
- font-size: 28px;
500
- @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
501
- font-size: 24px;
502
- }
503
- `,ap=pn(ti)`
504
- color: ${e=>e.theme.palette.grey[500]};
505
- font-size: 16px;
506
- cursor: pointer;
507
- `;function lp(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:c,showResourcesSwitch:p,layout:d,baseSearch:x}=et(),{filters:w,handleSort:s,handlePrice:a,handleDeveloper:O,handleSwitchShowResources:b,cleanFilter:S}=e,k=ma(t);return i.jsxs(yt,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[i.jsx(pe,{variant:"h2",textTransform:"capitalize",children:o(w.category)}),i.jsxs(yt,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[d.showSearch?i.jsx(Z,{flex:1,children:x?i.jsx(ip,{}):i.jsx(rp,{locale:r,endpoint:n,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,w.owner&&c&&i.jsx(Yi,{label:t("blocklet.authorTag",{name:c}),size:"small",onDelete:()=>O("")}),w.resourceDid&&w.resourceBlocklet&&i.jsx(Yi,{label:t("blocklet.resourceTag",{name:w.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),p?i.jsx(Ao,{checked:w.showResources!=="false",onChange:L=>b(L?"true":"false"),label:t("common.showResources")}):null,i.jsx(Ao,{checked:w.price==="free",onChange:L=>a(L?"free":""),label:t("blocklet.free")}),i.jsx(wa,{value:w.sortBy||k[0].value,options:k,placeholder:t("sort.sort"),onChange:L=>s(L)})]})]})}function Ao({checked:e,onChange:t,label:n}){return i.jsx(Hr,{sx:{m:0,p:0},className:"check-button",control:i.jsx(Xr,{checked:e,icon:i.jsx(Dt,{style:{padding:0},icon:yh}),checkedIcon:i.jsx(Dt,{style:{padding:0,color:"#3478E2"},icon:bh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function tr({children:e}){return i.jsxs(Z,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(dl,{}),e]})}function Do(){const{t:e}=et();return i.jsx(pe,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Mr({filterTip:e,keywordTip:t}){const{t:n,locale:r}=et(),o=()=>r==="zh"?"、":" , ";return i.jsxs(Z,{mt:1,display:"flex",children:[i.jsx(pe,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&i.jsx(pe,{children:n("blocklet.filterTip")}),e&&t&&o(),t&&i.jsx(pe,{children:n("blocklet.keywordTip")})]})}function Fr({primaryStart:e,primaryEnd:t,filter:n}){return i.jsxs(pe,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[i.jsx(pe,{children:e}),i.jsx(pe,{color:"primary",children:n}),i.jsxs(pe,{children:[t," "]})]})}function cp(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=et(),{filters:o}=t,c=!!r||!!o.price;if(o.keyword&&c)return i.jsxs(tr,{children:[i.jsx(Fr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Mr,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(tr,{children:[i.jsx(Fr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Mr,{keywordTip:!0})]});if(c){const p=n(r);return i.jsxs(tr,{children:[p?i.jsx(Fr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:p}):i.jsx(Do,{}),i.jsx(Mr,{filterTip:!0})]})}return i.jsx(tr,{children:i.jsx(Do,{})})}const up=(e,t,n,r)=>zl(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:c,pageSize:p}=n,d={...t,category:t.category==="All"?"":t.category,sortBy:dt[t.sortBy],page:c,pageSize:p};r(null);const{data:x={}}=await e.get(dt.blockletsPath,{params:d});return n.currentPage++,{page:c,pageSize:p,list:(x==null?void 0:x.dataList)||[],total:(x==null?void 0:x.total)||0}},{isNoMore:o=>o?o.page*o.pageSize>=o.total:!1,reloadDeps:[e,hl(t)],onError:r});function dp(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:c}=et(),{filters:p}=n,d=Wl({currentPage:dt.currentPage,pageSize:Bh()?dt.mobilePageSize:dt.pageSize,defaultCurrentPage:dt.defaultCurrentPage}),[x,w]=N.useState(null),s=up(t,p,d,w),a=N.useMemo(()=>{var O,b;return r?r(((O=s.data)==null?void 0:O.list)||[]):((b=s.data)==null?void 0:b.list)||[]},[s.data,r]);return N.useEffect(()=>{const O=a.find(b=>b.owner.did===p.owner);c((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[p.owner,a,c]),{blocklets:a,fetchBlockletsError:x,loadMore:s.loadMore,hasNextPage:!s.noMore,total:((e=s.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:s.loading,loadingMore:s.loadingMore},errors:{...o,fetchBlockletsError:x}}}function hp(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:c,layout:p,baseSearch:d}=et(),{filters:x}=t,{blocklets:w,errors:s,loadMore:a,loadings:O,hasNextPage:b,total:S}=dp(),[k]=vh({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:b,onLoadMore:a});if(s.fetchBlockletsError){const U=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(hr,{error:U})}const L=d&&p.showSearch||!x.keyword;return i.jsxs(i.Fragment,{children:[L?i.jsx(lp,{}):i.jsxs(i.Fragment,{children:[i.jsx(Fi,{xs:i.jsx(Ea,{}),md:null}),K()]}),A(),!O.fetchBlockletsLoading&&b&&i.jsx(Z,{height:60,display:"flex",justifyContent:"center",py:2,ref:k,children:i.jsx(ht,{})})]});function A(){return O.fetchBlockletsLoading?i.jsx(Sa,{mt:15}):w.length?i.jsx(Z,{className:"blocklet-list",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${c}px, 1fr))`,p:"2px",gap:2,children:w.map(U=>i.jsx(Z,{"data-blocklet-did":U.did,sx:{minWidth:c},children:r({blocklet:U,blocklets:w,serverVersion:o})},U.did))}):i.jsx(cp,{})}function K(){return i.jsxs(yt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[i.jsx(pe,{variant:"h3",children:e("blocklet.search",{keyword:x.keyword})}),i.jsx(pe,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:S})})]})}}function pp(){const{t:e,selectedCategory:t,getCategoryLocale:n}=et(),{toggleOpen:r}=Mi();return i.jsxs(pe,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(xa,{onClick:()=>r(!0),children:i.jsx(ul,{})}),n(t)||e("common.category")]})}function fp({menus:e,children:t}){var n;const{search:r,layout:o}=et(),{filters:c}=r,p=c.category||c.keyword||c.price,d=(n=e==null?void 0:e.find(x=>x.key===c.menu))==null?void 0:n.key;return i.jsx(Ph,{children:i.jsxs(is,{FallbackComponent:hr,children:[i.jsx(pp,{}),i.jsxs(Z,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(Xh,{menus:e}),i.jsxs(yt,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[d&&(t==null?void 0:t(d)),!d&&(o.showExplore&&!p?i.jsx(np,{}):i.jsx(hp,{}))]})]})]})})}function mp(e){const{menus:t,children:n,...r}=e,o=Gn(),c=Go(jl({...o,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return i.jsx(Ho,{theme:c,children:i.jsx(qh,{...r,children:i.jsx(fp,{menus:t,children:n})})})}var $i={},gp=ar;Object.defineProperty($i,"__esModule",{value:!0});var Ta=$i.default=void 0,vp=gp(ur()),yp=i;Ta=$i.default=(0,vp.default)((0,yp.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const bp=(e,t)=>!t||!e?!0:$r.satisfies($r.coerce(e),t);function Ui({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=pt();return bp(t,n)?e:i.jsx(Ka,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(pe,{children:i.jsx(Hn,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}Ui.propTypes={children:P.node.isRequired,serverVersion:P.string,requirementVersion:P.string};Ui.defaultProps={serverVersion:"",requirementVersion:""};const $n=getComputedStyle(document.documentElement),xp=Go({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:$n.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:$n.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:$n.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:$n.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:$n.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{fontSize:14,button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),wp=(e,t)=>qn(t,`/blocklets/${e.did}`),Mo=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Ep=e=>e.inStore&&At.isFreeBlocklet(e)===!1;function Wi({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var A;const{t:c}=pt();let p=qn(r,Ol(e.did,e.logo||""));try{const K=new URL(p);K.searchParams.set("v",e.version||+new Date),p=K.href}catch{}const[d,x]=N.useState(!1),w=K=>K.currentTarget.contains(K.target)?!0:(K.preventDefault(),!1),s=async K=>{K.preventDefault(),K.stopPropagation();try{x(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(U){Zr.error(U.message)}finally{x(!1)}},{blocklet:a}=pr(),O=()=>((a==null?void 0:a.children)||[]).find(ee=>ee.meta.bundleDid===e.did).meta.version,S=(()=>{const K=((a==null?void 0:a.children)||[]).find(U=>U.meta.bundleDid===e.did);if(K){try{const U=K.meta.version,ee=e.version;if($r.gt(ee,U))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let k=c("blocklet.component.choose");S==="upgrade"?k=c("blocklet.component.upgrade"):S==="disable"?k=c("blocklet.component.installed"):Ep(e)&&(k=c("common.purchase"));const L=(A=e.requirements)==null?void 0:A.server;return i.jsx(Va,{href:wp(e,r),style:{color:"initial",textDecoration:"none"},onClick:w,target:"_blank",children:i.jsx(Sp,{title:Mo({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Mo({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?p:"",version:e.version,button:i.jsx(Ui,{serverVersion:o,requirementVersion:L,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(Jd,{children:i.jsxs(at,{onClick:s,size:"small",disabled:d||S==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:S==="upgrade"?`${O()} -> ${e.version}`:"",children:[d?i.jsxs(i.Fragment,{children:[i.jsx(ht,{size:16,style:{marginRight:3}}),k]}):k,S==="upgrade"?i.jsx(Ta,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Wi.propTypes={blocklet:P.object.isRequired,blocklets:P.array,handleButtonClick:P.func,endpoint:P.string,serverVersion:P.string};Wi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function zi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:c,resourceType:p,resourceDid:d,showResourcesSwitch:x,showCategory:w,...s}){const{locale:a}=pt(),[O,b]=N.useState(!1),[S,k]=N.useState({}),L=K=>{k(K)},A=n;return N.useEffect(()=>{k({showResources:!0,resourceType:p,resourceDid:d})},[A,p,d]),N.useEffect(()=>{b(!0),k({showResources:!0,resourceType:p,resourceDid:d})},[]),i.jsx(Ho,{theme:xp,children:i.jsx(is,{FallbackComponent:hr,resetKeys:[A],children:i.jsxs(Z,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(mp,{showCategory:w,showResourcesSwitch:x,blockletRender:K=>{const U={...K,handleButtonClick:e,endpoint:A};return r({...K,defaultRender:i.jsx(Wi,{...U})})},baseSearch:!0,endpoint:A,locale:a,onFilterChange:L,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:c,fetchCategoryDelay:500}),i.jsx(Z,{sx:{mt:2},children:" "})]})})})}zi.propTypes={storeUrl:P.string.isRequired,handleButtonClick:P.func,handleSearchSelect:P.func,handleBlockletRender:P.func,extraFilter:P.func,serverVersion:P.string,resourceType:P.string,resourceDid:P.string,showResourcesSwitch:P.bool,showCategory:P.bool};zi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const Sp=Ke(Ni)`
508
- .ms-highlight {
509
- color: ${e=>e.theme.palette.primary.main};
510
- }
511
- `,qi=N.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:c,setActiveStepByKey:p,setActiveStepByIndex:d}=pl(),{t:x,locale:w}=pt(),s=o[c];return N.useEffect(()=>{n(c)},[n,c]),N.useImperativeHandle(r,()=>({setActiveStepByKey:p,setActiveStepByIndex:d})),i.jsx(jp,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(fl,{locale:w,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?kl({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,stepTip:x("blocklet.component.add"),children:i.jsx(Tp,{children:typeof(s==null?void 0:s.body)=="function"?s.body():s==null?void 0:s.body})})})});qi.propTypes={meta:P.any,onStepChange:P.func.isRequired,isMobile:P.bool.isRequired};qi.defaultProps={meta:null};const Fo=e=>e.isMobile?`
512
- height: calc(100vh - 56px - 64px - 48px);
513
- `:"",Tp=Ke.div`
514
- width: 100%;
515
- height: 100%;
516
- display: flex;
517
- flex-direction: column;
518
- justify-content: flex-start;
519
- align-items: flex-start;
520
-
521
- .bottom-button {
522
- min-width: 200px;
523
- }
524
-
525
- // blocklet-select-side
526
- aside {
527
- width: 140px;
528
- }
529
- `,jp=Ke(Z)`
530
- ${({className:e})=>e==="mobileStyle"?`
531
- & > div{
532
- height: 100%;
533
- }
534
- .root-header {
535
- .app-name-content {
536
- display: none;
537
- }
538
- }
539
-
540
- // content-panel
541
- .root-header + div{
542
- padding-top: 0;
543
- position: relative;
544
- & > div {
545
- padding-top: 0;
546
- }
547
- }
548
-
549
- header + div {
550
- padding-top: 0;
551
- }
552
-
553
- header {
554
- .header-title {
555
- margin-left: 0;
556
- }
557
-
558
- .header-title-name {
559
- max-width: 100% !important;
560
- }
561
- }
562
- .app-content {
563
- padding: 0!important;
564
- }
565
- `:`
566
- position: relative;
567
- .ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
568
- width: 100%;
569
- height: 100%;
570
- }
571
-
572
- .root-header {
573
- z-index: auto !important;
574
- position: fixed !important;
575
- }
576
- & > div {
577
- height: 100%;
578
- width: 100%;
579
- max-width: 100%;
580
- & > div {
581
- max-height: unset !important;
582
- max-width: 100%;
583
- & > div {
584
- // left-panel
585
- &:first-child {
586
- padding: 0;
587
- width: 20%;
588
- min-width: 180px;
589
-
590
- & > div:first-child {
591
- display: none;
592
- }
593
- // step
594
- & > div:last-child {
595
- // margin-top: 32px;
596
- margin-top: 0;
597
- }
598
- }
599
- // right-panel
600
- &:last-child {
601
- padding-top: 0;
602
- padding-right: 0px;
603
- overflow-y: hidden;
604
- .app-content {
605
- padding: 0 0 24px 0;
606
- }
607
- .button-container {
608
- padding-right: 0;
609
- }
610
- }
611
- }
612
- }
613
- }
614
-
615
- `}
616
-
617
- & .app-overview {
618
- margin-left: 0 !important;
619
- }
620
-
621
- & .flex-justify-center {
622
- display: flex;
623
- justify-content: center;
624
- }
625
-
626
- & .flex-align-center {
627
- display: flex;
628
- height: 100%;
629
- align-items: center;
630
- ${e=>Fo(e)}
631
- }
632
-
633
- & .agreement-wrapper {
634
- ${e=>Fo(e)}
635
- max-height: 60vh;
636
- .eula-trigger {
637
- padding-right: 0;
638
- }
639
- .next-button {
640
- display: none;
641
- }
642
- }
643
-
644
- & .connect {
645
- background: white;
646
- }
647
- `,Op=qi,kp=e=>e.inStore&&At.isFreeBlocklet(e)===!1,Rp=e=>{var t;return[Ot.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Ot.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},Br=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===Ot.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Cp=e=>(e.environments||[]).some(t=>t.required),Bo=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Ip=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(c=>c.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},$o=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function ja({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:c,inDialog:p,selectedMeta:d,storeUrl:x,showResourcesSwitch:w,showFromUrl:s,enableRunBackground:a,showCategory:O}){var Qt,Zt,en,Ft,I,ut,tn,nn,l;const{t:b,locale:S}=pt(),[k,L]=N.useState(!1),[A,K]=N.useState(null),[U,ee]=N.useState(""),[j,W]=N.useState(""),{api:J,ws:{useSubscription:$},inService:le,info:me}=Cn(),{blocklet:ae,actions:{refreshBlocklet:ke}}=pr(),[Ue,Ye]=N.useState(null),[tt,Y]=N.useState(!1),he={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[q,Se]=N.useState(he),[re,ct]=N.useState(0),we=N.useRef({}),Je=N.useRef({}),We=N.useRef({}),Rt=Nt(h=>h.breakpoints.down("md")),Kt=Ya(),[Mt,Vt]=N.useState(!0),{meta:Ie}=we.current,_e=xs(Ie),je=h=>Se(y=>({...y,...h}));N.useEffect(()=>{if(q.pathPrefix){const{errMsg:h}=Yt({...q,pathPrefix:q.pathPrefix,locale:S});ee(h)}},[q.pathPrefix]),N.useEffect(()=>{re===0&&Se(he)},[re]);const ye=()=>{const h=Br(ae)??"";je({didSpaceEndpoint:h})},Ct=()=>{var h;return(h=we==null?void 0:we.current)!=null&&h.meta?At.getDisplayName(we.current):""},Gt=h=>{const y=R=>{je({installResultProps:{variant:"error",title:Ct(),subTitle:h,footer:i.jsx(at,{className:"bottom-button",disabled:R,"data-cy":"retry-install-component",onClick:async()=>{y(!0),await gn(we.current.installInput)},children:i.jsxs(Z,{display:"flex",alignItems:"center",children:[R&&i.jsx(ht,{size:16,style:{marginRight:8}}),b("common.retry")]})})}})};y()},Ht=h=>y=>{var R,_;(((R=y==null?void 0:y.meta)==null?void 0:R.did)||(y==null?void 0:y.meta))===((_=ae==null?void 0:ae.meta)==null?void 0:_.did)&&h(y)};$(Ot.BlockletEvents.statusChange,Ht(h=>{switch(h.status){case Ot.BlockletStatus.upgrading:je({installResultProps:{variant:"success",title:Ct(),subTitle:b("blocklet.component.installSuccessTip")}}),$o({componentDid:Kt.componentDid});break}const y=Br(ae);je(R=>({...R,didSpaceEndpoint:y}))}),[(Qt=ae==null?void 0:ae.meta)==null?void 0:Qt.did]),$(Ot.BlockletEvents.downloadFailed,Ht(()=>{Gt(b("blocklet.component.installComponentError"))}),[(Zt=ae==null?void 0:ae.meta)==null?void 0:Zt.did]),$(Ot.BlockletEvents.installFailed,Ht(()=>{Gt(b("blocklet.component.installComponentError"))}),[(en=ae==null?void 0:ae.meta)==null?void 0:en.did]);const ge=[],Xt=()=>{L(!1),Se({}),we.current={},e()},mn=h=>((ae==null?void 0:ae.children)||[]).find(y=>y.meta.did===h),gn=async h=>{var Et,Bt;const{pathPrefix:y,bundleDid:R,title:_,componentName:z="",componentDid:G=""}=q,ce=((Et=we.current)==null?void 0:Et.meta)||{},{configs:ie=[],registryUrl:Ae,inStore:Fe,inputUrl:Re,dist:De}=ce,Ge=(Bt=we.current)==null?void 0:Bt.downloadTokenList,He=Re||(Fe?to(Ae,R,De):"");L(!0);const vn={rootDid:ae.meta.did,url:He,mountPoint:y?Qn(y):`/${Qn(ce.title||ce.name)}`,title:_,name:z,did:G,onlyRequired:!Mt,...q.hasEnvironmentsStep&&ie.length>0?{configs:ie.map(nt=>({...nt,value:q.configsValue[nt.key]||""}))}:{},...Ge?{downloadTokenList:Ge}:{},...h};try{if(await J.installComponent({input:vn}),Ae){const{teamDid:nt,storeList:$t}=ss({fromBlocklet:le,nodeInfo:me,blocklet:ae}),{isNew:It,decoded:Ut}=Il(Ae,$t);It&&await J.addBlockletStore({input:{teamDid:nt,url:Ut}})}je({installResultProps:{}}),ke({showError:!1,attachRuntimeInfo:!1})}catch(nt){const $t=ds(nt);Zr.error($t),console.error("installComponent error: ",nt),Gt($t)}finally{L(!1),we.current.installInput=vn}},Yt=h=>{const y=tc({params:{...h,did:h.bundleDid},blocklets:[ae],blocklet:ae,locale:S});if(y){const R=mn(h.bundleDid),_=nc({params:{...h,did:h.bundleDid},blocklet:ae});if(R&&R.mountPoint===_)return{errMsg:""}}return{errMsg:y}},Qe=async h=>{var R,_;const{errMsg:y}=Yt({...q,locale:S});ee(y),re===ge.length-2&&await gn(h),(_=(R=Je.current)==null?void 0:R.setActiveStepByIndex)==null||_.call(R,z=>z+1)},bt=()=>{var h,y;(y=(h=Je.current)==null?void 0:h.setActiveStepByIndex)==null||y.call(h,R=>R-1)},xt=()=>{const{pathPrefix:h,bundleDid:y,title:R,componentName:_="",componentDid:z=""}=q,{meta:G={}}=we.current||{},{registryUrl:ce,inStore:ie,inputUrl:Ae,dist:Fe}=G,Re=ie?to(ce,y,Fe):Ae;Ye({meta:G,installOpts:{type:"component",rootDid:ae.meta.did,mountPoint:h,url:Re,title:R,name:_,did:z}})},ft=h=>{Y(!1),je({purchaseResultProps:{variant:"error",title:Ct(),subTitle:h,style:{paddingTop:120},footer:i.jsx(at,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{je({purchaseResultProps:{}})},children:b("common.retry")})}})},wt=({downloadTokenList:h})=>{we.current.downloadTokenList=h,Y(!1),Qe()},Ve=({chooseParams:h=we.current,componentDid:y,isInit:R=!1})=>{var Ut,_n,Pn,Yn;const{meta:_,registryUrl:z,inStore:G,inputUrl:ce}=h,{did:ie,title:Ae,name:Fe}=_,Re=(((Ut=ae.settings)==null?void 0:Ut.children)||[]).filter(rt=>rt.status==="deleted"&&rt.meta.bundleDid===ie),De=y||"",Ge=(_n=_.environments)==null?void 0:_n.map(rt=>{const{name:yn,validation:rn,...mt}=rt,bn={validation:vl(rn)?"":rn};return{...mt,key:yn,...bn}});we.current={...h,meta:{..._,configs:Ge,registryUrl:z,inStore:G,inputUrl:ce}};let He={};if(R){const rt=[ae],yn=Ge||[],rn=[],mt=ns(yl([...yn,...rn]),"key").filter(St=>!!St.key).sort((St,wn)=>St.required&&!wn.required?-1:wn.required&&!St.required?1:0),bn=At.getSharedConfigObj(rt[0],{configs:mt}),xn={},Jn=mt.map(St=>{const{default:wn,key:Te,...En}=St;return xn[Te]=bn[Te]||wn,{...En,key:Te,hidden:!!Ot.BLOCKLET_CONFIGURABLE_KEY[Te]}});He={...He,configsList:Jn,configsValue:xn,hasMissRequiredConfigs:Bo(Jn,xn)}}const vn=ae.children.some(rt=>rt.mountPoint==="/"),Et=Re.find(rt=>rt.meta.bundleDid===ie),Bt=ae.children.find(rt=>rt.meta.bundleDid===ie);He.title=Ae||"",Et?He={...He,pathPrefix:Et.mountPoint||"",componentName:Et.meta.name,hasEnvironmentsStep:!1}:Bt?He={...He,pathPrefix:Bt.mountPoint||"",componentName:Bt.meta.name,hasEnvironmentsStep:!1}:He={...He,pathPrefix:vn?`/${Qn(Ae)||Qn(Fe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Yn=(Pn=we.current.meta)==null?void 0:Pn.environments)==null?void 0:Yn.length)>0};const nt=kp(we.current.meta),$t=Rp(we.current.meta),It=Br(ae);je({bundleDid:ie,componentDid:De,...He,hasRequiredEnvironments:Cp(we.current.meta),requirePurchase:nt,didSpaceIsRequiredSetup:$t,didSpaceEndpoint:It}),R&&nt&&xt()};N.useEffect(()=>{!d||re!==0||!ae||(Ve({chooseParams:{blocklets:[d],meta:d,registryUrl:x||d.homepage,inStore:!0},isInit:!0}),je({showFromUrlDialog:!1}),Qe())},[d,re,ae]),ge.push({key:"selectComponent",name:b("blocklet.component.selectComponent"),body:i.jsxs(sn,{sx:{width:400},component:"div",children:[s&&q.showFromUrlDialog&&i.jsx(ki,{mode:"component",onCancel:()=>{je({showFromUrlDialog:!1})},onSuccess:({meta:h,inputUrl:y,inStore:R,registryUrl:_})=>{Ve({chooseParams:{meta:h,inputUrl:y,inStore:R,registryUrl:_},isInit:!0}),je({showFromUrlDialog:!1}),Qe()},handleText:{title:b("blocklet.component.addComponentTip.fromUrl"),confirm:b("blocklet.component.choose")}}),i.jsx(Li,{stores:n,extra:Qo.isInServerlessMode(me)?null:s?i.jsxs(at,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{je({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(ps,{style:{fontSize:20,marginRight:4}})," ",b("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:k,onChange:()=>{Se({}),we.current={}},storageKey:c,children:({currentRegistry:h})=>i.jsx(zi,{showResourcesSwitch:w,showCategory:O,serverVersion:me==null?void 0:me.version,style:Rt?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:h.url,resourceType:r,resourceDid:o,handleButtonClick:y=>{Ve({chooseParams:{...y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:y,defaultRender:R})=>{const _=(q==null?void 0:q.bundleDid)&&(q==null?void 0:q.bundleDid)===(y==null?void 0:y.did);return i.jsxs(Pp,{children:[_&&i.jsx("div",{className:"check-container",children:i.jsx(os,{className:"check-icon"})}),i.jsx("div",{className:_?"choose-blocklet":"",style:{marginLeft:16},children:R})]})}})})]}),cancel:t==="embed"?void 0:b("common.cancel"),confirm:Ip({params:q,blocklet:ae,t:b}),onCancel:Xt,onConfirm:()=>{Qe()}}),ge.push({key:"agreement",name:b("launchBlocklet.introduction"),body:i.jsxs(sn,{component:"div",className:"agreement-wrapper",children:[i.jsx(as,{title:b("launchBlocklet.introduction"),subTitle:b("blocklet.component.addComponentTip.introduction")}),i.jsx(ui,{meta:Ie,onClickNext:Qe,installRelated:Mt,onChangeInstallRelated:Vt,handleDescEle:i.jsx("p",{children:b("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:d?void 0:b("common.pre"),disabled:!_e,confirm:b(_e?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:d?Xt:bt,onConfirm:()=>{Y(!1),Qe()}}),Ie&&q.requirePurchase&&ge.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[b("common.verifyNFT"),i.jsx(Er,{})]}),body:i.jsxs(sn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((I=(Ft=We.current)==null?void 0:Ft.getCurrentStep)==null?void 0:I.call(Ft))===2||tt)&&i.jsx(nr,{title:b("common.verifyNFT"),subTitle:b("blocklet.component.addComponentTip.verifyNFT")}),Un(q.purchaseResultProps)?Ue&&i.jsx(Kd,{ref:We,meta:Ue.meta,mode:q.componentDid?"verify":"both",onCancel:ft,installOpts:Ue.installOpts,handlePaySuccess:wt}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(no,{...q.purchaseResultProps})})]}),disabled:((tn=(ut=We.current)==null?void 0:ut.getCurrentStep)==null?void 0:tn.call(ut))===2||tt,cancel:b("common.pre"),confirm:b("common.next"),onConfirm:()=>{typeof We.current.onNext=="function"&&(We.current.onNext(),Y(!0))},onCancel:()=>{bt()}}),At.hasStartEngine(Ie)&&Rl.hasMountPoint(Ie)?ge.push({key:"config",name:b("common.config"),error:U,body:i.jsxs(sn,{component:"div",children:[i.jsx(nr,{title:b("common.config"),subTitle:b("blocklet.component.addComponentTip.config")}),i.jsx(lr,{label:b("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||b("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:q.pathPrefix,onChange:h=>{const y=h.target.value;je({pathPrefix:y}),W(b("common.slugifyHint",{value:Cl(y)}))}}),!!U&&i.jsx(Vo,{severity:"error",style:{width:"100%",marginTop:8},children:U})]}),cancel:b("common.pre"),confirm:b("common.next"),onCancel:bt,onConfirm:()=>{Qe()}}):Ie&&(q.pathPrefix=((l=(nn=Ie.interfaces)==null?void 0:nn[0])==null?void 0:l.path)||`/${Ie.did}`),Ie&&(q!=null&&q.hasEnvironmentsStep)&&ge.push({key:"environment",name:i.jsxs(i.Fragment,{children:[b("common.environment")," ",q.hasRequiredEnvironments&&i.jsx(Er,{})]}),disabled:!!A||(q==null?void 0:q.hasMissRequiredConfigs),body:()=>i.jsxs(sn,{component:"div",style:{overflowY:"auto"},children:[i.jsx(nr,{title:b("common.environment"),subTitle:b("blocklet.component.addComponentTip.environment")}),i.jsx(Ll,{style:{marginTop:-12,width:"100%"},schema:q.configsList,defaultValue:q.configsValue,onChange:(h,{action:y,currentItem:R,allValues:_})=>{y==="confirm"&&je({hasMissRequiredConfigs:Bo(q.configsList,_),configsValue:_}),y==="edit"?K(R):["cancel","confirm"].includes(y)&&K(null)}})]}),cancel:b("common.pre"),confirm:b("common.next"),onCancel:bt,onConfirm:Qe}),Ie&&(q!=null&&q.didSpaceIsRequiredSetup)&&ge.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[b("blocklet.component.didSpaceConfig")," ",q.didSpaceIsRequiredSetup==="required"&&i.jsx(Er,{})]}),disabled:(q==null?void 0:q.didSpaceIsRequiredSetup)&&!q.didSpaceEndpoint,body:()=>i.jsx(Pl,{children:i.jsxs(sn,{component:"div",children:[i.jsx(nr,{title:b("blocklet.component.didSpaceConfig"),subTitle:b("blocklet.component.didSpaceConfigTip")}),i.jsx(Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx(Pi,{blockletMeta:we.current.meta,onNext:()=>{Qe()},onEndpointUpdate:ye})})]})}),cancel:b("common.pre"),confirm:b("common.next"),onCancel:bt,onConfirm:Qe}),ge.push({key:"install",name:mn(Ie==null?void 0:Ie.did)?b("common.upgrade"):b("common.install"),disabled:a?!1:Un(q.installResultProps),loading:a?!1:Un(q.installResultProps),body:i.jsx(sn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Un(q.installResultProps)?i.jsx(ml,{message:i.jsx(Lp,{children:b(a?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(no,{...q.installResultProps})})}),confirm:b("common.complete"),onConfirm:()=>{$o({timeout:0,componentDid:Kt.componentDid,manual:!0}),Xt(),setTimeout(()=>{const h=document.getElementsByClassName("dashboard-main")[0];h&&(h.scrollTop=h.scrollHeight)},200)}});const Ne=ge[re]||{},Jt=()=>k||Ne.error||!q.bundleDid?!0:re>1?!q.pathPrefix:!1;return ae?i.jsxs(_p,{sx:{width:"100%",height:Rt?window.innerHeight:p?"72vh":"100vh"},children:[i.jsx(gl,{steps:ge,mode:"memory",children:i.jsx(Op,{ref:Je,meta:Ie,isMobile:Rt,onStepChange:h=>{ct(h)}})}),i.jsxs(Z,{className:"action-bar",children:[Ne.cancel&&i.jsx(at,{onClick:h=>{h.stopPropagation(),Ne.onCancel()},disabled:re===ge.length-2&&k,color:"inherit",children:Ne.cancel||b("common.cancel")}),Ne.confirm&&i.jsx(at,{onClick:h=>{h.stopPropagation(),Ne.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:k||(typeof Ne.disabled=="boolean"?Ne.disabled:Jt()),variant:"contained",autoFocus:!0,title:Ne.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(Z,{display:"flex",alignItems:"center",children:[(typeof Ne.loading=="boolean"?Ne.loading:k)&&i.jsx(ht,{style:{marginRight:8},size:16}),Ne.confirm]})})]})]}):null}ja.propTypes={onClose:P.func,mode:P.oneOf(["normal","embed"]),inDialog:P.bool,stores:P.arrayOf(P.string),storeUrl:P.string,resourceType:P.string,resourceDid:P.string,storageKey:P.string,selectedMeta:P.object,showResourcesSwitch:P.bool,showFromUrl:P.bool,enableRunBackground:P.bool,showCategory:P.bool};ja.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const _p=Ke(Z)`
648
- .action-bar {
649
- display: flex;
650
- justify-content: flex-end;
651
- position: sticky;
652
- bottom: 0;
653
- padding-top: 16px;
654
- z-index: 100;
655
- width: 100%;
656
- background: #fff;
657
- border-top: 1px solid #eee;
658
- }
659
- `,sn=Ke(pe)`
660
- width: 100%;
661
- height: 100%;
662
- `,nr=Ke(as)`
663
- margin-bottom: 24px;
664
- `,Pp=Ke.div`
665
- position: relative;
666
-
667
- .choose-blocklet {
668
- background-color: rgb(236, 251, 253);
669
- border-color: rgb(236, 251, 253);
670
- border-radius: 8px;
671
- }
672
-
673
- .check-container {
674
- position: absolute;
675
- right: 0;
676
- bottom: 0;
677
- display: flex;
678
- justify-content: flex-end;
679
- align-items: flex-end;
680
- width: 30px;
681
- height: 30px;
682
- border-radius: 0 0 8px 0;
683
- color: ${e=>e.theme.palette.common.white};
684
- overflow: hidden;
685
- transition: all ease 0.3s;
686
- &:after {
687
- position: absolute;
688
- z-index: 0;
689
- display: block;
690
- width: 0;
691
- height: 0;
692
- border-top: transparent solid 15px;
693
- border-left: transparent solid 15px;
694
- border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
695
- border-right: ${e=>e.theme.palette.primary.main} solid 15px;
696
- transition: all ease 0.1s;
697
- content: '';
698
- }
699
-
700
- .check-icon {
701
- position: relative;
702
- z-index: 2;
703
- margin: 0 1px 1px 0;
704
- font-size: 16px;
705
- transition: all ease 0.2s;
706
- }
707
- }
708
- `,Lp=Ke.div`
709
- color: ${e=>e.theme.palette.primary.main};
710
- .msg-before {
711
- display: inline-block;
712
- color: #aaa;
713
- font-size: 14px;
714
- margin-right: 6px;
715
- }
716
- `;export{ja as A,na as B,df as S,cf as a,uf as b,ps as d,ws as f};