@abtnode/webapp 1.16.49-beta-20250829-075052-2563fcb3 → 1.16.49

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 (187) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-DEjpOuYM.js → AdapterDayjs-DimT2cks.js} +1 -1
  4. package/dist/assets/{Add-ZXw0xLrb.js → Add-B2ZDVqat.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DTUdke6O.js +1 -0
  6. package/dist/assets/{Autocomplete-CK-9Ss3q.js → Autocomplete-B6hdnAbf.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-TCiC4Qkr.js → Breadcrumbs-C0NyAgW3.js} +1 -1
  8. package/dist/assets/{ButtonGroup-QoT5b0rj.js → ButtonGroup-BxZjrpDd.js} +1 -1
  9. package/dist/assets/{CSSTransition-Cjz4QCFv.js → CSSTransition-D9w1WbTD.js} +1 -1
  10. package/dist/assets/{CallMerge-Bn5ZQujz.js → CallMerge-CT9kGdYw.js} +1 -1
  11. package/dist/assets/{CardContent-NiCok_GZ.js → CardContent-DZQbbzze.js} +1 -1
  12. package/dist/assets/{ChevronLeft-WevXcbvT.js → ChevronLeft-C1WpAw9J.js} +1 -1
  13. package/dist/assets/{ChevronRight-DAJ57fQY.js → ChevronRight-BHex1y5g.js} +1 -1
  14. package/dist/assets/{Clear-BMrit09h.js → Clear-CY2XI9UL.js} +1 -1
  15. package/dist/assets/{DeleteOutline-B_ebn78a.js → DeleteOutline-DCwd4zu5.js} +1 -1
  16. package/dist/assets/{Done-BssJlxXF.js → Done-DvjnHsf4.js} +1 -1
  17. package/dist/assets/{Edit-DvJ7niyi.js → Edit-CQvdC-gs.js} +1 -1
  18. package/dist/assets/{ErrorOutline-keam6I0v.js → ErrorOutline-3x65gte5.js} +1 -1
  19. package/dist/assets/{FilterList-BpQVWjO7.js → FilterList-C7CgIPm8.js} +1 -1
  20. package/dist/assets/{Google-CuTp6K5l.js → Google-Bli8mQj2.js} +1 -1
  21. package/dist/assets/{HelpOutline-c9xWNXYj.js → HelpOutline-DK_qkp2M.js} +1 -1
  22. package/dist/assets/{Launch-C19ynGFM.js → Launch-Cazur-Fl.js} +1 -1
  23. package/dist/assets/{Link-OosiOUml.js → Link-B32ARgrh.js} +1 -1
  24. package/dist/assets/{ListItemButton-D3mT9pyo.js → ListItemButton-BOWa6EsK.js} +1 -1
  25. package/dist/assets/{ListSubheader-JaIza3kA.js → ListSubheader-59vUoVIT.js} +1 -1
  26. package/dist/assets/{LoadingButton-Bu-RMxo0.js → LoadingButton-ClNP4uj0.js} +1 -1
  27. package/dist/assets/{MoreVert-DCZ34SEU.js → MoreVert-Dnv5meLi.js} +1 -1
  28. package/dist/assets/{OpenInNew-qPio7v19.js → OpenInNew-CVZ7jhVw.js} +1 -1
  29. package/dist/assets/{Refresh-KVD21gJ3.js → Refresh-BU7QWHYu.js} +1 -1
  30. package/dist/assets/{Search-Bu66uiUL.js → Search-CviyP5PC.js} +1 -1
  31. package/dist/assets/{Slider-SLDVySsH.js → Slider-DEcPJiVm.js} +1 -1
  32. package/dist/assets/{Stepper-D9KKzkTp.js → Stepper-BXOkpPZl.js} +1 -1
  33. package/dist/assets/{Switch-D1I5dz3C.js → Switch-C_vix7qp.js} +1 -1
  34. package/dist/assets/{TableSearch-MDaph9_3.js → TableSearch-Dsfp_XUr.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-CLtFaWIk.js → ToggleButtonGroup-BRuEkEDq.js} +1 -1
  36. package/dist/assets/{Verified-CEUKiCvL.js → Verified-C1OHOKpp.js} +1 -1
  37. package/dist/assets/{VerifiedUser-CHrqY4DV.js → VerifiedUser-C0M9SrH7.js} +1 -1
  38. package/dist/assets/{ViewList-CKoaOL8s.js → ViewList-_seGVlfH.js} +1 -1
  39. package/dist/assets/{_createAggregator-YIpAp9ni.js → _createAggregator-s6UGbWKk.js} +1 -1
  40. package/dist/assets/{actions-CyCFMA6d.js → actions-BTM30cO2.js} +1 -1
  41. package/dist/assets/{actions-Fl5IcNig.js → actions-DaFcSF4Q.js} +1 -1
  42. package/dist/assets/{agreement-DlFMZUIl.js → agreement-DSL1Z9Z4.js} +1 -1
  43. package/dist/assets/api-BDClPnhH.js +1 -0
  44. package/dist/assets/{appearance-BliwBII_.js → appearance-B5Fxj0pt.js} +1 -1
  45. package/dist/assets/{audit-logs-Dt3Zm8Yo.js → audit-logs-DfhTX_zm.js} +1 -1
  46. package/dist/assets/{base-chart-Cgo222Iz.js → base-chart-CUBovNRp.js} +1 -1
  47. package/dist/assets/{blocklet-By8mMht1.js → blocklet-Clk0KDdY.js} +1 -1
  48. package/dist/assets/{chain-3qQXGmRA.js → chain-Bpi260c_.js} +1 -1
  49. package/dist/assets/{click-to-copy-BTxnhIi6.js → click-to-copy-BZWirPDQ.js} +1 -1
  50. package/dist/assets/client-BeAJe0yS.js +1 -0
  51. package/dist/assets/cloneDeep-BPw0K7hq.js +1 -0
  52. package/dist/assets/{collapse-Te61TlLa.js → collapse-BOYOLC_4.js} +1 -1
  53. package/dist/assets/{config-navigation-CK3bpGBt.js → config-navigation-BEIEFUiN.js} +46 -46
  54. package/dist/assets/connect-to-CKfgySWf.js +30 -0
  55. package/dist/assets/{cssMode-CjZUDAr9.js → cssMode-B5RVclx-.js} +1 -1
  56. package/dist/assets/{delete-confirm-B7t36usI.js → delete-confirm-BrhseXop.js} +1 -1
  57. package/dist/assets/{depsEqual-BvgcJ7Lu.js → depsEqual-msOq5b5x.js} +1 -1
  58. package/dist/assets/{detail-6E-dkGL-.js → detail-BlLW7YjN.js} +3 -3
  59. package/dist/assets/{domains-B_IwXIbE.js → domains-C_4AnOp5.js} +1 -1
  60. package/dist/assets/{download-BGGdBoo-.js → download-DY09iblB.js} +1 -1
  61. package/dist/assets/{edit.svg-C_SspFrp.js → edit.svg-D-BTMQSd.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-B-0g7s2E.js +1 -0
  63. package/dist/assets/engine-CjGipQ8H.js +1 -0
  64. package/dist/assets/{freemarker2-W5A6lREg.js → freemarker2-qOqeJDqa.js} +1 -1
  65. package/dist/assets/{get-safe-url-Ddlf6-ls.js → get-safe-url-0GDhhKMb.js} +1 -1
  66. package/dist/assets/getValidReactChildren-CS8vN0Dc.js +1 -0
  67. package/dist/assets/{graphqlMode-Dc1_ukwq.js → graphqlMode-K6gJ3gBf.js} +2 -2
  68. package/dist/assets/{handlebars-CVB3APXr.js → handlebars-CpCfM6TO.js} +1 -1
  69. package/dist/assets/{html-JqjfPaeH.js → html-fUKduY5C.js} +1 -1
  70. package/dist/assets/{html-title-Bzc9ddB_.js → html-title-HtPlSvGf.js} +1 -1
  71. package/dist/assets/{htmlMode-BU01m9PW.js → htmlMode-B-5GmxUH.js} +1 -1
  72. package/dist/assets/{iframe-toMt-kqs.js → iframe-CiaMOw3l.js} +1 -1
  73. package/dist/assets/{index-Ba-NPtma.js → index--IDE3zqS.js} +1 -1
  74. package/dist/assets/{index-B6-mWTPF.js → index-31DGwfk5.js} +4 -4
  75. package/dist/assets/{index-B6fAmfbh.js → index-B09qWXEi.js} +1 -1
  76. package/dist/assets/{index-BF3lDsjk.js → index-B58pv6JK.js} +1 -1
  77. package/dist/assets/{index-DQfEOUZ1.js → index-BCDhEJAj.js} +1 -1
  78. package/dist/assets/{index-Y3OPWyRK.js → index-BMlarUaU.js} +1 -1
  79. package/dist/assets/{index-Ga4GQQwB.js → index-BQl82i43.js} +1 -1
  80. package/dist/assets/{index-0wnayxHS.js → index-BVwfeTfE.js} +1 -1
  81. package/dist/assets/{index-DTA3-trG.js → index-BcMFt6jn.js} +3 -3
  82. package/dist/assets/{index-BpslFkWB.js → index-BcVAgGLo.js} +1 -1
  83. package/dist/assets/{index-cyH3qxmb.js → index-BhIGrRjA.js} +1 -1
  84. package/dist/assets/{index-sVwZa-Us.js → index-BniP3-Ka.js} +2 -2
  85. package/dist/assets/{index-CXToIdzn.js → index-BuNutR9F.js} +1 -1
  86. package/dist/assets/{index-Dg5xaFaR.js → index-Bz1WmE2z.js} +1 -1
  87. package/dist/assets/index-C0cmjlmK.js +363 -0
  88. package/dist/assets/{index-CPzdonhn.js → index-C21lcN-6.js} +3 -3
  89. package/dist/assets/{index-cJ8mqL4n.js → index-CB3gF2be.js} +1 -1
  90. package/dist/assets/{index-RR0ylab2.js → index-CB6io54J.js} +1 -1
  91. package/dist/assets/{index-CTSgdYTQ.js → index-CEcRkbK_.js} +1 -1
  92. package/dist/assets/{index-W_FxxPkG.js → index-C_Fk7Rzr.js} +1 -1
  93. package/dist/assets/{index-BfnW7izn.js → index-C_i8vZPM.js} +1 -1
  94. package/dist/assets/{index-CEs-_h3p.js → index-Cp668Jsm.js} +471 -468
  95. package/dist/assets/{index-aaIwkeLh.js → index-Cs7boeoz.js} +1 -1
  96. package/dist/assets/{index-BFArq4QY.js → index-CwANiKOk.js} +1 -1
  97. package/dist/assets/{index-CfKAChZk.js → index-D1AKo-x3.js} +1 -1
  98. package/dist/assets/{index-DkZuQt-p.js → index-DCr9iA79.js} +1 -1
  99. package/dist/assets/{index-D0yM2V0B.js → index-DGDwJTNO.js} +1 -1
  100. package/dist/assets/{index-BRFV_6XG.js → index-DLs4lvkb.js} +1 -1
  101. package/dist/assets/{index-Bb_IBo4s.js → index-DMSf9VmZ.js} +1 -1
  102. package/dist/assets/{index-Aruj3q0j.js → index-DNBJ_q-W.js} +1 -1
  103. package/dist/assets/index-DWCHUGMU.js +1 -0
  104. package/dist/assets/{index-DDa-PgAC.js → index-De5Caszn.js} +1 -1
  105. package/dist/assets/{index-BOoA_8JB.js → index-DiVM7PAR.js} +1 -1
  106. package/dist/assets/{index-8IOOvVIH.js → index-Dm676q-V.js} +1 -1
  107. package/dist/assets/{index-9QWNsjgH.js → index-N8fONOxR.js} +9 -9
  108. package/dist/assets/{index-wXVKNPUK.js → index-NeEbDyYj.js} +1 -1
  109. package/dist/assets/{index-BLjRs6Ba.js → index-QEEYyfjs.js} +1 -1
  110. package/dist/assets/{index-0QY3J8oX.js → index-Rr_K0vXu.js} +1 -1
  111. package/dist/assets/{index-DJvxZ00R.js → index-daIR3ecn.js} +2 -2
  112. package/dist/assets/{index-0IGVpdYK.js → index-k6Jydhg7.js} +1 -1
  113. package/dist/assets/{index-DWcByat0.js → index-n4_kY89C.js} +1 -1
  114. package/dist/assets/{index-BReYGikN.js → index-nbCQMVdu.js} +1 -1
  115. package/dist/assets/{index-40xZF0CX.js → index-sz3uFV7b.js} +1 -1
  116. package/dist/assets/{index-Onb6C8Vx.js → index-tE5HA0JS.js} +1 -1
  117. package/dist/assets/{index-MedijPFp.js → index-wdj0FEUp.js} +3 -3
  118. package/dist/assets/{index.esm-BUUAAL09.js → index.esm-BWXMXe80.js} +1 -1
  119. package/dist/assets/{install-from-url-CGq8j4wF.js → install-from-url-CvXm7zrQ.js} +1 -1
  120. package/dist/assets/{invitation-vC0PSQ_r.js → invitation-Bbd0EUPN.js} +1 -1
  121. package/dist/assets/{is-path-prefix-equal-BEgzcrKA.js → is-path-prefix-equal-9dPZdPqq.js} +1 -1
  122. package/dist/assets/{item-BkJpv1Bb.js → item-Czk-LxVv.js} +1 -1
  123. package/dist/assets/{javascript-CGqww4TO.js → javascript-Df4-_tCH.js} +1 -1
  124. package/dist/assets/{jsonMode-CPjnv_mU.js → jsonMode-lPvmVuEc.js} +1 -1
  125. package/dist/assets/{liquid-BUJogEZ3.js → liquid-iErrkmsS.js} +1 -1
  126. package/dist/assets/{list-header-CC4bqg_J.js → list-header-D9Jtipco.js} +1 -1
  127. package/dist/assets/{log-DgeUtrB_.js → log-D_Iy4G-2.js} +1 -1
  128. package/dist/assets/{lottie-react.esm-cJsgfzzd.js → lottie-react.esm-CLF_w70g.js} +1 -1
  129. package/dist/assets/{mdx-4nWtXnPd.js → mdx-CpiXAgeN.js} +1 -1
  130. package/dist/assets/{memory-D5iAd2IO.js → memory-0tMnFTeS.js} +1 -1
  131. package/dist/assets/{metric-DJsad5Cf.js → metric-Blz-YEnp.js} +1 -1
  132. package/dist/assets/omit-kqOgzbK4.js +1 -0
  133. package/dist/assets/{overview-DKy33514.js → overview-DQoppCkb.js} +1 -1
  134. package/dist/assets/{permission-9QXWzXg1.js → permission-Dq4G1Nhn.js} +1 -1
  135. package/dist/assets/{preference-DHg_HxRj.js → preference-5drfcglD.js} +3 -3
  136. package/dist/assets/{python-D4feWuz2.js → python-DXxIcyYN.js} +1 -1
  137. package/dist/assets/{raf-schd.esm-BrPOppB7.js → raf-schd.esm-le4x5qzb.js} +1 -1
  138. package/dist/assets/{razor-L3ctEfp9.js → razor-DEo7ceFX.js} +1 -1
  139. package/dist/assets/{rotate-session-key-CA9ENqfL.js → rotate-session-key-omld1AuK.js} +1 -1
  140. package/dist/assets/{runtime-BGqVXEzJ.js → runtime-myPRlwBo.js} +1 -1
  141. package/dist/assets/schema-B6D_WZyG.js +1 -0
  142. package/dist/assets/sdk-BbOdEeFV.js +1 -0
  143. package/dist/assets/{service-BmVdIXDk.js → service-M1mmil55.js} +1 -1
  144. package/dist/assets/{shorten-label-9dGUasPc.js → shorten-label-Dwsld825.js} +1 -1
  145. package/dist/assets/{simple-select-D22jL4Z4.js → simple-select-C7PnNUpe.js} +1 -1
  146. package/dist/assets/{spaces-CrjBCgnE.js → spaces-Dz6osU8D.js} +1 -1
  147. package/dist/assets/{status-DJy3aS5P.js → status-DC_uFdhU.js} +1 -1
  148. package/dist/assets/{status-DXxPNVJi.js → status-Dk7whVRe.js} +1 -1
  149. package/dist/assets/{switch-control-vwKpD-hx.js → switch-control-Dg5zSUdo.js} +1 -1
  150. package/dist/assets/{table-icons-BNwdYNHR.js → table-icons-jOs3s3dQ.js} +1 -1
  151. package/dist/assets/{team-DRiDufJD.js → team-D3LeaCxJ.js} +1 -1
  152. package/dist/assets/{toLower-Bx5_jlnW.js → toLower-D7KlZyXh.js} +1 -1
  153. package/dist/assets/toUpper-j7Or1KIp.js +1 -0
  154. package/dist/assets/{traffic-CAjpS6xG.js → traffic-Dh32_ebe.js} +1 -1
  155. package/dist/assets/{tsMode-Co-fr-VC.js → tsMode-BXE5NTFR.js} +1 -1
  156. package/dist/assets/{typescript-pLJSjS9f.js → typescript-Cyw-SWET.js} +1 -1
  157. package/dist/assets/{url-evaluation-Dx7Up5AZ.js → url-evaluation-ZlHZwvb8.js} +1 -1
  158. package/dist/assets/{url-join-BdgYWkAo.js → url-join-BaK21hdG.js} +1 -1
  159. package/dist/assets/{use-mobile-Bfe2NQYE.js → use-mobile-DmPwZVyR.js} +1 -1
  160. package/dist/assets/{use-mobile-CfF2Dwfb.js → use-mobile-fb1R4sTD.js} +1 -1
  161. package/dist/assets/{useAsync-Cx9qmI1n.js → useAsync-mK5hkfXk.js} +1 -1
  162. package/dist/assets/{useAsyncRetry-BCDpfxkE.js → useAsyncRetry-Bz9aJRiB.js} +1 -1
  163. package/dist/assets/{useLocalStorage-ZXHKUuQ3.js → useLocalStorage-D39oHiv_.js} +1 -1
  164. package/dist/assets/{useThemeProps-CgnjFBCx.js → useThemeProps-CEesX7e5.js} +1 -1
  165. package/dist/assets/{util-BDHNyUKP.js → util-B3o9CH5x.js} +1 -1
  166. package/dist/assets/{wait-container-CtaPbMQB.js → wait-container-Cq-OhUMI.js} +1 -1
  167. package/dist/assets/{without-wallet-BGmbjqUT.js → without-wallet-BK9y4GG-.js} +1 -1
  168. package/dist/assets/{wrap-locale-FW1OiiQu.js → wrap-locale-BDWmzfGR.js} +1 -1
  169. package/dist/assets/{xml-tX57m6nM.js → xml-C7AOEa-o.js} +1 -1
  170. package/dist/assets/{yaml-fstMoHtX.js → yaml-D87QX20d.js} +1 -1
  171. package/dist/index.html +1 -1
  172. package/dist/service-worker.js +1 -1
  173. package/package.json +1 -1
  174. package/dist/assets/ArrowDropDown-S7J75cd9.js +0 -1
  175. package/dist/assets/api-1uVGKylc.js +0 -1
  176. package/dist/assets/client-powqd2q0.js +0 -1
  177. package/dist/assets/cloneDeep-Cj2I-3EJ.js +0 -1
  178. package/dist/assets/connect-to-gjBtyZwF.js +0 -29
  179. package/dist/assets/emotion-cache.browser.esm-CN4wN0Q-.js +0 -1
  180. package/dist/assets/engine-CifWoWKx.js +0 -1
  181. package/dist/assets/getValidReactChildren-Y4g3roaS.js +0 -1
  182. package/dist/assets/index-C6jlNrOG.js +0 -363
  183. package/dist/assets/index-Crk_Rkot.js +0 -1
  184. package/dist/assets/omit-BQvRKGhV.js +0 -1
  185. package/dist/assets/schema-Bwrwlo2F.js +0 -1
  186. package/dist/assets/sdk-BASq25ZU.js +0 -1
  187. package/dist/assets/toUpper-CPtDcnc2.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-0IGVpdYK.js","./index-CEs-_h3p.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
- import{r as d,cs as z,c0 as U,ct as F,cu as X,aG as H,j as t,s as _,o as j,F as V,aP as B,g as G,cv as O,w as D,N as p,cw as J,W as Q,v as L,b7 as q,T as I,cx as M,L as K,cy as Y,bE as Z,cz as ee,cA as te,u as se,x as ae,bw as oe,ar as ne,af as re}from"./index-CEs-_h3p.js";import{V as ie}from"./ViewList-CKoaOL8s.js";import{D as ce}from"./Done-BssJlxXF.js";import{N as le}from"./index-Onb6C8Vx.js";import{w as pe}from"./wrap-locale-FW1OiiQu.js";import{g as de}from"./get-safe-url-Ddlf6-ls.js";import{S as ue,a as me,b as he}from"./Stepper-D9KKzkTp.js";import"./emotion-cache.browser.esm-CN4wN0Q-.js";var P=function(e){if(!e)return 0;var r=X(e).valueOf()-Date.now();return r<0?0:r},fe=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},xe=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,u=r.interval,b=u===void 0?1e3:u,x=r.onEnd,g=d.useMemo(function(){return z(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,h=U(d.useState(function(){return P(a)}),2),f=h[0],m=h[1],o=F(x);d.useEffect(function(){if(!a){m(0);return}m(P(a));var v=setInterval(function(){var n,c=P(a);m(c),c===0&&(clearInterval(v),(n=o.current)===null||n===void 0||n.call(o))},b);return function(){return clearInterval(v)}},[a,b]);var w=d.useMemo(function(){return fe(f)},[f]);return[f,w]};const ge=H(t.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}));function E({list:e=[],width:r=300,height:l=400,cardSpace:i=40,onSelect:u=()=>{},defaultIndex:b=0}){const[x,g]=d.useState(0),[a,h]=d.useState(0),f=d.useRef(null),m=n=>{if(n<0||n>e.length-1)return;g(n);const c=f.current.clientWidth;h(n*(r+i)-(c-r)/2+i*.5),u(n)};d.useEffect(()=>{m(b);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const w=n=>{o=n.touches[0].clientX},v=n=>{const c=n.changedTouches[0],k=o-c.clientX;Math.abs(k)>60&&(k>0?m(x+1):m(x-1))};return t.jsx(ve,{ref:f,onTouchStart:w,onTouchEnd:v,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((n,c)=>t.jsx("div",{className:`card-item ${c===x?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>m(c),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(le,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const ve=_.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-k6Jydhg7.js","./index-Cp668Jsm.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
+ import{r as d,cs as z,c0 as U,ct as F,cu as X,aG as H,j as t,s as _,o as j,F as V,aP as B,g as G,cv as O,w as D,N as p,cw as J,W as Q,v as L,b7 as q,T as I,cx as M,L as K,cy as Y,bE as Z,cz as ee,cA as te,u as se,x as ae,bw as oe,ar as ne,af as re}from"./index-Cp668Jsm.js";import{V as ie}from"./ViewList-_seGVlfH.js";import{D as ce}from"./Done-DvjnHsf4.js";import{N as le}from"./index-tE5HA0JS.js";import{w as pe}from"./wrap-locale-BDWmzfGR.js";import{g as de}from"./get-safe-url-0GDhhKMb.js";import{S as ue,a as me,b as he}from"./Stepper-BXOkpPZl.js";import"./emotion-cache.browser.esm-B-0g7s2E.js";var P=function(e){if(!e)return 0;var r=X(e).valueOf()-Date.now();return r<0?0:r},fe=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},xe=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,u=r.interval,b=u===void 0?1e3:u,x=r.onEnd,g=d.useMemo(function(){return z(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,h=U(d.useState(function(){return P(a)}),2),f=h[0],m=h[1],o=F(x);d.useEffect(function(){if(!a){m(0);return}m(P(a));var v=setInterval(function(){var n,c=P(a);m(c),c===0&&(clearInterval(v),(n=o.current)===null||n===void 0||n.call(o))},b);return function(){return clearInterval(v)}},[a,b]);var w=d.useMemo(function(){return fe(f)},[f]);return[f,w]};const ge=H(t.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}));function E({list:e=[],width:r=300,height:l=400,cardSpace:i=40,onSelect:u=()=>{},defaultIndex:b=0}){const[x,g]=d.useState(0),[a,h]=d.useState(0),f=d.useRef(null),m=n=>{if(n<0||n>e.length-1)return;g(n);const c=f.current.clientWidth;h(n*(r+i)-(c-r)/2+i*.5),u(n)};d.useEffect(()=>{m(b);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const w=n=>{o=n.touches[0].clientX},v=n=>{const c=n.changedTouches[0],k=o-c.clientX;Math.abs(k)>60&&(k>0?m(x+1):m(x-1))};return t.jsx(ve,{ref:f,onTouchStart:w,onTouchEnd:v,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((n,c)=>t.jsx("div",{className:`card-item ${c===x?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>m(c),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(le,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const ve=_.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -33,7 +33,7 @@ import{r as d,cs as z,c0 as U,ct as F,cu as X,aG as H,j as t,s as _,o as j,F as
33
33
  }
34
34
  }
35
35
  }
36
- `;E.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};function be({icon:e,active:r,completed:l}){const i={1:t.jsx(ie,{className:"step-icon"}),2:t.jsx(ge,{className:"step-icon"}),3:t.jsx(ce,{className:"step-icon"})},u=["step-icon-w"];return r&&u.push("step-icon-w--active"),l&&u.push("step-icon-w--completed"),t.jsx("div",{className:u.join(" "),children:i[String(e)]})}function we({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:u,teamDid:b}){const{api:x}=d.useContext(e),g=V(s=>s.breakpoints.down("sm")),a=B({user:null,passport:null,success:!1,activeStep:0}),h=d.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:m}=Y(),{t:o,locale:w}=d.useContext(G),{wallet:v}=O(),[n,c]=d.useState(0),{searchParams:k}=new URL(window.location.href),S=()=>{a.activeStep++},$=s=>{a.user=s.user},W=()=>{S()},A=(s,y)=>{s?.passportId&&f(s.passportId),s?.sessionToken&&(h.current.sessionToken=y(s.sessionToken)),s?.refreshToken&&(h.current.refreshToken=y(s.refreshToken)),a.success=!0,S()},T=async()=>{if(v&&M()){Z(()=>import("./index-0IGVpdYK.js").then(y=>y.i),__vite__mapDeps([0,1,2]),import.meta.url).then(y=>{y.call("arcClosePage")});return}ee(u)&&u({sessionToken:h.current.sessionToken,refreshToken:h.current.refreshToken});const s=k.get("redirect");if(s){window.location.replace(de(s));return}m(),window.location.replace("/")},R=s=>{a.passport=s.target.value},[C]=xe({leftTime:n,onEnd:()=>{T()}}),N=[{label:o("lostPassport.recoverPassport"),content:()=>{if(!a.user){const s=k.get("scope")||"passport";return t.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:$,locale:w,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")},extraParams:{scope:s}})}return t.jsxs(p,{className:"select-passport",children:[t.jsxs(p,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[t.jsx(J,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),t.jsxs(p,{children:[t.jsx(p,{className:"name",children:a.user.fullName}),t.jsx(p,{className:"did",sx:{mt:1},children:t.jsx(Q,{responsive:!g,compact:g,did:a.user.did})})]})]}),t.jsx(p,{children:t.jsx(E,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(s=>({src:l({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer.name,issuerDid:s.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:s.scope==="kyc"?{key:"Email",value:s.name}:void 0}),name:s.title,id:s.id,display:s.display})),onSelect:s=>R({target:{value:a.user.passportTypes[s].id}}),defaultIndex:0})}),t.jsx(p,{sx:{textAlign:"center"},children:t.jsx(L,{variant:"contained",color:"primary",onClick:()=>W(),disabled:!a.passport,children:o("common.next")})})]})}},{label:o("lostPassport.receivePassport"),content:()=>{const s={receiverDid:a.user.did,passportId:a.passport,teamDid:b||window?.blocklet?.did};return t.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:A,forceConnected:!1,locale:w,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:s})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),t.jsxs(p,{sx:{textAlign:"center"},children:[t.jsx(p,{sx:{mb:3,color:"success.main"},children:t.jsx(q,{style:{fontSize:60}})}),t.jsx(I,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),t.jsx(I,{component:"p",variant:"body2",color:"gray",children:v&&M()?o("issuePassport.dialog.autoClose",{seconds:Math.round(C/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(C/1e3)})}),t.jsx(L,{style:{marginTop:40},variant:"contained",color:"primary",onClick:T,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return t.jsx(ye,{children:t.jsxs(p,{className:"stepper",children:[t.jsx(ue,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:N.map(({label:s})=>t.jsx(me,{children:t.jsx(he,{slots:{stepIcon:be},children:s})},s))}),t.jsx(p,{className:"stepper-content",children:N[a.activeStep].content()}),!a.success&&t.jsx(p,{sx:{textAlign:"center",fontSize:12},children:t.jsx(K,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const ye=_(te)`
36
+ `;E.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};function be({icon:e,active:r,completed:l}){const i={1:t.jsx(ie,{className:"step-icon"}),2:t.jsx(ge,{className:"step-icon"}),3:t.jsx(ce,{className:"step-icon"})},u=["step-icon-w"];return r&&u.push("step-icon-w--active"),l&&u.push("step-icon-w--completed"),t.jsx("div",{className:u.join(" "),children:i[String(e)]})}function we({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:u,teamDid:b}){const{api:x}=d.useContext(e),g=V(s=>s.breakpoints.down("sm")),a=B({user:null,passport:null,success:!1,activeStep:0}),h=d.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:m}=Y(),{t:o,locale:w}=d.useContext(G),{wallet:v}=O(),[n,c]=d.useState(0),{searchParams:k}=new URL(window.location.href),S=()=>{a.activeStep++},$=s=>{a.user=s.user},W=()=>{S()},A=(s,y)=>{s?.passportId&&f(s.passportId),s?.sessionToken&&(h.current.sessionToken=y(s.sessionToken)),s?.refreshToken&&(h.current.refreshToken=y(s.refreshToken)),a.success=!0,S()},T=async()=>{if(v&&M()){Z(()=>import("./index-k6Jydhg7.js").then(y=>y.i),__vite__mapDeps([0,1,2]),import.meta.url).then(y=>{y.call("arcClosePage")});return}ee(u)&&u({sessionToken:h.current.sessionToken,refreshToken:h.current.refreshToken});const s=k.get("redirect");if(s){window.location.replace(de(s));return}m(),window.location.replace("/")},R=s=>{a.passport=s.target.value},[C]=xe({leftTime:n,onEnd:()=>{T()}}),N=[{label:o("lostPassport.recoverPassport"),content:()=>{if(!a.user){const s=k.get("scope")||"passport";return t.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:$,locale:w,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")},extraParams:{scope:s}})}return t.jsxs(p,{className:"select-passport",children:[t.jsxs(p,{className:"user-info",sx:{my:1,display:"flex",alignItems:"center"},children:[t.jsx(J,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),t.jsxs(p,{children:[t.jsx(p,{className:"name",children:a.user.fullName}),t.jsx(p,{className:"did",sx:{mt:1},children:t.jsx(Q,{responsive:!g,compact:g,did:a.user.did})})]})]}),t.jsx(p,{children:t.jsx(E,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(s=>({src:l({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer.name,issuerDid:s.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:s.scope==="kyc"?{key:"Email",value:s.name}:void 0}),name:s.title,id:s.id,display:s.display})),onSelect:s=>R({target:{value:a.user.passportTypes[s].id}}),defaultIndex:0})}),t.jsx(p,{sx:{textAlign:"center"},children:t.jsx(L,{variant:"contained",color:"primary",onClick:()=>W(),disabled:!a.passport,children:o("common.next")})})]})}},{label:o("lostPassport.receivePassport"),content:()=>{const s={receiverDid:a.user.did,passportId:a.passport,teamDid:b||window?.blocklet?.did};return t.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:x.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:A,forceConnected:!1,locale:w,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:s})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),t.jsxs(p,{sx:{textAlign:"center"},children:[t.jsx(p,{sx:{mb:3,color:"success.main"},children:t.jsx(q,{style:{fontSize:60}})}),t.jsx(I,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),t.jsx(I,{component:"p",variant:"body2",color:"gray",children:v&&M()?o("issuePassport.dialog.autoClose",{seconds:Math.round(C/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(C/1e3)})}),t.jsx(L,{style:{marginTop:40},variant:"contained",color:"primary",onClick:T,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return t.jsx(ye,{children:t.jsxs(p,{className:"stepper",children:[t.jsx(ue,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:N.map(({label:s})=>t.jsx(me,{children:t.jsx(he,{slots:{stepIcon:be},children:s})},s))}),t.jsx(p,{className:"stepper-content",children:N[a.activeStep].content()}),!a.success&&t.jsx(p,{sx:{textAlign:"center",fontSize:12},children:t.jsx(K,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const ye=_(te)`
37
37
  padding-top: 46px;
38
38
  padding-bottom: 46px;
39
39
  height: 100%;
@@ -1,4 +1,4 @@
1
- import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ie as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ig as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ih as Ct,ii as Nt,$ as nt,ij as wt,ik as Rt,il as Tt,im as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,io as Lt,a4 as kt}from"./index-CEs-_h3p.js";import{d as Ft,H as at,g as Pt}from"./index-BRFV_6XG.js";import{R as _e,S as _t}from"./actions-Fl5IcNig.js";import{B as Bt}from"./index-DQfEOUZ1.js";import{S as me}from"./shorten-label-9dGUasPc.js";import{v as ot}from"./index-BFArq4QY.js";import{T as zt}from"./html-title-Bzc9ddB_.js";import{R as Wt}from"./Refresh-KVD21gJ3.js";import{D as Mt,g as Ht}from"./traffic-CAjpS6xG.js";import{u as Kt}from"./use-mobile-Bfe2NQYE.js";import"./FilterList-BpQVWjO7.js";import"./CSSTransition-Cjz4QCFv.js";import"./emotion-cache.browser.esm-CN4wN0Q-.js";import"./index-BF3lDsjk.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BvgcJ7Lu.js";import"./index-DDa-PgAC.js";import"./TableSearch-MDaph9_3.js";import"./Search-Bu66uiUL.js";import"./Clear-BMrit09h.js";import"./MoreVert-DCZ34SEU.js";import"./useLocalStorage-ZXHKUuQ3.js";import"./url-evaluation-Dx7Up5AZ.js";import"./get-safe-url-Ddlf6-ls.js";import"./ButtonGroup-QoT5b0rj.js";import"./getValidReactChildren-Y4g3roaS.js";import"./permission-9QXWzXg1.js";import"./index.esm-BUUAAL09.js";import"./collapse-Te61TlLa.js";import"./blocklet-By8mMht1.js";import"./Switch-D1I5dz3C.js";import"./iframe-toMt-kqs.js";import"./ChevronLeft-WevXcbvT.js";import"./ChevronRight-DAJ57fQY.js";import"./index-DBii9-f-.js";import"./base-chart-Cgo222Iz.js";import"./index-0wnayxHS.js";import"./AdapterDayjs-DEjpOuYM.js";import"./useThemeProps-CgnjFBCx.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),qt=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
1
+ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ig as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ih as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ii as Ct,ij as Nt,$ as nt,ik as wt,il as Rt,im as Tt,io as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,ip as Lt,a4 as kt}from"./index-Cp668Jsm.js";import{d as Ft,H as at,g as Pt}from"./index-DLs4lvkb.js";import{R as _e,S as _t}from"./actions-DaFcSF4Q.js";import{B as Bt}from"./index-BCDhEJAj.js";import{S as me}from"./shorten-label-Dwsld825.js";import{v as ot}from"./index-CwANiKOk.js";import{T as zt}from"./html-title-HtPlSvGf.js";import{R as Wt}from"./Refresh-BU7QWHYu.js";import{D as Mt,g as Ht}from"./traffic-Dh32_ebe.js";import{u as Kt}from"./use-mobile-DmPwZVyR.js";import"./FilterList-C7CgIPm8.js";import"./CSSTransition-D9w1WbTD.js";import"./emotion-cache.browser.esm-B-0g7s2E.js";import"./index-B58pv6JK.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-msOq5b5x.js";import"./index-De5Caszn.js";import"./TableSearch-Dsfp_XUr.js";import"./Search-CviyP5PC.js";import"./Clear-CY2XI9UL.js";import"./MoreVert-Dnv5meLi.js";import"./useLocalStorage-D39oHiv_.js";import"./url-evaluation-ZlHZwvb8.js";import"./get-safe-url-0GDhhKMb.js";import"./ButtonGroup-BxZjrpDd.js";import"./getValidReactChildren-CS8vN0Dc.js";import"./permission-Dq4G1Nhn.js";import"./index.esm-BWXMXe80.js";import"./collapse-BOYOLC_4.js";import"./blocklet-Clk0KDdY.js";import"./Switch-C_vix7qp.js";import"./iframe-CiaMOw3l.js";import"./ChevronLeft-C1WpAw9J.js";import"./ChevronRight-BHex1y5g.js";import"./index-DBii9-f-.js";import"./base-chart-CUBovNRp.js";import"./index-BVwfeTfE.js";import"./AdapterDayjs-DimT2cks.js";import"./useThemeProps-CEesX7e5.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),qt=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{aG as je,j as e,u as Q,r as h,e as Fe,aH as $r,E as k,aI as Ur,aJ as an,aK as Hn,aL as sn,aM as et,m as z,ad as le,s as ne,aN as ln,o as p,aO as zr,aP as cn,aQ as Br,H as re,O as dn,T as A,t as q,az as fe,aR as _e,C as K,X as be,v as V,aS as Gn,Y as pe,N as W,g as Mt,P as tt,aT as Mr,d as Wt,aU as Ie,aV as me,aa as Wr,aW as qr,aX as Hr,y as Gr,A as Kn,W as un,p as mn,h as te,aY as qt,a as Et,U as X,b as ct,aZ as Yn,a_ as Vn,V as Xn,a4 as Pt,a$ as Kr,b0 as Yr,b1 as Vr,b2 as Xr,b3 as nt,J as Qr,b4 as Zr,aF as Ge,b5 as Jr,a9 as jt,a6 as wt,b6 as ei,a7 as _t,L as Ht,K as ti,b7 as ni,b8 as Qn,a8 as ri,b9 as Zn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as Jn,D as At,f as er,bf as ai,bg as fn,ak as si,bh as li,bi as ee,bj as ci,S as pn,k as gn,l as hn,bk as di,bl as ui,bm as mi}from"./index-CEs-_h3p.js";import{u as fi,T as pi}from"./html-title-Bzc9ddB_.js";import{A as gi}from"./ArrowDropDown-S7J75cd9.js";import{u as Kt,C as B,a as xn}from"./index.esm-BUUAAL09.js";import{S as ae}from"./switch-control-vwKpD-hx.js";import{P as ie}from"./permission-9QXWzXg1.js";import{H as tr,g as hi}from"./index-BRFV_6XG.js";import{A as nr}from"./Link-OosiOUml.js";import{D as ve,R as rr,a as It,b as xi,W as Ke}from"./url-evaluation-Dx7Up5AZ.js";import{D as dt}from"./delete-confirm-B7t36usI.js";import{v as rt}from"./index-BFArq4QY.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-ZXHKUuQ3.js";import{R as vi}from"./Refresh-KVD21gJ3.js";import{L as ji}from"./LoadingButton-Bu-RMxo0.js";import{C as wi,R as Ci,P as ir}from"./rotate-session-key-CA9ENqfL.js";import{A as Le}from"./Add-ZXw0xLrb.js";import{B as or,D as yn}from"./status-DJy3aS5P.js";import{i as Si}from"./is-path-prefix-equal-BEgzcrKA.js";import{N as Di}from"./ChevronRight-DAJ57fQY.js";import{I as ki}from"./MoreVert-DCZ34SEU.js";import{E as ar}from"./Edit-DvJ7niyi.js";import{A as Ri}from"./CallMerge-Bn5ZQujz.js";import{C as Ti}from"./CardContent-NiCok_GZ.js";import{S as Ei}from"./Slider-SLDVySsH.js";import"./Switch-D1I5dz3C.js";import"./FilterList-BpQVWjO7.js";import"./CSSTransition-Cjz4QCFv.js";import"./emotion-cache.browser.esm-CN4wN0Q-.js";import"./index-BF3lDsjk.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BvgcJ7Lu.js";import"./index-DDa-PgAC.js";import"./TableSearch-MDaph9_3.js";import"./Search-Bu66uiUL.js";import"./Clear-BMrit09h.js";import"./click-to-copy-BTxnhIi6.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),sr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Oi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",lr=h.createContext({}),{Provider:Fi,Consumer:ss}=lr,bn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=bn.includes(t.name),i=bn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Hn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function vn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Fe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await $r(g.domainAliases,{getIP:Ur}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Fi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(lr);return t}function Yt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function cr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}cr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
1
+ import{aG as je,j as e,u as Q,r as h,e as Fe,aH as $r,E as k,aI as Ur,aJ as an,aK as Hn,aL as sn,aM as et,m as z,ad as le,s as ne,aN as ln,o as p,aO as zr,aP as cn,aQ as Br,H as re,O as dn,T as A,t as q,az as fe,aR as _e,C as K,X as be,v as V,aS as Gn,Y as pe,N as W,g as Mt,P as tt,aT as Mr,d as Wt,aU as Ie,aV as me,aa as Wr,aW as qr,aX as Hr,y as Gr,A as Kn,W as un,p as mn,h as te,aY as qt,a as Et,U as X,b as ct,aZ as Yn,a_ as Vn,V as Xn,a4 as Pt,a$ as Kr,b0 as Yr,b1 as Vr,b2 as Xr,b3 as nt,J as Qr,b4 as Zr,aF as Ge,b5 as Jr,a9 as jt,a6 as wt,b6 as ei,a7 as _t,L as Ht,K as ti,b7 as ni,b8 as Qn,a8 as ri,b9 as Zn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as Jn,D as At,f as er,bf as ai,bg as fn,ak as si,bh as li,bi as ee,bj as ci,S as pn,k as gn,l as hn,bk as di,bl as ui,bm as mi}from"./index-Cp668Jsm.js";import{u as fi,T as pi}from"./html-title-HtPlSvGf.js";import{A as gi}from"./ArrowDropDown-DTUdke6O.js";import{u as Kt,C as B,a as xn}from"./index.esm-BWXMXe80.js";import{S as ae}from"./switch-control-Dg5zSUdo.js";import{P as ie}from"./permission-Dq4G1Nhn.js";import{H as tr,g as hi}from"./index-DLs4lvkb.js";import{A as nr}from"./Link-B32ARgrh.js";import{D as ve,R as rr,a as It,b as xi,W as Ke}from"./url-evaluation-ZlHZwvb8.js";import{D as dt}from"./delete-confirm-BrhseXop.js";import{v as rt}from"./index-CwANiKOk.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-D39oHiv_.js";import{R as vi}from"./Refresh-BU7QWHYu.js";import{L as ji}from"./LoadingButton-ClNP4uj0.js";import{C as wi,R as Ci,P as ir}from"./rotate-session-key-omld1AuK.js";import{A as Le}from"./Add-B2ZDVqat.js";import{B as or,D as yn}from"./status-DC_uFdhU.js";import{i as Si}from"./is-path-prefix-equal-9dPZdPqq.js";import{N as Di}from"./ChevronRight-BHex1y5g.js";import{I as ki}from"./MoreVert-Dnv5meLi.js";import{E as ar}from"./Edit-CQvdC-gs.js";import{A as Ri}from"./CallMerge-CT9kGdYw.js";import{C as Ti}from"./CardContent-DZQbbzze.js";import{S as Ei}from"./Slider-DEcPJiVm.js";import"./Switch-C_vix7qp.js";import"./FilterList-C7CgIPm8.js";import"./CSSTransition-D9w1WbTD.js";import"./emotion-cache.browser.esm-B-0g7s2E.js";import"./index-B58pv6JK.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-msOq5b5x.js";import"./index-De5Caszn.js";import"./TableSearch-Dsfp_XUr.js";import"./Search-CviyP5PC.js";import"./Clear-CY2XI9UL.js";import"./click-to-copy-BZWirPDQ.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),sr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Oi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",lr=h.createContext({}),{Provider:Fi,Consumer:ss}=lr,bn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=bn.includes(t.name),i=bn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Hn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function vn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Fe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await $r(g.domainAliases,{getIP:Ur}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Fi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(lr);return t}function Yt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function cr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}cr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
2
2
  margin-bottom: 24px;
3
3
  .top-btns-alert {
4
4
  @media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
@@ -1,4 +1,4 @@
1
- import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-CEs-_h3p.js";import{I as M}from"./invitation-vC0PSQ_r.js";import"./index-40xZF0CX.js";import"./index-Onb6C8Vx.js";import"./emotion-cache.browser.esm-CN4wN0Q-.js";import"./sdk-BASq25ZU.js";import"./wrap-locale-FW1OiiQu.js";function V(p){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),h=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),t=D(async()=>{if(!h)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:h}}),a=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(a){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",h);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:a}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(t.error)throw t.error;return t.value.invitation},[t]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const a=s.toString();await f.refresh(),v(`/${a&&`?${a}`}`,{replace:!0})},[c,v,f]);if(t.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",t.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:a}=await i.get(e.href);a.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(a),w(a))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(t,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(t,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(M,{...p,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(t,"value.needReceiveNFT")?T:null})]})}const X=H.div`
1
+ import{u as k,j as o,C as y,ay as W,cT as b,A as U,m as E,cI as _,r,aW as D,h as d,y as x,al as P,af as R,w as O,E as A,x as $,ax as K,bw as z,s as H}from"./index-Cp668Jsm.js";import{I as M}from"./invitation-Bbd0EUPN.js";import"./index-sz3uFV7b.js";import"./index-tE5HA0JS.js";import"./emotion-cache.browser.esm-B-0g7s2E.js";import"./sdk-BbOdEeFV.js";import"./wrap-locale-BDWmzfGR.js";function V(p){const{api:i,session:f}=W(),{info:n}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:N,decrypt:C}=_(),[I,g]=r.useState(!1),h=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),t=D(async()=>{if(!h)return null;let e;const{data:s}=await i.get("/api/invitation",{params:{inviteId:h}}),a=!!d(n,"ownerNft.did")&&s.role.name==="owner";if(a){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",N),u.searchParams.set("inviteId",h);const{data:F}=await i.get(u.href);e=F}return{invitation:s,nextWorkflow:e,needReceiveNFT:a}}),T=r.useCallback(()=>{g(!0)},[]),L=r.useCallback(()=>{if(t.error)throw t.error;return t.value.invitation},[t]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const s=new URLSearchParams(c.search);s.delete("inviteId");const a=s.toString();await f.refresh(),v(`/${a&&`?${a}`}`,{replace:!0})},[c,v,f]);if(t.loading)return o.jsx(y,{});const S=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",t.value.nextWorkflow.token),e.searchParams.set("locale",m);const s=setInterval(async()=>{const{data:a}=await i.get(e.href);a.status==="succeed"&&(clearInterval(s),f.updateConnectedInfo(a),w(a))},2e3)},j=()=>{g(!1)};return o.jsxs(X,{className:"page-invite",children:[d(t,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:n.launcher.url,checkFn:K.create({baseURL:n.launcher.url}).get,onSuccess:S,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(n),extraParams:{nw:d(t,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:n.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(M,{...p,getDataFn:L,createPassportSvg:e=>z(e,n),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(t,"value.needReceiveNFT")?T:null})]})}const X=H.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;
@@ -1,4 +1,4 @@
1
- import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-CEs-_h3p.js";import{u as L}from"./useLocalStorage-ZXHKUuQ3.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-BkJpv1Bb.js";import{e as D}from"./engine-CifWoWKx.js";import{g as U}from"./get-safe-url-Ddlf6-ls.js";import{P as V}from"./permission-9QXWzXg1.js";import{A as Le}from"./ArrowDropDown-S7J75cd9.js";import{B as Ee}from"./Breadcrumbs-TCiC4Qkr.js";import"./Verified-CEUKiCvL.js";import"./ChevronLeft-WevXcbvT.js";import"./ChevronRight-DAJ57fQY.js";import"./Search-Bu66uiUL.js";import"./index-DDa-PgAC.js";import"./blocklet-By8mMht1.js";import"./Autocomplete-CK-9Ss3q.js";import"./ListSubheader-JaIza3kA.js";import"./VerifiedUser-CHrqY4DV.js";import"./Add-ZXw0xLrb.js";import"./Launch-C19ynGFM.js";import"./Done-BssJlxXF.js";import"./DeleteOutline-B_ebn78a.js";import"./delete-confirm-B7t36usI.js";import"./click-to-copy-BTxnhIi6.js";import"./MoreVert-DCZ34SEU.js";import"./ButtonGroup-QoT5b0rj.js";import"./getValidReactChildren-Y4g3roaS.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
1
+ import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-Cp668Jsm.js";import{u as L}from"./useLocalStorage-D39oHiv_.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-Czk-LxVv.js";import{e as D}from"./engine-CjGipQ8H.js";import{g as U}from"./get-safe-url-0GDhhKMb.js";import{P as V}from"./permission-Dq4G1Nhn.js";import{A as Le}from"./ArrowDropDown-DTUdke6O.js";import{B as Ee}from"./Breadcrumbs-C0NyAgW3.js";import"./Verified-C1OHOKpp.js";import"./ChevronLeft-C1WpAw9J.js";import"./ChevronRight-BHex1y5g.js";import"./Search-CviyP5PC.js";import"./index-De5Caszn.js";import"./blocklet-Clk0KDdY.js";import"./Autocomplete-B6hdnAbf.js";import"./ListSubheader-59vUoVIT.js";import"./VerifiedUser-C0M9SrH7.js";import"./Add-B2ZDVqat.js";import"./Launch-Cazur-Fl.js";import"./Done-DvjnHsf4.js";import"./DeleteOutline-DCwd4zu5.js";import"./delete-confirm-BrhseXop.js";import"./click-to-copy-BZWirPDQ.js";import"./MoreVert-Dnv5meLi.js";import"./ButtonGroup-BxZjrpDd.js";import"./getValidReactChildren-CS8vN0Dc.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
2
2
  .ms-highlight {
3
3
  color: ${e=>e.theme.palette.primary.main};
4
4
  }
@@ -1,4 +1,4 @@
1
- import{aG as Kt,j as Q,bd as Gt,s as Ht,r as zt,_ as Wt,fn as we,dd as Zt,g9 as Yt}from"./index-CEs-_h3p.js";const Xt=Kt(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}));var En,$n;function jt(){if($n)return En;$n=1;function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const a=e[t],f=typeof a;(f==="object"||f==="function")&&!Object.isFrozen(a)&&n(a)}),e}class r{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function c(e,...t){const a=Object.create(null);for(const f in e)a[f]=e[f];return t.forEach(function(f){for(const F in f)a[F]=f[F]}),a}const w="</span>",$=e=>!!e.scope,A=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const a=e.split(".");return[`${t}${a.shift()}`,...a.map((f,F)=>`${f}${"_".repeat(F+1)}`)].join(" ")}return`${t}${e}`};class _{constructor(t,a){this.buffer="",this.classPrefix=a.classPrefix,t.walk(this)}addText(t){this.buffer+=o(t)}openNode(t){if(!$(t))return;const a=A(t.scope,{prefix:this.classPrefix});this.span(a)}closeNode(t){$(t)&&(this.buffer+=w)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const h=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class b{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const a=h({scope:t});this.add(a),this.stack.push(a)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,a){return typeof a=="string"?t.addText(a):a.children&&(t.openNode(a),a.children.forEach(f=>this._walk(t,f)),t.closeNode(a)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(a=>typeof a=="string")?t.children=[t.children.join("")]:t.children.forEach(a=>{b._collapse(a)}))}}class S extends b{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,a){const f=t.root;a&&(f.scope=`language:${a}`),this.add(f)}toHTML(){return new _(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function R(e){return e?typeof e=="string"?e:e.source:null}function N(e){return O("(?=",e,")")}function y(e){return O("(?:",e,")*")}function U(e){return O("(?:",e,")?")}function O(...e){return e.map(a=>R(a)).join("")}function P(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function B(...e){return"("+(P(e).capture?"":"?:")+e.map(f=>R(f)).join("|")+")"}function H(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z(e,t){const a=e&&e.exec(t);return a&&a.index===0}const se=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(e,{joinWith:t}){let a=0;return e.map(f=>{a+=1;const F=a;let K=R(f),u="";for(;K.length>0;){const l=se.exec(K);if(!l){u+=K;break}u+=K.substring(0,l.index),K=K.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?u+="\\"+String(Number(l[1])+F):(u+=l[0],l[0]==="("&&a++)}return u}).map(f=>`(${f})`).join(t)}const V=/\b\B/,ce="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ae="\\b\\d+(\\.\\d+)?",de="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ne="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",he=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=O(t,/.*\b/,e.binary,/\b.*/)),c({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(a,f)=>{a.index!==0&&f.ignoreMatch()}},e)},re={begin:"\\\\[\\s\\S]",relevance:0},Ae={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[re]},be={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[re]},fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,a={}){const f=c({scope:"comment",begin:e,end:t,contains:[]},a);f.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const F=B("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return f.contains.push({begin:O(/[ ]+/,"(",F,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),f},Y=I("//","$"),ee=I("/\\*","\\*/"),q=I("#","$"),X={scope:"number",begin:ae,relevance:0},_e={scope:"number",begin:de,relevance:0},qe={scope:"number",begin:Ne,relevance:0},Be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[re,{begin:/\[/,end:/\]/,relevance:0,contains:[re]}]},ve={scope:"title",begin:ce,relevance:0},Je={scope:"title",begin:te,relevance:0},$e={begin:"\\.\\s*"+te,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:Ae,BACKSLASH_ESCAPE:re,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Ne,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:_e,C_NUMBER_RE:de,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(t,a)=>{a.data._beginMatch=t[1]},"on:end":(t,a)=>{a.data._beginMatch!==t[1]&&a.ignoreMatch()}})},HASH_COMMENT_MODE:q,IDENT_RE:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:$e,NUMBER_MODE:X,NUMBER_RE:ae,PHRASAL_WORDS_MODE:fe,QUOTE_STRING_MODE:be,REGEXP_MODE:Be,RE_STARTERS_RE:Ee,SHEBANG:he,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:Je});function Qe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function en(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Qe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tn(e,t){Array.isArray(e.illegal)&&(e.illegal=B(...e.illegal))}function sn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){e.relevance===void 0&&(e.relevance=1)}const Ie=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const a=Object.assign({},e);Object.keys(e).forEach(f=>{delete e[f]}),e.keywords=a.keywords,e.begin=O(a.beforeMatch,N(a.begin)),e.starts={relevance:0,contains:[Object.assign(a,{endsParent:!0})]},e.relevance=0,delete a.beforeMatch},Re=["of","and","for","in","not","or","if","then","parent","list","value"],an="keyword";function mn(e,t,a=an){const f=Object.create(null);return typeof e=="string"?F(a,e.split(" ")):Array.isArray(e)?F(a,e):Object.keys(e).forEach(function(K){Object.assign(f,mn(e[K],t,K))}),f;function F(K,u){t&&(u=u.map(l=>l.toLowerCase())),u.forEach(function(l){const E=l.split("|");f[E[0]]=[K,dt(E[0],E[1])]})}}function dt(e,t){return t?Number(t):Et(e)?0:1}function Et(e){return Re.includes(e.toLowerCase())}const An={},Te=e=>{console.error(e)},Rn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Me=(e,t)=>{An[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),An[`${e}/${t}`]=!0)},Ue=new Error;function Tn(e,t,{key:a}){let f=0;const F=e[a],K={},u={};for(let l=1;l<=t.length;l++)u[l+f]=F[l],K[l+f]=!0,f+=H(t[l-1]);e[a]=u,e[a]._emit=K,e[a]._multi=!0}function bt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Te("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ue;if(typeof e.beginScope!="object"||e.beginScope===null)throw Te("beginScope must be object"),Ue;Tn(e,e.begin,{key:"beginScope"}),e.begin=M(e.begin,{joinWith:""})}}function ft(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Te("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ue;if(typeof e.endScope!="object"||e.endScope===null)throw Te("endScope must be object"),Ue;Tn(e,e.end,{key:"endScope"}),e.end=M(e.end,{joinWith:""})}}function _t(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pt(e){_t(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),bt(e),ft(e)}function Nt(e){function t(u,l){return new RegExp(R(u),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,E){E.position=this.position++,this.matchIndexes[this.matchAt]=E,this.regexes.push([E,l]),this.matchAt+=H(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(E=>E[1]);this.matcherRe=t(M(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const E=this.matcherRe.exec(l);if(!E)return null;const W=E.findIndex((De,cn)=>cn>0&&De!==void 0),G=this.matchIndexes[W];return E.splice(0,W),Object.assign(E,G)}}class f{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const E=new a;return this.rules.slice(l).forEach(([W,G])=>E.addRule(W,G)),E.compile(),this.multiRegexes[l]=E,E}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,E){this.rules.push([l,E]),E.type==="begin"&&this.count++}exec(l){const E=this.getMatcher(this.regexIndex);E.lastIndex=this.lastIndex;let W=E.exec(l);if(this.resumingScanAtSamePosition()&&!(W&&W.index===this.lastIndex)){const G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,W=G.exec(l)}return W&&(this.regexIndex+=W.position+1,this.regexIndex===this.count&&this.considerAll()),W}}function F(u){const l=new f;return u.contains.forEach(E=>l.addRule(E.begin,{rule:E,type:"begin"})),u.terminatorEnd&&l.addRule(u.terminatorEnd,{type:"end"}),u.illegal&&l.addRule(u.illegal,{type:"illegal"}),l}function K(u,l){const E=u;if(u.isCompiled)return E;[en,sn,pt,Ie].forEach(G=>G(u,l)),e.compilerExtensions.forEach(G=>G(u,l)),u.__beforeBegin=null,[nn,tn,L].forEach(G=>G(u,l)),u.isCompiled=!0;let W=null;return typeof u.keywords=="object"&&u.keywords.$pattern&&(u.keywords=Object.assign({},u.keywords),W=u.keywords.$pattern,delete u.keywords.$pattern),W=W||/\w+/,u.keywords&&(u.keywords=mn(u.keywords,e.case_insensitive)),E.keywordPatternRe=t(W,!0),l&&(u.begin||(u.begin=/\B|\b/),E.beginRe=t(E.begin),!u.end&&!u.endsWithParent&&(u.end=/\B|\b/),u.end&&(E.endRe=t(E.end)),E.terminatorEnd=R(E.end)||"",u.endsWithParent&&l.terminatorEnd&&(E.terminatorEnd+=(u.end?"|":"")+l.terminatorEnd)),u.illegal&&(E.illegalRe=t(u.illegal)),u.contains||(u.contains=[]),u.contains=[].concat(...u.contains.map(function(G){return ht(G==="self"?u:G)})),u.contains.forEach(function(G){K(G,E)}),u.starts&&K(u.starts,l),E.matcher=F(E),E}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=c(e.classNameAliases||{}),K(e)}function yn(e){return e?e.endsWithParent||yn(e.starts):!1}function ht(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return c(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:yn(e)?c(e,{starts:e.starts?c(e.starts):null}):Object.isFrozen(e)?c(e):e}var St="11.11.1";class mt extends Error{constructor(t,a){super(t),this.name="HTMLInjectionError",this.html=a}}const rn=o,On=c,In=Symbol("nomatch"),At=7,Mn=function(e){const t=Object.create(null),a=Object.create(null),f=[];let F=!0;const K="Could not find the language '{}', did you forget to load/include a language module?",u={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:S};function E(s){return l.noHighlightRe.test(s)}function W(s){let d=s.className+" ";d+=s.parentNode?s.parentNode.className:"";const T=l.languageDetectRe.exec(d);if(T){const D=Se(T[1]);return D||(Rn(K.replace("{}",T[1])),Rn("Falling back to no-highlight mode for this block.",s)),D?T[1]:"no-highlight"}return d.split(/\s+/).find(D=>E(D)||Se(D))}function G(s,d,T){let D="",z="";typeof d=="object"?(D=s,T=d.ignoreIllegals,z=d.language):(Me("10.7.0","highlight(lang, code, ...args) has been deprecated."),Me("10.7.0",`Please use highlight(code, options) instead.
1
+ import{aG as Kt,j as Q,bd as Gt,s as Ht,r as zt,_ as Wt,fn as we,dd as Zt,g9 as Yt}from"./index-Cp668Jsm.js";const Xt=Kt(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}));var En,$n;function jt(){if($n)return En;$n=1;function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const a=e[t],f=typeof a;(f==="object"||f==="function")&&!Object.isFrozen(a)&&n(a)}),e}class r{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function c(e,...t){const a=Object.create(null);for(const f in e)a[f]=e[f];return t.forEach(function(f){for(const F in f)a[F]=f[F]}),a}const w="</span>",$=e=>!!e.scope,A=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const a=e.split(".");return[`${t}${a.shift()}`,...a.map((f,F)=>`${f}${"_".repeat(F+1)}`)].join(" ")}return`${t}${e}`};class _{constructor(t,a){this.buffer="",this.classPrefix=a.classPrefix,t.walk(this)}addText(t){this.buffer+=o(t)}openNode(t){if(!$(t))return;const a=A(t.scope,{prefix:this.classPrefix});this.span(a)}closeNode(t){$(t)&&(this.buffer+=w)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const h=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class b{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const a=h({scope:t});this.add(a),this.stack.push(a)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,a){return typeof a=="string"?t.addText(a):a.children&&(t.openNode(a),a.children.forEach(f=>this._walk(t,f)),t.closeNode(a)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(a=>typeof a=="string")?t.children=[t.children.join("")]:t.children.forEach(a=>{b._collapse(a)}))}}class S extends b{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,a){const f=t.root;a&&(f.scope=`language:${a}`),this.add(f)}toHTML(){return new _(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function R(e){return e?typeof e=="string"?e:e.source:null}function N(e){return O("(?=",e,")")}function y(e){return O("(?:",e,")*")}function U(e){return O("(?:",e,")?")}function O(...e){return e.map(a=>R(a)).join("")}function P(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function B(...e){return"("+(P(e).capture?"":"?:")+e.map(f=>R(f)).join("|")+")"}function H(e){return new RegExp(e.toString()+"|").exec("").length-1}function Z(e,t){const a=e&&e.exec(t);return a&&a.index===0}const se=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(e,{joinWith:t}){let a=0;return e.map(f=>{a+=1;const F=a;let K=R(f),u="";for(;K.length>0;){const l=se.exec(K);if(!l){u+=K;break}u+=K.substring(0,l.index),K=K.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?u+="\\"+String(Number(l[1])+F):(u+=l[0],l[0]==="("&&a++)}return u}).map(f=>`(${f})`).join(t)}const V=/\b\B/,ce="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ae="\\b\\d+(\\.\\d+)?",de="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ne="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",he=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=O(t,/.*\b/,e.binary,/\b.*/)),c({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(a,f)=>{a.index!==0&&f.ignoreMatch()}},e)},re={begin:"\\\\[\\s\\S]",relevance:0},Ae={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[re]},be={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[re]},fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,a={}){const f=c({scope:"comment",begin:e,end:t,contains:[]},a);f.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const F=B("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return f.contains.push({begin:O(/[ ]+/,"(",F,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),f},Y=I("//","$"),ee=I("/\\*","\\*/"),q=I("#","$"),X={scope:"number",begin:ae,relevance:0},_e={scope:"number",begin:de,relevance:0},qe={scope:"number",begin:Ne,relevance:0},Be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[re,{begin:/\[/,end:/\]/,relevance:0,contains:[re]}]},ve={scope:"title",begin:ce,relevance:0},Je={scope:"title",begin:te,relevance:0},$e={begin:"\\.\\s*"+te,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:Ae,BACKSLASH_ESCAPE:re,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Ne,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:_e,C_NUMBER_RE:de,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(t,a)=>{a.data._beginMatch=t[1]},"on:end":(t,a)=>{a.data._beginMatch!==t[1]&&a.ignoreMatch()}})},HASH_COMMENT_MODE:q,IDENT_RE:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:$e,NUMBER_MODE:X,NUMBER_RE:ae,PHRASAL_WORDS_MODE:fe,QUOTE_STRING_MODE:be,REGEXP_MODE:Be,RE_STARTERS_RE:Ee,SHEBANG:he,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:Je});function Qe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function en(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Qe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tn(e,t){Array.isArray(e.illegal)&&(e.illegal=B(...e.illegal))}function sn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){e.relevance===void 0&&(e.relevance=1)}const Ie=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const a=Object.assign({},e);Object.keys(e).forEach(f=>{delete e[f]}),e.keywords=a.keywords,e.begin=O(a.beforeMatch,N(a.begin)),e.starts={relevance:0,contains:[Object.assign(a,{endsParent:!0})]},e.relevance=0,delete a.beforeMatch},Re=["of","and","for","in","not","or","if","then","parent","list","value"],an="keyword";function mn(e,t,a=an){const f=Object.create(null);return typeof e=="string"?F(a,e.split(" ")):Array.isArray(e)?F(a,e):Object.keys(e).forEach(function(K){Object.assign(f,mn(e[K],t,K))}),f;function F(K,u){t&&(u=u.map(l=>l.toLowerCase())),u.forEach(function(l){const E=l.split("|");f[E[0]]=[K,dt(E[0],E[1])]})}}function dt(e,t){return t?Number(t):Et(e)?0:1}function Et(e){return Re.includes(e.toLowerCase())}const An={},Te=e=>{console.error(e)},Rn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Me=(e,t)=>{An[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),An[`${e}/${t}`]=!0)},Ue=new Error;function Tn(e,t,{key:a}){let f=0;const F=e[a],K={},u={};for(let l=1;l<=t.length;l++)u[l+f]=F[l],K[l+f]=!0,f+=H(t[l-1]);e[a]=u,e[a]._emit=K,e[a]._multi=!0}function bt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Te("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ue;if(typeof e.beginScope!="object"||e.beginScope===null)throw Te("beginScope must be object"),Ue;Tn(e,e.begin,{key:"beginScope"}),e.begin=M(e.begin,{joinWith:""})}}function ft(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Te("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ue;if(typeof e.endScope!="object"||e.endScope===null)throw Te("endScope must be object"),Ue;Tn(e,e.end,{key:"endScope"}),e.end=M(e.end,{joinWith:""})}}function _t(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pt(e){_t(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),bt(e),ft(e)}function Nt(e){function t(u,l){return new RegExp(R(u),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,E){E.position=this.position++,this.matchIndexes[this.matchAt]=E,this.regexes.push([E,l]),this.matchAt+=H(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(E=>E[1]);this.matcherRe=t(M(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const E=this.matcherRe.exec(l);if(!E)return null;const W=E.findIndex((De,cn)=>cn>0&&De!==void 0),G=this.matchIndexes[W];return E.splice(0,W),Object.assign(E,G)}}class f{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const E=new a;return this.rules.slice(l).forEach(([W,G])=>E.addRule(W,G)),E.compile(),this.multiRegexes[l]=E,E}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,E){this.rules.push([l,E]),E.type==="begin"&&this.count++}exec(l){const E=this.getMatcher(this.regexIndex);E.lastIndex=this.lastIndex;let W=E.exec(l);if(this.resumingScanAtSamePosition()&&!(W&&W.index===this.lastIndex)){const G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,W=G.exec(l)}return W&&(this.regexIndex+=W.position+1,this.regexIndex===this.count&&this.considerAll()),W}}function F(u){const l=new f;return u.contains.forEach(E=>l.addRule(E.begin,{rule:E,type:"begin"})),u.terminatorEnd&&l.addRule(u.terminatorEnd,{type:"end"}),u.illegal&&l.addRule(u.illegal,{type:"illegal"}),l}function K(u,l){const E=u;if(u.isCompiled)return E;[en,sn,pt,Ie].forEach(G=>G(u,l)),e.compilerExtensions.forEach(G=>G(u,l)),u.__beforeBegin=null,[nn,tn,L].forEach(G=>G(u,l)),u.isCompiled=!0;let W=null;return typeof u.keywords=="object"&&u.keywords.$pattern&&(u.keywords=Object.assign({},u.keywords),W=u.keywords.$pattern,delete u.keywords.$pattern),W=W||/\w+/,u.keywords&&(u.keywords=mn(u.keywords,e.case_insensitive)),E.keywordPatternRe=t(W,!0),l&&(u.begin||(u.begin=/\B|\b/),E.beginRe=t(E.begin),!u.end&&!u.endsWithParent&&(u.end=/\B|\b/),u.end&&(E.endRe=t(E.end)),E.terminatorEnd=R(E.end)||"",u.endsWithParent&&l.terminatorEnd&&(E.terminatorEnd+=(u.end?"|":"")+l.terminatorEnd)),u.illegal&&(E.illegalRe=t(u.illegal)),u.contains||(u.contains=[]),u.contains=[].concat(...u.contains.map(function(G){return ht(G==="self"?u:G)})),u.contains.forEach(function(G){K(G,E)}),u.starts&&K(u.starts,l),E.matcher=F(E),E}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=c(e.classNameAliases||{}),K(e)}function yn(e){return e?e.endsWithParent||yn(e.starts):!1}function ht(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return c(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:yn(e)?c(e,{starts:e.starts?c(e.starts):null}):Object.isFrozen(e)?c(e):e}var St="11.11.1";class mt extends Error{constructor(t,a){super(t),this.name="HTMLInjectionError",this.html=a}}const rn=o,On=c,In=Symbol("nomatch"),At=7,Mn=function(e){const t=Object.create(null),a=Object.create(null),f=[];let F=!0;const K="Could not find the language '{}', did you forget to load/include a language module?",u={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:S};function E(s){return l.noHighlightRe.test(s)}function W(s){let d=s.className+" ";d+=s.parentNode?s.parentNode.className:"";const T=l.languageDetectRe.exec(d);if(T){const D=Se(T[1]);return D||(Rn(K.replace("{}",T[1])),Rn("Falling back to no-highlight mode for this block.",s)),D?T[1]:"no-highlight"}return d.split(/\s+/).find(D=>E(D)||Se(D))}function G(s,d,T){let D="",z="";typeof d=="object"?(D=s,T=d.ignoreIllegals,z=d.language):(Me("10.7.0","highlight(lang, code, ...args) has been deprecated."),Me("10.7.0",`Please use highlight(code, options) instead.
2
2
  https://github.com/highlightjs/highlight.js/issues/2277`),z=s,D=d),T===void 0&&(T=!0);const oe={code:D,language:z};Fe("before:highlight",oe);const me=oe.result?oe.result:De(oe.language,oe.code,T);return me.code=oe.code,Fe("after:highlight",me),me}function De(s,d,T,D){const z=Object.create(null);function oe(i,g){return i.keywords[g]}function me(){if(!p.keywords){j.addText(k);return}let i=0;p.keywordPatternRe.lastIndex=0;let g=p.keywordPatternRe.exec(k),m="";for(;g;){m+=k.substring(i,g.index);const C=ue.case_insensitive?g[0].toLowerCase():g[0],J=oe(p,C);if(J){const[pe,Pt]=J;if(j.addText(m),m="",z[C]=(z[C]||0)+1,z[C]<=At&&(He+=Pt),pe.startsWith("_"))m+=g[0];else{const Ft=ue.classNameAliases[pe]||pe;le(g[0],Ft)}}else m+=g[0];i=p.keywordPatternRe.lastIndex,g=p.keywordPatternRe.exec(k)}m+=k.substring(i),j.addText(m)}function Ke(){if(k==="")return;let i=null;if(typeof p.subLanguage=="string"){if(!t[p.subLanguage]){j.addText(k);return}i=De(p.subLanguage,k,!0,Bn[p.subLanguage]),Bn[p.subLanguage]=i._top}else i=on(k,p.subLanguage.length?p.subLanguage:null);p.relevance>0&&(He+=i.relevance),j.__addSublanguage(i._emitter,i.language)}function ie(){p.subLanguage!=null?Ke():me(),k=""}function le(i,g){i!==""&&(j.startScope(g),j.addText(i),j.endScope())}function xn(i,g){let m=1;const C=g.length-1;for(;m<=C;){if(!i._emit[m]){m++;continue}const J=ue.classNameAliases[i[m]]||i[m],pe=g[m];J?le(pe,J):(k=pe,me(),k=""),m++}}function vn(i,g){return i.scope&&typeof i.scope=="string"&&j.openNode(ue.classNameAliases[i.scope]||i.scope),i.beginScope&&(i.beginScope._wrap?(le(k,ue.classNameAliases[i.beginScope._wrap]||i.beginScope._wrap),k=""):i.beginScope._multi&&(xn(i.beginScope,g),k="")),p=Object.create(i,{parent:{value:p}}),p}function Dn(i,g,m){let C=Z(i.endRe,m);if(C){if(i["on:end"]){const J=new r(i);i["on:end"](g,J),J.isMatchIgnored&&(C=!1)}if(C){for(;i.endsParent&&i.parent;)i=i.parent;return i}}if(i.endsWithParent)return Dn(i.parent,g,m)}function Dt(i){return p.matcher.regexIndex===0?(k+=i[0],1):(dn=!0,0)}function kt(i){const g=i[0],m=i.rule,C=new r(m),J=[m.__beforeBegin,m["on:begin"]];for(const pe of J)if(pe&&(pe(i,C),C.isMatchIgnored))return Dt(g);return m.skip?k+=g:(m.excludeBegin&&(k+=g),ie(),!m.returnBegin&&!m.excludeBegin&&(k=g)),vn(m,i),m.returnBegin?0:g.length}function Bt(i){const g=i[0],m=d.substring(i.index),C=Dn(p,i,m);if(!C)return In;const J=p;p.endScope&&p.endScope._wrap?(ie(),le(g,p.endScope._wrap)):p.endScope&&p.endScope._multi?(ie(),xn(p.endScope,i)):J.skip?k+=g:(J.returnEnd||J.excludeEnd||(k+=g),ie(),J.excludeEnd&&(k=g));do p.scope&&j.closeNode(),!p.skip&&!p.subLanguage&&(He+=p.relevance),p=p.parent;while(p!==C.parent);return C.starts&&vn(C.starts,i),J.returnEnd?0:g.length}function $t(){const i=[];for(let g=p;g!==ue;g=g.parent)g.scope&&i.unshift(g.scope);i.forEach(g=>j.openNode(g))}let Ge={};function kn(i,g){const m=g&&g[0];if(k+=i,m==null)return ie(),0;if(Ge.type==="begin"&&g.type==="end"&&Ge.index===g.index&&m===""){if(k+=d.slice(g.index,g.index+1),!F){const C=new Error(`0 width match regex (${s})`);throw C.languageName=s,C.badRule=Ge.rule,C}return 1}if(Ge=g,g.type==="begin")return kt(g);if(g.type==="illegal"&&!T){const C=new Error('Illegal lexeme "'+m+'" for mode "'+(p.scope||"<unnamed>")+'"');throw C.mode=p,C}else if(g.type==="end"){const C=Bt(g);if(C!==In)return C}if(g.type==="illegal"&&m==="")return k+=`
3
3
  `,1;if(gn>1e5&&gn>g.index*3)throw new Error("potential infinite loop, way more iterations than matches");return k+=m,m.length}const ue=Se(s);if(!ue)throw Te(K.replace("{}",s)),new Error('Unknown language: "'+s+'"');const Ut=Nt(ue);let un="",p=D||Ut;const Bn={},j=new l.__emitter(l);$t();let k="",He=0,ye=0,gn=0,dn=!1;try{if(ue.__emitTokens)ue.__emitTokens(d,j);else{for(p.matcher.considerAll();;){gn++,dn?dn=!1:p.matcher.considerAll(),p.matcher.lastIndex=ye;const i=p.matcher.exec(d);if(!i)break;const g=d.substring(ye,i.index),m=kn(g,i);ye=i.index+m}kn(d.substring(ye))}return j.finalize(),un=j.toHTML(),{language:s,value:un,relevance:He,illegal:!1,_emitter:j,_top:p}}catch(i){if(i.message&&i.message.includes("Illegal"))return{language:s,value:rn(d),illegal:!0,relevance:0,_illegalBy:{message:i.message,index:ye,context:d.slice(ye-100,ye+100),mode:i.mode,resultSoFar:un},_emitter:j};if(F)return{language:s,value:rn(d),illegal:!1,relevance:0,errorRaised:i,_emitter:j,_top:p};throw i}}function cn(s){const d={value:rn(s),illegal:!1,relevance:0,_top:u,_emitter:new l.__emitter(l)};return d._emitter.addText(s),d}function on(s,d){d=d||l.languages||Object.keys(t);const T=cn(s),D=d.filter(Se).filter(Ln).map(ie=>De(ie,s,!1));D.unshift(T);const z=D.sort((ie,le)=>{if(ie.relevance!==le.relevance)return le.relevance-ie.relevance;if(ie.language&&le.language){if(Se(ie.language).supersetOf===le.language)return 1;if(Se(le.language).supersetOf===ie.language)return-1}return 0}),[oe,me]=z,Ke=oe;return Ke.secondBest=me,Ke}function Rt(s,d,T){const D=d&&a[d]||T;s.classList.add("hljs"),s.classList.add(`language-${D}`)}function ln(s){let d=null;const T=W(s);if(E(T))return;if(Fe("before:highlightElement",{el:s,language:T}),s.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",s);return}if(s.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(s)),l.throwUnescapedHTML))throw new mt("One of your code blocks includes unescaped HTML.",s.innerHTML);d=s;const D=d.textContent,z=T?G(D,{language:T,ignoreIllegals:!0}):on(D);s.innerHTML=z.value,s.dataset.highlighted="yes",Rt(s,T,z.language),s.result={language:z.language,re:z.relevance,relevance:z.relevance},z.secondBest&&(s.secondBest={language:z.secondBest.language,relevance:z.secondBest.relevance}),Fe("after:highlightElement",{el:s,result:z,text:D})}function Tt(s){l=On(l,s)}const yt=()=>{Pe(),Me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ot(){Pe(),Me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cn=!1;function Pe(){function s(){Pe()}if(document.readyState==="loading"){Cn||window.addEventListener("DOMContentLoaded",s,!1),Cn=!0;return}document.querySelectorAll(l.cssSelector).forEach(ln)}function It(s,d){let T=null;try{T=d(e)}catch(D){if(Te("Language definition for '{}' could not be registered.".replace("{}",s)),F)Te(D);else throw D;T=u}T.name||(T.name=s),t[s]=T,T.rawDefinition=d.bind(null,e),T.aliases&&wn(T.aliases,{languageName:s})}function Mt(s){delete t[s];for(const d of Object.keys(a))a[d]===s&&delete a[d]}function Ct(){return Object.keys(t)}function Se(s){return s=(s||"").toLowerCase(),t[s]||t[a[s]]}function wn(s,{languageName:d}){typeof s=="string"&&(s=[s]),s.forEach(T=>{a[T.toLowerCase()]=d})}function Ln(s){const d=Se(s);return d&&!d.disableAutodetect}function wt(s){s["before:highlightBlock"]&&!s["before:highlightElement"]&&(s["before:highlightElement"]=d=>{s["before:highlightBlock"](Object.assign({block:d.el},d))}),s["after:highlightBlock"]&&!s["after:highlightElement"]&&(s["after:highlightElement"]=d=>{s["after:highlightBlock"](Object.assign({block:d.el},d))})}function Lt(s){wt(s),f.push(s)}function xt(s){const d=f.indexOf(s);d!==-1&&f.splice(d,1)}function Fe(s,d){const T=s;f.forEach(function(D){D[T]&&D[T](d)})}function vt(s){return Me("10.7.0","highlightBlock will be removed entirely in v12.0"),Me("10.7.0","Please use highlightElement now."),ln(s)}Object.assign(e,{highlight:G,highlightAuto:on,highlightAll:Pe,highlightElement:ln,highlightBlock:vt,configure:Tt,initHighlighting:yt,initHighlightingOnLoad:Ot,registerLanguage:It,unregisterLanguage:Mt,listLanguages:Ct,getLanguage:Se,registerAliases:wn,autoDetection:Ln,inherit:On,addPlugin:Lt,removePlugin:xt}),e.debugMode=function(){F=!1},e.safeMode=function(){F=!0},e.versionString=St,e.regex={concat:O,lookahead:N,either:B,optional:U,anyNumberOfTimes:y};for(const s in Oe)typeof Oe[s]=="object"&&n(Oe[s]);return Object.assign(e,Oe),e},Ce=Mn({});return Ce.newInstance=()=>Mn({}),En=Ce,Ce.HighlightJS=Ce,Ce.default=Ce,En}var Vt=jt();const v=Gt(Vt),Un="[A-Za-z$_][0-9A-Za-z$_]*",qt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Jt=["true","false","null","undefined","NaN","Infinity"],Hn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],zn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],es=[].concat(Wn,Hn,zn);function pn(n){const r=n.regex,o=(I,{after:Y})=>{const ee="</"+I[0].slice(1);return I.input.indexOf(ee,Y)!==-1},c=Un,w={begin:"<>",end:"</>"},$=/<[A-Za-z0-9\\._:-]+\s*\/>/,A={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,Y)=>{const ee=I[0].length+I.index,q=I.input[ee];if(q==="<"||q===","){Y.ignoreMatch();return}q===">"&&(o(I,{after:ee})||Y.ignoreMatch());let X;const _e=I.input.substring(ee);if(X=_e.match(/^\s*=/)){Y.ignoreMatch();return}if((X=_e.match(/^\s+extends\s+/))&&X.index===0){Y.ignoreMatch();return}}},_={$pattern:Un,keyword:qt,literal:Jt,built_in:es,"variable.language":Qt},h="[0-9](_?[0-9])*",b=`\\.(${h})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${S})((${b})|\\.)?|(${b}))[eE][+-]?(${h})\\b`},{begin:`\\b(${S})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:_,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,N]},H={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},Z=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,{match:/\$\d+/},R];N.contains=Z.concat({begin:/\{/,end:/\}/,keywords:_,contains:["self"].concat(Z)});const se=[].concat(H,N.contains),M=se.concat([{begin:/(\s*)\(/,end:/\)/,keywords:_,contains:["self"].concat(se)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M},ce={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Hn,...zn]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},Ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(I){return r.concat("(?!",I.join("|"),")")}const he={match:r.concat(/\b/,Ee([...Wn,"super","import"].map(I=>`${I}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ae={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},be="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(be)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:_,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,H,{match:/\$\d+/},R,te,{scope:"attr",match:c+r.lookahead(":"),relevance:0},fe,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,n.REGEXP_MODE,{className:"function",begin:be,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:w.begin,end:w.end},{match:$},{begin:A.begin,"on:begin":A.isTrulyOpeningTag,end:A.end}],subLanguage:"xml",contains:[{begin:A.begin,end:A.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},he,Ne,ce,Ae,{match:/\$[(.]/}]}}const je="[A-Za-z$_][0-9A-Za-z$_]*",Zn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Yn=["true","false","null","undefined","NaN","Infinity"],Xn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],jn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Jn=[].concat(Vn,Xn,jn);function ns(n){const r=n.regex,o=(I,{after:Y})=>{const ee="</"+I[0].slice(1);return I.input.indexOf(ee,Y)!==-1},c=je,w={begin:"<>",end:"</>"},$=/<[A-Za-z0-9\\._:-]+\s*\/>/,A={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,Y)=>{const ee=I[0].length+I.index,q=I.input[ee];if(q==="<"||q===","){Y.ignoreMatch();return}q===">"&&(o(I,{after:ee})||Y.ignoreMatch());let X;const _e=I.input.substring(ee);if(X=_e.match(/^\s*=/)){Y.ignoreMatch();return}if((X=_e.match(/^\s+extends\s+/))&&X.index===0){Y.ignoreMatch();return}}},_={$pattern:je,keyword:Zn,literal:Yn,built_in:Jn,"variable.language":qn},h="[0-9](_?[0-9])*",b=`\\.(${h})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${S})((${b})|\\.)?|(${b}))[eE][+-]?(${h})\\b`},{begin:`\\b(${S})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:_,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},U={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,N]},H={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},Z=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,{match:/\$\d+/},R];N.contains=Z.concat({begin:/\{/,end:/\}/,keywords:_,contains:["self"].concat(Z)});const se=[].concat(H,N.contains),M=se.concat([{begin:/(\s*)\(/,end:/\)/,keywords:_,contains:["self"].concat(se)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M},ce={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xn,...jn]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},Ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(I){return r.concat("(?!",I.join("|"),")")}const he={match:r.concat(/\b/,Ee([...Vn,"super","import"].map(I=>`${I}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ae={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},be="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(be)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:_,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,y,U,O,P,H,{match:/\$\d+/},R,te,{scope:"attr",match:c+r.lookahead(":"),relevance:0},fe,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,n.REGEXP_MODE,{className:"function",begin:be,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:w.begin,end:w.end},{match:$},{begin:A.begin,"on:begin":A.isTrulyOpeningTag,end:A.end}],subLanguage:"xml",contains:[{begin:A.begin,end:A.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},he,Ne,ce,Ae,{match:/\$[(.]/}]}}function Nn(n){const r=n.regex,o=ns(n),c=je,w=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],$={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},A={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:w},contains:[o.exports.CLASS_REFERENCE]},_={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],b={$pattern:je,keyword:Zn.concat(h),literal:Yn,built_in:Jn.concat(w),"variable.language":qn},S={className:"meta",begin:"@"+c},R=(O,P,B)=>{const H=O.contains.findIndex(Z=>Z.label===P);if(H===-1)throw new Error("can not find mode to replace");O.contains.splice(H,1,B)};Object.assign(o.keywords,b),o.exports.PARAMS_CONTAINS.push(S);const N=o.contains.find(O=>O.scope==="attr"),y=Object.assign({},N,{match:r.concat(c,r.lookahead(/\s*\?:/))});o.exports.PARAMS_CONTAINS.push([o.exports.CLASS_REFERENCE,N,y]),o.contains=o.contains.concat([S,$,A,y]),R(o,"shebang",n.SHEBANG()),R(o,"use_strict",_);const U=o.contains.find(O=>O.label==="func.def");return U.relevance=0,Object.assign(o,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),o}function ts(n){const r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],w={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:c},contains:[r,o,n.QUOTE_STRING_MODE,w,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function ss(n){const r=n.regex,o="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",c="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",A={$pattern:o,keyword:["after","alias","and","case","catch","cond","defstruct","defguard","do","else","end","fn","for","if","import","in","not","or","quote","raise","receive","require","reraise","rescue","try","unless","unquote","unquote_splicing","use","when","with|0"],literal:["false","nil","true"]},_={className:"subst",begin:/#\{/,end:/\}/,keywords:A},h={className:"number",begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},S={match:/\\[\s\S]/,scope:"char.escape",relevance:0},R=`[/|([{<"']`,N=[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin:/</,end:/>/}],y=M=>({scope:"char.escape",begin:r.concat(/\\/,M),relevance:0}),U={className:"string",begin:"~[a-z](?="+R+")",contains:N.map(M=>n.inherit(M,{contains:[y(M.end),S,_]}))},O={className:"string",begin:"~[A-Z](?="+R+")",contains:N.map(M=>n.inherit(M,{contains:[y(M.end)]}))},P={className:"regex",variants:[{begin:"~r(?="+R+")",contains:N.map(M=>n.inherit(M,{end:r.concat(M.end,/[uismxfU]{0,7}/),contains:[y(M.end),S,_]}))},{begin:"~R(?="+R+")",contains:N.map(M=>n.inherit(M,{end:r.concat(M.end,/[uismxfU]{0,7}/),contains:[y(M.end)]}))}]},B={className:"string",contains:[n.BACKSLASH_ESCAPE,_],variants:[{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/,contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/,contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},H={className:"function",beginKeywords:"def defp defmacro defmacrop",end:/\B\b/,contains:[n.inherit(n.TITLE_MODE,{begin:o,endsParent:!0})]},Z=n.inherit(H,{className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord",end:/\bdo\b|$|;/}),se=[B,P,O,U,n.HASH_COMMENT_MODE,Z,H,{begin:"::"},{className:"symbol",begin:":(?![\\s:])",contains:[B,{begin:c}],relevance:0},{className:"symbol",begin:o+":(?!:)",relevance:0},{className:"title.class",begin:/(\b[A-Z][a-zA-Z0-9_]+)/,relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"}];return _.contains=se,{name:"Elixir",aliases:["ex","exs"],keywords:A,contains:se}}var Le="[0-9](_*[0-9])*",ze=`\\.(${Le})`,We="[0-9a-fA-F](_*[0-9a-fA-F])*",Pn={className:"number",variants:[{begin:`(\\b(${Le})((${ze})|\\.)?|(${ze}))[eE][+-]?(${Le})[fFdD]?\\b`},{begin:`\\b(${Le})((${ze})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ze})[fFdD]?\\b`},{begin:`\\b(${Le})[fFdD]\\b`},{begin:`\\b0[xX]((${We})\\.?|(${We})?\\.(${We}))[pP][+-]?(${Le})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${We})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Qn(n,r,o){return o===-1?"":n.replace(r,c=>Qn(n,r,o-1))}function as(n){const r=n.regex,o="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",c=o+Qn("(?:<"+o+"~~~(?:\\s*,\\s*"+o+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},b={className:"meta",begin:"@"+o,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},S={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[r.concat(/(?!else)/,o),/\s+/,o,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,o],className:{1:"keyword",3:"title.class"},contains:[S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+c+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[b,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,Pn,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Pn,b]}}function et(n){return n?typeof n=="string"?n:n.source:null}function ke(n){return x("(?=",n,")")}function x(...n){return n.map(o=>et(o)).join("")}function is(n){const r=n[n.length-1];return typeof r=="object"&&r.constructor===Object?(n.splice(n.length-1,1),r):{}}function ne(...n){return"("+(is(n).capture?"":"?:")+n.map(c=>et(c)).join("|")+")"}const hn=n=>x(/\b/,n,/\w$/.test(n)?/\b/:/\B/),rs=["Protocol","Type"].map(hn),Fn=["init","self"].map(hn),cs=["Any","Self"],bn=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Kn=["false","nil","true"],os=["assignment","associativity","higherThan","left","lowerThan","none","right"],ls=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Gn=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],nt=ne(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),tt=ne(nt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),fn=x(nt,tt,"*"),st=ne(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ve=ne(st,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ge=x(st,Ve,"*"),Ze=x(/[A-Z]/,Ve,"*"),us=["attached","autoclosure",x(/convention\(/,ne("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",x(/objc\(/,ge,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],gs=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function ds(n){const r={match:/\s+/,relevance:0},o=n.COMMENT("/\\*","\\*/",{contains:["self"]}),c=[n.C_LINE_COMMENT_MODE,o],w={match:[/\./,ne(...rs,...Fn)],className:{2:"keyword"}},$={match:x(/\./,ne(...bn)),relevance:0},A=bn.filter(L=>typeof L=="string").concat(["_|0"]),_=bn.filter(L=>typeof L!="string").concat(cs).map(hn),h={variants:[{className:"keyword",match:ne(..._,...Fn)}]},b={$pattern:ne(/\b\w+/,/#\w+/),keyword:A.concat(ls),literal:Kn},S=[w,$,h],R={match:x(/\./,ne(...Gn)),relevance:0},N={className:"built_in",match:x(/\b/,ne(...Gn),/(?=\()/)},y=[R,N],U={match:/->/,relevance:0},O={className:"operator",relevance:0,variants:[{match:fn},{match:`\\.(\\.|${tt})+`}]},P=[U,O],B="([0-9]_*)+",H="([0-9a-fA-F]_*)+",Z={className:"number",relevance:0,variants:[{match:`\\b(${B})(\\.(${B}))?([eE][+-]?(${B}))?\\b`},{match:`\\b0x(${H})(\\.(${H}))?([pP][+-]?(${B}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},se=(L="")=>({className:"subst",variants:[{match:x(/\\/,L,/[0\\tnr"']/)},{match:x(/\\/,L,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(L="")=>({className:"subst",match:x(/\\/,L,/[\t ]*(?:[\r\n]|\r\n)/)}),V=(L="")=>({className:"subst",label:"interpol",begin:x(/\\/,L,/\(/),end:/\)/}),ce=(L="")=>({begin:x(L,/"""/),end:x(/"""/,L),contains:[se(L),M(L),V(L)]}),te=(L="")=>({begin:x(L,/"/),end:x(/"/,L),contains:[se(L),V(L)]}),ae={className:"string",variants:[ce(),ce("#"),ce("##"),ce("###"),te(),te("#"),te("##"),te("###")]},de=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],Ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:de},Ee=L=>{const Ie=x(L,/\//),Re=x(/\//,L);return{begin:Ie,end:Re,contains:[...de,{scope:"comment",begin:`#(?!.*${Re})`,end:/$/}]}},he={scope:"regexp",variants:[Ee("###"),Ee("##"),Ee("#"),Ne]},re={match:x(/`/,ge,/`/)},Ae={className:"variable",match:/\$\d+/},be={className:"variable",match:`\\$${Ve}+`},fe=[re,Ae,be],I={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:gs,contains:[...P,Z,ae]}]}},Y={scope:"keyword",match:x(/@/,ne(...us),ke(ne(/\(/,/\s+/)))},ee={scope:"meta",match:x(/@/,ge)},q=[I,Y,ee],X={match:ke(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:x(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ve,"+")},{className:"type",match:Ze,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:x(/\s+&\s+/,ke(Ze)),relevance:0}]},_e={begin:/</,end:/>/,keywords:b,contains:[...c,...S,...q,U,X]};X.contains.push(_e);const qe={match:x(ge,/\s*:/),keywords:"_|0",relevance:0},Be={begin:/\(/,end:/\)/,relevance:0,keywords:b,contains:["self",qe,...c,he,...S,...y,...P,Z,ae,...fe,...q,X]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...c,X]},Je={begin:ne(ke(x(ge,/\s*:/)),ke(x(ge,/\s+/,ge,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ge}]},$e={begin:/\(/,end:/\)/,keywords:b,contains:[Je,...c,...S,...P,Z,ae,...q,X,Be],endsParent:!0,illegal:/["']/},Sn={match:[/(func|macro)/,/\s+/,ne(re.match,ge,fn)],className:{1:"keyword",3:"title.function"},contains:[ve,$e,r],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,$e,r],illegal:/\[|%/},Qe={match:[/operator/,/\s+/,fn],className:{1:"keyword",3:"title"}},en={begin:[/precedencegroup/,/\s+/,Ze],className:{1:"keyword",3:"title"},contains:[X],keywords:[...os,...Kn],end:/}/},nn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},tn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},sn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ge,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:b,contains:[ve,...S,{begin:/:/,end:/\{/,keywords:b,contains:[{scope:"title.class.inherited",match:Ze},...S],relevance:0}]};for(const L of ae.variants){const Ie=L.contains.find(an=>an.label==="interpol");Ie.keywords=b;const Re=[...S,...y,...P,Z,ae,...fe];Ie.contains=[...Re,{begin:/\(/,end:/\)/,contains:["self",...Re]}]}return{name:"Swift",keywords:b,contains:[...c,Sn,Oe,nn,tn,sn,Qe,en,{beginKeywords:"import",end:/$/,contains:[...c],relevance:0},he,...S,...y,...P,Z,ae,...fe,...q,X,Be]}}function at(n){const r={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,_={"variable.language":["this","super"],$pattern:o,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:o,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:_,illegal:"</",contains:[r,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}var xe="[0-9](_*[0-9])*",Ye=`\\.(${xe})`,Xe="[0-9a-fA-F](_*[0-9a-fA-F])*",Es={className:"number",variants:[{begin:`(\\b(${xe})((${Ye})|\\.)?|(${Ye}))[eE][+-]?(${xe})[fFdD]?\\b`},{begin:`\\b(${xe})((${Ye})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ye})[fFdD]?\\b`},{begin:`\\b(${xe})[fFdD]\\b`},{begin:`\\b0[xX]((${Xe})\\.?|(${Xe})?\\.(${Xe}))[pP][+-]?(${xe})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Xe})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function it(n){const r={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},o={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},c={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},w={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},$={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},A={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[$,w]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,$,w]}]};w.contains.push(A);const _={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(A,{className:"string"}),"self"]}]},b=Es,S=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),R={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=R;return N.variants[1].contains=[R],R.variants[1].contains=[N],{name:"Kotlin",aliases:["kt","kts"],keywords:r,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,S,o,c,_,h,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:r,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:r,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[R,n.C_LINE_COMMENT_MODE,S],relevance:0},n.C_LINE_COMMENT_MODE,S,_,h,A,n.C_NUMBER_MODE]},S]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},_,h]},A,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
4
4
  `},b]}}function rt(n){const r=["package","import","option","optional","required","repeated","group","oneof"],o=["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"],c={match:[/(message|enum|service)\s+/,n.IDENT_RE],scope:{1:"keyword",2:"title.class"}};return{name:"Protocol Buffers",aliases:["proto"],keywords:{keyword:r,type:o,literal:["true","false"]},contains:[n.QUOTE_STRING_MODE,n.NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,c,{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}function ct(n){const r=n.regex,o=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),c=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],_={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:c,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},b={className:"subst",begin:/\{/,end:/\}/,keywords:_,illegal:/#/},S={begin:/\{\{/,relevance:0},R={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,h,S,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,h,S,b]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,S,b]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,S,b]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",y=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,U=`\\b|${c.join("|")}`,O={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${y}))[eE][+-]?(${N})[jJ]?(?=${U})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${U})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${U})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${U})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${U})`},{begin:`\\b(${N})[jJ](?=${U})`}]},P={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:_,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},B={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",h,O,R,n.HASH_COMMENT_MODE]}]};return b.contains=[R,O,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:_,illegal:/(<\/|\?)|=>/,contains:[h,O,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},R,P,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[B]},{variants:[{match:[/\bclass/,/\s+/,o,/\s*/,/\(\s*/,o,/\s*\)/]},{match:[/\bclass/,/\s+/,o]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[O,B,R]}]}}function ot(n){const r="true false yes no null",o="[\\w#;/?:@&=+$,.~*'()[\\]]+",c={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},w={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},$={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},A={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,w]},_=n.inherit(A,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},U={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},O={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},P=[c,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+o},{className:"type",begin:"!<"+o+">"},{className:"type",begin:"!"+o},{className:"type",begin:"!!"+o},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},N,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},U,O,$,A],B=[...P];return B.pop(),B.push(_),y.contains=B,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:P}}function lt(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ut(n){const r=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function gt(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function bs(n){const r=n.regex,o={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},c={begin:"^[-\\*]{3,}",end:"$"},w={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},$={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},A={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},_=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:r.concat(/\[.+?\]\(/,_,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},b={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},S={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},R=n.inherit(b,{contains:[]}),N=n.inherit(S,{contains:[]});b.contains.push(N),S.contains.push(R);let y=[o,h];return[b,S,R,N].forEach(B=>{B.contains=B.contains.concat(y)}),y=y.concat(b,S),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},o,$,b,S,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},w,c,h,A,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}const fs=Ht("div")`