@usine/server 0.2.1 → 0.4.0

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 (231) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +54 -20
  3. package/dist/backend.d.ts +26 -5
  4. package/dist/backend.d.ts.map +1 -1
  5. package/dist/backend.js +41 -16
  6. package/dist/backend.js.map +1 -1
  7. package/dist/backup.d.ts +6 -3
  8. package/dist/backup.d.ts.map +1 -1
  9. package/dist/backup.js +26 -8
  10. package/dist/backup.js.map +1 -1
  11. package/dist/cli.d.ts +77 -11
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +280 -31
  14. package/dist/cli.js.map +1 -1
  15. package/dist/command.d.ts +22 -0
  16. package/dist/command.d.ts.map +1 -0
  17. package/dist/command.js +51 -0
  18. package/dist/command.js.map +1 -0
  19. package/dist/detach.d.ts +83 -0
  20. package/dist/detach.d.ts.map +1 -0
  21. package/dist/detach.js +320 -0
  22. package/dist/detach.js.map +1 -0
  23. package/dist/export-run.d.ts +1 -1
  24. package/dist/export-run.d.ts.map +1 -1
  25. package/dist/export-run.js +3 -3
  26. package/dist/export-run.js.map +1 -1
  27. package/dist/failure-message.d.ts +19 -0
  28. package/dist/failure-message.d.ts.map +1 -0
  29. package/dist/failure-message.js +127 -0
  30. package/dist/failure-message.js.map +1 -0
  31. package/dist/http.d.ts +14 -5
  32. package/dist/http.d.ts.map +1 -1
  33. package/dist/http.js +86 -33
  34. package/dist/http.js.map +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/instance/environment.d.ts +17 -0
  40. package/dist/instance/environment.d.ts.map +1 -0
  41. package/dist/instance/environment.js +51 -0
  42. package/dist/instance/environment.js.map +1 -0
  43. package/dist/instance/id.d.ts +17 -0
  44. package/dist/instance/id.d.ts.map +1 -0
  45. package/dist/instance/id.js +35 -0
  46. package/dist/instance/id.js.map +1 -0
  47. package/dist/instance/lock.d.ts +27 -0
  48. package/dist/instance/lock.d.ts.map +1 -0
  49. package/dist/instance/lock.js +127 -0
  50. package/dist/instance/lock.js.map +1 -0
  51. package/dist/instance/manifest.d.ts +52 -0
  52. package/dist/instance/manifest.d.ts.map +1 -0
  53. package/dist/instance/manifest.js +131 -0
  54. package/dist/instance/manifest.js.map +1 -0
  55. package/dist/instance/operator-api.d.ts +30 -0
  56. package/dist/instance/operator-api.d.ts.map +1 -0
  57. package/dist/instance/operator-api.js +47 -0
  58. package/dist/instance/operator-api.js.map +1 -0
  59. package/dist/instance/ports.d.ts +23 -0
  60. package/dist/instance/ports.d.ts.map +1 -0
  61. package/dist/instance/ports.js +81 -0
  62. package/dist/instance/ports.js.map +1 -0
  63. package/dist/instance/record.d.ts +82 -0
  64. package/dist/instance/record.d.ts.map +1 -0
  65. package/dist/instance/record.js +116 -0
  66. package/dist/instance/record.js.map +1 -0
  67. package/dist/instance/state.d.ts +45 -0
  68. package/dist/instance/state.d.ts.map +1 -0
  69. package/dist/instance/state.js +79 -0
  70. package/dist/instance/state.js.map +1 -0
  71. package/dist/instance/systemd.d.ts +36 -0
  72. package/dist/instance/systemd.d.ts.map +1 -0
  73. package/dist/instance/systemd.js +61 -0
  74. package/dist/instance/systemd.js.map +1 -0
  75. package/dist/logger.d.ts +3 -0
  76. package/dist/logger.d.ts.map +1 -0
  77. package/dist/logger.js +27 -0
  78. package/dist/logger.js.map +1 -0
  79. package/dist/main.js +38 -18
  80. package/dist/main.js.map +1 -1
  81. package/dist/registry.d.ts +20 -0
  82. package/dist/registry.d.ts.map +1 -0
  83. package/dist/registry.js +37 -0
  84. package/dist/registry.js.map +1 -0
  85. package/dist/reload-signal.d.ts +8 -0
  86. package/dist/reload-signal.d.ts.map +1 -0
  87. package/dist/reload-signal.js +21 -0
  88. package/dist/reload-signal.js.map +1 -0
  89. package/dist/restart.d.ts +19 -0
  90. package/dist/restart.d.ts.map +1 -0
  91. package/dist/restart.js +105 -0
  92. package/dist/restart.js.map +1 -0
  93. package/dist/shutdown.d.ts +5 -2
  94. package/dist/shutdown.d.ts.map +1 -1
  95. package/dist/shutdown.js +11 -5
  96. package/dist/shutdown.js.map +1 -1
  97. package/dist/status.d.ts +12 -0
  98. package/dist/status.d.ts.map +1 -0
  99. package/dist/status.js +99 -0
  100. package/dist/status.js.map +1 -0
  101. package/dist/stop.d.ts +81 -0
  102. package/dist/stop.d.ts.map +1 -0
  103. package/dist/stop.js +195 -0
  104. package/dist/stop.js.map +1 -0
  105. package/dist/system-sleep.d.ts +9 -0
  106. package/dist/system-sleep.d.ts.map +1 -0
  107. package/dist/system-sleep.js +42 -0
  108. package/dist/system-sleep.js.map +1 -0
  109. package/dist/tracing.d.ts +22 -0
  110. package/dist/tracing.d.ts.map +1 -0
  111. package/dist/tracing.js +61 -0
  112. package/dist/tracing.js.map +1 -0
  113. package/dist/up.d.ts +2 -2
  114. package/dist/up.d.ts.map +1 -1
  115. package/dist/up.js +62 -24
  116. package/dist/up.js.map +1 -1
  117. package/dist/upgrade.d.ts +58 -0
  118. package/dist/upgrade.d.ts.map +1 -0
  119. package/dist/upgrade.js +237 -0
  120. package/dist/upgrade.js.map +1 -0
  121. package/dist/web/assets/CompositeItem-DU6IyNMY.js +1 -0
  122. package/dist/web/assets/ToolbarRootContext-Cytu6o2e.js +1 -0
  123. package/dist/web/assets/X.es-B7iqdxa_.js +1 -0
  124. package/dist/web/assets/_agent-BVKD5odk.js +1 -0
  125. package/dist/web/assets/_loop-BFLzamuo.js +1 -0
  126. package/dist/web/assets/_name-Bh4AQ9sR.js +6 -0
  127. package/dist/web/assets/_name-CMVsmWzq.js +1 -0
  128. package/dist/web/assets/_name-DCkgEma_.js +1 -0
  129. package/dist/web/assets/_name-Ds_pWi15.js +1 -0
  130. package/dist/web/assets/_number-B9aYwvcQ.js +1 -0
  131. package/dist/web/assets/_run-BZWt47QS.js +8 -0
  132. package/dist/web/assets/_worker-Dgfufm5p.js +1 -0
  133. package/dist/web/assets/action-rCd1FeAz.js +1 -0
  134. package/dist/web/assets/agents-Drbg6qpH.js +1 -0
  135. package/dist/web/assets/agents-_6-dEjrY.js +1 -0
  136. package/dist/web/assets/button-DVWXde__.js +1 -0
  137. package/dist/web/assets/collapsible-IOhZV1qg.js +1 -0
  138. package/dist/web/assets/core-wi-Hu_JV.js +12 -0
  139. package/dist/web/assets/drawer-BiqnR_8i.js +1 -0
  140. package/dist/web/assets/dropdown-menu-C9D1kRkO.js +1 -0
  141. package/dist/web/assets/edit-and-retry-BgOR6mvP.js +1 -0
  142. package/dist/web/assets/engine-javascript-D-6se_EF.js +141 -0
  143. package/dist/web/assets/error-alert-9tKpTE3v.js +1 -0
  144. package/dist/web/assets/file-error-SjG2jLJ9.js +1 -0
  145. package/dist/web/assets/fill-cell-ClM88KFD.js +1 -0
  146. package/dist/web/assets/heading-lX1a1LNN.js +1 -0
  147. package/dist/web/assets/index-BymNZU1Q.js +10 -0
  148. package/dist/web/assets/index-Dyjfp3ET.css +2 -0
  149. package/dist/web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  150. package/dist/web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  151. package/dist/web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  152. package/dist/web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  153. package/dist/web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  154. package/dist/web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  155. package/dist/web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  156. package/dist/web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  157. package/dist/web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  158. package/dist/web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  159. package/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  160. package/dist/web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  161. package/dist/web/assets/label-badge-aIGT1Bry.js +1 -0
  162. package/dist/web/assets/list-v8WJp2Eq.js +1 -0
  163. package/dist/web/assets/loops-BFoFf_og.js +1 -0
  164. package/dist/web/assets/mark-CC3RwMy_.js +1 -0
  165. package/dist/web/assets/markdown-BnyfnuCL.js +29 -0
  166. package/dist/web/assets/matchContext-BquevSJS.js +2 -0
  167. package/dist/web/assets/model-BerBT6R0.js +1 -0
  168. package/dist/web/assets/moves-Dg9sshX5.js +1 -0
  169. package/dist/web/assets/overview-C_tFKGZ8.js +1 -0
  170. package/dist/web/assets/page-DWnGi6wA.js +301 -0
  171. package/dist/web/assets/project-not-found-CodaBVdu.js +1 -0
  172. package/dist/web/assets/pull-request-marks-DE00nqGW.js +1 -0
  173. package/dist/web/assets/queries-B1SHA_r4.js +1 -0
  174. package/dist/web/assets/reload-Dsl0zjJ7.js +1 -0
  175. package/dist/web/assets/repositories-BdxmD192.js +1 -0
  176. package/dist/web/assets/repositories-D4wYJfa_.js +1 -0
  177. package/dist/web/assets/route-B_gphTYG.js +1 -0
  178. package/dist/web/assets/route-Cc7dKnn5.js +1 -0
  179. package/dist/web/assets/routes-BLy5TGH_.js +65 -0
  180. package/dist/web/assets/run-again-BTKagSXR.js +1 -0
  181. package/dist/web/assets/section-B3pWIIBa.js +1 -0
  182. package/dist/web/assets/section-CD-MB5r3.js +1 -0
  183. package/dist/web/assets/section-Id99HktI.js +1 -0
  184. package/dist/web/assets/settings-YrDysQXW.js +1 -0
  185. package/dist/web/assets/slots-BraHmbNr.js +1 -0
  186. package/dist/web/assets/status-badge-DnvNo1tG.js +1 -0
  187. package/dist/web/assets/strings-CW2XaR5f.js +1 -0
  188. package/dist/web/assets/table-BjyI4fVI.js +1 -0
  189. package/dist/web/assets/tasks-DCL8kLmD.js +1 -0
  190. package/dist/web/assets/transcript-sxRJzx6t.js +5 -0
  191. package/dist/web/assets/usage-CLQJdX9-.js +1 -0
  192. package/dist/web/assets/use-now-0P8TUXeg.js +1 -0
  193. package/dist/web/assets/useAnchoredPopupScrollLock-CQ83Wy-r.js +1 -0
  194. package/dist/web/assets/useNavigate-BW1WdocJ.js +1 -0
  195. package/dist/web/assets/usePositioner-rNCxnHO-.js +1 -0
  196. package/dist/web/assets/useTimeout-_TcdZXP6.js +1 -0
  197. package/dist/web/assets/with-selector-DoElmmtd.js +1 -0
  198. package/dist/web/assets/workers-BH5CBOR3.js +1 -0
  199. package/dist/web/index.html +16 -10
  200. package/package.json +17 -12
  201. package/dist/web/assets/_name-DdyMEUN6.js +0 -6
  202. package/dist/web/assets/_name-eoobiMh0.js +0 -1
  203. package/dist/web/assets/_name-pUxlKZt5.js +0 -1
  204. package/dist/web/assets/badge-t7m0Vk1K.js +0 -146
  205. package/dist/web/assets/button-BoOukj77.js +0 -1
  206. package/dist/web/assets/core-CLXRiB63.js +0 -12
  207. package/dist/web/assets/empty-DbVYU7bi.js +0 -1
  208. package/dist/web/assets/engine-javascript-h-x4hGa4.js +0 -141
  209. package/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  210. package/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  211. package/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  212. package/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  213. package/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  214. package/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  215. package/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  216. package/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  217. package/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  218. package/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  219. package/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  220. package/dist/web/assets/index-CVBBoW6r.css +0 -2
  221. package/dist/web/assets/index-CsW8KcJW.js +0 -10
  222. package/dist/web/assets/loops-DghpuoiG.js +0 -1
  223. package/dist/web/assets/operator-copy-DIsVXn17.js +0 -1
  224. package/dist/web/assets/overview-DmCIVPwN.js +0 -1
  225. package/dist/web/assets/rolldown-runtime-hePW80VL.js +0 -1
  226. package/dist/web/assets/routes-BDyP7vCr.js +0 -1
  227. package/dist/web/assets/run-drawer-B-xhTXe4.js +0 -157
  228. package/dist/web/assets/status-badge-yblcElE0.js +0 -1
  229. package/dist/web/assets/table-B8cLYNvq.js +0 -1
  230. package/dist/web/assets/useCompositeItem-HmBmWxUW.js +0 -1
  231. package/dist/web/assets/with-selector-N6m4X0X_.js +0 -1
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{Tt as r,ct as i,hn as a,ot as o,vt as s,wt as c}from"./mark-CC3RwMy_.js";import{A as l,I as u,M as d,P as f,V as p,h as m,k as h,r as g}from"./button-DVWXde__.js";import{a as _,c as v,i as y,o as b,r as x,t as S,u as C}from"./useTimeout-_TcdZXP6.js";var w=e(t(),1);function T({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=w.useRef(e!==void 0),[a,o]=w.useState(()=>t);return[i&&e!==void 0?e:a,w.useCallback(e=>{i||o(e)},[])]}function E(e){let{open:t,defaultOpen:n=!1,onOpenChange:i,disabled:o}=e,[s,u]=T({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:d,setMounted:f,transitionStatus:p}=x(s,!0,!0),m=a(),[h,g]=w.useState(),_=h===null?void 0:h??m,v=l(e=>{let t=!s,n=r(c,e.nativeEvent);i(t,n),!n.isCanceled&&u(t)});return w.useMemo(()=>({defaultPanelId:m,disabled:o,handleTrigger:v,mounted:d,open:s,panelId:_,setMounted:f,setOpen:u,setPanelIdState:g,transitionStatus:p}),[m,o,v,d,s,_,f,u,g,p])}var D=w.createContext(void 0);function O(){let e=w.useContext(D);if(e===void 0)throw Error(d(15));return e}var k=`data-open`,A=`data-closed`,j=v,M=`data-panel-open`,N={[k]:``},P={[A]:``},F={open(e){return e?{[M]:``}:null}},I={open(e){return e?N:P},...y},L=n(),R=w.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...u}=e,d=l(o),p=E({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),m=w.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),h=w.useMemo(()=>({...p,onOpenChange:d,state:m}),[p,d,m]),g=f(`div`,e,{state:m,ref:t,props:u,stateAttributesMapping:I});return(0,L.jsx)(D.Provider,{value:h,children:g})}),z={...F,...y},B=w.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=O(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...p}=e,{getButtonProps:m,buttonRef:h}=g({disabled:c,native:u});return f(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:z})}),V={height:void 0,width:void 0};function H(e){let{externalRef:t,hiddenUntilFound:n,id:a,keepMounted:c,mounted:u,onOpenChange:d,open:f,setMounted:m,setOpen:g,transitionStatus:v}=e,y=w.useRef(null),x=w.useRef(null),[T,E]=w.useState(V),D=w.useRef(V),O=w.useRef(!1),k=w.useRef(f),A=w.useRef(!1),[M,N]=w.useState(!1),P=w.useRef(null),F=p(t,y),I=o(f),L=b(y),R=!f&&!u,z=M?`idle`:v,B=f&&(k.current||A.current),H=!f&&u&&x.current===`css-animation`&&T.height===void 0&&T.width===void 0?D.current:T,G=n&&R&&x.current!==`css-animation`,J=l((e,t=!0)=>{t&&(D.current=e),E(e)}),Y=l(()=>{P.current?.(),P.current=null}),X=l(e=>{Y(),P.current=()=>{P.current=null,e()}}),Z=l(()=>{f&&u&&x.current===`css-animation`&&(A.current=!0)});h(()=>{M&&v!==`starting`&&N(!1)},[M,v]),w.useEffect(()=>()=>{Z(),Y()},[Z,Y]),h(()=>{f||(k.current=!1,A.current=!1);let e=y.current;if(!e)return;!f&&P.current&&Y();let t=W(e,B);if(x.current=t,f&&v===`idle`&&k.current&&t===`css-animation`){D.current=U(e);return}if(f&&v===`starting`){let n=O.current;if(O.current=!1,t===`none`){J(U(e)),N(!0);return}if(t===`css-transition`){let t=q(e);if(J(U(e)),!n)return t;let r=K(e,`transition-duration`,`0s`);return X(r),N(!0),t}J(U(e));let r=K(e,`animation-name`,`none`);if(!n){r();return}let i=K(e,`animation-duration`,`0s`);r(),X(i),N(!0);return}if(!f&&u&&(v===`idle`||v===`starting`)){if(t===`none`){J(V,!1),m(!1);return}J(U(e));return}if(v!==`ending`)return;if(t===`none`){m(!1);return}let n=U(e);n.height>0||n.width>0?(J(n),t===`css-animation`&&K(e,`animation-name`,`none`)()):m(!1)},[u,f,Y,J,m,X,B,v]),_({enabled:f&&u&&z===`idle`,open:!0,ref:y,onComplete(){f&&J(V,!1)}}),w.useEffect(()=>{if(f||!u||z!==`ending`)return;if(!y.current){m(!1),J(V,!1);return}let e=new AbortController,t=-1;function n(){I.current||(m(!1),J(V,!1))}return t=C.request(()=>{L(n,e.signal)}),()=>{C.cancel(t),e.abort()}},[I,u,f,z,L,J,m]),h(()=>{let e=y.current;e&&n&&R&&e.setAttribute(`hidden`,`until-found`)},[R,n]),w.useEffect(function(){let e=y.current;if(!e)return;let t=S.create(),n=-1,a=(r,i)=>{t.start(0,()=>{I.current||(n=C.request(()=>{I.current||(r&&(O.current=!1),i&&e.setAttribute(j,``),e.setAttribute(`hidden`,`until-found`))}))})},o=i(e,`beforematch`,t=>{let n=r(s,t);if(d(!0,n),n.isCanceled){a(!1,!1);return}O.current=!0;let i=e.hasAttribute(j);e.removeAttribute(j),g(!0),a(!0,i)});return()=>{t.clear(),C.cancel(n),o()}},[I,d,g]);let Q=c||n||u||f;return{height:H.height,props:{...G?{[j]:``}:void 0,hidden:R,id:a},ref:F,shouldPreventOpenAnimation:B,shouldRender:Q,transitionStatus:z,width:H.width}}function U(e){return{height:e.scrollHeight,width:e.scrollWidth}}function W(e,t){let n=m(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&G(n.animationDuration),i=G(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function G(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function K(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function q(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=C.request(n);return()=>{C.cancel(r),n()}}var J=`--collapsible-panel-height`,Y=`--collapsible-panel-width`,X=w.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:d,onOpenChange:p,open:m,setMounted:g,setPanelIdState:_,setOpen:v,state:y,transitionStatus:b}=O(),x=r??!1,S=i??!1,C=o||void 0,w=C??l;h(()=>(_(e=>C??(e===null?void 0:e)),()=>{_(e=>e===C?null:e)}),[C,_]);let{height:T,props:E,ref:D,shouldPreventOpenAnimation:k,shouldRender:A,transitionStatus:j,width:M}=H({externalRef:t,hiddenUntilFound:x,id:w,keepMounted:S,mounted:d,onOpenChange:p,open:m,setMounted:g,setOpen:v,transitionStatus:b}),N={...y,transitionStatus:j},P=u(s,N),F=f(`div`,{...e,style:void 0},{state:N,ref:D,props:[E,{style:{[J]:T===void 0?`auto`:`${T}px`,[Y]:M===void 0?`auto`:`${M}px`}},c,P?{style:P}:void 0,k?{style:{animationName:`none`}}:void 0],stateAttributesMapping:I});return A?F:null});function Z({...e}){return(0,L.jsx)(R,{"data-slot":`collapsible`,...e})}function Q({...e}){return(0,L.jsx)(B,{"data-slot":`collapsible-trigger`,...e})}function $({...e}){return(0,L.jsx)(X,{"data-slot":`collapsible-content`,...e})}export{T as i,$ as n,Q as r,Z as t};
@@ -0,0 +1,12 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o}from"./markdown-BnyfnuCL.js";var s={}.hasOwnProperty;function c(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&s.call(t,e)){let n=String(t[e]);i=s.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e!==null&&(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function v(e,t){return e<t?-1:+(e>t)}function ee(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ae(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new le(l,u,e,o,s,c)}}return n}var le=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},b=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new y(a,o,s)}var de=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},me=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null)this._mainRule.acceptOverwrite(e,n,r,i);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pe(e,t,n,r,i))}}},x=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ge(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c|0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ce(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof C?w({baseGrammar:a,selfGrammar:i},r):we(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];T([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&T(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&T(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function T(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&T(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ae(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName))}}}var Te=class{kind=0},Ee=class{kind=1},De=class{constructor(e){this.ruleName=e}kind=2},Oe=class{constructor(e){this.scopeName=e}kind=3},ke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ae(e){if(e===`$base`)return new Te;if(e===`$self`)return new Ee;let t=e.indexOf(`#`);return t===-1?new Oe(e):t===0?new De(e.substring(1)):new ke(e.substring(0,t),e.substring(t+1))}var je=/\\(\d+)/,Me=/\\(\d+)/g,Ne=-1,Pe=-2;function Fe(e){return e}function Ie(e){return e}var E=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Le=class extends E{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Re=class extends E{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new D(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ze=class extends E{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends E{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this._end=new D(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ve=class extends E{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new D(o,Pe),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new O,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},He=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Le(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ze(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ve(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Be(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ae(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ze||e instanceof Be||e instanceof Ve)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},D=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&je.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Me.lastIndex=0,this.source.replace(Me,(e,t)=>ne(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},O=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ue(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Ue(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ue=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
2
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},We=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ge=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new We(e,8),this._embeddedLanguagesMatcher=new Ke(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new We(0,0);_getBasicScopeAttributes=new re(e=>new We(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ke=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ne(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var qe=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Je(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ye(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new qe(i,!0);f()}return new qe(i,!1);function f(){let o=Xe(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ne){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),k(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Be){let r=o;k(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Ve){let r=o;k(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(k(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ye(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Ve&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=et(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Pe){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),k(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Xe(e,t,n,r,i,a){let o=Ze(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Qe(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Ze(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=$e(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Qe(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=$e(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function $e(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function et(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function k(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Je(e,p,n&&d.start===0,d.start,f,i,!1,0),ye(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new tt(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var tt=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function nt(e,t,n,r,i,a,o,s){return new at(e,t,n,r,i,a,o,s)}function rt(e,t,n,r,i){let a=S(t,A),o=He.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function A(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(it(t[r],e))return n=r+1,!0;return!1})}function it(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var at=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ge(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ot(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=S(e,A);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)rt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&rt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Fe(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ie(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ot(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=He.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===st.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=x.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?j.createRootAndLookUpScopeName(a,r,this):j.createRoot(`unknown`,r),t=new st(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
3
+ `;let a=this.createOnigString(e),o=a.content.length,s=new lt(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Je(this,a,i,0,t,s,!0,r);return ye(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ot(e,t){return e=u(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var j=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=ie.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ie(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ie(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),x.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},st=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?j.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ie(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=j.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Fe(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,j.fromExtension(r,n.contentNameScopesList))}},ct=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):S(e,A).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>S(e,A).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lt=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=x.set(n,0,he(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=x.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ut=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,nt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ut(y.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(y.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ct(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Se(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ft=st.NULL;function M(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function N(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pt(e){return Array.isArray(e)?e:[e]}async function mt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function P(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function ht(e){return e===`ansi`||P(e)}function F(e){return e===`none`}function gt(e){return F(e)}var _t=/(\r?\n)/g;function I(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(_t),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var vt={light:`#333333`,dark:`#bbbbbb`},yt={light:`#fffffe`,dark:`#1e1e1e`},bt=`__shiki_resolved`;function L(e){if(e?.[bt])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?vt.light:vt.dark,n||=t.type===`light`?yt.light:yt.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,bt,{enumerable:!1,writable:!1,value:!0}),t}async function xt(e){return[...new Set((await Promise.all(e.filter(e=>!ht(e)).map(async e=>await mt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function St(e){return(await Promise.all(e.map(async e=>gt(e)?null:L(await mt(e))))).filter(e=>!!e)}function Ct(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new l(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wt=class extends dt{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=L(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=y.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ct(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new l(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tt=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},R=0;function z(e){R+=1,e.warnings!==!1&&R>=10&&R%10==0&&console.warn(`[Shiki] ${R} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new l("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(L),i=new wt(new Tt(e.engine,n),r,n,e.langAlias),a;function o(t){return Ct(t,e.langAlias)}function s(e){_();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new l(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};_();let t=i.getTheme(e);if(!t)throw new l(`Theme \`${e}\` not found, you may need to load it first`);return t}function u(e){_();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function d(){return _(),i.getLoadedThemes()}function f(){return _(),i.getLoadedLanguages()}function p(...e){_(),i.loadLanguages(e.flat(1))}async function m(...e){return p(await xt(e))}function h(...e){_();for(let t of e.flat(1))i.loadTheme(t)}async function g(...e){return _(),h(await St(e))}function _(){if(t)throw new l(`Shiki instance has been disposed`)}function v(){t||(t=!0,i.dispose(),--R)}return{setTheme:u,getTheme:c,getLanguage:s,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:p,loadTheme:g,loadThemeSync:h,dispose:v,[Symbol.dispose]:v}}var Et=z;async function Dt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([St(e.themes||[]),xt(e.langs||[]),e.engine]);return z({...e,themes:t,langs:n,engine:r})}var Ot=Dt,kt=new WeakMap;function B(e,t){kt.set(e,t)}function V(e){return kt.get(e)}var H=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(pt(n).map(e=>[e,ft])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return At(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function At(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function jt(e,t){if(!(e instanceof H))throw new l(`Invalid grammar state`);return e.getInternalStack(t)}var Mt=/,/,Nt=/ /;function Pt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(P(e.resolveLangAlias(n.lang||`text`))||F(r))return I(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new l(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new l(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return It(t,o,i,a,n)}function Ft(...e){if(e.length===2)return V(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(P(i)||F(a))throw new l(`Plain language does not have grammar state`);if(i===`ansi`)throw new l(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new H(Lt(n,c,o,s,r).stateStack,c.name,o.name)}function It(e,t,n,r,i){let a=Lt(e,t,n,r,i),o=new H(a.stateStack,t.name,n.name);return B(a.tokens,o),a.tokens}function Lt(e,t,n,r,i){let a=M(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=I(e),u=i.grammarState?jt(i.grammarState,n.name)??ft:i.grammarContextCode==null?ft:Lt(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=N(r[x.getForeground(s)],a),u=x.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=x.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Mt).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Nt))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Rt(t.scopes):zt(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Rt(e){return e.map(e=>({scopeName:e}))}function zt(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ht(e,i,t.slice(0,r))}}return n}function Bt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Vt(e,t,n){if(!Bt(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Bt(e[r],n[i])&&--r,--i;return r===-1}function Ht(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Vt(e,t,n)){r.push(a);break}return r}function U(e,t,n,r=Pt){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:V(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ut(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new H(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&B(s,c),s}function Ut(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Wt=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Gt=/["&'<>`]/g,Kt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qt=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jt=/[|\\{}()[\]^$+*?.]/g,Yt=new WeakMap;function Xt(e,t){return e=e.replace(t.subset?Zt(t.subset):Gt,r),t.subset||t.escapeOnly?e:e.replace(Kt,n).replace(qt,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Zt(e){let t=Yt.get(e);return t||(t=Qt(e),Yt.set(e,t)),t}function Qt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Jt,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var $t=/[\dA-Fa-f]/;function en(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!$t.test(String.fromCharCode(t))?r:r+`;`}var tn=/\d/;function nn(e,t,n){let r=`&#`+String(e);return n&&t&&!tn.test(String.fromCharCode(t))?r:r+`;`}var rn=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),an={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},on=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sn={}.hasOwnProperty,cn={},W;for(W in an)sn.call(an,W)&&(cn[an[W]]=W);var ln=/[^\dA-Za-z]/;function un(e,t,n,r){let i=String.fromCharCode(e);if(sn.call(cn,i)){let e=cn[i],a=`&`+e;return n&&rn.includes(e)&&!on.includes(e)&&(!r||t&&t!==61&&ln.test(String.fromCharCode(t)))?a:a+`;`}return``}function dn(e,t,n){let r=en(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=un(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=nn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function G(e,t){return Xt(e,Object.assign({format:dn},t))}var fn=/^>|^->|<!--|-->|--!>|<!-$/g,pn=[`>`],mn=[`<`,`>`];function hn(e,t,n,r){return r.settings.bogusComments?`<?`+G(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))+`>`:`<!--`+e.value.replace(fn,i)+`-->`;function i(e){return G(e,Object.assign({},r.settings.characterReferences,{subset:mn}))}}function gn(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var K=yn(1),_n=yn(-1),vn=[];function yn(e){return t;function t(t,n,r){let i=t?t.children:vn,a=(n||0)+e,s=i[a];if(!r)for(;s&&o(s);)a+=e,s=i[a];return s}}var bn={}.hasOwnProperty;function xn(e){return t;function t(t,n,r){return bn.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Sn=xn({body:Tn,caption:Cn,colgroup:Cn,dd:kn,dt:On,head:Cn,html:wn,li:Dn,optgroup:jn,option:Mn,p:En,rp:An,rt:An,tbody:Pn,td:Ln,tfoot:Fn,th:Ln,thead:Nn,tr:In});function Cn(e,t,n){let r=K(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&o(r.value.charAt(0)))}function wn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function Tn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function En(e,t,n){let r=K(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Dn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function On(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function kn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function An(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function jn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Mn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Nn(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Pn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fn(e,t,n){return!K(n,t)}function In(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ln(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rn=xn({body:Vn,colgroup:Hn,head:Bn,html:zn,tbody:Un});function zn(e){let t=K(e,-1);return!t||t.type!==`comment`}function Bn(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Vn(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&o(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Hn(e,t,n){let r=_n(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Un(e,t,n){let r=_n(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var q={name:[[`
4
+ \f\r &/=>`.split(``),`
5
+ \f\r "&'/=>\``.split(``)],[`\0
6
+ \f\r "&'/<=>`.split(``),`\0
7
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
8
+ \f\r &>`.split(``),`\0
9
+ \f\r "&'<=>\``.split(``)],[`\0
10
+ \f\r "&'<=>\``.split(``),`\0
11
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Wn(t,n,r,i){let a=i.schema,o=a.space!==`svg`&&i.settings.omitOptionalTags,s=a.space===`svg`?i.settings.closeEmptyElements:i.settings.voids.includes(t.tagName.toLowerCase()),c=[],l;a.space===`html`&&t.tagName===`svg`&&(i.schema=e);let u=Gn(i,t.properties),d=i.all(a.space===`html`&&t.tagName===`template`?t.content:t);return i.schema=a,d&&(s=!1),(u||!o||!Rn(t,n,r))&&(c.push(`<`,t.tagName,u?` `+u:``),s&&(a.space===`svg`||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),!s&&(!o||!Sn(t,n,r))&&c.push(`</`+t.tagName+`>`),c.join(``)}function Gn(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Kn(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Kn(e,n,o){let s=i(e.schema,n),c=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,l=+!e.settings.allowDangerousCharacters,u=e.quote,d;if(s.overloadedBoolean&&(o===s.attribute||o===``)?o=!0:(s.boolean||s.overloadedBoolean)&&(typeof o!=`string`||o===s.attribute||o===``)&&(o=!!o),o==null||o===!1||typeof o==`number`&&Number.isNaN(o))return``;let f=G(s.attribute,Object.assign({},e.settings.characterReferences,{subset:q.name[c][l]}));return o===!0||(o=Array.isArray(o)?(s.commaSeparated?t:a)(o,{padLeft:!e.settings.tightCommaSeparatedLists}):String(o),e.settings.collapseEmptyAttributes&&!o)?f:(e.settings.preferUnquoted&&(d=G(o,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:q.unquoted[c][l]}))),d!==o&&(e.settings.quoteSmart&&r(o,u)>r(o,e.alternative)&&(u=e.alternative),d=u+G(o,Object.assign({},e.settings.characterReferences,{subset:(u===`'`?q.single:q.double)[c][l],attribute:!0}))+u),f+(d&&`=`+d))}var qn=[`<`,`&`];function Jn(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:G(e.value,Object.assign({},r.settings.characterReferences,{subset:qn}))}function Yn(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Jn(e,t,n,r)}function Xn(e,t,n,r){return r.all(e)}var Zn=c(`type`,{invalid:Qn,unknown:$n,handlers:{comment:hn,doctype:gn,element:Wn,raw:Yn,root:Xn,text:Jn}});function Qn(e){throw Error("Expected node, not `"+e+"`")}function $n(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var er={},tr={},nr=[];function rr(t,r){let i=r||er,a=i.quote||`"`,o=a===`"`?`'`:`"`;if(a!==`"`&&a!==`'`)throw Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:ir,all:ar,settings:{omitOptionalTags:i.omitOptionalTags||!1,allowParseErrors:i.allowParseErrors||!1,allowDangerousCharacters:i.allowDangerousCharacters||!1,quoteSmart:i.quoteSmart||!1,preferUnquoted:i.preferUnquoted||!1,tightAttributes:i.tightAttributes||!1,upperDoctype:i.upperDoctype||!1,tightDoctype:i.tightDoctype||!1,bogusComments:i.bogusComments||!1,tightCommaSeparatedLists:i.tightCommaSeparatedLists||!1,tightSelfClosing:i.tightSelfClosing||!1,collapseEmptyAttributes:i.collapseEmptyAttributes||!1,allowDangerousHtml:i.allowDangerousHtml||!1,voids:i.voids||Wt,characterReferences:i.characterReferences||tr,closeSelfClosing:i.closeSelfClosing||!1,closeEmptyElements:i.closeEmptyElements||!1},schema:i.space===`svg`?e:n,quote:a,alternative:o}.one(Array.isArray(t)?{type:`root`,children:t}:t,void 0,void 0)}function ir(e,t,n){return Zn(e,t,n,this)}function ar(e){let t=[],n=e&&e.children||nr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var or=/\s+/g;function sr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(or)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(or);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var cr=/:?lang=["']([^"']+)["']/g,lr=/(?:```|~~~)([\w-]+)/g,ur=/\\begin\{([\w-]+)\}/g,dr=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,fr=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function pr(e){let t=I(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function mr(e,t,n){let r=new Set;for(let t of e.matchAll(cr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(lr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ur)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(dr)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(fr.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var hr=[`color`,`background-color`];function gr(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _r(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function vr(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=_r(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return gr(e,a)})):e}function yr(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>J(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},u=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&hr.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let d=o[e][a]||`inherit`,f=o[r][a]||`inherit`;c[a]=`light-dark(${d}, ${f})`,i===`css-vars`&&(c[u(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[u(n,a)]=s)}}),a.htmlStyle=c,a}function J(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&b.Italic&&(t[`font-style`]=`italic`),e.fontStyle&b.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&b.Underline&&n.push(`underline`),e.fontStyle&b.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Y(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function br(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=pr(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new l(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));xr(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return vr(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new l(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,u=-1;if(t===0&&(c=0),n===0&&(u=0),n===1/0&&(u=a.children.length),c===-1||u===-1)for(let e=0;e<a.children.length;e++)s+=Sr(a.children[e]),c===-1&&s.length===t&&(c=e+1),u===-1&&s.length===n&&(u=e+1);if(c===-1)throw new l(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(u===-1)throw new l(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let d=a.children.slice(c,u);if(!i.alwaysWrap&&d.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&d.length===1&&d[0].type===`element`)o(d[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};o(e,i,`wrapper`),a.children.splice(c,d.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&sr(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function xr(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new l(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new l(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Sr(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Sr).join(``):``}var Cr=[br()];function wr(e){let t=Tr(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Cr]}function Tr(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var X=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Er={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Dr(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Or(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function kr(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Er[r]&&t.push({type:`setDecoration`,value:Er[r]});else if(r<=29){let e=Er[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-30]}});else if(r===38){let n=Or(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-40]}});else if(r===48){let n=Or(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-100+8]}})}}return t}function Ar(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Dr(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=kr(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var jr={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Mr(e=jr){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<X.length;e++)r.push(t(X[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Nr=/#([0-9a-f]{3,8})/i,Pr=/var\((--[\w-]+-ansi-[\w-]+)\)/,Fr={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Ir(e,t,n){let r=M(e,n),i=I(t),a=Mr(Object.fromEntries(X.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Fr[t]]}))),o=Ar();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=N(i,r),o=N(o,r),n.decorations.has(`dim`)&&(i=Lr(i));let s=b.None;return n.decorations.has(`bold`)&&(s|=b.Bold),n.decorations.has(`italic`)&&(s|=b.Italic),n.decorations.has(`underline`)&&(s|=b.Underline),n.decorations.has(`strikethrough`)&&(s|=b.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Lr(e){let t=e.match(Nr);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Pr);return n?`var(${n[1]}-dim)`:e}function Z(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!P(r)&&!F(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Ir(r,t,n)}return Pt(e,t,n)}function Q(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=n,p=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:+(t.color===u));if(p.length===0)throw new l("`themes` option must not be empty");let m=U(e,t,n,Z);if(c=V(m),u&&u!==`light-dark()`&&!p.some(e=>e.color===u))throw new l(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);a=m.map(e=>e.map(e=>yr(e,g,d,u,f))),c&&B(a,c);let _=p.map(e=>M(e.theme,n));i=Rr(p,h,_,d,u,`fg`,f),r=Rr(p,h,_,d,u,`bg`,f),o=`shiki-themes ${h.map(e=>e.name).join(` `)}`,s=u?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=M(n.theme,n);a=Z(e,t,n);let l=e.getTheme(n.theme);r=N(l.bg,s),i=N(l.fg,s),o=l.name,c=V(a)}else throw new l("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Rr(e,t,n,r,i,a,o){return e.map((s,c)=>{let u=N(t[c][a],n[c])||`inherit`,d=`${r+s.color}${a===`bg`?`-bg`:``}:${u}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${N(t[r][a],n[r])||`inherit`}, ${N(t[i][a],n[i])||`inherit`});${d}`}return u}return o===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}var zr=/^\s+$/,Br=/^(\s*)(.*?)(\s*)$/;function $(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>$(e,t,n),codeToTokens:(t,n)=>Q(e,t,n)}){let i=t;for(let e of wr(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Q(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Hr(a):d===`never`&&(a=Ur(a)),f&&(a=Wr(a));let p={...r,get source(){return i}};for(let e of wr(n))a=e.tokens?.call(p,a)||a;return Vr(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Vr(e,t,n,r=V(e)){let i=wr(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:sr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
12
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Y(a.htmlStyle||J(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&B(m,r),m}function Hr(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&b.Underline||i.fontStyle&b.Strikethrough));o&&zr.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Ur(e){return e.map(e=>e.flatMap(e=>{if(zr.test(e.content))return e;let t=e.content.match(Br);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Wr(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Y(e.htmlStyle||J(e)),i=Y(n.htmlStyle||J(n)),a=e.fontStyle&&(e.fontStyle&b.Underline||e.fontStyle&b.Strikethrough),o=n.fontStyle&&(n.fontStyle&b.Underline||n.fontStyle&b.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Gr=rr;function Kr(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>$(e,t,n),codeToTokens:(t,n)=>Q(e,t,n)},i=Gr($(e,t,n,r));for(let e of wr(n))i=e.postprocess?.call(r,i,n)||i;return i}async function qr(e){let t=await Dt(e);return{getLastGrammarState:(...e)=>Ft(t,...e),codeToTokensBase:(e,n)=>Z(t,e,n),codeToTokensWithThemes:(e,n)=>U(t,e,n),codeToTokens:(e,n)=>Q(t,e,n),codeToHast:(e,n)=>$(t,e,n),codeToHtml:(e,n)=>Kr(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Jr(e){let t=z(e);return{getLastGrammarState:(...e)=>Ft(t,...e),codeToTokensBase:(e,n)=>Z(t,e,n),codeToTokensWithThemes:(e,n)=>U(t,e,n),codeToTokens:(e,n)=>Q(t,e,n),codeToHast:(e,n)=>$(t,e,n),codeToHtml:(e,n)=>Kr(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Yr(e){let t;async function n(n){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}return n}var Xr=Yr(qr);function Zr(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,ht(n))return[];let r=t[n];if(!r)throw new l(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(gt(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new l(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await qr({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Qr(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function $r(e,t){let n=Qr(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}function ei(e={}){let{name:t=`css-variables`,variablePrefix:n=`--shiki-`,fontStyle:r=!0}=e,i=t=>e.variableDefaults?.[t]?`var(${n}${t}, ${e.variableDefaults[t]})`:`var(${n}${t})`,a={name:t,type:`dark`,colors:{"editor.foreground":i(`foreground`),"editor.background":i(`background`),"terminal.ansiBlack":i(`ansi-black`),"terminal.ansiRed":i(`ansi-red`),"terminal.ansiGreen":i(`ansi-green`),"terminal.ansiYellow":i(`ansi-yellow`),"terminal.ansiBlue":i(`ansi-blue`),"terminal.ansiMagenta":i(`ansi-magenta`),"terminal.ansiCyan":i(`ansi-cyan`),"terminal.ansiWhite":i(`ansi-white`),"terminal.ansiBrightBlack":i(`ansi-bright-black`),"terminal.ansiBrightRed":i(`ansi-bright-red`),"terminal.ansiBrightGreen":i(`ansi-bright-green`),"terminal.ansiBrightYellow":i(`ansi-bright-yellow`),"terminal.ansiBrightBlue":i(`ansi-bright-blue`),"terminal.ansiBrightMagenta":i(`ansi-bright-magenta`),"terminal.ansiBrightCyan":i(`ansi-bright-cyan`),"terminal.ansiBrightWhite":i(`ansi-bright-white`)},tokenColors:[{scope:[`keyword.operator.accessor`,`meta.group.braces.round.function.arguments`,`meta.template.expression`,`markup.fenced_code meta.embedded.block`],settings:{foreground:i(`foreground`)}},{scope:`emphasis`,settings:{fontStyle:`italic`}},{scope:[`strong`,`markup.heading.markdown`,`markup.bold.markdown`],settings:{fontStyle:`bold`}},{scope:[`markup.italic.markdown`],settings:{fontStyle:`italic`}},{scope:`meta.link.inline.markdown`,settings:{fontStyle:`underline`,foreground:i(`token-link`)}},{scope:[`string`,`markup.fenced_code`,`markup.inline`],settings:{foreground:i(`token-string`)}},{scope:[`comment`,`string.quoted.docstring.multi`],settings:{foreground:i(`token-comment`)}},{scope:[`constant.numeric`,`constant.language`,`constant.other.placeholder`,`constant.character.format.placeholder`,`variable.language.this`,`variable.other.object`,`variable.other.class`,`variable.other.constant`,`meta.property-name`,`meta.property-value`,`support`],settings:{foreground:i(`token-constant`)}},{scope:[`keyword`,`storage.modifier`,`storage.type`,`storage.control.clojure`,`entity.name.function.clojure`,`entity.name.tag.yaml`,`support.function.node`,`support.type.property-name.json`,`punctuation.separator.key-value`,`punctuation.definition.template-expression`],settings:{foreground:i(`token-keyword`)}},{scope:`variable.parameter.function`,settings:{foreground:i(`token-parameter`)}},{scope:[`support.function`,`entity.name.type`,`entity.other.inherited-class`,`meta.function-call`,`meta.instance.constructor`,`entity.other.attribute-name`,`entity.name.function`,`constant.keyword.clojure`],settings:{foreground:i(`token-function`)}},{scope:[`entity.name.tag`,`string.quoted`,`string.regexp`,`string.interpolated`,`string.template`,`string.unquoted.plain.out.yaml`,`keyword.other.template`],settings:{foreground:i(`token-string-expression`)}},{scope:[`punctuation.definition.arguments`,`punctuation.definition.dict`,`punctuation.separator`,`meta.function-call.arguments`],settings:{foreground:i(`token-punctuation`)}},{scope:[`markup.underline.link`,`punctuation.definition.metadata.markdown`],settings:{foreground:i(`token-link`)}},{scope:[`beginning.punctuation.definition.list.markdown`],settings:{foreground:i(`token-string`)}},{scope:[`punctuation.definition.string.begin.markdown`,`punctuation.definition.string.end.markdown`,`string.other.link.title.markdown`,`string.other.link.description.markdown`],settings:{foreground:i(`token-keyword`)}},{scope:[`markup.inserted`,`meta.diff.header.to-file`,`punctuation.definition.inserted`],settings:{foreground:i(`token-inserted`)}},{scope:[`markup.deleted`,`meta.diff.header.from-file`,`punctuation.definition.deleted`],settings:{foreground:i(`token-deleted`)}},{scope:[`markup.changed`,`punctuation.definition.changed`],settings:{foreground:i(`token-changed`)}}]};return r||(a.tokenColors=a.tokenColors?.map(e=>(e.settings?.fontStyle&&delete e.settings.fontStyle,e))),a}export{l as ShikiError,sr as addClassToHast,N as applyColorReplacements,$ as codeToHast,Kr as codeToHtml,Q as codeToTokens,Z as codeToTokensBase,U as codeToTokensWithThemes,Zr as createBundledHighlighter,ei as createCssVariablesTheme,qr as createHighlighterCore,Jr as createHighlighterCoreSync,pr as createPositionConverter,Ot as createShikiInternal,Et as createShikiInternalSync,z as createShikiPrimitive,Dt as createShikiPrimitiveAsync,$r as createSingletonShorthands,yr as flatTokenVariants,Ft as getLastGrammarState,Xr as getSingletonHighlighterCore,J as getTokenStyleObject,mr as guessEmbeddedLanguages,Gr as hastToHtml,F as isNoneTheme,P as isPlainLang,ht as isSpecialLang,gt as isSpecialTheme,Qr as makeSingletonHighlighter,Yr as makeSingletonHighlighterCore,mt as normalizeGetter,L as normalizeTheme,M as resolveColorReplacements,I as splitLines,gr as splitToken,vr as splitTokens,Y as stringifyTokenStyle,pt as toArray,Ir as tokenizeAnsiWithTheme,It as tokenizeWithTheme,Vr as tokensToHast,br as transformerDecorations};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{Gt as r,Jt as i,Kt as a,Rt as o,Xt as s,m as c,s as l}from"./page-DWnGi6wA.js";import{t as u}from"./error-alert-9tKpTE3v.js";import{D as d,G as f,W as p,n as m}from"./button-DVWXde__.js";import{n as h,t as g}from"./edit-and-retry-BgOR6mvP.js";import{a as _,h as v,l as y,m as b,n as x,p as S,r as C,u as w}from"./transcript-sxRJzx6t.js";import{r as T}from"./strings-CW2XaR5f.js";import{n as E,p as D,r as O}from"./overview-C_tFKGZ8.js";import{$ as k,A,G as j,K as M,Q as N,X as P,Z as F,et as I,q as L}from"./index-BymNZU1Q.js";import{t as R}from"./use-now-0P8TUXeg.js";var z=e(t(),1),B=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z`}))]]),V=z.forwardRef((e,t)=>z.createElement(p,{ref:t,...e,weights:B}));V.displayName=`ArrowsOutSimpleIcon`;var H=n(),U=({detail:e})=>{let t=(0,z.useMemo)(()=>_(S(e.transcript,e.run.attempts,e.sessionState),e.run.attempts,e.transcript),[e.transcript,e.sessionState,e.run.attempts]),n=[...t.chapters].reverse().find(({live:e})=>e),r=t.chapters.flatMap(({rows:e})=>e).reverse().find(e=>e._tag===`Message`);return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[n===void 0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Attempt starting`}):(0,H.jsx)(w,{chapter:n}),r?._tag===`Message`&&(0,H.jsxs)(`section`,{"aria-label":`Latest message`,className:`space-y-1`,children:[(0,H.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:r.speaker.name}),(0,H.jsx)(`time`,{dateTime:r.receivedAt,title:c(r.receivedAt),className:`font-mono tabular-nums text-muted-foreground`,children:l(r.receivedAt)})]}),(0,H.jsx)(`p`,{className:`line-clamp-6 text-md wrap-anywhere`,children:y(r.text)}),r.queued!==null&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D(r.queued)})]})]})},W=e=>{let t=e.attempts.at(-1),n=t?.salvage??null;return e.state===`Succeeded`?i({_tag:`Succeeded`,message:o(e.resultMessage)}):e.state===`Canceled`?i({_tag:`Canceled`,salvage:n}):e.state===`Failed`&&t?.outcome?._tag===`Failed`?i({_tag:`Failed`,failure:t.outcome.failure,salvage:n}):a()},G=({machine:e})=>{let t=R(15e3);return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:T(e,t)})},K=({detail:e})=>{let t=e.run;switch(t.state){case`Pending`:return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Opened, not scheduled yet`});case`Waiting`:return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Waiting for approval`});case`Queued`:return e.machine?.state===`creating`?(0,H.jsx)(G,{machine:e.machine}):(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Approved, waiting for a free worker`});case`Running`:return(0,H.jsx)(U,{detail:e});case`Succeeded`:case`Failed`:case`Canceled`:return r(W(t),{onNone:()=>(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt started`}),onSome:e=>(0,H.jsx)(C,{end:e,outOfMemory:t.attempts.at(-1)?.outOfMemory??null})})}},q=({runId:e,open:t,close:n})=>{let{data:r}=s(E()),i=x(e,t),[a,o]=(0,z.useState)(null),c=A(),l=i.data?.run;return(0,H.jsx)(P,{open:t,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(F,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-md`,children:[(0,H.jsx)(k,{className:`shrink-0 gap-3 border-b px-5 pt-5 pb-4 pr-20`,children:l===void 0||i.data===void 0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(I,{children:`Loading…`}),(0,H.jsx)(N,{children:`Loading run…`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(v,{detail:i.data,overview:r,placement:`drawer`,shared:t,as:I,actions:(0,H.jsx)(b,{detail:i.data,onEdit:o,openRun:c})}),(0,H.jsxs)(N,{className:`sr-only`,children:[`Run `,l.id,` of `,l.loop,` on `,l.repository]})]})}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[i.isError&&(0,H.jsx)(u,{message:i.error.message}),l!==void 0&&a!==null&&h(l,a)&&(0,H.jsx)(g,{run:l,intent:a,close:()=>o(null),openRun:c},`${l.id}:${a}`),i.data!==void 0&&(0,H.jsx)(K,{detail:i.data}),l!==void 0&&(0,H.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...O(l.repository),run:l.id},search:{},viewTransition:!0,className:m({variant:`outline`}),children:`Open run page`})]}),l!==void 0&&(0,H.jsxs)(j,{children:[(0,H.jsx)(L,{render:(0,H.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...O(l.repository),run:l.id},search:{},viewTransition:!0,"aria-label":`Open run page`,className:d(m({variant:`ghost`,size:`icon-sm`}),`absolute top-4 right-11`)}),children:(0,H.jsx)(V,{"aria-hidden":`true`})}),(0,H.jsx)(M,{side:`bottom`,children:`Open run page`})]})]})})};export{q as RunDrawer};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{A as r,At as i,B as a,C as o,D as s,E as c,Et as l,F as u,Ft as d,G as f,Gt as p,H as m,I as h,J as g,K as _,L as v,Lt as y,M as b,Mt as x,Nt as S,O as C,P as w,Pt as ee,Rt as T,T as E,Tt as te,U as D,V as O,Vt as ne,W as k,Wt as re,X as A,Xt as j,Y as ie,Yt as M,Z as N,Zt as P,_t as F,an as I,at as ae,bt as L,cn as R,dn as z,f as oe,fn as B,gn as V,gt as H,hn as U,ht as W,in as G,jt as se,k as ce,ln as K,lt as le,mn as q,mt as ue,nn as de,nt as fe,on as pe,ot as J,p as me,pt as he,q as ge,rn as _e,rt as ve,tt as ye,u as be,un as xe,v as Se,vt as Ce,w as we,xt as Te,zt as Ee}from"./mark-CC3RwMy_.js";import{A as Y,D as De,F as Oe,H as ke,L as Ae,M as X,N as je,P as Me,R as Ne,V as Pe,W as Fe,h as Ie,i as Le,k as Z,m as Re,o as ze,r as Be,v as Ve,y as He}from"./button-DVWXde__.js";import{a as Ue,d as We,n as Ge,o as Ke}from"./useTimeout-_TcdZXP6.js";import{a as qe,c as Je,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,t as et}from"./usePositioner-rNCxnHO-.js";import{i as tt,n as nt,o as rt,r as it,t as at}from"./useAnchoredPopupScrollLock-CQ83Wy-r.js";import{ct as ot}from"./index-BymNZU1Q.js";import{t as st}from"./ToolbarRootContext-Cytu6o2e.js";import{n as ct,r as lt,t as ut}from"./CompositeItem-DU6IyNMY.js";var Q=e(t(),1),dt=new Map([[`bold`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),ft=Q.forwardRef((e,t)=>Q.createElement(Fe,{ref:t,...e,weights:dt}));ft.displayName=`DotsThreeIcon`;var pt=Q.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Me(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function mt(e){return B&&e.movementX===0&&e.movementY===0}function ht(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gt(e,t){return ht(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _t(e,t,n){return ht(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vt(e,t,n){return ht(t,n?e===_e:e===G,e===de)}function yt(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:ht(t,n?e===G:e===_e,e===I)}function bt(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:_=!0,disabledIndices:v=void 0,orientation:b=`vertical`,triggerOrientation:S=b,parentOrientation:C,id:w,resetOnPointerLeave:E=!0,externalTree:D,nestedReturnFocusRef:O,grid:k}=t,A=k!=null,j=e.useState(`open`),M=e.useState(`floatingElement`),N=e.useState(`domReferenceElement`),P=e.context.dataRef,I=ne(M),ae=re(N),L=J(I),z=g(),oe=ie(D),B=Q.useRef(m),H=Q.useRef(s??-1),U=Q.useRef(null),W=Q.useRef(!0),G=Y(e=>{a(H.current===-1?null:H.current,e)}),ce=Q.useRef(!!M),le=Q.useRef(j),q=Q.useRef(!1),ue=Q.useRef(!1),de=Q.useRef(null),fe=J(v),me=J(j),ge=J(s),_e=J(E),ye=We(),be=We(),xe=Y(()=>{ye.cancel();function e(e){f||(de.current=ve(e,{sync:q.current,preventScroll:!0}))}let t=n.current[H.current],r=ue.current;t&&e(t),(q.current?e=>e():e=>ye.request(e))(()=>{let i=n.current[H.current]||t;i&&(t||e(i),Oe&&(r||!W.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Z(()=>{P.current.orientation=b},[P,b]),Z(()=>{j||(U.current=null),(!j||m!==`auto`)&&(B.current=m)},[j,m]),Z(()=>{o&&(j&&M?(H.current=s??-1,B.current&&s!=null&&(ue.current=!0,G())):ce.current&&(H.current=-1,G()))},[o,j,M,s,G]),Z(()=>{if(o){if(!j)q.current=!1;else if(M){if(r==null){if(q.current=!1,ge.current!=null)return;if(ce.current&&(H.current=-1,xe()),(!le.current||!ce.current)&&B.current&&(U.current!=null||B.current===!0&&U.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>be.request(e):queueMicrotask)(t),e+=1):(H.current=U.current==null||_t(U.current,S,d)||u?se(n):i(n),U.current=null,G())};t()}}else ee(n.current,r)||(H.current=r,xe(),ue.current=!1)}}},[o,j,M,r,ge,u,n,S,d,G,xe,be]),Z(()=>{if(!o||M||!oe||f||!ce.current)return;let e=oe.nodesRef.current,t=e.find(e=>e.id===z)?.context?.elements.floating,n=pe(V(N??t??null)),r=e.some(e=>e.context&&R(e.context.elements.floating,n));t&&!r&&W.current&&t.focus({preventScroll:!0})},[o,M,N,oe,z,f]),Z(()=>{le.current=j,ce.current=!!M});let Se=r!=null,Ce=Y(e=>{if(!me.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(H.current!==t||r!==t)&&(H.current=t,G(e))}),we=Y(()=>C??oe?.nodesRef.current.find(e=>e.id===z)?.context?.dataRef?.current.orientation),Te=Y(()=>se(n,fe.current)),De=Y(t=>{if(W.current=!1,q.current=!0,t.which===229||!me.current&&t.currentTarget===L.current)return;if(u&&yt(t.key,b,d,A)){gt(t.key,we())||Ee(t),e.setOpen(!1,te(F,t.nativeEvent));let n=O?.current??N;Ve(n)&&n.focus();return}r!=null&&r!==H.current&&!ee(n.current,r)&&(H.current=r);let a=H.current,o=se(n,v),s=i(n,v);if(ae||(t.key===`Home`&&(Ee(t),H.current=o,G(t)),t.key===`End`&&(Ee(t),H.current=s,G(t))),k!=null){let e=k(t,H.current,n,b,l,d,v,o,s);if(e!=null&&e!==H.current&&(H.current=e,G(t)),b===`both`)return}if(gt(t.key,b)){Ee(t);let e=pe(t.currentTarget.ownerDocument);if(j&&!f&&R(t.currentTarget,e)&&!n.current.some(t=>t!=null&&R(t,e))){H.current=_t(t.key,b,d)?o:s,G(t),r===H.current&&xe();return}let{index:i,wrapped:u}=x(n.current,a,{decrement:!_t(t.key,b,d),loopFocus:l,allowEscape:c,disabledIndices:v,minIndex:o,maxIndex:s});u&&(q.current=!1),H.current=i,G(t)}}),Oe=Q.useMemo(()=>({onFocus(e){q.current=!0,Ce(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){mt(e)||(q.current=!0,ue.current=!1,h&&Ce(e))},onPointerLeave(e){if(!me.current||!W.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(h&&!n.current.includes(t)&&_e.current&&(de.current?.(),de.current=null,H.current=-1,G(e),!f)){let e=L.current,t=pe(V(e));e&&R(e,t)&&e.focus({preventScroll:!0})}}}),[Ce,me,L,h,n,G,_e,f]),ke=Q.useMemo(()=>f&&j&&Se&&{"aria-activedescendant":`${w}-${r}`},[f,j,Se,w,r]),Ae=Q.useMemo(()=>({...ae?{}:ke,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&j&&!f){let n=K(t.nativeEvent);if(n&&!R(L.current,n))return;Ee(t);let r=te(he,t.nativeEvent);e.setOpen(!1,r);let i=O?.current??N;!r.isCanceled&&Ve(i)&&i.focus()}else De(t)},onPointerMove(e){mt(e)||(W.current=!0)}}),[ke,De,L,ae,e,j,f,N,O]),X=Q.useMemo(()=>{function t(t){e.setOpen(!0,te(F,t.nativeEvent,t.currentTarget))}function n(e){m===`auto`&&y(e.nativeEvent)&&(B.current=!f)}function r(e){B.current=m,m===`auto`&&T(e.nativeEvent)&&(B.current=!0)}return{onKeyDown(n){let r=e.select(`open`);W.current=!1;let i=n.key.startsWith(`Arrow`),a=vt(n.key,we(),d),o=gt(n.key,r?b:S),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||p(n.currentTarget)))return De(n);if(r||_||!i){if(s){let e=gt(n.key,we());U.current=u&&e?null:n.key}u?a&&(Ee(n),r?(H.current=Te(),G(n),f&&L.current?.focus()):t(n)):o&&(ge.current!=null&&(H.current=ge.current),Ee(n),!r&&_?t(n):De(n),r&&G(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(H.current=-1,G(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[De,m,Te,u,G,e,_,b,S,we,d,ge,f,L]),je=Q.useMemo(()=>({...ke,...X}),[ke,X]);return Q.useMemo(()=>o?{reference:je,floating:Ae,item:Oe,trigger:X}:{},[o,je,Ae,X,Oe])}function xt(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,f=Y(s),p=e.useState(`open`),m=Ge(),h=Q.useRef(``),g=Q.useRef(u??i??-1),_=Q.useRef(null),v=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!S(n)||n?.matches(`:disabled`)?!1:o==null||!d(Ae,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let v=n.current;if(h.current.length>0&&e.key===` `&&(Ee(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(v,h.current)===-1&&e.key!==` `&&f?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(Ee(e),f?.(!0));let y=h.current===``;y&&(g.current=u??i??-1),v.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,f?.(!1)});let b=((y?u??i??-1:g.current)??0)+1,x=c(v,h.current,b);x===-1?e.key!==` `&&(h.current=``,f?.(!1)):(a?.(x,e),_.current=x)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);R(r,n)||R(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});Z(()=>{(p||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,u,m,f]);let b=Q.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return Q.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var $=n(),St=Q.createContext(void 0);function Ct(e){let t=Q.useContext(St);if(t===void 0&&!e)throw Error(X(33));return t}var wt=Q.createContext(void 0);function Tt(e){let t=Q.useContext(wt);if(t===void 0&&!e)throw Error(X(36));return t}var Et=Q.createContext(void 0);function Dt(e=!0){let t=Q.useContext(Et);if(t===void 0&&!e)throw Error(X(25));return t}var Ot=Q.createContext(null);function kt(e=`root`){let t=Q.useContext(Ot),n=Q.useContext(wt);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var At={visible:!0,ref:null};function jt(){return At}function Mt(e,t,n=`root`){let r=kt(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??jt)({label:e.label,children:e.children,render:e.render}),a=Pe(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Nt(e){e.preventDefault()}function Pt(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Tt(),u=Dt(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Nt:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:W})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!q&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Le(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Ft={type:`regular-item`};function It(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Q.useRef(null),{getButtonProps:d,buttonRef:f}=Be({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Pt({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Q.useCallback(e=>Oe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Pe(u,f);return Q.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Lt=Q.createContext(void 0),Rt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Q.useState(void 0),c=Me(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,$.jsx)(Lt.Provider,{value:s,children:c})}),zt=Q.forwardRef(function(e,t){let n=kt()?.Group??Rt;return(0,$.jsx)(n,{...e,ref:t})}),Bt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Tt(),f=lt({guess:!0,label:a}),p=U(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=It({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Ft});return Me(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Vt=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Bt,{...e,ref:n.ref}):null}),Ht=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:o=!1,style:s,...c}=e,{store:l}=Tt(),u=Q.useRef(null),d=lt({guess:!0,label:a}),f=U(i),p=l.useState(`isActive`,d.index),m=l.useState(`floatingNodeId`),h=l.useState(`itemProps`),g=l.context.typingRef,{getButtonProps:_,buttonRef:v}=Be({native:!1,composite:!0}),y=Pt({closeOnClick:o,highlighted:p,id:f,nodeId:m,store:l,typingRef:g,itemRef:u,itemMetadata:Ft});function b(e){return Oe(y,e,_)}return Me(`a`,e,{state:{highlighted:p},props:[h,c,b],ref:[u,v,t,d.ref]})}),Ut=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Ht,{...e,ref:n.ref}):null}),Wt=Q.createContext(void 0);function Gt(){return Q.useContext(Wt)}function Kt(e,t){let n=je(e.render);if(Q.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function qt(e,t,n){let r=Kt(e,t),i=r===t?void 0:r;return[r,Q.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Jt(e,t,n){let r=je(e.render),i=Q.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Yt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Tt(),m=Gt(),{side:h,align:g}=Ct(),_=st(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),ee=l.useState(`lastOpenChangeReason`),T=l.useState(`rootId`),E=l.useState(`floatingRootContext`),D=l.useState(`floatingTreeRoot`),O=l.useState(`closeDelay`),ne=l.useState(`hoverEnabled`),re=l.useState(`disabled`),A=l.useState(`openMethod`),j=l.useState(`activeTriggerId`),ie=l.useState(`listElement`),[N,P]=qt(e,u,d),F=Jt(e,C,j),I=w.type===`menu`?m:void 0,ae=w.type===`context-menu`,L=s??w.type!==`menu`;s===void 0&&ie&&w.type!==`menu`&&(L=()=>l.state.activeIndex===null&&ie),Ue({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){l.setOpen(!1,te(e.reason,e.domEvent))}return D.events.on(`close`,e),()=>{D.events.off(`close`,e)}},[D.events,l]),Qe(E,{enabled:ne&&!re&&!ae&&w.type!==`menubar`,closeDelay:O});let R=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:z,handleFocus:oe}=(Q.useContext(Ot)?.useParentHandoff??Zt)(l,w,v,f),B={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},V=Me(`div`,e,{state:B,ref:[t,l.context.popupRef,R,P],stateAttributesMapping:M,props:[b,{id:N,...ie?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":F},onKeyDown(e){I?.onPopupKeyDown?.(e),_&&Se.has(e.key)&&e.stopPropagation()},onFocus:oe},Ze(y),c,{"data-rootownerid":T}]}),H=w.type===void 0||ae;(C||w.type===`menubar`&&ee!==`outside-press`)&&(H=!0);let U=I?.getReturnElement??z;return(0,$.jsx)(k,{context:E,openInteractionType:A,modal:ae,disabled:!x,returnFocus:a??U??H,explicitReturnFocus:a===void 0&&U?!1:void 0,initialFocus:L,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:D,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:V})}),Xt={parentVirtualFocusRef:void 0,handleFocus:void 0};function Zt(){return Xt}var Qt=Q.forwardRef(function(e,t){let n=kt()?.Popup??Yt;return(0,$.jsx)(n,{...e,ref:t})}),$t=Q.createContext(void 0);function en(){let e=Q.useContext($t);if(e===void 0)throw Error(X(32));return e}var tn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Tt();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,$.jsx)($t.Provider,{value:n,children:(0,$.jsx)(N,{ref:t,...r,portalOwnerRole:o})})}),nn=Q.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=ye,style:_,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=Tt(),S=en(),C=Dt(!0),w=y.useState(`parent`),ee=y.useState(`floatingRootContext`),T=y.useState(`floatingTreeRoot`),E=y.useState(`mounted`),D=y.useState(`open`),O=y.useState(`modal`),ne=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),re=y.useState(`transitionStatus`),A=y.useState(`positionerElement`),j=y.useState(`instantType`),ie=y.useState(`adaptiveOrigin`),M=y.useState(`lastOpenChangeReason`),N=y.useState(`floatingNodeId`),P=y.useState(`floatingParentNodeId`),F=ee.useState(`domReferenceElement`),I=n,ae=c,L=l,R=s,z=g;w.type===`context-menu`&&(I=n??w.context?.anchor,R??=`start`,!o&&R!==`center`&&(L=e.alignOffset??2,ae=e.sideOffset??-5));let B=o,V=R;w.type===`menu`?(B??=`inline-end`,V??=`start`,z=e.collisionAvoidance??fe):w.type===`menubar`&&(B??=w.context.orientation===`vertical`?`inline-end`:`bottom`,V??=`start`);let H=w.type===`context-menu`,U=$e({anchor:I,floatingRootContext:ee,positionMethod:C?`fixed`:r,mounted:E,side:B,sideOffset:ae,align:V,alignOffset:L,arrowPadding:H?0:p,collisionBoundary:u,collisionPadding:d,sticky:m,nodeId:N,keepMounted:S,disableAnchorTracking:h,collisionAvoidance:z,shift:H?{crossAxis:!(`side`in z&&z.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:ie,lazyFlip:b?`placement`:!1});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&y.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,te(Te)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[y,T.events,N]),Q.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,te(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,y]);let W=Ge();Q.useEffect(()=>{D||W.clear()},[D,W]),Q.useEffect(()=>{function e(e){if(D&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?W.isStarted()||W.start(e,()=>{y.setOpen(!1,te(Te))}):y.setOpen(!1,te(Te))}else W.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,k,y,W]),Q.useEffect(()=>{let e={open:D,nodeId:N,parentNodeId:P,reason:y.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,y,N,P]),nt({store:y,domReference:F,positionerElement:A,open:D});let G={open:D,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:w.type===`menu`,instant:j},se=w.type===`menubar`&&w.context.modal;at(D&&(se||O&&M!==`trigger-hover`),ne===`touch`,A,k);let ce=et(e,G,{styles:U.positionerStyles,transitionStatus:re,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),K=E&&w.type!==`menu`&&(w.type!==`menubar`&&O&&M!==`trigger-hover`||w.type===`menubar`&&w.context.modal),le=null;return w.type===`menubar`?le=w.context.contentElement:w.type===void 0&&(le=k),(0,$.jsxs)(St.Provider,{value:U,children:[K&&(0,$.jsx)(oe,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:me(!D),cutout:le}),(0,$.jsx)(f,{id:N,children:(0,$.jsx)(ct,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:ce})})]})}),rn=Q.createContext(null);function an(e){let t=Q.useContext(rn);if(t===null&&!e)throw Error(X(5));return t}function on(e){return e==null?Ce:e.type.startsWith(`key`)?H:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?L:Ce}var sn={...we,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=we.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>B&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!we.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},cn=class extends E{constructor(e,t,n=!1){let r=new C,i=un(r,t,n,e);super(i,ln(r),sn),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function ln(e){return{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Q.createRef(),beforeTriggerFocusGuardRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function un(e,t,n=!1,r){return{...o(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ne,inputProps:Ne,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new A,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ne,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var dn=Q.createContext(null);function fn(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function pn(e,t){return e===`list-navigation`||fn(e,t)}var mn=c(function(e){let{children:t,open:n,onOpenChange:i,onOpenChangeComplete:a,onItemHighlighted:o,defaultOpen:s=!1,disabled:c=!1,modal:d,loopFocus:f=!0,orientation:p=`vertical`,actionsRef:y,closeParentOnEsc:x=!1,handle:S,triggerId:C,defaultTriggerId:ee=null,highlightItemOnHover:T=!0,isSubmenu:E=!1,virtualFocus:O=!1,virtualFocusRef:ne,allowEscape:k=!0,resetOnPointerLeave:re=!0}=e,A=Dt(!0),j=Tt(!0),ie=an(!0),M=j?.store,N=j?.virtualFocus??!1,P=Q.useMemo(()=>E&&M?{type:`menu`,store:M}:ie?{type:`menubar`,context:ie}:A&&!M?{type:`context-menu`,context:A}:{type:void 0},[A,M,ie,E]),F=U(),I=U(),[ae,L]=Q.useState(void 0),R=(ae??I)||void 0,z=g(),oe=P.type===`menu`?P.store:void 0,B=(n??s)&&oe?.state.transitionStatus===`starting`,V=ke(()=>B?oe?.state.instantType:void 0).current,W=ke(()=>{let e=new cn({open:s,openProp:n,activeTriggerId:ee,triggerIdProp:C,parent:P,disabled:c,highlightItemOnHover:T,modal:P.type===void 0?d:void 0,rootId:F,instantType:V},R,z!=null);return e.context.virtualFocusRef=ne,e}).current;W.useControlledProp(`openProp`,n),W.useControlledProp(`triggerIdProp`,C),W.useContextCallback(`onOpenChangeComplete`,a);let G=W.useState(`floatingTreeRoot`),se=ge(G),K=W.useState(`open`),le=W.useState(`activeTriggerElement`),q=W.useState(`positionerElement`),de=W.useState(`hoverEnabled`),fe=W.useState(`disabled`),pe=W.useState(`lastOpenChangeReason`),J=W.useState(`parent`),me=W.useState(`activeIndex`),he=W.useState(`keyboardOpen`),_e=W.useState(`payload`),ve=W.useState(`floatingParentNodeId`),ye=Q.useRef(null),xe=Q.useRef(J.type!==`context-menu`),Se=Ge(),we=Q.useRef(!0),Te=Ge(),Ee=ve!=null,{openMethod:De,triggerProps:X}=tt(K);W.useSyncedValues({disabled:c,highlightItemOnHover:T,modal:J.type===void 0?d:void 0,openMethod:De,rootId:F}),u(W);let{forceUnmount:je,transitionStatus:Me}=h(K,W,()=>{W.set(`allowMouseEnter`,!1)},B),Pe=Ke(W.context.popupRef);Q.useEffect(()=>{if(V===void 0)return;let e=()=>{W.state.instantType===V&&W.set(`instantType`,void 0)};if(!K){e();return}if(Me!==void 0)return;if(W.context.popupRef.current==null){e();return}let t=new AbortController;return Pe(e,t.signal),()=>{t.abort()}},[V,K,Me,Pe,W]),Z(()=>{A&&!j?W.update({parent:{type:`context-menu`,context:A},floatingNodeId:se,floatingParentNodeId:z}):(j||!W.select(`activeTriggerElement`))&&W.update({floatingNodeId:se,floatingParentNodeId:z})},[A,j,se,z,le,W]),Q.useEffect(()=>{K||(ye.current=null),J.type===`context-menu`&&(K?Se.start(500,()=>{xe.current=!0}):(Se.clear(),xe.current=!1))},[Se,K,J.type]),Z(()=>{!K&&!de&&W.set(`hoverEnabled`,!0)},[K,de,W]);let Fe=Y((e,t)=>{let n=t.reason;if(!e&&!W.select(`open`)||K===e&&t.trigger===le&&pe===n)return;let r=b(t);if(!e&&t.trigger==null&&(t.trigger=le??void 0),i?.(e,t),t.isCanceled)return;W.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!we.current)return;e&&n===`trigger-focus`?(we.current=!1,Te.start(300,()=>{we.current=!0})):(we.current=!0,Te.clear());let o=!e&&(n===`escape-key`||n==null);ye.current=t.event;let s=w(W.state,e,t.trigger,r());s.openChangeReason=n,s.keyboardOpen=e&&pn(n,a),s.instantType=J.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:fn(n,a)?`click`:o?`dismiss`:void 0,W.update(s)}),Ie=m({popupStore:W,floatingRootContext:W.state.floatingRootContext,floatingId:R,nested:z!=null,onOpenChange:Fe}),Le=Ie.context.events;Z(()=>{let e=({open:e,eventDetails:t})=>Fe(e,t);return Le.on(`setOpen`,e),()=>{Le?.off(`setOpen`,e)}},[Le,Fe]),Z(()=>W.subscribeToParentMenu(),[W]);let Re=Q.useCallback(()=>{W.setOpen(!1,te(ue))},[W]);Q.useImperativeHandle(y,()=>({unmount:je,close:Re}),[je,Re]);let ze;J.type===`context-menu`&&(ze=J.context),Q.useImperativeHandle(ze?.positionerRef,()=>q,[q]),Q.useImperativeHandle(ze?.actionsRef,()=>({setOpen:Fe}),[Fe]);let Be=D(Ie,{enabled:!fe,bubbles:{escapeKey:x&&J.type===`menu`},outsidePress(){return J.type!==`context-menu`||ye.current?.type===`contextmenu`||xe.current},externalTree:Ee?G:void 0}),Ve=be(),He=bt(Ie,{enabled:!fe,listRef:W.context.itemDomElements,activeIndex:me,virtual:O,nested:J.type===`menubar`||!O&&J.type!==void 0,parentOrientation:J.type===`menubar`?J.context.orientation:void 0,loopFocus:f,focusItemOnOpen:O?he:void 0,allowEscape:O&&f&&k,orientation:p,triggerOrientation:O?`vertical`:p,rtl:Ve===`rtl`,disabledIndices:Ae,onNavigate(e,t){W.setActiveIndex(e,on(t),t?.nativeEvent)},openOnArrowKeyDown:J.type!==`context-menu`&&!(O&&E),externalTree:!O&&Ee?G:void 0,nestedReturnFocusRef:oe?.context.virtualFocusRef,focusItemOnHover:T,resetOnPointerLeave:re}),Ue=Q.useCallback(e=>{W.context.typingRef.current=e},[W]),We=xt(Ie,{enabled:!fe&&!O,listRef:W.context.itemLabels,elementsRef:W.context.itemDomElements,activeIndex:me,resetMs:500,onMatch:(e,t)=>{K&&e!==me&&W.setActiveIndex(e,H,t.nativeEvent)},onTyping:Ue}),qe=Y(o),Je=Q.useRef(-1),Ye=Y(()=>{let e=W.state.activeIndex,t=e===null?void 0:W.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Je.current===n&&W.context.reportedItem===t)return;Je.current=n,W.context.reportedItem=t,O&&W.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=W.context;W.context.highlightReason=Ce,W.context.highlightEvent=void 0,o&&qe(t,l(r,i,{label:t===void 0?void 0:W.context.itemLabels.current[n]??void 0}))});Z(()=>{Ye()},[me,Ye]);let Xe=Q.useMemo(()=>{if(!O)return He.reference;if(!He.trigger)return Ne;let{onFocus:e,...t}=He.trigger;return t},[O,He.reference,He.trigger]);W.useSyncedValue(`inputProps`,O?He.reference??Ne:Ne);let Ze=Q.useMemo(()=>{let e=Oe(We.reference,Xe,Be.reference,{onMouseMove(){W.set(`allowMouseEnter`,!0)}},X);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=K,e},[W,We.reference,Xe,Be.reference,X,K]),Qe=Q.useMemo(()=>{let e=Oe(He.trigger,Be.trigger,X);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[He.trigger,Be.trigger,X]);ke(()=>(W.update({inactiveTriggerProps:Qe}),null));let $e=Q.useMemo(()=>Oe(ce,{onMouseMove(){W.set(`allowMouseEnter`,!0),J.type===`menu`&&W.set(`hoverEnabled`,!1)},onClick(){W.select(`hoverEnabled`)&&W.set(`hoverEnabled`,!1)},onKeyDown(e){let t=W.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},We.floating,He.floating,Be.floating),[J.type,W,We.floating,He.floating,Be.floating]),et=He.item??Ne;v(W,{floatingRootContext:Ie,activeTriggerProps:Ze,inactiveTriggerProps:Qe,popupProps:$e,itemProps:et});let nt=Q.useMemo(()=>({store:W,parent:P,orientation:p,loopFocus:f,allowEscape:k,defaultFloatingId:I,setRenderedFloatingId:L,virtualFocus:O,parentVirtualFocus:N,syncHighlightedItem:Ye}),[W,P,p,f,k,I,O,N,Ye]),rt=typeof t==`function`?t({payload:_e}):t,it=(0,$.jsxs)(wt.Provider,{value:nt,children:[S&&(0,$.jsx)(r,{handle:S,store:W}),rt]});return(J.type===void 0||J.type===`context-menu`)&&(it=(0,$.jsx)(_,{externalTree:G,children:it})),it});function hn(e){let t=Q.useContext(dn);if(t===null)return(0,$.jsx)(mn,{...e});let n=t.Root;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}var gn={};function _n(e){Tt();let t=Q.useContext(dn);if(t!==null){let n=t.SubmenuRoot;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}return(0,$.jsx)(Wt.Provider,{value:gn,children:(0,$.jsx)(mn,{...e,isSubmenu:!0})})}var vn=5;function yn(e,t){let n=bn(t);return e.clientX>=n.left-vn&&e.clientX<=n.right+vn&&e.clientY>=n.top-vn&&e.clientY<=n.bottom+vn}function bn(e){let t=e.getBoundingClientRect(),n=Ie(e);if(xe)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function xn(e){if(Ve(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!He(e))return xn(Re(e))}function Sn(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,V(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Ne,[t,n,r])}var Cn=s(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:d=0,handle:f,payload:p,...m}=e,h=Tt(!0),_=Xe(f)??h?.store;if(!_)throw Error(X(85));let v=U(c),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),C=Q.useRef(null),w=Tn(),ee=ze(!0),T=ie(),E=Q.useMemo(()=>T??new A,[T]),te=ge(E),D=g(),{registerTrigger:O,isMountedByThisTrigger:ne}=a(v,C,_,{payload:p,closeDelay:d,parent:w,floatingTreeRoot:E,floatingNodeId:te,floatingParentNodeId:D,keyboardEventRelay:ee?.relayKeyboardEvent}),k=w.type===`menubar`,re=_.useState(`disabled`),M=o||re||k&&w.context.disabled,{getButtonProps:N,buttonRef:P}=Be({disabled:M,native:s});Q.useEffect(()=>{!x&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,w.type]);let F=Q.useRef(null),I=Ge(),L=Y(e=>{if(!F.current)return;I.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;R(F.current,t)||R(_.select(`positionerElement`),t)||t===F.current||(t==null||xn(t)!==_.select(`rootId`))&&(yn(e,F.current)||E.events.emit(`close`,{domEvent:e,reason:le}))});Q.useEffect(()=>{let e=V(F.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[x,L,_]);let z=k&&w.context.hasSubmenuOpen,oe=qe(b,{enabled:(l??z)&&!M&&(!k||z&&!ne),handleClose:Ye({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:d},triggerElementRef:C,externalTree:E,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),B=wn(x,_.select(`lastOpenChangeReason`)),H=rt(b,{enabled:!M,event:x&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),W=Je(b,{enabled:!M&&z}),G=Sn({open:x,enabled:k,mouseDownAction:`open`}),se=Q.useMemo(()=>Oe(W.reference,H.reference),[W.reference,H.reference]),ce=_.useState(`triggerProps`,ne),K=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:q,handleFocusTargetFocus:ue}=it(_,C),de={disabled:M,open:x},fe=[F,t,P,O,C],pe=[se,oe??Ne,ce,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(I.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),V(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},K,k?{role:`menuitem`}:{},G,m,N],J=Me(`button`,e,{enabled:!k,stateAttributesMapping:j,state:de,ref:fe,props:pe});return k?(0,$.jsx)(ut,{tag:`button`,render:n,className:r,style:i,state:de,refs:fe,props:pe,stateAttributesMapping:j}):x?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(ae,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:q},`${v}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:J},v),(0,$.jsx)(ae,{ref:_.context.triggerFocusTargetRef,onFocus:ue},`${v}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:J},v)});function wn(e,t){let n=Ge(),[r,i]=Q.useState(!1);return Z(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Tn(){let e=an(!0);return Q.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var En={"aria-expanded":void 0},Dn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=Tt(!0);if(p?.parent.type!==`menu`)throw Error(X(37));let m=Ct(),h=Gt(),{store:g,parentVirtualFocus:_}=p,v=p.parent.store,y=lt({guess:!0,label:a}),b=U(o),x=g.useState(`open`),S=Q.useRef(!1),C=g.useState(`positionerElement`),w=g.useState(`floatingRootContext`),ee=g.useState(`floatingTreeRoot`),T=g.useState(`triggerPopupId`,b),E=O(b,g),D=Y(e=>{E(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:u})}),ne=Q.useRef(null),k=Q.useCallback(e=>{ne.current=e,g.set(`activeTriggerElement`,e)},[g]);Z(()=>(D(ne.current),()=>D(null)),[D,b,g]),Z(()=>{if(!x||!C)return;function e(e){K(e)===g.context.beforeContentFocusGuardRef.current&&(S.current=e.relatedTarget===ne.current)}return C.addEventListener(`focusout`,e,!0),()=>{S.current=!1,C.removeEventListener(`focusout`,e,!0)}},[x,C,g]),g.useSyncedValue(`closeDelay`,u);let re=g.useState(`disabled`),A=v.useState(`disabled`),j=d||re||A,ie=v.useState(`itemProps`),M=v.useState(`isActive`,y.index),N=Q.useMemo(()=>({type:`submenu-trigger`,setActive(e){v.select(`highlightItemOnHover`)&&v.setActiveIndex(y.index,L,e)}}),[v,y.index]),{getItemProps:F,itemRef:I}=It({closeOnClick:!1,disabled:j,highlighted:M,id:b,store:g,typingRef:v.context.typingRef,nativeButton:s,itemMetadata:N,nodeId:m?.context.nodeId}),ae=g.useState(`hoverEnabled`),R=qe(w,{enabled:ae&&c&&!j,handleClose:Ye({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>v.select(`allowMouseEnter`):void 0,triggerElementRef:ne,externalTree:ee,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),oe=rt(w,{enabled:!j,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??Ne,B=g.useState(`triggerProps`,!0);delete B.id;let V={disabled:j,highlighted:M,open:x},H=g.useState(`openMethod`),W=g.useState(`lastOpenChangeReason`)===`list-navigation`||H===`keyboard`,G=x&&W&&z,se=h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0;return Me(`div`,e,{state:V,stateAttributesMapping:P,props:[oe,R,B,se,ie,G?En:void 0,{"aria-controls":T,tabIndex:_||!(x||M)?-1:0,onFocus(e){g.select(`open`)&&S.current&&(S.current=!1,g.setOpen(!1,te(he,e.nativeEvent)))},onBlur(){M&&v.setActiveIndex(null,Ce)}},f,F],ref:[t,y.ref,I,D,k]})}),On=Q.forwardRef(function(e,t){let n=Mt(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Oe(n.props,e):e;return(0,$.jsx)(Dn,{...r,ref:n.ref})});function kn({...e}){return(0,$.jsx)(hn,{"data-slot":`dropdown-menu`,...e})}function An({...e}){return(0,$.jsx)(Cn,{"data-slot":`dropdown-menu-trigger`,...e})}function jn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(tn,{children:(0,$.jsx)(nn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(Qt,{"data-slot":`dropdown-menu-content`,className:De(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-sm text-popover-foreground shadow-raised ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Mn({...e}){return(0,$.jsx)(zt,{"data-slot":`dropdown-menu-group`,...e})}function Nn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(Vt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:De(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/15 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Pn({className:e,inset:t,...n}){return(0,$.jsx)(Ut,{"data-slot":`dropdown-menu-link-item`,"data-inset":t,className:De(`relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...n})}function Fn({...e}){return(0,$.jsx)(_n,{"data-slot":`dropdown-menu-sub`,...e})}function In({className:e,inset:t,children:n,...r}){return(0,$.jsxs)(On,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:De(`flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,$.jsx)(ot,{className:`ml-auto`})]})}function Ln({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,$.jsx)(jn,{"data-slot":`dropdown-menu-sub-content`,className:De(`w-auto min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-raised ring-1 ring-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function Rn({className:e,...t}){return(0,$.jsx)(pt,{"data-slot":`dropdown-menu-separator`,className:De(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Pn as a,Ln as c,ft as d,Nn as i,In as l,jn as n,Rn as o,Mn as r,Fn as s,kn as t,An as u};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n}from"./matchContext-BquevSJS.js";import{H as r,O as i,W as a,bn as o,y as s}from"./page-DWnGi6wA.js";import{o as c,t as l}from"./error-alert-9tKpTE3v.js";import{_n as u}from"./mark-CC3RwMy_.js";import{D as d,W as f,t as p}from"./button-DVWXde__.js";import"./overview-C_tFKGZ8.js";import{k as m}from"./index-BymNZU1Q.js";var h=e(t(),1),g=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),_=h.forwardRef((e,t)=>h.createElement(f,{ref:t,...e,weights:g}));_.displayName=`CaretDownIcon`;var v=n();function y({className:e,...t}){return(0,v.jsx)(`textarea`,{"data-slot":`textarea`,className:d(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-card px-2 py-2 text-sm caret-primary transition-[color,border-color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring/70 focus-visible:ring-2 focus-visible:ring-ring/25 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/25`,e),...t})}function b({className:e,...t}){return(0,v.jsx)(`label`,{"data-slot":`label`,className:d(`flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function x({className:e,size:t=`default`,...n}){return(0,v.jsxs)(`div`,{className:d(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,v.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`h-7 w-full min-w-0 appearance-none rounded-md border border-input bg-input/20 py-0.5 pr-6 pl-2 text-xs/relaxed transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-[size=sm]:h-6 data-[size=sm]:text-xs dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,...n}),(0,v.jsx)(_,{className:`pointer-events-none absolute top-1/2 right-1.5 size-3.5 -translate-y-1/2 text-muted-foreground select-none group-data-[size=sm]/native-select:size-3 group-data-[size=sm]/native-select:-translate-y-[calc(--spacing(1.25))]`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function S({className:e,...t}){return(0,v.jsx)(`option`,{"data-slot":`native-select-option`,className:d(`bg-[Canvas] text-[CanvasText]`,e),...t})}var C={retry:{title:`Edit and retry`,note:`Uses the selected agent's current definition, even if you keep the same name. Later attempts use this task and agent until you edit them again.`,submit:`Save and retry`},runAgain:{title:`Edit and run again`,note:`Opens a new run on this item with this task and agent. This run is unchanged.`,submit:`Save and run again`}},w=(e,t)=>t===`retry`?e.canRetry:e.canRunAgain,T=(e,t)=>{let n=o();return c({mutationFn:t=>s(n=>n.editAndRetry({params:{runId:e.id},payload:t})),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:[`run`,e.id]}),n.invalidateQueries({queryKey:[`overview`]})]),t()}})},E=({run:e,intent:t,close:n,openRun:o,className:c})=>{let[f,g]=(0,h.useState)(e.task),[_,w]=(0,h.useState)(e.agent),E=(0,h.useId)(),D=C[t],O=u({queryKey:[`agents`],queryFn:()=>s(e=>e.agents())}),k=T(e,n),A=m(),j=t===`retry`?k:A,M=f.trim().length>0&&O.data?.some(e=>e===_)===!0,N=()=>{let n=new i({task:r.make(f),agent:a.make(_)});t===`retry`?k.mutate(n):A.mutate({runId:e.id,amendment:n},{onSuccess:e=>{e._tag===`Claimed`&&o(e.runId)}})};return(0,v.jsxs)(`form`,{"aria-label":D.title,className:d(`space-y-3`,c),onSubmit:e=>{e.preventDefault(),!j.isPending&&M&&N()},children:[(0,v.jsx)(`h3`,{className:`text-md font-semibold`,children:D.title}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D.note}),(0,v.jsx)(b,{htmlFor:`${E}-task`,children:`Task`}),(0,v.jsx)(y,{id:`${E}-task`,value:f,onChange:e=>g(e.target.value),rows:7,disabled:j.isPending}),(0,v.jsx)(b,{htmlFor:`${E}-agent`,children:`Agent`}),(0,v.jsxs)(x,{id:`${E}-agent`,value:_,onChange:e=>w(e.target.value),disabled:j.isPending||O.isPending,children:[!O.data?.includes(e.agent)&&(0,v.jsxs)(S,{value:e.agent,disabled:!0,children:[e.agent,` · unavailable`]}),O.data?.map(e=>(0,v.jsx)(S,{value:e,children:e},e))]}),(0,v.jsxs)(`div`,{className:`flex gap-2`,children:[(0,v.jsx)(p,{type:`submit`,size:`sm`,disabled:j.isPending||!M,children:D.submit}),(0,v.jsx)(p,{type:`button`,size:`sm`,variant:`ghost`,disabled:j.isPending,onClick:n,children:`Close editor`})]}),A.data?._tag===`CycleBlocked`&&(0,v.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),O.isError&&(0,v.jsx)(l,{message:O.error.message}),j.isError&&(0,v.jsx)(l,{message:j.error.message})]})};export{_ as a,y as i,w as n,b as r,E as t};