@ulpi/cli 0.1.4 → 0.1.6

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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{auth-PN7TMQHV-2W4ICG64.js → auth-FWM7MM4Q-VZC3U2XZ.js} +1 -1
  3. package/dist/{auth-ECQ3IB4E.js → auth-HDK7ECJL.js} +2 -1
  4. package/dist/{chunk-3SBPZRB5.js → chunk-3BCW6ABU.js} +402 -142
  5. package/dist/{chunk-JGBXM5NC.js → chunk-3WB5CXH4.js} +180 -5
  6. package/dist/{chunk-2HEE5OKX.js → chunk-4UCJIAOU.js} +2 -2
  7. package/dist/chunk-4XTHZVDS.js +109 -0
  8. package/dist/chunk-4ZPOZULQ.js +6522 -0
  9. package/dist/{chunk-SIAQVRKG.js → chunk-5MI5GIXM.js} +48 -2
  10. package/dist/{chunk-KLEASXUR.js → chunk-6ZL6NXMV.js} +1 -1
  11. package/dist/chunk-76D3BYJD.js +221 -0
  12. package/dist/{chunk-ZLYRPD7I.js → chunk-AWOSRA5F.js} +1 -1
  13. package/dist/{chunk-PDR55ZNW.js → chunk-BFEKZZHM.js} +274 -57
  14. package/dist/chunk-C7CLUQI6.js +1286 -0
  15. package/dist/{chunk-7AL4DOEJ.js → chunk-E3B5NROU.js} +7 -7
  16. package/dist/chunk-EJ7TW77N.js +1418 -0
  17. package/dist/{chunk-5J6NLQUN.js → chunk-IV6MWETF.js} +383 -168
  18. package/dist/chunk-IZPJHSPX.js +1478 -0
  19. package/dist/chunk-JLHNLM3C.js +228 -0
  20. package/dist/{chunk-BZL5H4YQ.js → chunk-KYYI23AQ.js} +2 -2
  21. package/dist/{chunk-2CLNOKPA.js → chunk-RSFJ6QSR.js} +18 -0
  22. package/dist/chunk-S6ANCSYO.js +1271 -0
  23. package/dist/chunk-SEU7WWNQ.js +1251 -0
  24. package/dist/chunk-SNQ7NAIS.js +453 -0
  25. package/dist/{ulpi-RMMCUAGP-JCJ273T6.js → chunk-TSLDGT5O.js} +73 -35
  26. package/dist/{chunk-SPOI23SB.js → chunk-UXHCHOWQ.js} +83 -62
  27. package/dist/chunk-V2H5D6Y3.js +146 -0
  28. package/dist/{chunk-QJ5GSMEC.js → chunk-VVEDXI7E.js} +2 -1
  29. package/dist/chunk-VXH5Y4FO.js +6761 -0
  30. package/dist/chunk-WED4LM5N.js +322 -0
  31. package/dist/{chunk-74WVVWJ4.js → chunk-YOKL7RB5.js} +184 -15
  32. package/dist/chunk-Z53CAR7G.js +298 -0
  33. package/dist/ci-X3U2W4HC.js +854 -0
  34. package/dist/cloud-2F3NLVHN.js +274 -0
  35. package/dist/{codemap-RKSD4MIE.js → codemap-XNGMAF3F.js} +37 -37
  36. package/dist/codex-MB5YTMRT.js +132 -0
  37. package/dist/{config-EGAXXCGL.js → config-OOELBYTH.js} +1 -1
  38. package/dist/dist-2BJYR5EI.js +59 -0
  39. package/dist/dist-2K7IEVTA.js +43 -0
  40. package/dist/dist-3EIQTZHT.js +1380 -0
  41. package/dist/{dist-YA2BWZB2.js → dist-4U5L2X2C.js} +2 -2
  42. package/dist/{dist-UKMCJBB2.js → dist-54KAMNLO.js} +16 -15
  43. package/dist/dist-6M4MZWZW.js +58 -0
  44. package/dist/dist-6X576SU2.js +27 -0
  45. package/dist/dist-7QOEYLFX.js +103 -0
  46. package/dist/dist-AYBGHEDY.js +2541 -0
  47. package/dist/dist-EK45QNEM.js +45 -0
  48. package/dist/{dist-CS2VKNYS.js → dist-FKFEJRPX.js} +16 -15
  49. package/dist/dist-GTEJUBBT.js +66 -0
  50. package/dist/dist-HA74OKJZ.js +40 -0
  51. package/dist/dist-HU5RZAON.js +48 -0
  52. package/dist/dist-IYE3OBRB.js +374 -0
  53. package/dist/{dist-GJYT2OQV.js → dist-JLU26AB6.js} +12 -9
  54. package/dist/{dist-6G7JC2RA.js → dist-KUCI6JFE.js} +49 -9
  55. package/dist/dist-NUEMFZFL.js +33 -0
  56. package/dist/{dist-RKOGLK7R.js → dist-NUXMDXZ3.js} +31 -3
  57. package/dist/{dist-QAU3LGJN.js → dist-YCNWHSLN.js} +15 -5
  58. package/dist/{dist-CB5D5LMO.js → dist-YFFG2ZD6.js} +9 -16
  59. package/dist/dist-ZG4OKCSR.js +15 -0
  60. package/dist/doctor-SI4LLLDZ.js +345 -0
  61. package/dist/{export-import-4A5MWLIA.js → export-import-JFQH4KSJ.js} +1 -1
  62. package/dist/{history-3MOBX4MA.js → history-5NE46ZAH.js} +7 -7
  63. package/dist/hooks-installer-UN5JZLDQ.js +19 -0
  64. package/dist/index.js +395 -619
  65. package/dist/{init-6CH4HV5T.js → init-5FK3VKRT.js} +79 -13
  66. package/dist/job-HIDMAFW2.js +376 -0
  67. package/dist/jobs.memory-PLMMSFHB-VBECCTHN.js +33 -0
  68. package/dist/kiro-VMUHDFGK.js +153 -0
  69. package/dist/{launchd-LF2QMSKZ.js → launchd-6AWT54HR.js} +9 -17
  70. package/dist/mcp-PDUD7SGP.js +249 -0
  71. package/dist/mcp-installer-PQU3XOGO.js +259 -0
  72. package/dist/mcp-setup-OA7IB3H3.js +263 -0
  73. package/dist/{memory-Y6OZTXJ2.js → memory-ZNAEAK3B.js} +17 -17
  74. package/dist/{ollama-3XCUZMZT-FYKHW4TZ.js → ollama-3XCUZMZT-4JMH6B7P.js} +1 -1
  75. package/dist/{openai-E7G2YAHU-UYY4ZWON.js → openai-E7G2YAHU-T3HMBPH7.js} +2 -2
  76. package/dist/portal-JYWVHXDU.js +210 -0
  77. package/dist/prd-Q4J5NVAR.js +408 -0
  78. package/dist/repos-WWZXNN3P.js +271 -0
  79. package/dist/review-integration-5WHEJU2A.js +14 -0
  80. package/dist/{rules-E427DKYJ.js → rules-Y4VSOY5Y.js} +3 -3
  81. package/dist/run-VPNXEIBY.js +687 -0
  82. package/dist/server-COL4AXKU-P7S7NNF6.js +11 -0
  83. package/dist/server-KKSETHDV-XSSLEENT.js +20 -0
  84. package/dist/{skills-CX73O3IV.js → skills-QEYU2N27.js} +4 -2
  85. package/dist/start-JYOEL7AJ.js +303 -0
  86. package/dist/{status-4DFHDJMN.js → status-BHQYYGAL.js} +2 -2
  87. package/dist/{templates-U7T6MARD.js → templates-CBRUJ66V.js} +4 -3
  88. package/dist/tui-DP7736EX.js +61 -0
  89. package/dist/ulpi-5EN6JCAS-LFE3WSL4.js +10 -0
  90. package/dist/{uninstall-6SW35IK4.js → uninstall-ICUV6DDV.js} +3 -3
  91. package/dist/{update-M6IBJNYP.js → update-7ZMAYRBH.js} +3 -3
  92. package/dist/{version-checker-Q6YTYAGP.js → version-checker-4ZFMZA7Y.js} +2 -2
  93. package/package.json +39 -31
  94. package/dist/chunk-2MZER6ND.js +0 -415
  95. package/dist/chunk-2VYFVYJL.js +0 -4273
  96. package/dist/chunk-6OCEY7JY.js +0 -422
  97. package/dist/chunk-7LXY5UVC.js +0 -330
  98. package/dist/chunk-B55DDP24.js +0 -136
  99. package/dist/chunk-JWUUVXIV.js +0 -13694
  100. package/dist/chunk-MIAQVCFW.js +0 -39
  101. package/dist/chunk-YM2HV4IA.js +0 -505
  102. package/dist/ci-STSL2LSP.js +0 -370
  103. package/dist/mcp-installer-NQCGKQ23.js +0 -124
  104. package/dist/projects-ATHDD3D6.js +0 -271
  105. package/dist/review-ADUPV3PN.js +0 -152
  106. package/dist/server-USLHY6GH-AEOJC5ST.js +0 -18
  107. package/dist/server-X5P6WH2M-7K2RY34N.js +0 -11
  108. package/dist/skills/ulpi-generate-guardian/SKILL.md +0 -750
  109. package/dist/skills/ulpi-generate-guardian/references/framework-rules.md +0 -849
  110. package/dist/skills/ulpi-generate-guardian/references/language-rules.md +0 -591
  111. package/dist/ui-OWXZ3YSR.js +0 -167
  112. package/dist/ui.html +0 -698
package/dist/ui.html DELETED
@@ -1,698 +0,0 @@
1
- <!doctype html>
2
- <html lang="en" class="dark">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>ULPI</title>
7
- <script type="module" crossorigin>var aE=Object.defineProperty;var rE=(e,a,r)=>a in e?aE(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r;var Vn=(e,a,r)=>rE(e,typeof a!="symbol"?a+"":a,r);(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function nu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gf={exports:{}},Sl={};/**
8
- * @license React
9
- * react-jsx-runtime.production.js
10
- *
11
- * Copyright (c) Meta Platforms, Inc. and affiliates.
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */var ab;function iE(){if(ab)return Sl;ab=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(l,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:u}}return Sl.Fragment=a,Sl.jsx=r,Sl.jsxs=r,Sl}var rb;function lE(){return rb||(rb=1,gf.exports=iE()),gf.exports}var n=lE(),bf={exports:{}},kl={},yf={exports:{}},vf={};/**
16
- * @license React
17
- * scheduler.production.js
18
- *
19
- * Copyright (c) Meta Platforms, Inc. and affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */var ib;function oE(){return ib||(ib=1,(function(e){function a(B,Q){var ee=B.length;B.push(Q);e:for(;0<ee;){var ie=ee-1>>>1,T=B[ie];if(0<o(T,Q))B[ie]=Q,B[ee]=T,ee=ie;else break e}}function r(B){return B.length===0?null:B[0]}function l(B){if(B.length===0)return null;var Q=B[0],ee=B.pop();if(ee!==Q){B[0]=ee;e:for(var ie=0,T=B.length,L=T>>>1;ie<L;){var G=2*(ie+1)-1,O=B[G],H=G+1,V=B[H];if(0>o(O,ee))H<T&&0>o(V,O)?(B[ie]=V,B[H]=ee,ie=H):(B[ie]=O,B[G]=ee,ie=G);else if(H<T&&0>o(V,ee))B[ie]=V,B[H]=ee,ie=H;else break e}}return Q}function o(B,Q){var ee=B.sortIndex-Q.sortIndex;return ee!==0?ee:B.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],p=[],g=1,b=null,N=3,v=!1,w=!1,j=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function Z(B){for(var Q=r(p);Q!==null;){if(Q.callback===null)l(p);else if(Q.startTime<=B)l(p),Q.sortIndex=Q.expirationTime,a(m,Q);else break;Q=r(p)}}function Y(B){if(j=!1,Z(B),!w)if(r(m)!==null)w=!0,C||(C=!0,P());else{var Q=r(p);Q!==null&&U(Y,Q.startTime-B)}}var C=!1,I=-1,D=5,F=-1;function R(){return S?!0:!(e.unstable_now()-F<D)}function z(){if(S=!1,C){var B=e.unstable_now();F=B;var Q=!0;try{e:{w=!1,j&&(j=!1,_(I),I=-1),v=!0;var ee=N;try{t:{for(Z(B),b=r(m);b!==null&&!(b.expirationTime>B&&R());){var ie=b.callback;if(typeof ie=="function"){b.callback=null,N=b.priorityLevel;var T=ie(b.expirationTime<=B);if(B=e.unstable_now(),typeof T=="function"){b.callback=T,Z(B),Q=!0;break t}b===r(m)&&l(m),Z(B)}else l(m);b=r(m)}if(b!==null)Q=!0;else{var L=r(p);L!==null&&U(Y,L.startTime-B),Q=!1}}break e}finally{b=null,N=ee,v=!1}Q=void 0}}finally{Q?P():C=!1}}}var P;if(typeof M=="function")P=function(){M(z)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,$=q.port2;q.port1.onmessage=z,P=function(){$.postMessage(null)}}else P=function(){k(z,0)};function U(B,Q){I=k(function(){B(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function(B){switch(N){case 1:case 2:case 3:var Q=3;break;default:Q=N}var ee=N;N=Q;try{return B()}finally{N=ee}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ee=N;N=B;try{return Q()}finally{N=ee}},e.unstable_scheduleCallback=function(B,Q,ee){var ie=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ie+ee:ie):ee=ie,B){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=ee+T,B={id:g++,callback:Q,priorityLevel:B,startTime:ee,expirationTime:T,sortIndex:-1},ee>ie?(B.sortIndex=ee,a(p,B),r(m)===null&&B===r(p)&&(j?(_(I),I=-1):j=!0,U(Y,ee-ie))):(B.sortIndex=T,a(m,B),w||v||(w=!0,C||(C=!0,P()))),B},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(B){var Q=N;return function(){var ee=N;N=Q;try{return B.apply(this,arguments)}finally{N=ee}}}})(vf)),vf}var lb;function cE(){return lb||(lb=1,yf.exports=oE()),yf.exports}var Nf={exports:{}},Ze={};/**
24
- * @license React
25
- * react.production.js
26
- *
27
- * Copyright (c) Meta Platforms, Inc. and affiliates.
28
- *
29
- * This source code is licensed under the MIT license found in the
30
- * LICENSE file in the root directory of this source tree.
31
- */var ob;function uE(){if(ob)return Ze;ob=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),N=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=N&&L[N]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function k(L,G,O){this.props=L,this.context=G,this.refs=S,this.updater=O||w}k.prototype.isReactComponent={},k.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,G,"setState")},k.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function _(){}_.prototype=k.prototype;function M(L,G,O){this.props=L,this.context=G,this.refs=S,this.updater=O||w}var Z=M.prototype=new _;Z.constructor=M,j(Z,k.prototype),Z.isPureReactComponent=!0;var Y=Array.isArray;function C(){}var I={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function F(L,G,O){var H=O.ref;return{$$typeof:e,type:L,key:G,ref:H!==void 0?H:null,props:O}}function R(L,G){return F(L.type,G,L.props)}function z(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function P(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(O){return G[O]})}var q=/\/+/g;function $(L,G){return typeof L=="object"&&L!==null&&L.key!=null?P(""+L.key):G.toString(36)}function U(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(C,C):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function B(L,G,O,H,V){var re=typeof L;(re==="undefined"||re==="boolean")&&(L=null);var xe=!1;if(L===null)xe=!0;else switch(re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(L.$$typeof){case e:case a:xe=!0;break;case g:return xe=L._init,B(xe(L._payload),G,O,H,V)}}if(xe)return V=V(L),xe=H===""?"."+$(L,0):H,Y(V)?(O="",xe!=null&&(O=xe.replace(q,"$&/")+"/"),B(V,G,O,"",function(we){return we})):V!=null&&(z(V)&&(V=R(V,O+(V.key==null||L&&L.key===V.key?"":(""+V.key).replace(q,"$&/")+"/")+xe)),G.push(V)),1;xe=0;var je=H===""?".":H+":";if(Y(L))for(var Be=0;Be<L.length;Be++)H=L[Be],re=je+$(H,Be),xe+=B(H,G,O,re,V);else if(Be=v(L),typeof Be=="function")for(L=Be.call(L),Be=0;!(H=L.next()).done;)H=H.value,re=je+$(H,Be++),xe+=B(H,G,O,re,V);else if(re==="object"){if(typeof L.then=="function")return B(U(L),G,O,H,V);throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return xe}function Q(L,G,O){if(L==null)return L;var H=[],V=0;return B(L,H,"","",function(re){return G.call(O,re,V++)}),H}function ee(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(O){(L._status===0||L._status===-1)&&(L._status=1,L._result=O)},function(O){(L._status===0||L._status===-1)&&(L._status=2,L._result=O)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},T={map:Q,forEach:function(L,G,O){Q(L,function(){G.apply(this,arguments)},O)},count:function(L){var G=0;return Q(L,function(){G++}),G},toArray:function(L){return Q(L,function(G){return G})||[]},only:function(L){if(!z(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ze.Activity=b,Ze.Children=T,Ze.Component=k,Ze.Fragment=r,Ze.Profiler=o,Ze.PureComponent=M,Ze.StrictMode=l,Ze.Suspense=m,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(L){return I.H.useMemoCache(L)}},Ze.cache=function(L){return function(){return L.apply(null,arguments)}},Ze.cacheSignal=function(){return null},Ze.cloneElement=function(L,G,O){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var H=j({},L.props),V=L.key;if(G!=null)for(re in G.key!==void 0&&(V=""+G.key),G)!D.call(G,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&G.ref===void 0||(H[re]=G[re]);var re=arguments.length-2;if(re===1)H.children=O;else if(1<re){for(var xe=Array(re),je=0;je<re;je++)xe[je]=arguments[je+2];H.children=xe}return F(L.type,V,H)},Ze.createContext=function(L){return L={$$typeof:d,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:u,_context:L},L},Ze.createElement=function(L,G,O){var H,V={},re=null;if(G!=null)for(H in G.key!==void 0&&(re=""+G.key),G)D.call(G,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(V[H]=G[H]);var xe=arguments.length-2;if(xe===1)V.children=O;else if(1<xe){for(var je=Array(xe),Be=0;Be<xe;Be++)je[Be]=arguments[Be+2];V.children=je}if(L&&L.defaultProps)for(H in xe=L.defaultProps,xe)V[H]===void 0&&(V[H]=xe[H]);return F(L,re,V)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(L){return{$$typeof:f,render:L}},Ze.isValidElement=z,Ze.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:ee}},Ze.memo=function(L,G){return{$$typeof:p,type:L,compare:G===void 0?null:G}},Ze.startTransition=function(L){var G=I.T,O={};I.T=O;try{var H=L(),V=I.S;V!==null&&V(O,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(C,ie)}catch(re){ie(re)}finally{G!==null&&O.types!==null&&(G.types=O.types),I.T=G}},Ze.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Ze.use=function(L){return I.H.use(L)},Ze.useActionState=function(L,G,O){return I.H.useActionState(L,G,O)},Ze.useCallback=function(L,G){return I.H.useCallback(L,G)},Ze.useContext=function(L){return I.H.useContext(L)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(L,G){return I.H.useDeferredValue(L,G)},Ze.useEffect=function(L,G){return I.H.useEffect(L,G)},Ze.useEffectEvent=function(L){return I.H.useEffectEvent(L)},Ze.useId=function(){return I.H.useId()},Ze.useImperativeHandle=function(L,G,O){return I.H.useImperativeHandle(L,G,O)},Ze.useInsertionEffect=function(L,G){return I.H.useInsertionEffect(L,G)},Ze.useLayoutEffect=function(L,G){return I.H.useLayoutEffect(L,G)},Ze.useMemo=function(L,G){return I.H.useMemo(L,G)},Ze.useOptimistic=function(L,G){return I.H.useOptimistic(L,G)},Ze.useReducer=function(L,G,O){return I.H.useReducer(L,G,O)},Ze.useRef=function(L){return I.H.useRef(L)},Ze.useState=function(L){return I.H.useState(L)},Ze.useSyncExternalStore=function(L,G,O){return I.H.useSyncExternalStore(L,G,O)},Ze.useTransition=function(){return I.H.useTransition()},Ze.version="19.2.4",Ze}var cb;function su(){return cb||(cb=1,Nf.exports=uE()),Nf.exports}var wf={exports:{}},On={};/**
32
- * @license React
33
- * react-dom.production.js
34
- *
35
- * Copyright (c) Meta Platforms, Inc. and affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */var ub;function dE(){if(ub)return On;ub=1;var e=su();function a(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,p,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:m,containerInfo:p,implementation:g}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,On.createPortal=function(m,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return u(m,p,null,g)},On.flushSync=function(m){var p=d.T,g=l.p;try{if(d.T=null,l.p=2,m)return m()}finally{d.T=p,l.p=g,l.d.f()}},On.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(m,p))},On.prefetchDNS=function(m){typeof m=="string"&&l.d.D(m)},On.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,b=f(g,p.crossOrigin),N=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?l.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:N,fetchPriority:v}):g==="script"&&l.d.X(m,{crossOrigin:b,integrity:N,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},On.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);l.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(m)},On.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,b=f(g,p.crossOrigin);l.d.L(m,g,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},On.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=f(p.as,p.crossOrigin);l.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(m)},On.requestFormReset=function(m){l.d.r(m)},On.unstable_batchedUpdates=function(m,p){return m(p)},On.useFormState=function(m,p,g){return d.H.useFormState(m,p,g)},On.useFormStatus=function(){return d.H.useHostTransitionStatus()},On.version="19.2.4",On}var db;function u0(){if(db)return wf.exports;db=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),wf.exports=dE(),wf.exports}/**
40
- * @license React
41
- * react-dom-client.production.js
42
- *
43
- * Copyright (c) Meta Platforms, Inc. and affiliates.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE file in the root directory of this source tree.
47
- */var fb;function fE(){if(fb)return kl;fb=1;var e=cE(),a=su(),r=u0();function l(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var s=t,i=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(i=s.return),t=s.return;while(t)}return s.tag===3?i:null}function d(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function f(t){if(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function m(t){if(u(t)!==t)throw Error(l(188))}function p(t){var s=t.alternate;if(!s){if(s=u(t),s===null)throw Error(l(188));return s!==t?null:t}for(var i=t,c=s;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(c=h.return,c!==null){i=c;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return m(h),t;if(x===c)return m(h),s;x=x.sibling}throw Error(l(188))}if(i.return!==c.return)i=h,c=x;else{for(var E=!1,A=h.child;A;){if(A===i){E=!0,i=h,c=x;break}if(A===c){E=!0,c=h,i=x;break}A=A.sibling}if(!E){for(A=x.child;A;){if(A===i){E=!0,i=x,c=h;break}if(A===c){E=!0,c=x,i=h;break}A=A.sibling}if(!E)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:s}function g(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=g(t),s!==null)return s;t=t.sibling}return null}var b=Object.assign,N=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),M=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=z&&t[z]||t["@@iterator"],typeof t=="function"?t:null)}var q=Symbol.for("react.client.reference");function $(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===q?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case Y:return"Suspense";case C:return"SuspenseList";case F:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case M:return t.displayName||"Context";case _:return(t._context.displayName||"Context")+".Consumer";case Z:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return s=t.displayName||null,s!==null?s:$(t.type)||"Memo";case D:s=t._payload,t=t._init;try{return $(t(s))}catch{}}return null}var U=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ie=[],T=-1;function L(t){return{current:t}}function G(t){0>T||(t.current=ie[T],ie[T]=null,T--)}function O(t,s){T++,ie[T]=t.current,t.current=s}var H=L(null),V=L(null),re=L(null),xe=L(null);function je(t,s){switch(O(re,s),O(V,t),O(H,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?_g(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=_g(s),t=Cg(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(H),O(H,t)}function Be(){G(H),G(V),G(re)}function we(t){t.memoizedState!==null&&O(xe,t);var s=H.current,i=Cg(s,t.type);s!==i&&(O(V,t),O(H,i))}function Ye(t){V.current===t&&(G(H),G(V)),xe.current===t&&(G(xe),Nl._currentValue=ee)}var jt,en;function oe(t){if(jt===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);jt=s&&s[1]||"",en=-1<i.stack.indexOf(`
48
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
49
- `+jt+t+en}var ke=!1;function he(t,s){if(!t||ke)return"";ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(le){var ae=le}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(le){ae=le}t.call(pe.prototype)}}else{try{throw Error()}catch(le){ae=le}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),E=x[0],A=x[1];if(E&&A){var K=E.split(`
50
- `),se=A.split(`
51
- `);for(h=c=0;c<K.length&&!K[c].includes("DetermineComponentFrameRoot");)c++;for(;h<se.length&&!se[h].includes("DetermineComponentFrameRoot");)h++;if(c===K.length||h===se.length)for(c=K.length-1,h=se.length-1;1<=c&&0<=h&&K[c]!==se[h];)h--;for(;1<=c&&0<=h;c--,h--)if(K[c]!==se[h]){if(c!==1||h!==1)do if(c--,h--,0>h||K[c]!==se[h]){var fe=`
52
- `+K[c].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=c&&0<=h);break}}}finally{ke=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?oe(i):""}function Xe(t,s){switch(t.tag){case 26:case 27:case 5:return oe(t.type);case 16:return oe("Lazy");case 13:return t.child!==s&&s!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return he(t.type,!1);case 11:return he(t.type.render,!1);case 1:return he(t.type,!0);case 31:return oe("Activity");default:return""}}function Qe(t){try{var s="",i=null;do s+=Xe(t,i),i=t,t=t.return;while(t);return s}catch(c){return`
53
- Error generating stack: `+c.message+`
54
- `+c.stack}}var lt=Object.prototype.hasOwnProperty,At=e.unstable_scheduleCallback,Yt=e.unstable_cancelCallback,gt=e.unstable_shouldYield,Vt=e.unstable_requestPaint,ct=e.unstable_now,yn=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,ot=e.unstable_IdlePriority,cn=e.log,jn=e.unstable_setDisableYieldValue,un=null,et=null;function qt(t){if(typeof cn=="function"&&jn(t),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(un,t)}catch{}}var Ve=Math.clz32?Math.clz32:rr,vn=Math.log,Rt=Math.LN2;function rr(t){return t>>>=0,t===0?32:31-(vn(t)/Rt|0)|0}var Os=256,Zs=262144,Qs=4194304;function Rn(t){var s=t&42;if(s!==0)return s;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function X(t,s,i){var c=t.pendingLanes;if(c===0)return 0;var h=0,x=t.suspendedLanes,E=t.pingedLanes;t=t.warmLanes;var A=c&134217727;return A!==0?(c=A&~x,c!==0?h=Rn(c):(E&=A,E!==0?h=Rn(E):i||(i=A&~t,i!==0&&(h=Rn(i))))):(A=c&~x,A!==0?h=Rn(A):E!==0?h=Rn(E):i||(i=c&~t,i!==0&&(h=Rn(i)))),h===0?0:s!==0&&s!==h&&(s&x)===0&&(x=h&-h,i=s&-s,x>=i||x===32&&(i&4194048)!==0)?s:h}function de(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function Se(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _e(){var t=Qs;return Qs<<=1,(Qs&62914560)===0&&(Qs=4194304),t}function Mt(t){for(var s=[],i=0;31>i;i++)s.push(t);return s}function St(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function De(t,s,i,c,h,x){var E=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var A=t.entanglements,K=t.expirationTimes,se=t.hiddenUpdates;for(i=E&~i;0<i;){var fe=31-Ve(i),pe=1<<fe;A[fe]=0,K[fe]=-1;var ae=se[fe];if(ae!==null)for(se[fe]=null,fe=0;fe<ae.length;fe++){var le=ae[fe];le!==null&&(le.lane&=-536870913)}i&=~pe}c!==0&&Ce(t,c,0),x!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=x&~(E&~s))}function Ce(t,s,i){t.pendingLanes|=s,t.suspendedLanes&=~s;var c=31-Ve(s);t.entangledLanes|=s,t.entanglements[c]=t.entanglements[c]|1073741824|i&261930}function qe(t,s){var i=t.entangledLanes|=s;for(t=t.entanglements;i;){var c=31-Ve(i),h=1<<c;h&s|t[c]&s&&(t[c]|=s),i&=~h}}function Xt(t,s){var i=s&-s;return i=(i&42)!==0?1:$t(i),(i&(t.suspendedLanes|s))!==0?0:i}function $t(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ns(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ja(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:Qg(t.type))}function Sa(t,s){var i=Q.p;try{return Q.p=t,s()}finally{Q.p=i}}var os=Math.random().toString(36).slice(2),Zt="__reactFiber$"+os,Nn="__reactProps$"+os,Ds="__reactContainer$"+os,Ls="__reactEvents$"+os,Ur="__reactListeners$"+os,ka="__reactHandles$"+os,Br="__reactResources$"+os,Ws="__reactMarker$"+os;function ir(t){delete t[Zt],delete t[Nn],delete t[Ls],delete t[Ur],delete t[ka]}function Sn(t){var s=t[Zt];if(s)return s;for(var i=t.parentNode;i;){if(s=i[Ds]||i[Zt]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(t=Lg(t);t!==null;){if(i=t[Zt])return i;t=Lg(t)}return s}t=i,i=t.parentNode}return null}function ws(t){if(t=t[Zt]||t[Ds]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function zs(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function Is(t){var s=t[Br];return s||(s=t[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function tn(t){t[Ws]=!0}var lr=new Set,Us={};function cs(t,s){ge(t,s),ge(t+"Capture",s)}function ge(t,s){for(Us[t]=s,t=0;t<s.length;t++)lr.add(s[t])}var Ie=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),st={},te={};function ce(t){return lt.call(te,t)?!0:lt.call(st,t)?!1:Ie.test(t)?te[t]=!0:(st[t]=!0,!1)}function ye(t,s,i){if(ce(s))if(i===null)t.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+i)}}function Te(t,s,i){if(i===null)t.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+i)}}function Me(t,s,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(s,i,""+c)}}function Ue(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function it(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function kt(t,s,i){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,x=c.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return h.call(this)},set:function(E){i=""+E,x.call(this,E)}}),Object.defineProperty(t,s,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Fe(t){if(!t._valueTracker){var s=it(t)?"checked":"value";t._valueTracker=kt(t,s,""+t[s])}}function _a(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var i=s.getValue(),c="";return t&&(c=it(t)?t.checked?"true":"false":t.value),t=c,t!==i?(s.setValue(t),!0):!1}function Gt(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var $r=/[\n"\\]/g;function Mn(t){return t.replace($r,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Li(t,s,i,c,h,x,E,A){t.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.type=E:t.removeAttribute("type"),s!=null?E==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+Ue(s)):t.value!==""+Ue(s)&&(t.value=""+Ue(s)):E!=="submit"&&E!=="reset"||t.removeAttribute("value"),s!=null?Pr(t,E,Ue(s)):i!=null?Pr(t,E,Ue(i)):c!=null&&t.removeAttribute("value"),h==null&&x!=null&&(t.defaultChecked=!!x),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+Ue(A):t.removeAttribute("name")}function or(t,s,i,c,h,x,E,A){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),s!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){Fe(t);return}i=i!=null?""+Ue(i):"",s=s!=null?""+Ue(s):i,A||s===t.value||(t.value=s),t.defaultValue=s}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=A?t.checked:!!c,t.defaultChecked=!!c,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.name=E),Fe(t)}function Pr(t,s,i){s==="number"&&Gt(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function kn(t,s,i,c){if(t=t.options,s){s={};for(var h=0;h<i.length;h++)s["$"+i[h]]=!0;for(i=0;i<t.length;i++)h=s.hasOwnProperty("$"+t[i].value),t[i].selected!==h&&(t[i].selected=h),h&&c&&(t[i].defaultSelected=!0)}else{for(i=""+Ue(i),s=null,h=0;h<t.length;h++){if(t[h].value===i){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}s!==null||t[h].disabled||(s=t[h])}s!==null&&(s.selected=!0)}}function oo(t,s,i){if(s!=null&&(s=""+Ue(s),s!==t.value&&(t.value=s),i==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=i!=null?""+Ue(i):""}function Fr(t,s,i,c){if(s==null){if(c!=null){if(i!=null)throw Error(l(92));if(U(c)){if(1<c.length)throw Error(l(93));c=c[0]}i=c}i==null&&(i=""),s=i}i=Ue(s),t.defaultValue=i,c=t.textContent,c===i&&c!==""&&c!==null&&(t.value=c),Fe(t)}function Ke(t,s){if(s){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=s;return}}t.textContent=s}var co=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dn(t,s,i){var c=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":c?t.setProperty(s,i):typeof i!="number"||i===0||co.has(s)?s==="float"?t.cssFloat=i:t[s]=(""+i).trim():t[s]=i+"px"}function _t(t,s,i){if(s!=null&&typeof s!="object")throw Error(l(62));if(t=t.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in s)c=s[h],s.hasOwnProperty(h)&&i[h]!==c&&dn(t,h,c)}else for(var x in s)s.hasOwnProperty(x)&&dn(t,x,s[x])}function Ca(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Js=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zi=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ta(t){return zi.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ee(){}var Le=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var mt=null,Qt=null;function us(t){var s=ws(t);if(s&&(t=s.stateNode)){var i=t[Nn]||null;e:switch(t=s.stateNode,s.type){case"input":if(Li(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Mn(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var c=i[s];if(c!==t&&c.form===t.form){var h=c[Nn]||null;if(!h)throw Error(l(90));Li(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<i.length;s++)c=i[s],c.form===t.form&&_a(c)}break e;case"textarea":oo(t,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&kn(t,!!i.multiple,s,!1)}}}var Ii=!1;function uo(t,s,i){if(Ii)return t(s,i);Ii=!0;try{var c=t(s);return c}finally{if(Ii=!1,(mt!==null||Qt!==null)&&(Wo(),mt&&(s=mt,t=Qt,Qt=mt=null,us(s),t)))for(s=0;s<t.length;s++)us(t[s])}}function Ui(t,s){var i=t.stateNode;if(i===null)return null;var c=i[Nn]||null;if(c===null)return null;i=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,s,typeof i));return i}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xu=!1;if(ea)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){xu=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{xu=!1}var Aa=null,gu=null,fo=null;function Cp(){if(fo)return fo;var t,s=gu,i=s.length,c,h="value"in Aa?Aa.value:Aa.textContent,x=h.length;for(t=0;t<i&&s[t]===h[t];t++);var E=i-t;for(c=1;c<=E&&s[i-c]===h[x-c];c++);return fo=h.slice(t,1<c?1-c:void 0)}function mo(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function po(){return!0}function Tp(){return!1}function Fn(t){function s(i,c,h,x,E){this._reactName=i,this._targetInst=h,this.type=c,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var A in t)t.hasOwnProperty(A)&&(i=t[A],this[A]=i?i(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?po:Tp,this.isPropagationStopped=Tp,this}return b(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=po)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=po)},persist:function(){},isPersistent:po}),s}var cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ho=Fn(cr),$i=b({},cr,{view:0,detail:0}),nN=Fn($i),bu,yu,Pi,xo=b({},$i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Pi&&(Pi&&t.type==="mousemove"?(bu=t.screenX-Pi.screenX,yu=t.screenY-Pi.screenY):yu=bu=0,Pi=t),bu)},movementY:function(t){return"movementY"in t?t.movementY:yu}}),Ap=Fn(xo),sN=b({},xo,{dataTransfer:0}),aN=Fn(sN),rN=b({},$i,{relatedTarget:0}),vu=Fn(rN),iN=b({},cr,{animationName:0,elapsedTime:0,pseudoElement:0}),lN=Fn(iN),oN=b({},cr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cN=Fn(oN),uN=b({},cr,{data:0}),Rp=Fn(uN),dN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pN(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=mN[t])?!!s[t]:!1}function Nu(){return pN}var hN=b({},$i,{key:function(t){if(t.key){var s=dN[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=mo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?fN[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(t){return t.type==="keypress"?mo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?mo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xN=Fn(hN),gN=b({},xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mp=Fn(gN),bN=b({},$i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),yN=Fn(bN),vN=b({},cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),NN=Fn(vN),wN=b({},xo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),EN=Fn(wN),jN=b({},cr,{newState:0,oldState:0}),SN=Fn(jN),kN=[9,13,27,32],wu=ea&&"CompositionEvent"in window,Fi=null;ea&&"documentMode"in document&&(Fi=document.documentMode);var _N=ea&&"TextEvent"in window&&!Fi,Op=ea&&(!wu||Fi&&8<Fi&&11>=Fi),Dp=" ",Lp=!1;function zp(t,s){switch(t){case"keyup":return kN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ip(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hr=!1;function CN(t,s){switch(t){case"compositionend":return Ip(s);case"keypress":return s.which!==32?null:(Lp=!0,Dp);case"textInput":return t=s.data,t===Dp&&Lp?null:t;default:return null}}function TN(t,s){if(Hr)return t==="compositionend"||!wu&&zp(t,s)?(t=Cp(),fo=gu=Aa=null,Hr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Op&&s.locale!=="ko"?null:s.data;default:return null}}var AN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Up(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!AN[t.type]:s==="textarea"}function Bp(t,s,i,c){mt?Qt?Qt.push(c):Qt=[c]:mt=c,s=rc(s,"onChange"),0<s.length&&(i=new ho("onChange","change",null,i,c),t.push({event:i,listeners:s}))}var Hi=null,qi=null;function RN(t){Ng(t,0)}function go(t){var s=zs(t);if(_a(s))return t}function $p(t,s){if(t==="change")return s}var Pp=!1;if(ea){var Eu;if(ea){var ju="oninput"in document;if(!ju){var Fp=document.createElement("div");Fp.setAttribute("oninput","return;"),ju=typeof Fp.oninput=="function"}Eu=ju}else Eu=!1;Pp=Eu&&(!document.documentMode||9<document.documentMode)}function Hp(){Hi&&(Hi.detachEvent("onpropertychange",qp),qi=Hi=null)}function qp(t){if(t.propertyName==="value"&&go(qi)){var s=[];Bp(s,qi,t,We(t)),uo(RN,s)}}function MN(t,s,i){t==="focusin"?(Hp(),Hi=s,qi=i,Hi.attachEvent("onpropertychange",qp)):t==="focusout"&&Hp()}function ON(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return go(qi)}function DN(t,s){if(t==="click")return go(s)}function LN(t,s){if(t==="input"||t==="change")return go(s)}function zN(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Qn=typeof Object.is=="function"?Object.is:zN;function Gi(t,s){if(Qn(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var i=Object.keys(t),c=Object.keys(s);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var h=i[c];if(!lt.call(s,h)||!Qn(t[h],s[h]))return!1}return!0}function Gp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Kp(t,s){var i=Gp(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=s&&c>=s)return{node:i,offset:s-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Gp(i)}}function Yp(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Yp(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Vp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Gt(t.document);s instanceof t.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)t=s.contentWindow;else break;s=Gt(t.document)}return s}function Su(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var IN=ea&&"documentMode"in document&&11>=document.documentMode,qr=null,ku=null,Ki=null,_u=!1;function Xp(t,s,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;_u||qr==null||qr!==Gt(c)||(c=qr,"selectionStart"in c&&Su(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ki&&Gi(Ki,c)||(Ki=c,c=rc(ku,"onSelect"),0<c.length&&(s=new ho("onSelect","select",null,s,i),t.push({event:s,listeners:c}),s.target=qr)))}function ur(t,s){var i={};return i[t.toLowerCase()]=s.toLowerCase(),i["Webkit"+t]="webkit"+s,i["Moz"+t]="moz"+s,i}var Gr={animationend:ur("Animation","AnimationEnd"),animationiteration:ur("Animation","AnimationIteration"),animationstart:ur("Animation","AnimationStart"),transitionrun:ur("Transition","TransitionRun"),transitionstart:ur("Transition","TransitionStart"),transitioncancel:ur("Transition","TransitionCancel"),transitionend:ur("Transition","TransitionEnd")},Cu={},Zp={};ea&&(Zp=document.createElement("div").style,"AnimationEvent"in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),"TransitionEvent"in window||delete Gr.transitionend.transition);function dr(t){if(Cu[t])return Cu[t];if(!Gr[t])return t;var s=Gr[t],i;for(i in s)if(s.hasOwnProperty(i)&&i in Zp)return Cu[t]=s[i];return t}var Qp=dr("animationend"),Wp=dr("animationiteration"),Jp=dr("animationstart"),UN=dr("transitionrun"),BN=dr("transitionstart"),$N=dr("transitioncancel"),eh=dr("transitionend"),th=new Map,Tu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Tu.push("scrollEnd");function Es(t,s){th.set(t,s),cs(s,[t])}var bo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ds=[],Kr=0,Au=0;function yo(){for(var t=Kr,s=Au=Kr=0;s<t;){var i=ds[s];ds[s++]=null;var c=ds[s];ds[s++]=null;var h=ds[s];ds[s++]=null;var x=ds[s];if(ds[s++]=null,c!==null&&h!==null){var E=c.pending;E===null?h.next=h:(h.next=E.next,E.next=h),c.pending=h}x!==0&&nh(i,h,x)}}function vo(t,s,i,c){ds[Kr++]=t,ds[Kr++]=s,ds[Kr++]=i,ds[Kr++]=c,Au|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Ru(t,s,i,c){return vo(t,s,i,c),No(t)}function fr(t,s){return vo(t,null,null,s),No(t)}function nh(t,s,i){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i);for(var h=!1,x=t.return;x!==null;)x.childLanes|=i,c=x.alternate,c!==null&&(c.childLanes|=i),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(h=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,h&&s!==null&&(h=31-Ve(i),t=x.hiddenUpdates,c=t[h],c===null?t[h]=[s]:c.push(s),s.lane=i|536870912),x):null}function No(t){if(50<pl)throw pl=0,$d=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var Yr={};function PN(t,s,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(t,s,i,c){return new PN(t,s,i,c)}function Mu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ta(t,s){var i=t.alternate;return i===null?(i=Wn(t.tag,s,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=s,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,s=t.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function sh(t,s){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,s=i.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function wo(t,s,i,c,h,x){var E=0;if(c=t,typeof t=="function")Mu(t)&&(E=1);else if(typeof t=="string")E=Kw(t,i,H.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case F:return t=Wn(31,i,s,h),t.elementType=F,t.lanes=x,t;case j:return mr(i.children,h,x,s);case S:E=8,h|=24;break;case k:return t=Wn(12,i,s,h|2),t.elementType=k,t.lanes=x,t;case Y:return t=Wn(13,i,s,h),t.elementType=Y,t.lanes=x,t;case C:return t=Wn(19,i,s,h),t.elementType=C,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M:E=10;break e;case _:E=9;break e;case Z:E=11;break e;case I:E=14;break e;case D:E=16,c=null;break e}E=29,i=Error(l(130,t===null?"null":typeof t,"")),c=null}return s=Wn(E,i,s,h),s.elementType=t,s.type=c,s.lanes=x,s}function mr(t,s,i,c){return t=Wn(7,t,c,s),t.lanes=i,t}function Ou(t,s,i){return t=Wn(6,t,null,s),t.lanes=i,t}function ah(t){var s=Wn(18,null,null,0);return s.stateNode=t,s}function Du(t,s,i){return s=Wn(4,t.children!==null?t.children:[],t.key,s),s.lanes=i,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var rh=new WeakMap;function fs(t,s){if(typeof t=="object"&&t!==null){var i=rh.get(t);return i!==void 0?i:(s={value:t,source:s,stack:Qe(s)},rh.set(t,s),s)}return{value:t,source:s,stack:Qe(s)}}var Vr=[],Xr=0,Eo=null,Yi=0,ms=[],ps=0,Ra=null,Bs=1,$s="";function na(t,s){Vr[Xr++]=Yi,Vr[Xr++]=Eo,Eo=t,Yi=s}function ih(t,s,i){ms[ps++]=Bs,ms[ps++]=$s,ms[ps++]=Ra,Ra=t;var c=Bs;t=$s;var h=32-Ve(c)-1;c&=~(1<<h),i+=1;var x=32-Ve(s)+h;if(30<x){var E=h-h%5;x=(c&(1<<E)-1).toString(32),c>>=E,h-=E,Bs=1<<32-Ve(s)+h|i<<h|c,$s=x+t}else Bs=1<<x|i<<h|c,$s=t}function Lu(t){t.return!==null&&(na(t,1),ih(t,1,0))}function zu(t){for(;t===Eo;)Eo=Vr[--Xr],Vr[Xr]=null,Yi=Vr[--Xr],Vr[Xr]=null;for(;t===Ra;)Ra=ms[--ps],ms[ps]=null,$s=ms[--ps],ms[ps]=null,Bs=ms[--ps],ms[ps]=null}function lh(t,s){ms[ps++]=Bs,ms[ps++]=$s,ms[ps++]=Ra,Bs=s.id,$s=s.overflow,Ra=t}var _n=null,Ft=null,bt=!1,Ma=null,hs=!1,Iu=Error(l(519));function Oa(t){var s=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vi(fs(s,t)),Iu}function oh(t){var s=t.stateNode,i=t.type,c=t.memoizedProps;switch(s[Zt]=t,s[Nn]=c,i){case"dialog":dt("cancel",s),dt("close",s);break;case"iframe":case"object":case"embed":dt("load",s);break;case"video":case"audio":for(i=0;i<xl.length;i++)dt(xl[i],s);break;case"source":dt("error",s);break;case"img":case"image":case"link":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"input":dt("invalid",s),or(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":dt("invalid",s);break;case"textarea":dt("invalid",s),Fr(s,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||c.suppressHydrationWarning===!0||Sg(s.textContent,i)?(c.popover!=null&&(dt("beforetoggle",s),dt("toggle",s)),c.onScroll!=null&&dt("scroll",s),c.onScrollEnd!=null&&dt("scrollend",s),c.onClick!=null&&(s.onclick=Ee),s=!0):s=!1,s||Oa(t,!0)}function ch(t){for(_n=t.return;_n;)switch(_n.tag){case 5:case 31:case 13:hs=!1;return;case 27:case 3:hs=!0;return;default:_n=_n.return}}function Zr(t){if(t!==_n)return!1;if(!bt)return ch(t),bt=!0,!1;var s=t.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||tf(t.type,t.memoizedProps)),i=!i),i&&Ft&&Oa(t),ch(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Ft=Dg(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Ft=Dg(t)}else s===27?(s=Ft,Ya(t.type)?(t=lf,lf=null,Ft=t):Ft=s):Ft=_n?gs(t.stateNode.nextSibling):null;return!0}function pr(){Ft=_n=null,bt=!1}function Uu(){var t=Ma;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),Ma=null),t}function Vi(t){Ma===null?Ma=[t]:Ma.push(t)}var Bu=L(null),hr=null,sa=null;function Da(t,s,i){O(Bu,s._currentValue),s._currentValue=i}function aa(t){t._currentValue=Bu.current,G(Bu)}function $u(t,s,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),t===i)break;t=t.return}}function Pu(t,s,i,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var x=h.dependencies;if(x!==null){var E=h.child;x=x.firstContext;e:for(;x!==null;){var A=x;x=h;for(var K=0;K<s.length;K++)if(A.context===s[K]){x.lanes|=i,A=x.alternate,A!==null&&(A.lanes|=i),$u(x.return,i,t),c||(E=null);break e}x=A.next}}else if(h.tag===18){if(E=h.return,E===null)throw Error(l(341));E.lanes|=i,x=E.alternate,x!==null&&(x.lanes|=i),$u(E,i,t),E=null}else E=h.child;if(E!==null)E.return=h;else for(E=h;E!==null;){if(E===t){E=null;break}if(h=E.sibling,h!==null){h.return=E.return,E=h;break}E=E.return}h=E}}function Qr(t,s,i,c){t=null;for(var h=s,x=!1;h!==null;){if(!x){if((h.flags&524288)!==0)x=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var E=h.alternate;if(E===null)throw Error(l(387));if(E=E.memoizedProps,E!==null){var A=h.type;Qn(h.pendingProps.value,E.value)||(t!==null?t.push(A):t=[A])}}else if(h===xe.current){if(E=h.alternate,E===null)throw Error(l(387));E.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Nl):t=[Nl])}h=h.return}t!==null&&Pu(s,t,i,c),s.flags|=262144}function jo(t){for(t=t.firstContext;t!==null;){if(!Qn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function xr(t){hr=t,sa=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return uh(hr,t)}function So(t,s){return hr===null&&xr(t),uh(t,s)}function uh(t,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},sa===null){if(t===null)throw Error(l(308));sa=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else sa=sa.next=s;return i}var FN=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(i,c){t.push(c)}};this.abort=function(){s.aborted=!0,t.forEach(function(i){return i()})}},HN=e.unstable_scheduleCallback,qN=e.unstable_NormalPriority,fn={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fu(){return{controller:new FN,data:new Map,refCount:0}}function Xi(t){t.refCount--,t.refCount===0&&HN(qN,function(){t.controller.abort()})}var Zi=null,Hu=0,Wr=0,Jr=null;function GN(t,s){if(Zi===null){var i=Zi=[];Hu=0,Wr=Kd(),Jr={status:"pending",value:void 0,then:function(c){i.push(c)}}}return Hu++,s.then(dh,dh),s}function dh(){if(--Hu===0&&Zi!==null){Jr!==null&&(Jr.status="fulfilled");var t=Zi;Zi=null,Wr=0,Jr=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function KN(t,s){var i=[],c={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return t.then(function(){c.status="fulfilled",c.value=s;for(var h=0;h<i.length;h++)(0,i[h])(s)},function(h){for(c.status="rejected",c.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),c}var fh=B.S;B.S=function(t,s){Xx=ct(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&GN(t,s),fh!==null&&fh(t,s)};var gr=L(null);function qu(){var t=gr.current;return t!==null?t:Ut.pooledCache}function ko(t,s){s===null?O(gr,gr.current):O(gr,s.pool)}function mh(){var t=qu();return t===null?null:{parent:fn._currentValue,pool:t}}var ei=Error(l(460)),Gu=Error(l(474)),_o=Error(l(542)),Co={then:function(){}};function ph(t){return t=t.status,t==="fulfilled"||t==="rejected"}function hh(t,s,i){switch(i=t[i],i===void 0?t.push(s):i!==s&&(s.then(Ee,Ee),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,gh(t),t;default:if(typeof s.status=="string")s.then(Ee,Ee);else{if(t=Ut,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=s,t.status="pending",t.then(function(c){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=c}},function(c){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,gh(t),t}throw yr=s,ei}}function br(t){try{var s=t._init;return s(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(yr=i,ei):i}}var yr=null;function xh(){if(yr===null)throw Error(l(459));var t=yr;return yr=null,t}function gh(t){if(t===ei||t===_o)throw Error(l(483))}var ti=null,Qi=0;function To(t){var s=Qi;return Qi+=1,ti===null&&(ti=[]),hh(ti,t,s)}function Wi(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function Ao(t,s){throw s.$$typeof===N?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function bh(t){function s(J,W){if(t){var ne=J.deletions;ne===null?(J.deletions=[W],J.flags|=16):ne.push(W)}}function i(J,W){if(!t)return null;for(;W!==null;)s(J,W),W=W.sibling;return null}function c(J){for(var W=new Map;J!==null;)J.key!==null?W.set(J.key,J):W.set(J.index,J),J=J.sibling;return W}function h(J,W){return J=ta(J,W),J.index=0,J.sibling=null,J}function x(J,W,ne){return J.index=ne,t?(ne=J.alternate,ne!==null?(ne=ne.index,ne<W?(J.flags|=67108866,W):ne):(J.flags|=67108866,W)):(J.flags|=1048576,W)}function E(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function A(J,W,ne,me){return W===null||W.tag!==6?(W=Ou(ne,J.mode,me),W.return=J,W):(W=h(W,ne),W.return=J,W)}function K(J,W,ne,me){var $e=ne.type;return $e===j?fe(J,W,ne.props.children,me,ne.key):W!==null&&(W.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===D&&br($e)===W.type)?(W=h(W,ne.props),Wi(W,ne),W.return=J,W):(W=wo(ne.type,ne.key,ne.props,null,J.mode,me),Wi(W,ne),W.return=J,W)}function se(J,W,ne,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==ne.containerInfo||W.stateNode.implementation!==ne.implementation?(W=Du(ne,J.mode,me),W.return=J,W):(W=h(W,ne.children||[]),W.return=J,W)}function fe(J,W,ne,me,$e){return W===null||W.tag!==7?(W=mr(ne,J.mode,me,$e),W.return=J,W):(W=h(W,ne),W.return=J,W)}function pe(J,W,ne){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Ou(""+W,J.mode,ne),W.return=J,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return ne=wo(W.type,W.key,W.props,null,J.mode,ne),Wi(ne,W),ne.return=J,ne;case w:return W=Du(W,J.mode,ne),W.return=J,W;case D:return W=br(W),pe(J,W,ne)}if(U(W)||P(W))return W=mr(W,J.mode,ne,null),W.return=J,W;if(typeof W.then=="function")return pe(J,To(W),ne);if(W.$$typeof===M)return pe(J,So(J,W),ne);Ao(J,W)}return null}function ae(J,W,ne,me){var $e=W!==null?W.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return $e!==null?null:A(J,W,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ne.key===$e?K(J,W,ne,me):null;case w:return ne.key===$e?se(J,W,ne,me):null;case D:return ne=br(ne),ae(J,W,ne,me)}if(U(ne)||P(ne))return $e!==null?null:fe(J,W,ne,me,null);if(typeof ne.then=="function")return ae(J,W,To(ne),me);if(ne.$$typeof===M)return ae(J,W,So(J,ne),me);Ao(J,ne)}return null}function le(J,W,ne,me,$e){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(ne)||null,A(W,J,""+me,$e);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case v:return J=J.get(me.key===null?ne:me.key)||null,K(W,J,me,$e);case w:return J=J.get(me.key===null?ne:me.key)||null,se(W,J,me,$e);case D:return me=br(me),le(J,W,ne,me,$e)}if(U(me)||P(me))return J=J.get(ne)||null,fe(W,J,me,$e,null);if(typeof me.then=="function")return le(J,W,ne,To(me),$e);if(me.$$typeof===M)return le(J,W,ne,So(W,me),$e);Ao(W,me)}return null}function Oe(J,W,ne,me){for(var $e=null,vt=null,ze=W,at=W=0,ht=null;ze!==null&&at<ne.length;at++){ze.index>at?(ht=ze,ze=null):ht=ze.sibling;var Nt=ae(J,ze,ne[at],me);if(Nt===null){ze===null&&(ze=ht);break}t&&ze&&Nt.alternate===null&&s(J,ze),W=x(Nt,W,at),vt===null?$e=Nt:vt.sibling=Nt,vt=Nt,ze=ht}if(at===ne.length)return i(J,ze),bt&&na(J,at),$e;if(ze===null){for(;at<ne.length;at++)ze=pe(J,ne[at],me),ze!==null&&(W=x(ze,W,at),vt===null?$e=ze:vt.sibling=ze,vt=ze);return bt&&na(J,at),$e}for(ze=c(ze);at<ne.length;at++)ht=le(ze,J,at,ne[at],me),ht!==null&&(t&&ht.alternate!==null&&ze.delete(ht.key===null?at:ht.key),W=x(ht,W,at),vt===null?$e=ht:vt.sibling=ht,vt=ht);return t&&ze.forEach(function(Wa){return s(J,Wa)}),bt&&na(J,at),$e}function Ge(J,W,ne,me){if(ne==null)throw Error(l(151));for(var $e=null,vt=null,ze=W,at=W=0,ht=null,Nt=ne.next();ze!==null&&!Nt.done;at++,Nt=ne.next()){ze.index>at?(ht=ze,ze=null):ht=ze.sibling;var Wa=ae(J,ze,Nt.value,me);if(Wa===null){ze===null&&(ze=ht);break}t&&ze&&Wa.alternate===null&&s(J,ze),W=x(Wa,W,at),vt===null?$e=Wa:vt.sibling=Wa,vt=Wa,ze=ht}if(Nt.done)return i(J,ze),bt&&na(J,at),$e;if(ze===null){for(;!Nt.done;at++,Nt=ne.next())Nt=pe(J,Nt.value,me),Nt!==null&&(W=x(Nt,W,at),vt===null?$e=Nt:vt.sibling=Nt,vt=Nt);return bt&&na(J,at),$e}for(ze=c(ze);!Nt.done;at++,Nt=ne.next())Nt=le(ze,J,at,Nt.value,me),Nt!==null&&(t&&Nt.alternate!==null&&ze.delete(Nt.key===null?at:Nt.key),W=x(Nt,W,at),vt===null?$e=Nt:vt.sibling=Nt,vt=Nt);return t&&ze.forEach(function(sE){return s(J,sE)}),bt&&na(J,at),$e}function Lt(J,W,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===j&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:e:{for(var $e=ne.key;W!==null;){if(W.key===$e){if($e=ne.type,$e===j){if(W.tag===7){i(J,W.sibling),me=h(W,ne.props.children),me.return=J,J=me;break e}}else if(W.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===D&&br($e)===W.type){i(J,W.sibling),me=h(W,ne.props),Wi(me,ne),me.return=J,J=me;break e}i(J,W);break}else s(J,W);W=W.sibling}ne.type===j?(me=mr(ne.props.children,J.mode,me,ne.key),me.return=J,J=me):(me=wo(ne.type,ne.key,ne.props,null,J.mode,me),Wi(me,ne),me.return=J,J=me)}return E(J);case w:e:{for($e=ne.key;W!==null;){if(W.key===$e)if(W.tag===4&&W.stateNode.containerInfo===ne.containerInfo&&W.stateNode.implementation===ne.implementation){i(J,W.sibling),me=h(W,ne.children||[]),me.return=J,J=me;break e}else{i(J,W);break}else s(J,W);W=W.sibling}me=Du(ne,J.mode,me),me.return=J,J=me}return E(J);case D:return ne=br(ne),Lt(J,W,ne,me)}if(U(ne))return Oe(J,W,ne,me);if(P(ne)){if($e=P(ne),typeof $e!="function")throw Error(l(150));return ne=$e.call(ne),Ge(J,W,ne,me)}if(typeof ne.then=="function")return Lt(J,W,To(ne),me);if(ne.$$typeof===M)return Lt(J,W,So(J,ne),me);Ao(J,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,W!==null&&W.tag===6?(i(J,W.sibling),me=h(W,ne),me.return=J,J=me):(i(J,W),me=Ou(ne,J.mode,me),me.return=J,J=me),E(J)):i(J,W)}return function(J,W,ne,me){try{Qi=0;var $e=Lt(J,W,ne,me);return ti=null,$e}catch(ze){if(ze===ei||ze===_o)throw ze;var vt=Wn(29,ze,null,J.mode);return vt.lanes=me,vt.return=J,vt}finally{}}}var vr=bh(!0),yh=bh(!1),La=!1;function Ku(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function za(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ia(t,s,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(wt&2)!==0){var h=c.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),c.pending=s,s=No(t),nh(t,null,i),s}return vo(t,c,s,i),No(t)}function Ji(t,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var c=s.lanes;c&=t.pendingLanes,i|=c,s.lanes=i,qe(t,i)}}function Vu(t,s){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var h=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var E={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?h=x=E:x=x.next=E,i=i.next}while(i!==null);x===null?h=x=s:x=x.next=s}else h=x=s;i={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=s:t.next=s,i.lastBaseUpdate=s}var Xu=!1;function el(){if(Xu){var t=Jr;if(t!==null)throw t}}function tl(t,s,i,c){Xu=!1;var h=t.updateQueue;La=!1;var x=h.firstBaseUpdate,E=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var K=A,se=K.next;K.next=null,E===null?x=se:E.next=se,E=K;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,A=fe.lastBaseUpdate,A!==E&&(A===null?fe.firstBaseUpdate=se:A.next=se,fe.lastBaseUpdate=K))}if(x!==null){var pe=h.baseState;E=0,fe=se=K=null,A=x;do{var ae=A.lane&-536870913,le=ae!==A.lane;if(le?(pt&ae)===ae:(c&ae)===ae){ae!==0&&ae===Wr&&(Xu=!0),fe!==null&&(fe=fe.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Oe=t,Ge=A;ae=s;var Lt=i;switch(Ge.tag){case 1:if(Oe=Ge.payload,typeof Oe=="function"){pe=Oe.call(Lt,pe,ae);break e}pe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ge.payload,ae=typeof Oe=="function"?Oe.call(Lt,pe,ae):Oe,ae==null)break e;pe=b({},pe,ae);break e;case 2:La=!0}}ae=A.callback,ae!==null&&(t.flags|=64,le&&(t.flags|=8192),le=h.callbacks,le===null?h.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:A.tag,payload:A.payload,callback:A.callback,next:null},fe===null?(se=fe=le,K=pe):fe=fe.next=le,E|=ae;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;le=A,A=le.next,le.next=null,h.lastBaseUpdate=le,h.shared.pending=null}}while(!0);fe===null&&(K=pe),h.baseState=K,h.firstBaseUpdate=se,h.lastBaseUpdate=fe,x===null&&(h.shared.lanes=0),Fa|=E,t.lanes=E,t.memoizedState=pe}}function vh(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function Nh(t,s){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)vh(i[t],s)}var ni=L(null),Ro=L(0);function wh(t,s){t=ma,O(Ro,t),O(ni,s),ma=t|s.baseLanes}function Zu(){O(Ro,ma),O(ni,ni.current)}function Qu(){ma=Ro.current,G(ni),G(Ro)}var Jn=L(null),xs=null;function Ua(t){var s=t.alternate;O(an,an.current&1),O(Jn,t),xs===null&&(s===null||ni.current!==null||s.memoizedState!==null)&&(xs=t)}function Wu(t){O(an,an.current),O(Jn,t),xs===null&&(xs=t)}function Eh(t){t.tag===22?(O(an,an.current),O(Jn,t),xs===null&&(xs=t)):Ba()}function Ba(){O(an,an.current),O(Jn,Jn.current)}function es(t){G(Jn),xs===t&&(xs=null),G(an)}var an=L(0);function Mo(t){for(var s=t;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||af(i)||rf(i)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ra=0,tt=null,Ot=null,mn=null,Oo=!1,si=!1,Nr=!1,Do=0,nl=0,ai=null,YN=0;function nn(){throw Error(l(321))}function Ju(t,s){if(s===null)return!1;for(var i=0;i<s.length&&i<t.length;i++)if(!Qn(t[i],s[i]))return!1;return!0}function ed(t,s,i,c,h,x){return ra=x,tt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,B.H=t===null||t.memoizedState===null?ix:hd,Nr=!1,x=i(c,h),Nr=!1,si&&(x=Sh(s,i,c,h)),jh(t),x}function jh(t){B.H=rl;var s=Ot!==null&&Ot.next!==null;if(ra=0,mn=Ot=tt=null,Oo=!1,nl=0,ai=null,s)throw Error(l(300));t===null||pn||(t=t.dependencies,t!==null&&jo(t)&&(pn=!0))}function Sh(t,s,i,c){tt=t;var h=0;do{if(si&&(ai=null),nl=0,si=!1,25<=h)throw Error(l(301));if(h+=1,mn=Ot=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}B.H=lx,x=s(i,c)}while(si);return x}function VN(){var t=B.H,s=t.useState()[0];return s=typeof s.then=="function"?sl(s):s,t=t.useState()[0],(Ot!==null?Ot.memoizedState:null)!==t&&(tt.flags|=1024),s}function td(){var t=Do!==0;return Do=0,t}function nd(t,s,i){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~i}function sd(t){if(Oo){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Oo=!1}ra=0,mn=Ot=tt=null,si=!1,nl=Do=0,ai=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?tt.memoizedState=mn=t:mn=mn.next=t,mn}function rn(){if(Ot===null){var t=tt.alternate;t=t!==null?t.memoizedState:null}else t=Ot.next;var s=mn===null?tt.memoizedState:mn.next;if(s!==null)mn=s,Ot=t;else{if(t===null)throw tt.alternate===null?Error(l(467)):Error(l(310));Ot=t,t={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},mn===null?tt.memoizedState=mn=t:mn=mn.next=t}return mn}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(t){var s=nl;return nl+=1,ai===null&&(ai=[]),t=hh(ai,t,s),s=tt,(mn===null?s.memoizedState:mn.next)===null&&(s=s.alternate,B.H=s===null||s.memoizedState===null?ix:hd),t}function zo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return sl(t);if(t.$$typeof===M)return Cn(t)}throw Error(l(438,String(t)))}function ad(t){var s=null,i=tt.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var c=tt.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=Lo(),tt.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(t),c=0;c<t;c++)i[c]=R;return s.index++,i}function ia(t,s){return typeof s=="function"?s(t):s}function Io(t){var s=rn();return rd(s,Ot,t)}function rd(t,s,i){var c=t.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=i;var h=t.baseQueue,x=c.pending;if(x!==null){if(h!==null){var E=h.next;h.next=x.next,x.next=E}s.baseQueue=h=x,c.pending=null}if(x=t.baseState,h===null)t.memoizedState=x;else{s=h.next;var A=E=null,K=null,se=s,fe=!1;do{var pe=se.lane&-536870913;if(pe!==se.lane?(pt&pe)===pe:(ra&pe)===pe){var ae=se.revertLane;if(ae===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),pe===Wr&&(fe=!0);else if((ra&ae)===ae){se=se.next,ae===Wr&&(fe=!0);continue}else pe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(A=K=pe,E=x):K=K.next=pe,tt.lanes|=ae,Fa|=ae;pe=se.action,Nr&&i(x,pe),x=se.hasEagerState?se.eagerState:i(x,pe)}else ae={lane:pe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(A=K=ae,E=x):K=K.next=ae,tt.lanes|=pe,Fa|=pe;se=se.next}while(se!==null&&se!==s);if(K===null?E=x:K.next=A,!Qn(x,t.memoizedState)&&(pn=!0,fe&&(i=Jr,i!==null)))throw i;t.memoizedState=x,t.baseState=E,t.baseQueue=K,c.lastRenderedState=x}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function id(t){var s=rn(),i=s.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var c=i.dispatch,h=i.pending,x=s.memoizedState;if(h!==null){i.pending=null;var E=h=h.next;do x=t(x,E.action),E=E.next;while(E!==h);Qn(x,s.memoizedState)||(pn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),i.lastRenderedState=x}return[x,c]}function kh(t,s,i){var c=tt,h=rn(),x=bt;if(x){if(i===void 0)throw Error(l(407));i=i()}else i=s();var E=!Qn((Ot||h).memoizedState,i);if(E&&(h.memoizedState=i,pn=!0),h=h.queue,cd(Th.bind(null,c,h,t),[t]),h.getSnapshot!==s||E||mn!==null&&mn.memoizedState.tag&1){if(c.flags|=2048,ri(9,{destroy:void 0},Ch.bind(null,c,h,i,s),null),Ut===null)throw Error(l(349));x||(ra&127)!==0||_h(c,s,i)}return i}function _h(t,s,i){t.flags|=16384,t={getSnapshot:s,value:i},s=tt.updateQueue,s===null?(s=Lo(),tt.updateQueue=s,s.stores=[t]):(i=s.stores,i===null?s.stores=[t]:i.push(t))}function Ch(t,s,i,c){s.value=i,s.getSnapshot=c,Ah(s)&&Rh(t)}function Th(t,s,i){return i(function(){Ah(s)&&Rh(t)})}function Ah(t){var s=t.getSnapshot;t=t.value;try{var i=s();return!Qn(t,i)}catch{return!0}}function Rh(t){var s=fr(t,2);s!==null&&Yn(s,t,2)}function ld(t){var s=In();if(typeof t=="function"){var i=t;if(t=i(),Nr){qt(!0);try{i()}finally{qt(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:t},s}function Mh(t,s,i,c){return t.baseState=i,rd(t,Ot,typeof c=="function"?c:ia)}function XN(t,s,i,c,h){if($o(t))throw Error(l(485));if(t=s.action,t!==null){var x={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};B.T!==null?i(!0):x.isTransition=!1,c(x),i=s.pending,i===null?(x.next=s.pending=x,Oh(s,x)):(x.next=i.next,s.pending=i.next=x)}}function Oh(t,s){var i=s.action,c=s.payload,h=t.state;if(s.isTransition){var x=B.T,E={};B.T=E;try{var A=i(h,c),K=B.S;K!==null&&K(E,A),Dh(t,s,A)}catch(se){od(t,s,se)}finally{x!==null&&E.types!==null&&(x.types=E.types),B.T=x}}else try{x=i(h,c),Dh(t,s,x)}catch(se){od(t,s,se)}}function Dh(t,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){Lh(t,s,c)},function(c){return od(t,s,c)}):Lh(t,s,i)}function Lh(t,s,i){s.status="fulfilled",s.value=i,zh(s),t.state=i,s=t.pending,s!==null&&(i=s.next,i===s?t.pending=null:(i=i.next,s.next=i,Oh(t,i)))}function od(t,s,i){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=i,zh(s),s=s.next;while(s!==c)}t.action=null}function zh(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Ih(t,s){return s}function Uh(t,s){if(bt){var i=Ut.formState;if(i!==null){e:{var c=tt;if(bt){if(Ft){t:{for(var h=Ft,x=hs;h.nodeType!==8;){if(!x){h=null;break t}if(h=gs(h.nextSibling),h===null){h=null;break t}}x=h.data,h=x==="F!"||x==="F"?h:null}if(h){Ft=gs(h.nextSibling),c=h.data==="F!";break e}}Oa(c)}c=!1}c&&(s=i[0])}}return i=In(),i.memoizedState=i.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ih,lastRenderedState:s},i.queue=c,i=sx.bind(null,tt,c),c.dispatch=i,c=ld(!1),x=pd.bind(null,tt,!1,c.queue),c=In(),h={state:s,dispatch:null,action:t,pending:null},c.queue=h,i=XN.bind(null,tt,h,x,i),h.dispatch=i,c.memoizedState=t,[s,i,!1]}function Bh(t){var s=rn();return $h(s,Ot,t)}function $h(t,s,i){if(s=rd(t,s,Ih)[0],t=Io(ia)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=sl(s)}catch(E){throw E===ei?_o:E}else c=s;s=rn();var h=s.queue,x=h.dispatch;return i!==s.memoizedState&&(tt.flags|=2048,ri(9,{destroy:void 0},ZN.bind(null,h,i),null)),[c,x,t]}function ZN(t,s){t.action=s}function Ph(t){var s=rn(),i=Ot;if(i!==null)return $h(s,i,t);rn(),s=s.memoizedState,i=rn();var c=i.queue.dispatch;return i.memoizedState=t,[s,c,!1]}function ri(t,s,i,c){return t={tag:t,create:i,deps:c,inst:s,next:null},s=tt.updateQueue,s===null&&(s=Lo(),tt.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,s.lastEffect=t),t}function Fh(){return rn().memoizedState}function Uo(t,s,i,c){var h=In();tt.flags|=t,h.memoizedState=ri(1|s,{destroy:void 0},i,c===void 0?null:c)}function Bo(t,s,i,c){var h=rn();c=c===void 0?null:c;var x=h.memoizedState.inst;Ot!==null&&c!==null&&Ju(c,Ot.memoizedState.deps)?h.memoizedState=ri(s,x,i,c):(tt.flags|=t,h.memoizedState=ri(1|s,x,i,c))}function Hh(t,s){Uo(8390656,8,t,s)}function cd(t,s){Bo(2048,8,t,s)}function QN(t){tt.flags|=4;var s=tt.updateQueue;if(s===null)s=Lo(),tt.updateQueue=s,s.events=[t];else{var i=s.events;i===null?s.events=[t]:i.push(t)}}function qh(t){var s=rn().memoizedState;return QN({ref:s,nextImpl:t}),function(){if((wt&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}function Gh(t,s){return Bo(4,2,t,s)}function Kh(t,s){return Bo(4,4,t,s)}function Yh(t,s){if(typeof s=="function"){t=t();var i=s(t);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function Vh(t,s,i){i=i!=null?i.concat([t]):null,Bo(4,4,Yh.bind(null,s,t),i)}function ud(){}function Xh(t,s){var i=rn();s=s===void 0?null:s;var c=i.memoizedState;return s!==null&&Ju(s,c[1])?c[0]:(i.memoizedState=[t,s],t)}function Zh(t,s){var i=rn();s=s===void 0?null:s;var c=i.memoizedState;if(s!==null&&Ju(s,c[1]))return c[0];if(c=t(),Nr){qt(!0);try{t()}finally{qt(!1)}}return i.memoizedState=[c,s],c}function dd(t,s,i){return i===void 0||(ra&1073741824)!==0&&(pt&261930)===0?t.memoizedState=s:(t.memoizedState=i,t=Qx(),tt.lanes|=t,Fa|=t,i)}function Qh(t,s,i,c){return Qn(i,s)?i:ni.current!==null?(t=dd(t,i,c),Qn(t,s)||(pn=!0),t):(ra&42)===0||(ra&1073741824)!==0&&(pt&261930)===0?(pn=!0,t.memoizedState=i):(t=Qx(),tt.lanes|=t,Fa|=t,s)}function Wh(t,s,i,c,h){var x=Q.p;Q.p=x!==0&&8>x?x:8;var E=B.T,A={};B.T=A,pd(t,!1,s,i);try{var K=h(),se=B.S;if(se!==null&&se(A,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=KN(K,c);al(t,s,fe,ss(t))}else al(t,s,c,ss(t))}catch(pe){al(t,s,{then:function(){},status:"rejected",reason:pe},ss())}finally{Q.p=x,E!==null&&A.types!==null&&(E.types=A.types),B.T=E}}function WN(){}function fd(t,s,i,c){if(t.tag!==5)throw Error(l(476));var h=Jh(t).queue;Wh(t,h,s,ee,i===null?WN:function(){return ex(t),i(c)})}function Jh(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:ee},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:i},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function ex(t){var s=Jh(t);s.next===null&&(s=t.alternate.memoizedState),al(t,s.next.queue,{},ss())}function md(){return Cn(Nl)}function tx(){return rn().memoizedState}function nx(){return rn().memoizedState}function JN(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var i=ss();t=za(i);var c=Ia(s,t,i);c!==null&&(Yn(c,s,i),Ji(c,s,i)),s={cache:Fu()},t.payload=s;return}s=s.return}}function ew(t,s,i){var c=ss();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},$o(t)?ax(s,i):(i=Ru(t,s,i,c),i!==null&&(Yn(i,t,c),rx(i,s,c)))}function sx(t,s,i){var c=ss();al(t,s,i,c)}function al(t,s,i,c){var h={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if($o(t))ax(s,h);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var E=s.lastRenderedState,A=x(E,i);if(h.hasEagerState=!0,h.eagerState=A,Qn(A,E))return vo(t,s,h,0),Ut===null&&yo(),!1}catch{}finally{}if(i=Ru(t,s,h,c),i!==null)return Yn(i,t,c),rx(i,s,c),!0}return!1}function pd(t,s,i,c){if(c={lane:2,revertLane:Kd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},$o(t)){if(s)throw Error(l(479))}else s=Ru(t,i,c,2),s!==null&&Yn(s,t,2)}function $o(t){var s=t.alternate;return t===tt||s!==null&&s===tt}function ax(t,s){si=Oo=!0;var i=t.pending;i===null?s.next=s:(s.next=i.next,i.next=s),t.pending=s}function rx(t,s,i){if((i&4194048)!==0){var c=s.lanes;c&=t.pendingLanes,i|=c,s.lanes=i,qe(t,i)}}var rl={readContext:Cn,use:zo,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};rl.useEffectEvent=nn;var ix={readContext:Cn,use:zo,useCallback:function(t,s){return In().memoizedState=[t,s===void 0?null:s],t},useContext:Cn,useEffect:Hh,useImperativeHandle:function(t,s,i){i=i!=null?i.concat([t]):null,Uo(4194308,4,Yh.bind(null,s,t),i)},useLayoutEffect:function(t,s){return Uo(4194308,4,t,s)},useInsertionEffect:function(t,s){Uo(4,2,t,s)},useMemo:function(t,s){var i=In();s=s===void 0?null:s;var c=t();if(Nr){qt(!0);try{t()}finally{qt(!1)}}return i.memoizedState=[c,s],c},useReducer:function(t,s,i){var c=In();if(i!==void 0){var h=i(s);if(Nr){qt(!0);try{i(s)}finally{qt(!1)}}}else h=s;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=ew.bind(null,tt,t),[c.memoizedState,t]},useRef:function(t){var s=In();return t={current:t},s.memoizedState=t},useState:function(t){t=ld(t);var s=t.queue,i=sx.bind(null,tt,s);return s.dispatch=i,[t.memoizedState,i]},useDebugValue:ud,useDeferredValue:function(t,s){var i=In();return dd(i,t,s)},useTransition:function(){var t=ld(!1);return t=Wh.bind(null,tt,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,i){var c=tt,h=In();if(bt){if(i===void 0)throw Error(l(407));i=i()}else{if(i=s(),Ut===null)throw Error(l(349));(pt&127)!==0||_h(c,s,i)}h.memoizedState=i;var x={value:i,getSnapshot:s};return h.queue=x,Hh(Th.bind(null,c,x,t),[t]),c.flags|=2048,ri(9,{destroy:void 0},Ch.bind(null,c,x,i,s),null),i},useId:function(){var t=In(),s=Ut.identifierPrefix;if(bt){var i=$s,c=Bs;i=(c&~(1<<32-Ve(c)-1)).toString(32)+i,s="_"+s+"R_"+i,i=Do++,0<i&&(s+="H"+i.toString(32)),s+="_"}else i=YN++,s="_"+s+"r_"+i.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:md,useFormState:Uh,useActionState:Uh,useOptimistic:function(t){var s=In();s.memoizedState=s.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=pd.bind(null,tt,!0,i),i.dispatch=s,[t,s]},useMemoCache:ad,useCacheRefresh:function(){return In().memoizedState=JN.bind(null,tt)},useEffectEvent:function(t){var s=In(),i={impl:t};return s.memoizedState=i,function(){if((wt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},hd={readContext:Cn,use:zo,useCallback:Xh,useContext:Cn,useEffect:cd,useImperativeHandle:Vh,useInsertionEffect:Gh,useLayoutEffect:Kh,useMemo:Zh,useReducer:Io,useRef:Fh,useState:function(){return Io(ia)},useDebugValue:ud,useDeferredValue:function(t,s){var i=rn();return Qh(i,Ot.memoizedState,t,s)},useTransition:function(){var t=Io(ia)[0],s=rn().memoizedState;return[typeof t=="boolean"?t:sl(t),s]},useSyncExternalStore:kh,useId:tx,useHostTransitionStatus:md,useFormState:Bh,useActionState:Bh,useOptimistic:function(t,s){var i=rn();return Mh(i,Ot,t,s)},useMemoCache:ad,useCacheRefresh:nx};hd.useEffectEvent=qh;var lx={readContext:Cn,use:zo,useCallback:Xh,useContext:Cn,useEffect:cd,useImperativeHandle:Vh,useInsertionEffect:Gh,useLayoutEffect:Kh,useMemo:Zh,useReducer:id,useRef:Fh,useState:function(){return id(ia)},useDebugValue:ud,useDeferredValue:function(t,s){var i=rn();return Ot===null?dd(i,t,s):Qh(i,Ot.memoizedState,t,s)},useTransition:function(){var t=id(ia)[0],s=rn().memoizedState;return[typeof t=="boolean"?t:sl(t),s]},useSyncExternalStore:kh,useId:tx,useHostTransitionStatus:md,useFormState:Ph,useActionState:Ph,useOptimistic:function(t,s){var i=rn();return Ot!==null?Mh(i,Ot,t,s):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:ad,useCacheRefresh:nx};lx.useEffectEvent=qh;function xd(t,s,i,c){s=t.memoizedState,i=i(c,s),i=i==null?s:b({},s,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var gd={enqueueSetState:function(t,s,i){t=t._reactInternals;var c=ss(),h=za(c);h.payload=s,i!=null&&(h.callback=i),s=Ia(t,h,c),s!==null&&(Yn(s,t,c),Ji(s,t,c))},enqueueReplaceState:function(t,s,i){t=t._reactInternals;var c=ss(),h=za(c);h.tag=1,h.payload=s,i!=null&&(h.callback=i),s=Ia(t,h,c),s!==null&&(Yn(s,t,c),Ji(s,t,c))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var i=ss(),c=za(i);c.tag=2,s!=null&&(c.callback=s),s=Ia(t,c,i),s!==null&&(Yn(s,t,i),Ji(s,t,i))}};function ox(t,s,i,c,h,x,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,E):s.prototype&&s.prototype.isPureReactComponent?!Gi(i,c)||!Gi(h,x):!0}function cx(t,s,i,c){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,c),s.state!==t&&gd.enqueueReplaceState(s,s.state,null)}function wr(t,s){var i=s;if("ref"in s){i={};for(var c in s)c!=="ref"&&(i[c]=s[c])}if(t=t.defaultProps){i===s&&(i=b({},i));for(var h in t)i[h]===void 0&&(i[h]=t[h])}return i}function ux(t){bo(t)}function dx(t){console.error(t)}function fx(t){bo(t)}function Po(t,s){try{var i=t.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function mx(t,s,i){try{var c=t.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function bd(t,s,i){return i=za(i),i.tag=3,i.payload={element:null},i.callback=function(){Po(t,s)},i}function px(t){return t=za(t),t.tag=3,t}function hx(t,s,i,c){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var x=c.value;t.payload=function(){return h(x)},t.callback=function(){mx(s,i,c)}}var E=i.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(t.callback=function(){mx(s,i,c),typeof h!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})})}function tw(t,s,i,c,h){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=i.alternate,s!==null&&Qr(s,i,h,!0),i=Jn.current,i!==null){switch(i.tag){case 31:case 13:return xs===null?Jo():i.alternate===null&&sn===0&&(sn=3),i.flags&=-257,i.flags|=65536,i.lanes=h,c===Co?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([c]):s.add(c),Hd(t,c,h)),!1;case 22:return i.flags|=65536,c===Co?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([c]):i.add(c)),Hd(t,c,h)),!1}throw Error(l(435,i.tag))}return Hd(t,c,h),Jo(),!1}if(bt)return s=Jn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,c!==Iu&&(t=Error(l(422),{cause:c}),Vi(fs(t,i)))):(c!==Iu&&(s=Error(l(423),{cause:c}),Vi(fs(s,i))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=fs(c,i),h=bd(t.stateNode,c,h),Vu(t,h),sn!==4&&(sn=2)),!1;var x=Error(l(520),{cause:c});if(x=fs(x,i),ml===null?ml=[x]:ml.push(x),sn!==4&&(sn=2),s===null)return!0;c=fs(c,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,t=h&-h,i.lanes|=t,t=bd(i.stateNode,c,t),Vu(i,t),!1;case 1:if(s=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ha===null||!Ha.has(x))))return i.flags|=65536,h&=-h,i.lanes|=h,h=px(h),hx(h,t,i,c),Vu(i,h),!1}i=i.return}while(i!==null);return!1}var yd=Error(l(461)),pn=!1;function Tn(t,s,i,c){s.child=t===null?yh(s,null,i,c):vr(s,t.child,i,c)}function xx(t,s,i,c,h){i=i.render;var x=s.ref;if("ref"in c){var E={};for(var A in c)A!=="ref"&&(E[A]=c[A])}else E=c;return xr(s),c=ed(t,s,i,E,x,h),A=td(),t!==null&&!pn?(nd(t,s,h),la(t,s,h)):(bt&&A&&Lu(s),s.flags|=1,Tn(t,s,c,h),s.child)}function gx(t,s,i,c,h){if(t===null){var x=i.type;return typeof x=="function"&&!Mu(x)&&x.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=x,bx(t,s,x,c,h)):(t=wo(i.type,null,c,s,s.mode,h),t.ref=s.ref,t.return=s,s.child=t)}if(x=t.child,!_d(t,h)){var E=x.memoizedProps;if(i=i.compare,i=i!==null?i:Gi,i(E,c)&&t.ref===s.ref)return la(t,s,h)}return s.flags|=1,t=ta(x,c),t.ref=s.ref,t.return=s,s.child=t}function bx(t,s,i,c,h){if(t!==null){var x=t.memoizedProps;if(Gi(x,c)&&t.ref===s.ref)if(pn=!1,s.pendingProps=c=x,_d(t,h))(t.flags&131072)!==0&&(pn=!0);else return s.lanes=t.lanes,la(t,s,h)}return vd(t,s,i,c,h)}function yx(t,s,i,c){var h=c.children,x=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,t!==null){for(c=s.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~x}else c=0,s.child=null;return vx(t,s,x,i,c)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&ko(s,x!==null?x.cachePool:null),x!==null?wh(s,x):Zu(),Eh(s);else return c=s.lanes=536870912,vx(t,s,x!==null?x.baseLanes|i:i,i,c)}else x!==null?(ko(s,x.cachePool),wh(s,x),Ba(),s.memoizedState=null):(t!==null&&ko(s,null),Zu(),Ba());return Tn(t,s,h,i),s.child}function il(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function vx(t,s,i,c,h){var x=qu();return x=x===null?null:{parent:fn._currentValue,pool:x},s.memoizedState={baseLanes:i,cachePool:x},t!==null&&ko(s,null),Zu(),Eh(s),t!==null&&Qr(t,s,c,!0),s.childLanes=h,null}function Fo(t,s){return s=qo({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function Nx(t,s,i){return vr(s,t.child,null,i),t=Fo(s,s.pendingProps),t.flags|=2,es(s),s.memoizedState=null,t}function nw(t,s,i){var c=s.pendingProps,h=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(bt){if(c.mode==="hidden")return t=Fo(s,c),s.lanes=536870912,il(null,t);if(Wu(s),(t=Ft)?(t=Og(t,hs),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:Ra!==null?{id:Bs,overflow:$s}:null,retryLane:536870912,hydrationErrors:null},i=ah(t),i.return=s,s.child=i,_n=s,Ft=null)):t=null,t===null)throw Oa(s);return s.lanes=536870912,null}return Fo(s,c)}var x=t.memoizedState;if(x!==null){var E=x.dehydrated;if(Wu(s),h)if(s.flags&256)s.flags&=-257,s=Nx(t,s,i);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(l(558));else if(pn||Qr(t,s,i,!1),h=(i&t.childLanes)!==0,pn||h){if(c=Ut,c!==null&&(E=Xt(c,i),E!==0&&E!==x.retryLane))throw x.retryLane=E,fr(t,E),Yn(c,t,E),yd;Jo(),s=Nx(t,s,i)}else t=x.treeContext,Ft=gs(E.nextSibling),_n=s,bt=!0,Ma=null,hs=!1,t!==null&&lh(s,t),s=Fo(s,c),s.flags|=4096;return s}return t=ta(t.child,{mode:c.mode,children:c.children}),t.ref=s.ref,s.child=t,t.return=s,t}function Ho(t,s){var i=s.ref;if(i===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(s.flags|=4194816)}}function vd(t,s,i,c,h){return xr(s),i=ed(t,s,i,c,void 0,h),c=td(),t!==null&&!pn?(nd(t,s,h),la(t,s,h)):(bt&&c&&Lu(s),s.flags|=1,Tn(t,s,i,h),s.child)}function wx(t,s,i,c,h,x){return xr(s),s.updateQueue=null,i=Sh(s,c,i,h),jh(t),c=td(),t!==null&&!pn?(nd(t,s,x),la(t,s,x)):(bt&&c&&Lu(s),s.flags|=1,Tn(t,s,i,x),s.child)}function Ex(t,s,i,c,h){if(xr(s),s.stateNode===null){var x=Yr,E=i.contextType;typeof E=="object"&&E!==null&&(x=Cn(E)),x=new i(c,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=gd,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=c,x.state=s.memoizedState,x.refs={},Ku(s),E=i.contextType,x.context=typeof E=="object"&&E!==null?Cn(E):Yr,x.state=s.memoizedState,E=i.getDerivedStateFromProps,typeof E=="function"&&(xd(s,i,E,c),x.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&gd.enqueueReplaceState(x,x.state,null),tl(s,c,x,h),el(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(t===null){x=s.stateNode;var A=s.memoizedProps,K=wr(i,A);x.props=K;var se=x.context,fe=i.contextType;E=Yr,typeof fe=="object"&&fe!==null&&(E=Cn(fe));var pe=i.getDerivedStateFromProps;fe=typeof pe=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=s.pendingProps!==A,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||se!==E)&&cx(s,x,c,E),La=!1;var ae=s.memoizedState;x.state=ae,tl(s,c,x,h),el(),se=s.memoizedState,A||ae!==se||La?(typeof pe=="function"&&(xd(s,i,pe,c),se=s.memoizedState),(K=La||ox(s,i,K,c,ae,se,E))?(fe||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=se),x.props=c,x.state=se,x.context=E,c=K):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{x=s.stateNode,Yu(t,s),E=s.memoizedProps,fe=wr(i,E),x.props=fe,pe=s.pendingProps,ae=x.context,se=i.contextType,K=Yr,typeof se=="object"&&se!==null&&(K=Cn(se)),A=i.getDerivedStateFromProps,(se=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==pe||ae!==K)&&cx(s,x,c,K),La=!1,ae=s.memoizedState,x.state=ae,tl(s,c,x,h),el();var le=s.memoizedState;E!==pe||ae!==le||La||t!==null&&t.dependencies!==null&&jo(t.dependencies)?(typeof A=="function"&&(xd(s,i,A,c),le=s.memoizedState),(fe=La||ox(s,i,fe,c,ae,le,K)||t!==null&&t.dependencies!==null&&jo(t.dependencies))?(se||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,le,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,le,K)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===t.memoizedProps&&ae===t.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&ae===t.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=le),x.props=c,x.state=le,x.context=K,c=fe):(typeof x.componentDidUpdate!="function"||E===t.memoizedProps&&ae===t.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&ae===t.memoizedState||(s.flags|=1024),c=!1)}return x=c,Ho(t,s),c=(s.flags&128)!==0,x||c?(x=s.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,t!==null&&c?(s.child=vr(s,t.child,null,h),s.child=vr(s,null,i,h)):Tn(t,s,i,h),s.memoizedState=x.state,t=s.child):t=la(t,s,h),t}function jx(t,s,i,c){return pr(),s.flags|=256,Tn(t,s,i,c),s.child}var Nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wd(t){return{baseLanes:t,cachePool:mh()}}function Ed(t,s,i){return t=t!==null?t.childLanes&~i:0,s&&(t|=ns),t}function Sx(t,s,i){var c=s.pendingProps,h=!1,x=(s.flags&128)!==0,E;if((E=x)||(E=t!==null&&t.memoizedState===null?!1:(an.current&2)!==0),E&&(h=!0,s.flags&=-129),E=(s.flags&32)!==0,s.flags&=-33,t===null){if(bt){if(h?Ua(s):Ba(),(t=Ft)?(t=Og(t,hs),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:Ra!==null?{id:Bs,overflow:$s}:null,retryLane:536870912,hydrationErrors:null},i=ah(t),i.return=s,s.child=i,_n=s,Ft=null)):t=null,t===null)throw Oa(s);return rf(t)?s.lanes=32:s.lanes=536870912,null}var A=c.children;return c=c.fallback,h?(Ba(),h=s.mode,A=qo({mode:"hidden",children:A},h),c=mr(c,h,i,null),A.return=s,c.return=s,A.sibling=c,s.child=A,c=s.child,c.memoizedState=wd(i),c.childLanes=Ed(t,E,i),s.memoizedState=Nd,il(null,c)):(Ua(s),jd(s,A))}var K=t.memoizedState;if(K!==null&&(A=K.dehydrated,A!==null)){if(x)s.flags&256?(Ua(s),s.flags&=-257,s=Sd(t,s,i)):s.memoizedState!==null?(Ba(),s.child=t.child,s.flags|=128,s=null):(Ba(),A=c.fallback,h=s.mode,c=qo({mode:"visible",children:c.children},h),A=mr(A,h,i,null),A.flags|=2,c.return=s,A.return=s,c.sibling=A,s.child=c,vr(s,t.child,null,i),c=s.child,c.memoizedState=wd(i),c.childLanes=Ed(t,E,i),s.memoizedState=Nd,s=il(null,c));else if(Ua(s),rf(A)){if(E=A.nextSibling&&A.nextSibling.dataset,E)var se=E.dgst;E=se,c=Error(l(419)),c.stack="",c.digest=E,Vi({value:c,source:null,stack:null}),s=Sd(t,s,i)}else if(pn||Qr(t,s,i,!1),E=(i&t.childLanes)!==0,pn||E){if(E=Ut,E!==null&&(c=Xt(E,i),c!==0&&c!==K.retryLane))throw K.retryLane=c,fr(t,c),Yn(E,t,c),yd;af(A)||Jo(),s=Sd(t,s,i)}else af(A)?(s.flags|=192,s.child=t.child,s=null):(t=K.treeContext,Ft=gs(A.nextSibling),_n=s,bt=!0,Ma=null,hs=!1,t!==null&&lh(s,t),s=jd(s,c.children),s.flags|=4096);return s}return h?(Ba(),A=c.fallback,h=s.mode,K=t.child,se=K.sibling,c=ta(K,{mode:"hidden",children:c.children}),c.subtreeFlags=K.subtreeFlags&65011712,se!==null?A=ta(se,A):(A=mr(A,h,i,null),A.flags|=2),A.return=s,c.return=s,c.sibling=A,s.child=c,il(null,c),c=s.child,A=t.child.memoizedState,A===null?A=wd(i):(h=A.cachePool,h!==null?(K=fn._currentValue,h=h.parent!==K?{parent:K,pool:K}:h):h=mh(),A={baseLanes:A.baseLanes|i,cachePool:h}),c.memoizedState=A,c.childLanes=Ed(t,E,i),s.memoizedState=Nd,il(t.child,c)):(Ua(s),i=t.child,t=i.sibling,i=ta(i,{mode:"visible",children:c.children}),i.return=s,i.sibling=null,t!==null&&(E=s.deletions,E===null?(s.deletions=[t],s.flags|=16):E.push(t)),s.child=i,s.memoizedState=null,i)}function jd(t,s){return s=qo({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function qo(t,s){return t=Wn(22,t,null,s),t.lanes=0,t}function Sd(t,s,i){return vr(s,t.child,null,i),t=jd(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function kx(t,s,i){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s),$u(t.return,s,i)}function kd(t,s,i,c,h,x){var E=t.memoizedState;E===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:h,treeForkCount:x}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=c,E.tail=i,E.tailMode=h,E.treeForkCount=x)}function _x(t,s,i){var c=s.pendingProps,h=c.revealOrder,x=c.tail;c=c.children;var E=an.current,A=(E&2)!==0;if(A?(E=E&1|2,s.flags|=128):E&=1,O(an,E),Tn(t,s,c,i),c=bt?Yi:0,!A&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&kx(t,i,s);else if(t.tag===19)kx(t,i,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(i=s.child,h=null;i!==null;)t=i.alternate,t!==null&&Mo(t)===null&&(h=i),i=i.sibling;i=h,i===null?(h=s.child,s.child=null):(h=i.sibling,i.sibling=null),kd(s,!1,h,i,x,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,h=s.child,s.child=null;h!==null;){if(t=h.alternate,t!==null&&Mo(t)===null){s.child=h;break}t=h.sibling,h.sibling=i,i=h,h=t}kd(s,!0,i,null,x,c);break;case"together":kd(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function la(t,s,i){if(t!==null&&(s.dependencies=t.dependencies),Fa|=s.lanes,(i&s.childLanes)===0)if(t!==null){if(Qr(t,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,i=ta(t,t.pendingProps),s.child=i,i.return=s;t.sibling!==null;)t=t.sibling,i=i.sibling=ta(t,t.pendingProps),i.return=s;i.sibling=null}return s.child}function _d(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&jo(t)))}function sw(t,s,i){switch(s.tag){case 3:je(s,s.stateNode.containerInfo),Da(s,fn,t.memoizedState.cache),pr();break;case 27:case 5:we(s);break;case 4:je(s,s.stateNode.containerInfo);break;case 10:Da(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Wu(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(Ua(s),s.flags|=128,null):(i&s.child.childLanes)!==0?Sx(t,s,i):(Ua(s),t=la(t,s,i),t!==null?t.sibling:null);Ua(s);break;case 19:var h=(t.flags&128)!==0;if(c=(i&s.childLanes)!==0,c||(Qr(t,s,i,!1),c=(i&s.childLanes)!==0),h){if(c)return _x(t,s,i);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),O(an,an.current),c)break;return null;case 22:return s.lanes=0,yx(t,s,i,s.pendingProps);case 24:Da(s,fn,t.memoizedState.cache)}return la(t,s,i)}function Cx(t,s,i){if(t!==null)if(t.memoizedProps!==s.pendingProps)pn=!0;else{if(!_d(t,i)&&(s.flags&128)===0)return pn=!1,sw(t,s,i);pn=(t.flags&131072)!==0}else pn=!1,bt&&(s.flags&1048576)!==0&&ih(s,Yi,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(t=br(s.elementType),s.type=t,typeof t=="function")Mu(t)?(c=wr(t,c),s.tag=1,s=Ex(null,s,t,c,i)):(s.tag=0,s=vd(null,s,t,c,i));else{if(t!=null){var h=t.$$typeof;if(h===Z){s.tag=11,s=xx(null,s,t,c,i);break e}else if(h===I){s.tag=14,s=gx(null,s,t,c,i);break e}}throw s=$(t)||t,Error(l(306,s,""))}}return s;case 0:return vd(t,s,s.type,s.pendingProps,i);case 1:return c=s.type,h=wr(c,s.pendingProps),Ex(t,s,c,h,i);case 3:e:{if(je(s,s.stateNode.containerInfo),t===null)throw Error(l(387));c=s.pendingProps;var x=s.memoizedState;h=x.element,Yu(t,s),tl(s,c,null,i);var E=s.memoizedState;if(c=E.cache,Da(s,fn,c),c!==x.cache&&Pu(s,[fn],i,!0),el(),c=E.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:E.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=jx(t,s,c,i);break e}else if(c!==h){h=fs(Error(l(424)),s),Vi(h),s=jx(t,s,c,i);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ft=gs(t.firstChild),_n=s,bt=!0,Ma=null,hs=!0,i=yh(s,null,c,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(pr(),c===h){s=la(t,s,i);break e}Tn(t,s,c,i)}s=s.child}return s;case 26:return Ho(t,s),t===null?(i=Bg(s.type,null,s.pendingProps,null))?s.memoizedState=i:bt||(i=s.type,t=s.pendingProps,c=ic(re.current).createElement(i),c[Zt]=s,c[Nn]=t,An(c,i,t),tn(c),s.stateNode=c):s.memoizedState=Bg(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return we(s),t===null&&bt&&(c=s.stateNode=zg(s.type,s.pendingProps,re.current),_n=s,hs=!0,h=Ft,Ya(s.type)?(lf=h,Ft=gs(c.firstChild)):Ft=h),Tn(t,s,s.pendingProps.children,i),Ho(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&bt&&((h=c=Ft)&&(c=Ow(c,s.type,s.pendingProps,hs),c!==null?(s.stateNode=c,_n=s,Ft=gs(c.firstChild),hs=!1,h=!0):h=!1),h||Oa(s)),we(s),h=s.type,x=s.pendingProps,E=t!==null?t.memoizedProps:null,c=x.children,tf(h,x)?c=null:E!==null&&tf(h,E)&&(s.flags|=32),s.memoizedState!==null&&(h=ed(t,s,VN,null,null,i),Nl._currentValue=h),Ho(t,s),Tn(t,s,c,i),s.child;case 6:return t===null&&bt&&((t=i=Ft)&&(i=Dw(i,s.pendingProps,hs),i!==null?(s.stateNode=i,_n=s,Ft=null,t=!0):t=!1),t||Oa(s)),null;case 13:return Sx(t,s,i);case 4:return je(s,s.stateNode.containerInfo),c=s.pendingProps,t===null?s.child=vr(s,null,c,i):Tn(t,s,c,i),s.child;case 11:return xx(t,s,s.type,s.pendingProps,i);case 7:return Tn(t,s,s.pendingProps,i),s.child;case 8:return Tn(t,s,s.pendingProps.children,i),s.child;case 12:return Tn(t,s,s.pendingProps.children,i),s.child;case 10:return c=s.pendingProps,Da(s,s.type,c.value),Tn(t,s,c.children,i),s.child;case 9:return h=s.type._context,c=s.pendingProps.children,xr(s),h=Cn(h),c=c(h),s.flags|=1,Tn(t,s,c,i),s.child;case 14:return gx(t,s,s.type,s.pendingProps,i);case 15:return bx(t,s,s.type,s.pendingProps,i);case 19:return _x(t,s,i);case 31:return nw(t,s,i);case 22:return yx(t,s,i,s.pendingProps);case 24:return xr(s),c=Cn(fn),t===null?(h=qu(),h===null&&(h=Ut,x=Fu(),h.pooledCache=x,x.refCount++,x!==null&&(h.pooledCacheLanes|=i),h=x),s.memoizedState={parent:c,cache:h},Ku(s),Da(s,fn,h)):((t.lanes&i)!==0&&(Yu(t,s),tl(s,null,null,i),el()),h=t.memoizedState,x=s.memoizedState,h.parent!==c?(h={parent:c,cache:c},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),Da(s,fn,c)):(c=x.cache,Da(s,fn,c),c!==h.cache&&Pu(s,[fn],i,!0))),Tn(t,s,s.pendingProps.children,i),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function oa(t){t.flags|=4}function Cd(t,s,i,c,h){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(tg())t.flags|=8192;else throw yr=Co,Gu}else t.flags&=-16777217}function Tx(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!qg(s))if(tg())t.flags|=8192;else throw yr=Co,Gu}function Go(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?_e():536870912,t.lanes|=s,ci|=s)}function ll(t,s){if(!bt)switch(t.tailMode){case"hidden":s=t.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Ht(t){var s=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(s)for(var h=t.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=i,s}function aw(t,s,i){var c=s.pendingProps;switch(zu(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(s),null;case 1:return Ht(s),null;case 3:return i=s.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),aa(fn),Be(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(Zr(s)?oa(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Uu())),Ht(s),null;case 26:var h=s.type,x=s.memoizedState;return t===null?(oa(s),x!==null?(Ht(s),Tx(s,x)):(Ht(s),Cd(s,h,null,c,i))):x?x!==t.memoizedState?(oa(s),Ht(s),Tx(s,x)):(Ht(s),s.flags&=-16777217):(t=t.memoizedProps,t!==c&&oa(s),Ht(s),Cd(s,h,t,c,i)),null;case 27:if(Ye(s),i=re.current,h=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&oa(s);else{if(!c){if(s.stateNode===null)throw Error(l(166));return Ht(s),null}t=H.current,Zr(s)?oh(s):(t=zg(h,c,i),s.stateNode=t,oa(s))}return Ht(s),null;case 5:if(Ye(s),h=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&oa(s);else{if(!c){if(s.stateNode===null)throw Error(l(166));return Ht(s),null}if(x=H.current,Zr(s))oh(s);else{var E=ic(re.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?E.createElement("select",{is:c.is}):E.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?E.createElement(h,{is:c.is}):E.createElement(h)}}x[Zt]=s,x[Nn]=c;e:for(E=s.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===s)break e;for(;E.sibling===null;){if(E.return===null||E.return===s)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}s.stateNode=x;e:switch(An(x,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&oa(s)}}return Ht(s),Cd(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,i),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==c&&oa(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(l(166));if(t=re.current,Zr(s)){if(t=s.stateNode,i=s.memoizedProps,c=null,h=_n,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[Zt]=s,t=!!(t.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||Sg(t.nodeValue,i)),t||Oa(s,!0)}else t=ic(t).createTextNode(c),t[Zt]=s,s.stateNode=t}return Ht(s),null;case 31:if(i=s.memoizedState,t===null||t.memoizedState!==null){if(c=Zr(s),i!==null){if(t===null){if(!c)throw Error(l(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Zt]=s}else pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ht(s),t=!1}else i=Uu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return s.flags&256?(es(s),s):(es(s),null);if((s.flags&128)!==0)throw Error(l(558))}return Ht(s),null;case 13:if(c=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Zr(s),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(l(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(l(317));h[Zt]=s}else pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ht(s),h=!1}else h=Uu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(es(s),s):(es(s),null)}return es(s),(s.flags&128)!==0?(s.lanes=i,s):(i=c!==null,t=t!==null&&t.memoizedState!==null,i&&(c=s.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==h&&(c.flags|=2048)),i!==t&&i&&(s.child.flags|=8192),Go(s,s.updateQueue),Ht(s),null);case 4:return Be(),t===null&&Zd(s.stateNode.containerInfo),Ht(s),null;case 10:return aa(s.type),Ht(s),null;case 19:if(G(an),c=s.memoizedState,c===null)return Ht(s),null;if(h=(s.flags&128)!==0,x=c.rendering,x===null)if(h)ll(c,!1);else{if(sn!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(x=Mo(t),x!==null){for(s.flags|=128,ll(c,!1),t=x.updateQueue,s.updateQueue=t,Go(s,t),s.subtreeFlags=0,t=i,i=s.child;i!==null;)sh(i,t),i=i.sibling;return O(an,an.current&1|2),bt&&na(s,c.treeForkCount),s.child}t=t.sibling}c.tail!==null&&ct()>Zo&&(s.flags|=128,h=!0,ll(c,!1),s.lanes=4194304)}else{if(!h)if(t=Mo(x),t!==null){if(s.flags|=128,h=!0,t=t.updateQueue,s.updateQueue=t,Go(s,t),ll(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!bt)return Ht(s),null}else 2*ct()-c.renderingStartTime>Zo&&i!==536870912&&(s.flags|=128,h=!0,ll(c,!1),s.lanes=4194304);c.isBackwards?(x.sibling=s.child,s.child=x):(t=c.last,t!==null?t.sibling=x:s.child=x,c.last=x)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=ct(),t.sibling=null,i=an.current,O(an,h?i&1|2:i&1),bt&&na(s,c.treeForkCount),t):(Ht(s),null);case 22:case 23:return es(s),Qu(),c=s.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(i&536870912)!==0&&(s.flags&128)===0&&(Ht(s),s.subtreeFlags&6&&(s.flags|=8192)):Ht(s),i=s.updateQueue,i!==null&&Go(s,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==i&&(s.flags|=2048),t!==null&&G(gr),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),aa(fn),Ht(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function rw(t,s){switch(zu(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return aa(fn),Be(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Ye(s),null;case 31:if(s.memoizedState!==null){if(es(s),s.alternate===null)throw Error(l(340));pr()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(es(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));pr()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return G(an),null;case 4:return Be(),null;case 10:return aa(s.type),null;case 22:case 23:return es(s),Qu(),t!==null&&G(gr),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return aa(fn),null;case 25:return null;default:return null}}function Ax(t,s){switch(zu(s),s.tag){case 3:aa(fn),Be();break;case 26:case 27:case 5:Ye(s);break;case 4:Be();break;case 31:s.memoizedState!==null&&es(s);break;case 13:es(s);break;case 19:G(an);break;case 10:aa(s.type);break;case 22:case 23:es(s),Qu(),t!==null&&G(gr);break;case 24:aa(fn)}}function ol(t,s){try{var i=s.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var h=c.next;i=h;do{if((i.tag&t)===t){c=void 0;var x=i.create,E=i.inst;c=x(),E.destroy=c}i=i.next}while(i!==h)}}catch(A){Tt(s,s.return,A)}}function $a(t,s,i){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var x=h.next;c=x;do{if((c.tag&t)===t){var E=c.inst,A=E.destroy;if(A!==void 0){E.destroy=void 0,h=s;var K=i,se=A;try{se()}catch(fe){Tt(h,K,fe)}}}c=c.next}while(c!==x)}}catch(fe){Tt(s,s.return,fe)}}function Rx(t){var s=t.updateQueue;if(s!==null){var i=t.stateNode;try{Nh(s,i)}catch(c){Tt(t,t.return,c)}}}function Mx(t,s,i){i.props=wr(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(c){Tt(t,s,c)}}function cl(t,s){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof i=="function"?t.refCleanup=i(c):i.current=c}}catch(h){Tt(t,s,h)}}function Ps(t,s){var i=t.ref,c=t.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(h){Tt(t,s,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){Tt(t,s,h)}else i.current=null}function Ox(t){var s=t.type,i=t.memoizedProps,c=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(h){Tt(t,t.return,h)}}function Td(t,s,i){try{var c=t.stateNode;_w(c,t.type,i,s),c[Nn]=s}catch(h){Tt(t,t.return,h)}}function Dx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ya(t.type)||t.tag===4}function Ad(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ya(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Rd(t,s,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(t),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=Ee));else if(c!==4&&(c===27&&Ya(t.type)&&(i=t.stateNode,s=null),t=t.child,t!==null))for(Rd(t,s,i),t=t.sibling;t!==null;)Rd(t,s,i),t=t.sibling}function Ko(t,s,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?i.insertBefore(t,s):i.appendChild(t);else if(c!==4&&(c===27&&Ya(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(Ko(t,s,i),t=t.sibling;t!==null;)Ko(t,s,i),t=t.sibling}function Lx(t){var s=t.stateNode,i=t.memoizedProps;try{for(var c=t.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);An(s,c,i),s[Zt]=t,s[Nn]=i}catch(x){Tt(t,t.return,x)}}var ca=!1,hn=!1,Md=!1,zx=typeof WeakSet=="function"?WeakSet:Set,wn=null;function iw(t,s){if(t=t.containerInfo,Jd=mc,t=Vp(t),Su(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var h=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var E=0,A=-1,K=-1,se=0,fe=0,pe=t,ae=null;t:for(;;){for(var le;pe!==i||h!==0&&pe.nodeType!==3||(A=E+h),pe!==x||c!==0&&pe.nodeType!==3||(K=E+c),pe.nodeType===3&&(E+=pe.nodeValue.length),(le=pe.firstChild)!==null;)ae=pe,pe=le;for(;;){if(pe===t)break t;if(ae===i&&++se===h&&(A=E),ae===x&&++fe===c&&(K=E),(le=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=le}i=A===-1||K===-1?null:{start:A,end:K}}else i=null}i=i||{start:0,end:0}}else i=null;for(ef={focusedElem:t,selectionRange:i},mc=!1,wn=s;wn!==null;)if(s=wn,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,wn=t;else for(;wn!==null;){switch(s=wn,x=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)h=t[i],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,i=s,h=x.memoizedProps,x=x.memoizedState,c=i.stateNode;try{var Oe=wr(i.type,h);t=c.getSnapshotBeforeUpdate(Oe,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ge){Tt(i,i.return,Ge)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,i=t.nodeType,i===9)sf(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":sf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=s.sibling,t!==null){t.return=s.return,wn=t;break}wn=s.return}}function Ix(t,s,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:da(t,i),c&4&&ol(5,i);break;case 1:if(da(t,i),c&4)if(t=i.stateNode,s===null)try{t.componentDidMount()}catch(E){Tt(i,i.return,E)}else{var h=wr(i.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(h,s,t.__reactInternalSnapshotBeforeUpdate)}catch(E){Tt(i,i.return,E)}}c&64&&Rx(i),c&512&&cl(i,i.return);break;case 3:if(da(t,i),c&64&&(t=i.updateQueue,t!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{Nh(t,s)}catch(E){Tt(i,i.return,E)}}break;case 27:s===null&&c&4&&Lx(i);case 26:case 5:da(t,i),s===null&&c&4&&Ox(i),c&512&&cl(i,i.return);break;case 12:da(t,i);break;case 31:da(t,i),c&4&&$x(t,i);break;case 13:da(t,i),c&4&&Px(t,i),c&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=hw.bind(null,i),Lw(t,i))));break;case 22:if(c=i.memoizedState!==null||ca,!c){s=s!==null&&s.memoizedState!==null||hn,h=ca;var x=hn;ca=c,(hn=s)&&!x?fa(t,i,(i.subtreeFlags&8772)!==0):da(t,i),ca=h,hn=x}break;case 30:break;default:da(t,i)}}function Ux(t){var s=t.alternate;s!==null&&(t.alternate=null,Ux(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&ir(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Kt=null,Hn=!1;function ua(t,s,i){for(i=i.child;i!==null;)Bx(t,s,i),i=i.sibling}function Bx(t,s,i){if(et&&typeof et.onCommitFiberUnmount=="function")try{et.onCommitFiberUnmount(un,i)}catch{}switch(i.tag){case 26:hn||Ps(i,s),ua(t,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:hn||Ps(i,s);var c=Kt,h=Hn;Ya(i.type)&&(Kt=i.stateNode,Hn=!1),ua(t,s,i),bl(i.stateNode),Kt=c,Hn=h;break;case 5:hn||Ps(i,s);case 6:if(c=Kt,h=Hn,Kt=null,ua(t,s,i),Kt=c,Hn=h,Kt!==null)if(Hn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(i.stateNode)}catch(x){Tt(i,s,x)}else try{Kt.removeChild(i.stateNode)}catch(x){Tt(i,s,x)}break;case 18:Kt!==null&&(Hn?(t=Kt,Rg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),gi(t)):Rg(Kt,i.stateNode));break;case 4:c=Kt,h=Hn,Kt=i.stateNode.containerInfo,Hn=!0,ua(t,s,i),Kt=c,Hn=h;break;case 0:case 11:case 14:case 15:$a(2,i,s),hn||$a(4,i,s),ua(t,s,i);break;case 1:hn||(Ps(i,s),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Mx(i,s,c)),ua(t,s,i);break;case 21:ua(t,s,i);break;case 22:hn=(c=hn)||i.memoizedState!==null,ua(t,s,i),hn=c;break;default:ua(t,s,i)}}function $x(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{gi(t)}catch(i){Tt(s,s.return,i)}}}function Px(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{gi(t)}catch(i){Tt(s,s.return,i)}}function lw(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new zx),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new zx),s;default:throw Error(l(435,t.tag))}}function Yo(t,s){var i=lw(t);s.forEach(function(c){if(!i.has(c)){i.add(c);var h=xw.bind(null,t,c);c.then(h,h)}})}function qn(t,s){var i=s.deletions;if(i!==null)for(var c=0;c<i.length;c++){var h=i[c],x=t,E=s,A=E;e:for(;A!==null;){switch(A.tag){case 27:if(Ya(A.type)){Kt=A.stateNode,Hn=!1;break e}break;case 5:Kt=A.stateNode,Hn=!1;break e;case 3:case 4:Kt=A.stateNode.containerInfo,Hn=!0;break e}A=A.return}if(Kt===null)throw Error(l(160));Bx(x,E,h),Kt=null,Hn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Fx(s,t),s=s.sibling}var js=null;function Fx(t,s){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:qn(s,t),Gn(t),c&4&&($a(3,t,t.return),ol(3,t),$a(5,t,t.return));break;case 1:qn(s,t),Gn(t),c&512&&(hn||i===null||Ps(i,i.return)),c&64&&ca&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var h=js;if(qn(s,t),Gn(t),c&512&&(hn||i===null||Ps(i,i.return)),c&4){var x=i!==null?i.memoizedState:null;if(c=t.memoizedState,i===null)if(c===null)if(t.stateNode===null){e:{c=t.type,i=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":x=h.getElementsByTagName("title")[0],(!x||x[Ws]||x[Zt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=h.createElement(c),h.head.insertBefore(x,h.querySelector("head > title"))),An(x,c,i),x[Zt]=t,tn(x),c=x;break e;case"link":var E=Fg("link","href",h).get(c+(i.href||""));if(E){for(var A=0;A<E.length;A++)if(x=E[A],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){E.splice(A,1);break t}}x=h.createElement(c),An(x,c,i),h.head.appendChild(x);break;case"meta":if(E=Fg("meta","content",h).get(c+(i.content||""))){for(A=0;A<E.length;A++)if(x=E[A],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){E.splice(A,1);break t}}x=h.createElement(c),An(x,c,i),h.head.appendChild(x);break;default:throw Error(l(468,c))}x[Zt]=t,tn(x),c=x}t.stateNode=c}else Hg(h,t.type,t.stateNode);else t.stateNode=Pg(h,c,t.memoizedProps);else x!==c?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,c===null?Hg(h,t.type,t.stateNode):Pg(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Td(t,t.memoizedProps,i.memoizedProps)}break;case 27:qn(s,t),Gn(t),c&512&&(hn||i===null||Ps(i,i.return)),i!==null&&c&4&&Td(t,t.memoizedProps,i.memoizedProps);break;case 5:if(qn(s,t),Gn(t),c&512&&(hn||i===null||Ps(i,i.return)),t.flags&32){h=t.stateNode;try{Ke(h,"")}catch(Oe){Tt(t,t.return,Oe)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,Td(t,h,i!==null?i.memoizedProps:h)),c&1024&&(Md=!0);break;case 6:if(qn(s,t),Gn(t),c&4){if(t.stateNode===null)throw Error(l(162));c=t.memoizedProps,i=t.stateNode;try{i.nodeValue=c}catch(Oe){Tt(t,t.return,Oe)}}break;case 3:if(cc=null,h=js,js=lc(s.containerInfo),qn(s,t),js=h,Gn(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{gi(s.containerInfo)}catch(Oe){Tt(t,t.return,Oe)}Md&&(Md=!1,Hx(t));break;case 4:c=js,js=lc(t.stateNode.containerInfo),qn(s,t),Gn(t),js=c;break;case 12:qn(s,t),Gn(t);break;case 31:qn(s,t),Gn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Yo(t,c)));break;case 13:qn(s,t),Gn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Xo=ct()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Yo(t,c)));break;case 22:h=t.memoizedState!==null;var K=i!==null&&i.memoizedState!==null,se=ca,fe=hn;if(ca=se||h,hn=fe||K,qn(s,t),hn=fe,ca=se,Gn(t),c&8192)e:for(s=t.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(i===null||K||ca||hn||Er(t)),i=null,s=t;;){if(s.tag===5||s.tag===26){if(i===null){K=i=s;try{if(x=K.stateNode,h)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{A=K.stateNode;var pe=K.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;A.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Oe){Tt(K,K.return,Oe)}}}else if(s.tag===6){if(i===null){K=s;try{K.stateNode.nodeValue=h?"":K.memoizedProps}catch(Oe){Tt(K,K.return,Oe)}}}else if(s.tag===18){if(i===null){K=s;try{var le=K.stateNode;h?Mg(le,!0):Mg(K.stateNode,!1)}catch(Oe){Tt(K,K.return,Oe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;i===s&&(i=null),s=s.return}i===s&&(i=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=t.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,Yo(t,i))));break;case 19:qn(s,t),Gn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Yo(t,c)));break;case 30:break;case 21:break;default:qn(s,t),Gn(t)}}function Gn(t){var s=t.flags;if(s&2){try{for(var i,c=t.return;c!==null;){if(Dx(c)){i=c;break}c=c.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var h=i.stateNode,x=Ad(t);Ko(t,x,h);break;case 5:var E=i.stateNode;i.flags&32&&(Ke(E,""),i.flags&=-33);var A=Ad(t);Ko(t,A,E);break;case 3:case 4:var K=i.stateNode.containerInfo,se=Ad(t);Rd(t,se,K);break;default:throw Error(l(161))}}catch(fe){Tt(t,t.return,fe)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Hx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Hx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function da(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Ix(t,s.alternate,s),s=s.sibling}function Er(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:$a(4,s,s.return),Er(s);break;case 1:Ps(s,s.return);var i=s.stateNode;typeof i.componentWillUnmount=="function"&&Mx(s,s.return,i),Er(s);break;case 27:bl(s.stateNode);case 26:case 5:Ps(s,s.return),Er(s);break;case 22:s.memoizedState===null&&Er(s);break;case 30:Er(s);break;default:Er(s)}t=t.sibling}}function fa(t,s,i){for(i=i&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,h=t,x=s,E=x.flags;switch(x.tag){case 0:case 11:case 15:fa(h,x,i),ol(4,x);break;case 1:if(fa(h,x,i),c=x,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(se){Tt(c,c.return,se)}if(c=x,h=c.updateQueue,h!==null){var A=c.stateNode;try{var K=h.shared.hiddenCallbacks;if(K!==null)for(h.shared.hiddenCallbacks=null,h=0;h<K.length;h++)vh(K[h],A)}catch(se){Tt(c,c.return,se)}}i&&E&64&&Rx(x),cl(x,x.return);break;case 27:Lx(x);case 26:case 5:fa(h,x,i),i&&c===null&&E&4&&Ox(x),cl(x,x.return);break;case 12:fa(h,x,i);break;case 31:fa(h,x,i),i&&E&4&&$x(h,x);break;case 13:fa(h,x,i),i&&E&4&&Px(h,x);break;case 22:x.memoizedState===null&&fa(h,x,i),cl(x,x.return);break;case 30:break;default:fa(h,x,i)}s=s.sibling}}function Od(t,s){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Xi(i))}function Dd(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Xi(t))}function Ss(t,s,i,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)qx(t,s,i,c),s=s.sibling}function qx(t,s,i,c){var h=s.flags;switch(s.tag){case 0:case 11:case 15:Ss(t,s,i,c),h&2048&&ol(9,s);break;case 1:Ss(t,s,i,c);break;case 3:Ss(t,s,i,c),h&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Xi(t)));break;case 12:if(h&2048){Ss(t,s,i,c),t=s.stateNode;try{var x=s.memoizedProps,E=x.id,A=x.onPostCommit;typeof A=="function"&&A(E,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(K){Tt(s,s.return,K)}}else Ss(t,s,i,c);break;case 31:Ss(t,s,i,c);break;case 13:Ss(t,s,i,c);break;case 23:break;case 22:x=s.stateNode,E=s.alternate,s.memoizedState!==null?x._visibility&2?Ss(t,s,i,c):ul(t,s):x._visibility&2?Ss(t,s,i,c):(x._visibility|=2,ii(t,s,i,c,(s.subtreeFlags&10256)!==0||!1)),h&2048&&Od(E,s);break;case 24:Ss(t,s,i,c),h&2048&&Dd(s.alternate,s);break;default:Ss(t,s,i,c)}}function ii(t,s,i,c,h){for(h=h&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=t,E=s,A=i,K=c,se=E.flags;switch(E.tag){case 0:case 11:case 15:ii(x,E,A,K,h),ol(8,E);break;case 23:break;case 22:var fe=E.stateNode;E.memoizedState!==null?fe._visibility&2?ii(x,E,A,K,h):ul(x,E):(fe._visibility|=2,ii(x,E,A,K,h)),h&&se&2048&&Od(E.alternate,E);break;case 24:ii(x,E,A,K,h),h&&se&2048&&Dd(E.alternate,E);break;default:ii(x,E,A,K,h)}s=s.sibling}}function ul(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=t,c=s,h=c.flags;switch(c.tag){case 22:ul(i,c),h&2048&&Od(c.alternate,c);break;case 24:ul(i,c),h&2048&&Dd(c.alternate,c);break;default:ul(i,c)}s=s.sibling}}var dl=8192;function li(t,s,i){if(t.subtreeFlags&dl)for(t=t.child;t!==null;)Gx(t,s,i),t=t.sibling}function Gx(t,s,i){switch(t.tag){case 26:li(t,s,i),t.flags&dl&&t.memoizedState!==null&&Yw(i,js,t.memoizedState,t.memoizedProps);break;case 5:li(t,s,i);break;case 3:case 4:var c=js;js=lc(t.stateNode.containerInfo),li(t,s,i),js=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=dl,dl=16777216,li(t,s,i),dl=c):li(t,s,i));break;default:li(t,s,i)}}function Kx(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function fl(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var c=s[i];wn=c,Vx(c,t)}Kx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yx(t),t=t.sibling}function Yx(t){switch(t.tag){case 0:case 11:case 15:fl(t),t.flags&2048&&$a(9,t,t.return);break;case 3:fl(t);break;case 12:fl(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,Vo(t)):fl(t);break;default:fl(t)}}function Vo(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var c=s[i];wn=c,Vx(c,t)}Kx(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:$a(8,s,s.return),Vo(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,Vo(s));break;default:Vo(s)}t=t.sibling}}function Vx(t,s){for(;wn!==null;){var i=wn;switch(i.tag){case 0:case 11:case 15:$a(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Xi(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,wn=c;else e:for(i=t;wn!==null;){c=wn;var h=c.sibling,x=c.return;if(Ux(c),c===i){wn=null;break e}if(h!==null){h.return=x,wn=h;break e}wn=x}}}var ow={getCacheForType:function(t){var s=Cn(fn),i=s.data.get(t);return i===void 0&&(i=t(),s.data.set(t,i)),i},cacheSignal:function(){return Cn(fn).controller.signal}},cw=typeof WeakMap=="function"?WeakMap:Map,wt=0,Ut=null,ut=null,pt=0,Ct=0,ts=null,Pa=!1,oi=!1,Ld=!1,ma=0,sn=0,Fa=0,jr=0,zd=0,ns=0,ci=0,ml=null,Kn=null,Id=!1,Xo=0,Xx=0,Zo=1/0,Qo=null,Ha=null,gn=0,qa=null,ui=null,pa=0,Ud=0,Bd=null,Zx=null,pl=0,$d=null;function ss(){return(wt&2)!==0&&pt!==0?pt&-pt:B.T!==null?Kd():ja()}function Qx(){if(ns===0)if((pt&536870912)===0||bt){var t=Zs;Zs<<=1,(Zs&3932160)===0&&(Zs=262144),ns=t}else ns=536870912;return t=Jn.current,t!==null&&(t.flags|=32),ns}function Yn(t,s,i){(t===Ut&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(di(t,0),Ga(t,pt,ns,!1)),St(t,i),((wt&2)===0||t!==Ut)&&(t===Ut&&((wt&2)===0&&(jr|=i),sn===4&&Ga(t,pt,ns,!1)),Fs(t))}function Wx(t,s,i){if((wt&6)!==0)throw Error(l(327));var c=!i&&(s&127)===0&&(s&t.expiredLanes)===0||de(t,s),h=c?fw(t,s):Fd(t,s,!0),x=c;do{if(h===0){oi&&!c&&Ga(t,s,0,!1);break}else{if(i=t.current.alternate,x&&!uw(i)){h=Fd(t,s,!1),x=!1;continue}if(h===2){if(x=s,t.errorRecoveryDisabledLanes&x)var E=0;else E=t.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){s=E;e:{var A=t;h=ml;var K=A.current.memoizedState.isDehydrated;if(K&&(di(A,E).flags|=256),E=Fd(A,E,!1),E!==2){if(Ld&&!K){A.errorRecoveryDisabledLanes|=x,jr|=x,h=4;break e}x=Kn,Kn=h,x!==null&&(Kn===null?Kn=x:Kn.push.apply(Kn,x))}h=E}if(x=!1,h!==2)continue}}if(h===1){di(t,0),Ga(t,s,0,!0);break}e:{switch(c=t,x=h,x){case 0:case 1:throw Error(l(345));case 4:if((s&4194048)!==s)break;case 6:Ga(c,s,ns,!Pa);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(h=Xo+300-ct(),10<h)){if(Ga(c,s,ns,!Pa),X(c,0,!0)!==0)break e;pa=s,c.timeoutHandle=Tg(Jx.bind(null,c,i,Kn,Qo,Id,s,ns,jr,ci,Pa,x,"Throttled",-0,0),h);break e}Jx(c,i,Kn,Qo,Id,s,ns,jr,ci,Pa,x,null,-0,0)}}break}while(!0);Fs(t)}function Jx(t,s,i,c,h,x,E,A,K,se,fe,pe,ae,le){if(t.timeoutHandle=-1,pe=s.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ee},Gx(s,x,pe);var Oe=(x&62914560)===x?Xo-ct():(x&4194048)===x?Xx-ct():0;if(Oe=Vw(pe,Oe),Oe!==null){pa=x,t.cancelPendingCommit=Oe(lg.bind(null,t,s,x,i,c,h,E,A,K,fe,pe,null,ae,le)),Ga(t,x,E,!se);return}}lg(t,s,x,i,c,h,E,A,K)}function uw(t){for(var s=t;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var h=i[c],x=h.getSnapshot;h=h.value;try{if(!Qn(x(),h))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ga(t,s,i,c){s&=~zd,s&=~jr,t.suspendedLanes|=s,t.pingedLanes&=~s,c&&(t.warmLanes|=s),c=t.expirationTimes;for(var h=s;0<h;){var x=31-Ve(h),E=1<<x;c[x]=-1,h&=~E}i!==0&&Ce(t,i,s)}function Wo(){return(wt&6)===0?(hl(0),!1):!0}function Pd(){if(ut!==null){if(Ct===0)var t=ut.return;else t=ut,sa=hr=null,sd(t),ti=null,Qi=0,t=ut;for(;t!==null;)Ax(t.alternate,t),t=t.return;ut=null}}function di(t,s){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,Aw(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),pa=0,Pd(),Ut=t,ut=i=ta(t.current,null),pt=s,Ct=0,ts=null,Pa=!1,oi=de(t,s),Ld=!1,ci=ns=zd=jr=Fa=sn=0,Kn=ml=null,Id=!1,(s&8)!==0&&(s|=s&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=s;0<c;){var h=31-Ve(c),x=1<<h;s|=t[h],c&=~x}return ma=s,yo(),i}function eg(t,s){tt=null,B.H=rl,s===ei||s===_o?(s=xh(),Ct=3):s===Gu?(s=xh(),Ct=4):Ct=s===yd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ts=s,ut===null&&(sn=1,Po(t,fs(s,t.current)))}function tg(){var t=Jn.current;return t===null?!0:(pt&4194048)===pt?xs===null:(pt&62914560)===pt||(pt&536870912)!==0?t===xs:!1}function ng(){var t=B.H;return B.H=rl,t===null?rl:t}function sg(){var t=B.A;return B.A=ow,t}function Jo(){sn=4,Pa||(pt&4194048)!==pt&&Jn.current!==null||(oi=!0),(Fa&134217727)===0&&(jr&134217727)===0||Ut===null||Ga(Ut,pt,ns,!1)}function Fd(t,s,i){var c=wt;wt|=2;var h=ng(),x=sg();(Ut!==t||pt!==s)&&(Qo=null,di(t,s)),s=!1;var E=sn;e:do try{if(Ct!==0&&ut!==null){var A=ut,K=ts;switch(Ct){case 8:Pd(),E=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(s=!0);var se=Ct;if(Ct=0,ts=null,fi(t,A,K,se),i&&oi){E=0;break e}break;default:se=Ct,Ct=0,ts=null,fi(t,A,K,se)}}dw(),E=sn;break}catch(fe){eg(t,fe)}while(!0);return s&&t.shellSuspendCounter++,sa=hr=null,wt=c,B.H=h,B.A=x,ut===null&&(Ut=null,pt=0,yo()),E}function dw(){for(;ut!==null;)ag(ut)}function fw(t,s){var i=wt;wt|=2;var c=ng(),h=sg();Ut!==t||pt!==s?(Qo=null,Zo=ct()+500,di(t,s)):oi=de(t,s);e:do try{if(Ct!==0&&ut!==null){s=ut;var x=ts;t:switch(Ct){case 1:Ct=0,ts=null,fi(t,s,x,1);break;case 2:case 9:if(ph(x)){Ct=0,ts=null,rg(s);break}s=function(){Ct!==2&&Ct!==9||Ut!==t||(Ct=7),Fs(t)},x.then(s,s);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:ph(x)?(Ct=0,ts=null,rg(s)):(Ct=0,ts=null,fi(t,s,x,7));break;case 5:var E=null;switch(ut.tag){case 26:E=ut.memoizedState;case 5:case 27:var A=ut;if(E?qg(E):A.stateNode.complete){Ct=0,ts=null;var K=A.sibling;if(K!==null)ut=K;else{var se=A.return;se!==null?(ut=se,ec(se)):ut=null}break t}}Ct=0,ts=null,fi(t,s,x,5);break;case 6:Ct=0,ts=null,fi(t,s,x,6);break;case 8:Pd(),sn=6;break e;default:throw Error(l(462))}}mw();break}catch(fe){eg(t,fe)}while(!0);return sa=hr=null,B.H=c,B.A=h,wt=i,ut!==null?0:(Ut=null,pt=0,yo(),sn)}function mw(){for(;ut!==null&&!gt();)ag(ut)}function ag(t){var s=Cx(t.alternate,t,ma);t.memoizedProps=t.pendingProps,s===null?ec(t):ut=s}function rg(t){var s=t,i=s.alternate;switch(s.tag){case 15:case 0:s=wx(i,s,s.pendingProps,s.type,void 0,pt);break;case 11:s=wx(i,s,s.pendingProps,s.type.render,s.ref,pt);break;case 5:sd(s);default:Ax(i,s),s=ut=sh(s,ma),s=Cx(i,s,ma)}t.memoizedProps=t.pendingProps,s===null?ec(t):ut=s}function fi(t,s,i,c){sa=hr=null,sd(s),ti=null,Qi=0;var h=s.return;try{if(tw(t,h,s,i,pt)){sn=1,Po(t,fs(i,t.current)),ut=null;return}}catch(x){if(h!==null)throw ut=h,x;sn=1,Po(t,fs(i,t.current)),ut=null;return}s.flags&32768?(bt||c===1?t=!0:oi||(pt&536870912)!==0?t=!1:(Pa=t=!0,(c===2||c===9||c===3||c===6)&&(c=Jn.current,c!==null&&c.tag===13&&(c.flags|=16384))),ig(s,t)):ec(s)}function ec(t){var s=t;do{if((s.flags&32768)!==0){ig(s,Pa);return}t=s.return;var i=aw(s.alternate,s,ma);if(i!==null){ut=i;return}if(s=s.sibling,s!==null){ut=s;return}ut=s=t}while(s!==null);sn===0&&(sn=5)}function ig(t,s){do{var i=rw(t.alternate,t);if(i!==null){i.flags&=32767,ut=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(t=t.sibling,t!==null)){ut=t;return}ut=t=i}while(t!==null);sn=6,ut=null}function lg(t,s,i,c,h,x,E,A,K){t.cancelPendingCommit=null;do tc();while(gn!==0);if((wt&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(x=s.lanes|s.childLanes,x|=Au,De(t,i,x,E,A,K),t===Ut&&(ut=Ut=null,pt=0),ui=s,qa=t,pa=i,Ud=x,Bd=h,Zx=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,gw(Ae,function(){return fg(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=B.T,B.T=null,h=Q.p,Q.p=2,E=wt,wt|=4;try{iw(t,s,i)}finally{wt=E,Q.p=h,B.T=c}}gn=1,og(),cg(),ug()}}function og(){if(gn===1){gn=0;var t=qa,s=ui,i=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||i){i=B.T,B.T=null;var c=Q.p;Q.p=2;var h=wt;wt|=4;try{Fx(s,t);var x=ef,E=Vp(t.containerInfo),A=x.focusedElem,K=x.selectionRange;if(E!==A&&A&&A.ownerDocument&&Yp(A.ownerDocument.documentElement,A)){if(K!==null&&Su(A)){var se=K.start,fe=K.end;if(fe===void 0&&(fe=se),"selectionStart"in A)A.selectionStart=se,A.selectionEnd=Math.min(fe,A.value.length);else{var pe=A.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),Oe=A.textContent.length,Ge=Math.min(K.start,Oe),Lt=K.end===void 0?Ge:Math.min(K.end,Oe);!le.extend&&Ge>Lt&&(E=Lt,Lt=Ge,Ge=E);var J=Kp(A,Ge),W=Kp(A,Lt);if(J&&W&&(le.rangeCount!==1||le.anchorNode!==J.node||le.anchorOffset!==J.offset||le.focusNode!==W.node||le.focusOffset!==W.offset)){var ne=pe.createRange();ne.setStart(J.node,J.offset),le.removeAllRanges(),Ge>Lt?(le.addRange(ne),le.extend(W.node,W.offset)):(ne.setEnd(W.node,W.offset),le.addRange(ne))}}}}for(pe=[],le=A;le=le.parentNode;)le.nodeType===1&&pe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<pe.length;A++){var me=pe[A];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}mc=!!Jd,ef=Jd=null}finally{wt=h,Q.p=c,B.T=i}}t.current=s,gn=2}}function cg(){if(gn===2){gn=0;var t=qa,s=ui,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=B.T,B.T=null;var c=Q.p;Q.p=2;var h=wt;wt|=4;try{Ix(t,s.alternate,s)}finally{wt=h,Q.p=c,B.T=i}}gn=3}}function ug(){if(gn===4||gn===3){gn=0,Vt();var t=qa,s=ui,i=pa,c=Zx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?gn=5:(gn=0,ui=qa=null,dg(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Ha=null),Ns(i),s=s.stateNode,et&&typeof et.onCommitFiberRoot=="function")try{et.onCommitFiberRoot(un,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=B.T,h=Q.p,Q.p=2,B.T=null;try{for(var x=t.onRecoverableError,E=0;E<c.length;E++){var A=c[E];x(A.value,{componentStack:A.stack})}}finally{B.T=s,Q.p=h}}(pa&3)!==0&&tc(),Fs(t),h=t.pendingLanes,(i&261930)!==0&&(h&42)!==0?t===$d?pl++:(pl=0,$d=t):pl=0,hl(0)}}function dg(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Xi(s)))}function tc(){return og(),cg(),ug(),fg()}function fg(){if(gn!==5)return!1;var t=qa,s=Ud;Ud=0;var i=Ns(pa),c=B.T,h=Q.p;try{Q.p=32>i?32:i,B.T=null,i=Bd,Bd=null;var x=qa,E=pa;if(gn=0,ui=qa=null,pa=0,(wt&6)!==0)throw Error(l(331));var A=wt;if(wt|=4,Yx(x.current),qx(x,x.current,E,i),wt=A,hl(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(un,x)}catch{}return!0}finally{Q.p=h,B.T=c,dg(t,s)}}function mg(t,s,i){s=fs(i,s),s=bd(t.stateNode,s,2),t=Ia(t,s,2),t!==null&&(St(t,2),Fs(t))}function Tt(t,s,i){if(t.tag===3)mg(t,t,i);else for(;s!==null;){if(s.tag===3){mg(s,t,i);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ha===null||!Ha.has(c))){t=fs(i,t),i=px(2),c=Ia(s,i,2),c!==null&&(hx(i,c,s,t),St(c,2),Fs(c));break}}s=s.return}}function Hd(t,s,i){var c=t.pingCache;if(c===null){c=t.pingCache=new cw;var h=new Set;c.set(s,h)}else h=c.get(s),h===void 0&&(h=new Set,c.set(s,h));h.has(i)||(Ld=!0,h.add(i),t=pw.bind(null,t,s,i),s.then(t,t))}function pw(t,s,i){var c=t.pingCache;c!==null&&c.delete(s),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,Ut===t&&(pt&i)===i&&(sn===4||sn===3&&(pt&62914560)===pt&&300>ct()-Xo?(wt&2)===0&&di(t,0):zd|=i,ci===pt&&(ci=0)),Fs(t)}function pg(t,s){s===0&&(s=_e()),t=fr(t,s),t!==null&&(St(t,s),Fs(t))}function hw(t){var s=t.memoizedState,i=0;s!==null&&(i=s.retryLane),pg(t,i)}function xw(t,s){var i=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(i=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(s),pg(t,i)}function gw(t,s){return At(t,s)}var nc=null,mi=null,qd=!1,sc=!1,Gd=!1,Ka=0;function Fs(t){t!==mi&&t.next===null&&(mi===null?nc=mi=t:mi=mi.next=t),sc=!0,qd||(qd=!0,yw())}function hl(t,s){if(!Gd&&sc){Gd=!0;do for(var i=!1,c=nc;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var x=0;else{var E=c.suspendedLanes,A=c.pingedLanes;x=(1<<31-Ve(42|t)+1)-1,x&=h&~(E&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,bg(c,x))}else x=pt,x=X(c,c===Ut?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||de(c,x)||(i=!0,bg(c,x));c=c.next}while(i);Gd=!1}}function bw(){hg()}function hg(){sc=qd=!1;var t=0;Ka!==0&&Tw()&&(t=Ka);for(var s=ct(),i=null,c=nc;c!==null;){var h=c.next,x=xg(c,s);x===0?(c.next=null,i===null?nc=h:i.next=h,h===null&&(mi=i)):(i=c,(t!==0||(x&3)!==0)&&(sc=!0)),c=h}gn!==0&&gn!==5||hl(t),Ka!==0&&(Ka=0)}function xg(t,s){for(var i=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var E=31-Ve(x),A=1<<E,K=h[E];K===-1?((A&i)===0||(A&c)!==0)&&(h[E]=Se(A,s)):K<=s&&(t.expiredLanes|=A),x&=~A}if(s=Ut,i=pt,i=X(t,t===s?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,i===0||t===s&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Yt(c),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||de(t,i)){if(s=i&-i,s===t.callbackPriority)return s;switch(c!==null&&Yt(c),Ns(i)){case 2:case 8:i=ve;break;case 32:i=Ae;break;case 268435456:i=ot;break;default:i=Ae}return c=gg.bind(null,t),i=At(i,c),t.callbackPriority=s,t.callbackNode=i,s}return c!==null&&c!==null&&Yt(c),t.callbackPriority=2,t.callbackNode=null,2}function gg(t,s){if(gn!==0&&gn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(tc()&&t.callbackNode!==i)return null;var c=pt;return c=X(t,t===Ut?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Wx(t,c,s),xg(t,ct()),t.callbackNode!=null&&t.callbackNode===i?gg.bind(null,t):null)}function bg(t,s){if(tc())return null;Wx(t,s,!0)}function yw(){Rw(function(){(wt&6)!==0?At(ue,bw):hg()})}function Kd(){if(Ka===0){var t=Wr;t===0&&(t=Os,Os<<=1,(Os&261888)===0&&(Os=256)),Ka=t}return Ka}function yg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ta(""+t)}function vg(t,s){var i=s.ownerDocument.createElement("input");return i.name=s.name,i.value=s.value,t.id&&i.setAttribute("form",t.id),s.parentNode.insertBefore(i,s),t=new FormData(t),i.parentNode.removeChild(i),t}function vw(t,s,i,c,h){if(s==="submit"&&i&&i.stateNode===h){var x=yg((h[Nn]||null).action),E=c.submitter;E&&(s=(s=E[Nn]||null)?yg(s.formAction):E.getAttribute("formAction"),s!==null&&(x=s,E=null));var A=new ho("action","action",null,c,h);t.push({event:A,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ka!==0){var K=E?vg(h,E):new FormData(h);fd(i,{pending:!0,data:K,method:h.method,action:x},null,K)}}else typeof x=="function"&&(A.preventDefault(),K=E?vg(h,E):new FormData(h),fd(i,{pending:!0,data:K,method:h.method,action:x},x,K))},currentTarget:h}]})}}for(var Yd=0;Yd<Tu.length;Yd++){var Vd=Tu[Yd],Nw=Vd.toLowerCase(),ww=Vd[0].toUpperCase()+Vd.slice(1);Es(Nw,"on"+ww)}Es(Qp,"onAnimationEnd"),Es(Wp,"onAnimationIteration"),Es(Jp,"onAnimationStart"),Es("dblclick","onDoubleClick"),Es("focusin","onFocus"),Es("focusout","onBlur"),Es(UN,"onTransitionRun"),Es(BN,"onTransitionStart"),Es($N,"onTransitionCancel"),Es(eh,"onTransitionEnd"),ge("onMouseEnter",["mouseout","mouseover"]),ge("onMouseLeave",["mouseout","mouseover"]),ge("onPointerEnter",["pointerout","pointerover"]),ge("onPointerLeave",["pointerout","pointerover"]),cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ew=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xl));function Ng(t,s){s=(s&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],h=c.event;c=c.listeners;e:{var x=void 0;if(s)for(var E=c.length-1;0<=E;E--){var A=c[E],K=A.instance,se=A.currentTarget;if(A=A.listener,K!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=se;try{x(h)}catch(fe){bo(fe)}h.currentTarget=null,x=K}else for(E=0;E<c.length;E++){if(A=c[E],K=A.instance,se=A.currentTarget,A=A.listener,K!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=se;try{x(h)}catch(fe){bo(fe)}h.currentTarget=null,x=K}}}}function dt(t,s){var i=s[Ls];i===void 0&&(i=s[Ls]=new Set);var c=t+"__bubble";i.has(c)||(wg(s,t,2,!1),i.add(c))}function Xd(t,s,i){var c=0;s&&(c|=4),wg(i,t,c,s)}var ac="_reactListening"+Math.random().toString(36).slice(2);function Zd(t){if(!t[ac]){t[ac]=!0,lr.forEach(function(i){i!=="selectionchange"&&(Ew.has(i)||Xd(i,!1,t),Xd(i,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[ac]||(s[ac]=!0,Xd("selectionchange",!1,s))}}function wg(t,s,i,c){switch(Qg(s)){case 2:var h=Qw;break;case 8:h=Ww;break;default:h=ff}i=h.bind(null,s,i,t),h=void 0,!xu||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(s,i,{capture:!0,passive:h}):t.addEventListener(s,i,!0):h!==void 0?t.addEventListener(s,i,{passive:h}):t.addEventListener(s,i,!1)}function Qd(t,s,i,c,h){var x=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var E=c.tag;if(E===3||E===4){var A=c.stateNode.containerInfo;if(A===h)break;if(E===4)for(E=c.return;E!==null;){var K=E.tag;if((K===3||K===4)&&E.stateNode.containerInfo===h)return;E=E.return}for(;A!==null;){if(E=Sn(A),E===null)return;if(K=E.tag,K===5||K===6||K===26||K===27){c=x=E;continue e}A=A.parentNode}}c=c.return}uo(function(){var se=x,fe=We(i),pe=[];e:{var ae=th.get(t);if(ae!==void 0){var le=ho,Oe=t;switch(t){case"keypress":if(mo(i)===0)break e;case"keydown":case"keyup":le=xN;break;case"focusin":Oe="focus",le=vu;break;case"focusout":Oe="blur",le=vu;break;case"beforeblur":case"afterblur":le=vu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=Ap;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=aN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=yN;break;case Qp:case Wp:case Jp:le=lN;break;case eh:le=NN;break;case"scroll":case"scrollend":le=nN;break;case"wheel":le=EN;break;case"copy":case"cut":case"paste":le=cN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Mp;break;case"toggle":case"beforetoggle":le=SN}var Ge=(s&4)!==0,Lt=!Ge&&(t==="scroll"||t==="scrollend"),J=Ge?ae!==null?ae+"Capture":null:ae;Ge=[];for(var W=se,ne;W!==null;){var me=W;if(ne=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ne===null||J===null||(me=Ui(W,J),me!=null&&Ge.push(gl(W,me,ne))),Lt)break;W=W.return}0<Ge.length&&(ae=new le(ae,Oe,null,i,fe),pe.push({event:ae,listeners:Ge}))}}if((s&7)===0){e:{if(ae=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",ae&&i!==Le&&(Oe=i.relatedTarget||i.fromElement)&&(Sn(Oe)||Oe[Ds]))break e;if((le||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(Oe=i.relatedTarget||i.toElement,le=se,Oe=Oe?Sn(Oe):null,Oe!==null&&(Lt=u(Oe),Ge=Oe.tag,Oe!==Lt||Ge!==5&&Ge!==27&&Ge!==6)&&(Oe=null)):(le=null,Oe=se),le!==Oe)){if(Ge=Ap,me="onMouseLeave",J="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(Ge=Mp,me="onPointerLeave",J="onPointerEnter",W="pointer"),Lt=le==null?ae:zs(le),ne=Oe==null?ae:zs(Oe),ae=new Ge(me,W+"leave",le,i,fe),ae.target=Lt,ae.relatedTarget=ne,me=null,Sn(fe)===se&&(Ge=new Ge(J,W+"enter",Oe,i,fe),Ge.target=ne,Ge.relatedTarget=Lt,me=Ge),Lt=me,le&&Oe)t:{for(Ge=jw,J=le,W=Oe,ne=0,me=J;me;me=Ge(me))ne++;me=0;for(var $e=W;$e;$e=Ge($e))me++;for(;0<ne-me;)J=Ge(J),ne--;for(;0<me-ne;)W=Ge(W),me--;for(;ne--;){if(J===W||W!==null&&J===W.alternate){Ge=J;break t}J=Ge(J),W=Ge(W)}Ge=null}else Ge=null;le!==null&&Eg(pe,ae,le,Ge,!1),Oe!==null&&Lt!==null&&Eg(pe,Lt,Oe,Ge,!0)}}e:{if(ae=se?zs(se):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var vt=$p;else if(Up(ae))if(Pp)vt=LN;else{vt=ON;var ze=MN}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&Ca(se.elementType)&&(vt=$p):vt=DN;if(vt&&(vt=vt(t,se))){Bp(pe,vt,i,fe);break e}ze&&ze(t,ae,se),t==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&Pr(ae,"number",ae.value)}switch(ze=se?zs(se):window,t){case"focusin":(Up(ze)||ze.contentEditable==="true")&&(qr=ze,ku=se,Ki=null);break;case"focusout":Ki=ku=qr=null;break;case"mousedown":_u=!0;break;case"contextmenu":case"mouseup":case"dragend":_u=!1,Xp(pe,i,fe);break;case"selectionchange":if(IN)break;case"keydown":case"keyup":Xp(pe,i,fe)}var at;if(wu)e:{switch(t){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Hr?zp(t,i)&&(ht="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(ht="onCompositionStart");ht&&(Op&&i.locale!=="ko"&&(Hr||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Hr&&(at=Cp()):(Aa=fe,gu="value"in Aa?Aa.value:Aa.textContent,Hr=!0)),ze=rc(se,ht),0<ze.length&&(ht=new Rp(ht,t,null,i,fe),pe.push({event:ht,listeners:ze}),at?ht.data=at:(at=Ip(i),at!==null&&(ht.data=at)))),(at=_N?CN(t,i):TN(t,i))&&(ht=rc(se,"onBeforeInput"),0<ht.length&&(ze=new Rp("onBeforeInput","beforeinput",null,i,fe),pe.push({event:ze,listeners:ht}),ze.data=at)),vw(pe,t,se,i,fe)}Ng(pe,s)})}function gl(t,s,i){return{instance:t,listener:s,currentTarget:i}}function rc(t,s){for(var i=s+"Capture",c=[];t!==null;){var h=t,x=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||x===null||(h=Ui(t,i),h!=null&&c.unshift(gl(t,h,x)),h=Ui(t,s),h!=null&&c.push(gl(t,h,x))),t.tag===3)return c;t=t.return}return[]}function jw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Eg(t,s,i,c,h){for(var x=s._reactName,E=[];i!==null&&i!==c;){var A=i,K=A.alternate,se=A.stateNode;if(A=A.tag,K!==null&&K===c)break;A!==5&&A!==26&&A!==27||se===null||(K=se,h?(se=Ui(i,x),se!=null&&E.unshift(gl(i,se,K))):h||(se=Ui(i,x),se!=null&&E.push(gl(i,se,K)))),i=i.return}E.length!==0&&t.push({event:s,listeners:E})}var Sw=/\r\n?/g,kw=/\u0000|\uFFFD/g;function jg(t){return(typeof t=="string"?t:""+t).replace(Sw,`
55
- `).replace(kw,"")}function Sg(t,s){return s=jg(s),jg(t)===s}function Dt(t,s,i,c,h,x){switch(i){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Ke(t,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Ke(t,""+c);break;case"className":Te(t,"class",c);break;case"tabIndex":Te(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Te(t,i,c);break;case"style":_t(t,c,x);break;case"data":if(s!=="object"){Te(t,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||i!=="href")){t.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Ta(""+c),t.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(i==="formAction"?(s!=="input"&&Dt(t,s,"name",h.name,h,null),Dt(t,s,"formEncType",h.formEncType,h,null),Dt(t,s,"formMethod",h.formMethod,h,null),Dt(t,s,"formTarget",h.formTarget,h,null)):(Dt(t,s,"encType",h.encType,h,null),Dt(t,s,"method",h.method,h,null),Dt(t,s,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Ta(""+c),t.setAttribute(i,c);break;case"onClick":c!=null&&(t.onclick=Ee);break;case"onScroll":c!=null&&dt("scroll",t);break;case"onScrollEnd":c!=null&&dt("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}i=Ta(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""+c):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":c===!0?t.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,c):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(i,c):t.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(i):t.setAttribute(i,c);break;case"popover":dt("beforetoggle",t),dt("toggle",t),ye(t,"popover",c);break;case"xlinkActuate":Me(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Me(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Me(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Me(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Me(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Me(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Me(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Me(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Me(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ye(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Js.get(i)||i,ye(t,i,c))}}function Wd(t,s,i,c,h,x){switch(i){case"style":_t(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof c=="string"?Ke(t,c):(typeof c=="number"||typeof c=="bigint")&&Ke(t,""+c);break;case"onScroll":c!=null&&dt("scroll",t);break;case"onScrollEnd":c!=null&&dt("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Ee);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Us.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),s=i.slice(2,h?i.length-7:void 0),x=t[Nn]||null,x=x!=null?x[i]:null,typeof x=="function"&&t.removeEventListener(s,x,h),typeof c=="function")){typeof x!="function"&&x!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(s,c,h);break e}i in t?t[i]=c:c===!0?t.setAttribute(i,""):ye(t,i,c)}}}function An(t,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",t),dt("load",t);var c=!1,h=!1,x;for(x in i)if(i.hasOwnProperty(x)){var E=i[x];if(E!=null)switch(x){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Dt(t,s,x,E,i,null)}}h&&Dt(t,s,"srcSet",i.srcSet,i,null),c&&Dt(t,s,"src",i.src,i,null);return;case"input":dt("invalid",t);var A=x=E=h=null,K=null,se=null;for(c in i)if(i.hasOwnProperty(c)){var fe=i[c];if(fe!=null)switch(c){case"name":h=fe;break;case"type":E=fe;break;case"checked":K=fe;break;case"defaultChecked":se=fe;break;case"value":x=fe;break;case"defaultValue":A=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(l(137,s));break;default:Dt(t,s,c,fe,i,null)}}or(t,x,A,K,se,E,h,!1);return;case"select":dt("invalid",t),c=E=x=null;for(h in i)if(i.hasOwnProperty(h)&&(A=i[h],A!=null))switch(h){case"value":x=A;break;case"defaultValue":E=A;break;case"multiple":c=A;default:Dt(t,s,h,A,i,null)}s=x,i=E,t.multiple=!!c,s!=null?kn(t,!!c,s,!1):i!=null&&kn(t,!!c,i,!0);return;case"textarea":dt("invalid",t),x=h=c=null;for(E in i)if(i.hasOwnProperty(E)&&(A=i[E],A!=null))switch(E){case"value":c=A;break;case"defaultValue":h=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(91));break;default:Dt(t,s,E,A,i,null)}Fr(t,c,h,x);return;case"option":for(K in i)if(i.hasOwnProperty(K)&&(c=i[K],c!=null))switch(K){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Dt(t,s,K,c,i,null)}return;case"dialog":dt("beforetoggle",t),dt("toggle",t),dt("cancel",t),dt("close",t);break;case"iframe":case"object":dt("load",t);break;case"video":case"audio":for(c=0;c<xl.length;c++)dt(xl[c],t);break;case"image":dt("error",t),dt("load",t);break;case"details":dt("toggle",t);break;case"embed":case"source":case"link":dt("error",t),dt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in i)if(i.hasOwnProperty(se)&&(c=i[se],c!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Dt(t,s,se,c,i,null)}return;default:if(Ca(s)){for(fe in i)i.hasOwnProperty(fe)&&(c=i[fe],c!==void 0&&Wd(t,s,fe,c,i,void 0));return}}for(A in i)i.hasOwnProperty(A)&&(c=i[A],c!=null&&Dt(t,s,A,c,i,null))}function _w(t,s,i,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,x=null,E=null,A=null,K=null,se=null,fe=null;for(le in i){var pe=i[le];if(i.hasOwnProperty(le)&&pe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":K=pe;default:c.hasOwnProperty(le)||Dt(t,s,le,null,c,pe)}}for(var ae in c){var le=c[ae];if(pe=i[ae],c.hasOwnProperty(ae)&&(le!=null||pe!=null))switch(ae){case"type":x=le;break;case"name":h=le;break;case"checked":se=le;break;case"defaultChecked":fe=le;break;case"value":E=le;break;case"defaultValue":A=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,s));break;default:le!==pe&&Dt(t,s,ae,le,c,pe)}}Li(t,E,A,K,se,fe,x,h);return;case"select":le=E=A=ae=null;for(x in i)if(K=i[x],i.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":le=K;default:c.hasOwnProperty(x)||Dt(t,s,x,null,c,K)}for(h in c)if(x=c[h],K=i[h],c.hasOwnProperty(h)&&(x!=null||K!=null))switch(h){case"value":ae=x;break;case"defaultValue":A=x;break;case"multiple":E=x;default:x!==K&&Dt(t,s,h,x,c,K)}s=A,i=E,c=le,ae!=null?kn(t,!!i,ae,!1):!!c!=!!i&&(s!=null?kn(t,!!i,s,!0):kn(t,!!i,i?[]:"",!1));return;case"textarea":le=ae=null;for(A in i)if(h=i[A],i.hasOwnProperty(A)&&h!=null&&!c.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Dt(t,s,A,null,c,h)}for(E in c)if(h=c[E],x=i[E],c.hasOwnProperty(E)&&(h!=null||x!=null))switch(E){case"value":ae=h;break;case"defaultValue":le=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(l(91));break;default:h!==x&&Dt(t,s,E,h,c,x)}oo(t,ae,le);return;case"option":for(var Oe in i)if(ae=i[Oe],i.hasOwnProperty(Oe)&&ae!=null&&!c.hasOwnProperty(Oe))switch(Oe){case"selected":t.selected=!1;break;default:Dt(t,s,Oe,null,c,ae)}for(K in c)if(ae=c[K],le=i[K],c.hasOwnProperty(K)&&ae!==le&&(ae!=null||le!=null))switch(K){case"selected":t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Dt(t,s,K,ae,c,le)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in i)ae=i[Ge],i.hasOwnProperty(Ge)&&ae!=null&&!c.hasOwnProperty(Ge)&&Dt(t,s,Ge,null,c,ae);for(se in c)if(ae=c[se],le=i[se],c.hasOwnProperty(se)&&ae!==le&&(ae!=null||le!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(l(137,s));break;default:Dt(t,s,se,ae,c,le)}return;default:if(Ca(s)){for(var Lt in i)ae=i[Lt],i.hasOwnProperty(Lt)&&ae!==void 0&&!c.hasOwnProperty(Lt)&&Wd(t,s,Lt,void 0,c,ae);for(fe in c)ae=c[fe],le=i[fe],!c.hasOwnProperty(fe)||ae===le||ae===void 0&&le===void 0||Wd(t,s,fe,ae,c,le);return}}for(var J in i)ae=i[J],i.hasOwnProperty(J)&&ae!=null&&!c.hasOwnProperty(J)&&Dt(t,s,J,null,c,ae);for(pe in c)ae=c[pe],le=i[pe],!c.hasOwnProperty(pe)||ae===le||ae==null&&le==null||Dt(t,s,pe,ae,c,le)}function kg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Cw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var h=i[c],x=h.transferSize,E=h.initiatorType,A=h.duration;if(x&&A&&kg(E)){for(E=0,A=h.responseEnd,c+=1;c<i.length;c++){var K=i[c],se=K.startTime;if(se>A)break;var fe=K.transferSize,pe=K.initiatorType;fe&&kg(pe)&&(K=K.responseEnd,E+=fe*(K<A?1:(A-se)/(K-se)))}if(--c,s+=8*(x+E)/(h.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Jd=null,ef=null;function ic(t){return t.nodeType===9?t:t.ownerDocument}function _g(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cg(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function tf(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var nf=null;function Tw(){var t=window.event;return t&&t.type==="popstate"?t===nf?!1:(nf=t,!0):(nf=null,!1)}var Tg=typeof setTimeout=="function"?setTimeout:void 0,Aw=typeof clearTimeout=="function"?clearTimeout:void 0,Ag=typeof Promise=="function"?Promise:void 0,Rw=typeof queueMicrotask=="function"?queueMicrotask:typeof Ag<"u"?function(t){return Ag.resolve(null).then(t).catch(Mw)}:Tg;function Mw(t){setTimeout(function(){throw t})}function Ya(t){return t==="head"}function Rg(t,s){var i=s,c=0;do{var h=i.nextSibling;if(t.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"||i==="/&"){if(c===0){t.removeChild(h),gi(s);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")bl(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,bl(i);for(var x=i.firstChild;x;){var E=x.nextSibling,A=x.nodeName;x[Ws]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=E}}else i==="body"&&bl(t.ownerDocument.body);i=h}while(i);gi(s)}function Mg(t,s){var i=t;t=0;do{var c=i.nextSibling;if(i.nodeType===1?s?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(s?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=c}while(i)}function sf(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":sf(i),ir(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function Ow(t,s,i,c){for(;t.nodeType===1;){var h=i;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Ws])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var x=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=gs(t.nextSibling),t===null)break}return null}function Dw(t,s,i){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=gs(t.nextSibling),t===null))return null;return t}function Og(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=gs(t.nextSibling),t===null))return null;return t}function af(t){return t.data==="$?"||t.data==="$~"}function rf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Lw(t,s){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||i.readyState!=="loading")s();else{var c=function(){s(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function gs(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var lf=null;function Dg(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(s===0)return gs(t.nextSibling);s--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||s++}t=t.nextSibling}return null}function Lg(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(s===0)return t;s--}else i!=="/$"&&i!=="/&"||s++}t=t.previousSibling}return null}function zg(t,s,i){switch(s=ic(i),t){case"html":if(t=s.documentElement,!t)throw Error(l(452));return t;case"head":if(t=s.head,!t)throw Error(l(453));return t;case"body":if(t=s.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function bl(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ir(t)}var bs=new Map,Ig=new Set;function lc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ha=Q.d;Q.d={f:zw,r:Iw,D:Uw,C:Bw,L:$w,m:Pw,X:Hw,S:Fw,M:qw};function zw(){var t=ha.f(),s=Wo();return t||s}function Iw(t){var s=ws(t);s!==null&&s.tag===5&&s.type==="form"?ex(s):ha.r(t)}var pi=typeof document>"u"?null:document;function Ug(t,s,i){var c=pi;if(c&&typeof s=="string"&&s){var h=Mn(s);h='link[rel="'+t+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),Ig.has(h)||(Ig.add(h),t={rel:t,crossOrigin:i,href:s},c.querySelector(h)===null&&(s=c.createElement("link"),An(s,"link",t),tn(s),c.head.appendChild(s)))}}function Uw(t){ha.D(t),Ug("dns-prefetch",t,null)}function Bw(t,s){ha.C(t,s),Ug("preconnect",t,s)}function $w(t,s,i){ha.L(t,s,i);var c=pi;if(c&&t&&s){var h='link[rel="preload"][as="'+Mn(s)+'"]';s==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+Mn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+Mn(i.imageSizes)+'"]')):h+='[href="'+Mn(t)+'"]';var x=h;switch(s){case"style":x=hi(t);break;case"script":x=xi(t)}bs.has(x)||(t=b({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:t,as:s},i),bs.set(x,t),c.querySelector(h)!==null||s==="style"&&c.querySelector(yl(x))||s==="script"&&c.querySelector(vl(x))||(s=c.createElement("link"),An(s,"link",t),tn(s),c.head.appendChild(s)))}}function Pw(t,s){ha.m(t,s);var i=pi;if(i&&t){var c=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+Mn(c)+'"][href="'+Mn(t)+'"]',x=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=xi(t)}if(!bs.has(x)&&(t=b({rel:"modulepreload",href:t},s),bs.set(x,t),i.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(vl(x)))return}c=i.createElement("link"),An(c,"link",t),tn(c),i.head.appendChild(c)}}}function Fw(t,s,i){ha.S(t,s,i);var c=pi;if(c&&t){var h=Is(c).hoistableStyles,x=hi(t);s=s||"default";var E=h.get(x);if(!E){var A={loading:0,preload:null};if(E=c.querySelector(yl(x)))A.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":s},i),(i=bs.get(x))&&of(t,i);var K=E=c.createElement("link");tn(K),An(K,"link",t),K._p=new Promise(function(se,fe){K.onload=se,K.onerror=fe}),K.addEventListener("load",function(){A.loading|=1}),K.addEventListener("error",function(){A.loading|=2}),A.loading|=4,oc(E,s,c)}E={type:"stylesheet",instance:E,count:1,state:A},h.set(x,E)}}}function Hw(t,s){ha.X(t,s);var i=pi;if(i&&t){var c=Is(i).hoistableScripts,h=xi(t),x=c.get(h);x||(x=i.querySelector(vl(h)),x||(t=b({src:t,async:!0},s),(s=bs.get(h))&&cf(t,s),x=i.createElement("script"),tn(x),An(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(h,x))}}function qw(t,s){ha.M(t,s);var i=pi;if(i&&t){var c=Is(i).hoistableScripts,h=xi(t),x=c.get(h);x||(x=i.querySelector(vl(h)),x||(t=b({src:t,async:!0,type:"module"},s),(s=bs.get(h))&&cf(t,s),x=i.createElement("script"),tn(x),An(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(h,x))}}function Bg(t,s,i,c){var h=(h=re.current)?lc(h):null;if(!h)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(s=hi(i.href),i=Is(h).hoistableStyles,c=i.get(s),c||(c={type:"style",instance:null,count:0,state:null},i.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=hi(i.href);var x=Is(h).hoistableStyles,E=x.get(t);if(E||(h=h.ownerDocument||h,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,E),(x=h.querySelector(yl(t)))&&!x._p&&(E.instance=x,E.state.loading=5),bs.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},bs.set(t,i),x||Gw(h,t,i,E.state))),s&&c===null)throw Error(l(528,""));return E}if(s&&c!==null)throw Error(l(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=xi(i),i=Is(h).hoistableScripts,c=i.get(s),c||(c={type:"script",instance:null,count:0,state:null},i.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function hi(t){return'href="'+Mn(t)+'"'}function yl(t){return'link[rel="stylesheet"]['+t+"]"}function $g(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function Gw(t,s,i,c){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=t.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),An(s,"link",i),tn(s),t.head.appendChild(s))}function xi(t){return'[src="'+Mn(t)+'"]'}function vl(t){return"script[async]"+t}function Pg(t,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var c=t.querySelector('style[data-href~="'+Mn(i.href)+'"]');if(c)return s.instance=c,tn(c),c;var h=b({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),tn(c),An(c,"style",h),oc(c,i.precedence,t),s.instance=c;case"stylesheet":h=hi(i.href);var x=t.querySelector(yl(h));if(x)return s.state.loading|=4,s.instance=x,tn(x),x;c=$g(i),(h=bs.get(h))&&of(c,h),x=(t.ownerDocument||t).createElement("link"),tn(x);var E=x;return E._p=new Promise(function(A,K){E.onload=A,E.onerror=K}),An(x,"link",c),s.state.loading|=4,oc(x,i.precedence,t),s.instance=x;case"script":return x=xi(i.src),(h=t.querySelector(vl(x)))?(s.instance=h,tn(h),h):(c=i,(h=bs.get(x))&&(c=b({},i),cf(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),tn(h),An(h,"link",c),t.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(l(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,oc(c,i.precedence,t));return s.instance}function oc(t,s,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,x=h,E=0;E<c.length;E++){var A=c[E];if(A.dataset.precedence===s)x=A;else if(x!==h)break}x?x.parentNode.insertBefore(t,x.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(t,s.firstChild))}function of(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function cf(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var cc=null;function Fg(t,s,i){if(cc===null){var c=new Map,h=cc=new Map;h.set(i,c)}else h=cc,c=h.get(i),c||(c=new Map,h.set(i,c));if(c.has(t))return c;for(c.set(t,null),i=i.getElementsByTagName(t),h=0;h<i.length;h++){var x=i[h];if(!(x[Ws]||x[Zt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(s)||"";E=t+E;var A=c.get(E);A?A.push(x):c.set(E,[x])}}return c}function Hg(t,s,i){t=t.ownerDocument||t,t.head.insertBefore(i,s==="title"?t.querySelector("head > title"):null)}function Kw(t,s,i){if(i===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function qg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Yw(t,s,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var h=hi(c.href),x=s.querySelector(yl(h));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=uc.bind(t),s.then(t,t)),i.state.loading|=4,i.instance=x,tn(x);return}x=s.ownerDocument||s,c=$g(c),(h=bs.get(h))&&of(c,h),x=x.createElement("link"),tn(x);var E=x;E._p=new Promise(function(A,K){E.onload=A,E.onerror=K}),An(x,"link",c),i.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,s),(s=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=uc.bind(t),s.addEventListener("load",i),s.addEventListener("error",i))}}var uf=0;function Vw(t,s){return t.stylesheets&&t.count===0&&fc(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var c=setTimeout(function(){if(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+s);0<t.imgBytes&&uf===0&&(uf=62500*Cw());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>uf?50:800)+s);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var dc=null;function fc(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,dc=new Map,s.forEach(Xw,t),dc=null,uc.call(t))}function Xw(t,s){if(!(s.state.loading&4)){var i=dc.get(t);if(i)var c=i.get(null);else{i=new Map,dc.set(t,i);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<h.length;x++){var E=h[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(i.set(E.dataset.precedence,E),c=E)}c&&i.set(null,c)}h=s.instance,E=h.getAttribute("data-precedence"),x=i.get(E)||c,x===c&&i.set(null,h),i.set(E,h),this.count++,c=uc.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),x?x.parentNode.insertBefore(h,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),s.state.loading|=4}}var Nl={$$typeof:M,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function Zw(t,s,i,c,h,x,E,A,K){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mt(0),this.hiddenUpdates=Mt(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Gg(t,s,i,c,h,x,E,A,K,se,fe,pe){return t=new Zw(t,s,i,E,K,se,fe,pe,A),s=1,x===!0&&(s|=24),x=Wn(3,null,null,s),t.current=x,x.stateNode=t,s=Fu(),s.refCount++,t.pooledCache=s,s.refCount++,x.memoizedState={element:c,isDehydrated:i,cache:s},Ku(x),t}function Kg(t){return t?(t=Yr,t):Yr}function Yg(t,s,i,c,h,x){h=Kg(h),c.context===null?c.context=h:c.pendingContext=h,c=za(s),c.payload={element:i},x=x===void 0?null:x,x!==null&&(c.callback=x),i=Ia(t,c,s),i!==null&&(Yn(i,t,s),Ji(i,t,s))}function Vg(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<s?i:s}}function df(t,s){Vg(t,s),(t=t.alternate)&&Vg(t,s)}function Xg(t){if(t.tag===13||t.tag===31){var s=fr(t,67108864);s!==null&&Yn(s,t,67108864),df(t,67108864)}}function Zg(t){if(t.tag===13||t.tag===31){var s=ss();s=$t(s);var i=fr(t,s);i!==null&&Yn(i,t,s),df(t,s)}}var mc=!0;function Qw(t,s,i,c){var h=B.T;B.T=null;var x=Q.p;try{Q.p=2,ff(t,s,i,c)}finally{Q.p=x,B.T=h}}function Ww(t,s,i,c){var h=B.T;B.T=null;var x=Q.p;try{Q.p=8,ff(t,s,i,c)}finally{Q.p=x,B.T=h}}function ff(t,s,i,c){if(mc){var h=mf(c);if(h===null)Qd(t,s,c,pc,i),Wg(t,c);else if(eE(h,t,s,i,c))c.stopPropagation();else if(Wg(t,c),s&4&&-1<Jw.indexOf(t)){for(;h!==null;){var x=ws(h);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=Rn(x.pendingLanes);if(E!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;E;){var K=1<<31-Ve(E);A.entanglements[1]|=K,E&=~K}Fs(x),(wt&6)===0&&(Zo=ct()+500,hl(0))}}break;case 31:case 13:A=fr(x,2),A!==null&&Yn(A,x,2),Wo(),df(x,2)}if(x=mf(c),x===null&&Qd(t,s,c,pc,i),x===h)break;h=x}h!==null&&c.stopPropagation()}else Qd(t,s,c,null,i)}}function mf(t){return t=We(t),pf(t)}var pc=null;function pf(t){if(pc=null,t=Sn(t),t!==null){var s=u(t);if(s===null)t=null;else{var i=s.tag;if(i===13){if(t=d(s),t!==null)return t;t=null}else if(i===31){if(t=f(s),t!==null)return t;t=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return pc=t,null}function Qg(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yn()){case ue:return 2;case ve:return 8;case Ae:case Pe:return 32;case ot:return 268435456;default:return 32}default:return 32}}var hf=!1,Va=null,Xa=null,Za=null,wl=new Map,El=new Map,Qa=[],Jw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Wg(t,s){switch(t){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Za=null;break;case"pointerover":case"pointerout":wl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":El.delete(s.pointerId)}}function jl(t,s,i,c,h,x){return t===null||t.nativeEvent!==x?(t={blockedOn:s,domEventName:i,eventSystemFlags:c,nativeEvent:x,targetContainers:[h]},s!==null&&(s=ws(s),s!==null&&Xg(s)),t):(t.eventSystemFlags|=c,s=t.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),t)}function eE(t,s,i,c,h){switch(s){case"focusin":return Va=jl(Va,t,s,i,c,h),!0;case"dragenter":return Xa=jl(Xa,t,s,i,c,h),!0;case"mouseover":return Za=jl(Za,t,s,i,c,h),!0;case"pointerover":var x=h.pointerId;return wl.set(x,jl(wl.get(x)||null,t,s,i,c,h)),!0;case"gotpointercapture":return x=h.pointerId,El.set(x,jl(El.get(x)||null,t,s,i,c,h)),!0}return!1}function Jg(t){var s=Sn(t.target);if(s!==null){var i=u(s);if(i!==null){if(s=i.tag,s===13){if(s=d(i),s!==null){t.blockedOn=s,Sa(t.priority,function(){Zg(i)});return}}else if(s===31){if(s=f(i),s!==null){t.blockedOn=s,Sa(t.priority,function(){Zg(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hc(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var i=mf(t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);Le=c,i.target.dispatchEvent(c),Le=null}else return s=ws(i),s!==null&&Xg(s),t.blockedOn=i,!1;s.shift()}return!0}function eb(t,s,i){hc(t)&&i.delete(s)}function tE(){hf=!1,Va!==null&&hc(Va)&&(Va=null),Xa!==null&&hc(Xa)&&(Xa=null),Za!==null&&hc(Za)&&(Za=null),wl.forEach(eb),El.forEach(eb)}function xc(t,s){t.blockedOn===s&&(t.blockedOn=null,hf||(hf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,tE)))}var gc=null;function tb(t){gc!==t&&(gc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gc===t&&(gc=null);for(var s=0;s<t.length;s+=3){var i=t[s],c=t[s+1],h=t[s+2];if(typeof c!="function"){if(pf(c||i)===null)continue;break}var x=ws(i);x!==null&&(t.splice(s,3),s-=3,fd(x,{pending:!0,data:h,method:i.method,action:c},c,h))}}))}function gi(t){function s(K){return xc(K,t)}Va!==null&&xc(Va,t),Xa!==null&&xc(Xa,t),Za!==null&&xc(Za,t),wl.forEach(s),El.forEach(s);for(var i=0;i<Qa.length;i++){var c=Qa[i];c.blockedOn===t&&(c.blockedOn=null)}for(;0<Qa.length&&(i=Qa[0],i.blockedOn===null);)Jg(i),i.blockedOn===null&&Qa.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var h=i[c],x=i[c+1],E=h[Nn]||null;if(typeof x=="function")E||tb(i);else if(E){var A=null;if(x&&x.hasAttribute("formAction")){if(h=x,E=x[Nn]||null)A=E.formAction;else if(pf(h)!==null)continue}else A=E.action;typeof A=="function"?i[c+1]=A:(i.splice(c,3),c-=3),tb(i)}}}function nb(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return h=E})},focusReset:"manual",scroll:"manual"})}function s(){h!==null&&(h(),h=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),h!==null&&(h(),h=null)}}}function xf(t){this._internalRoot=t}bc.prototype.render=xf.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var i=s.current,c=ss();Yg(i,c,t,s,null,null)},bc.prototype.unmount=xf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Yg(t.current,2,null,t,null,null),Wo(),s[Ds]=null}};function bc(t){this._internalRoot=t}bc.prototype.unstable_scheduleHydration=function(t){if(t){var s=ja();t={blockedOn:null,target:t,priority:s};for(var i=0;i<Qa.length&&s!==0&&s<Qa[i].priority;i++);Qa.splice(i,0,t),i===0&&Jg(t)}};var sb=a.version;if(sb!=="19.2.4")throw Error(l(527,sb,"19.2.4"));Q.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(s),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var nE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yc.isDisabled&&yc.supportsFiber)try{un=yc.inject(nE),et=yc}catch{}}return kl.createRoot=function(t,s){if(!o(t))throw Error(l(299));var i=!1,c="",h=ux,x=dx,E=fx;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),s=Gg(t,1,!1,null,null,i,c,null,h,x,E,nb),t[Ds]=s.current,Zd(t),new xf(s)},kl.hydrateRoot=function(t,s,i){if(!o(t))throw Error(l(299));var c=!1,h="",x=ux,E=dx,A=fx,K=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError),i.formState!==void 0&&(K=i.formState)),s=Gg(t,1,!0,s,i??null,c,h,K,x,E,A,nb),s.context=Kg(null),i=s.current,c=ss(),c=$t(c),h=za(c),h.callback=null,Ia(i,h,c),i=c,s.current.lanes=i,St(s,i),Fs(s),t[Ds]=s.current,Zd(t),new bc(s)},kl.version="19.2.4",kl}var mb;function mE(){if(mb)return bf.exports;mb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),bf.exports=fE(),bf.exports}var pE=mE(),y=su();const au=nu(y);/**
56
- * react-router v7.13.0
57
- *
58
- * Copyright (c) Remix Software Inc.
59
- *
60
- * This source code is licensed under the MIT license found in the
61
- * LICENSE.md file in the root directory of this source tree.
62
- *
63
- * @license MIT
64
- */var pb="popstate";function hE(e={}){function a(l,o){let{pathname:u,search:d,hash:f}=l.location;return um("",{pathname:u,search:d,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(l,o){return typeof o=="string"?o:$l(o)}return gE(a,r,null,e)}function Jt(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function As(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function xE(){return Math.random().toString(36).substring(2,10)}function hb(e,a){return{usr:e.state,key:e.key,idx:a}}function um(e,a,r=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?Ri(a):a,state:r,key:a&&a.key||l||xE()}}function $l({pathname:e="/",search:a="",hash:r=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ri(e){let a={};if(e){let r=e.indexOf("#");r>=0&&(a.hash=e.substring(r),e=e.substring(0,r));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function gE(e,a,r,l={}){let{window:o=document.defaultView,v5Compat:u=!1}=l,d=o.history,f="POP",m=null,p=g();p==null&&(p=0,d.replaceState({...d.state,idx:p},""));function g(){return(d.state||{idx:null}).idx}function b(){f="POP";let S=g(),k=S==null?null:S-p;p=S,m&&m({action:f,location:j.location,delta:k})}function N(S,k){f="PUSH";let _=um(j.location,S,k);p=g()+1;let M=hb(_,p),Z=j.createHref(_);try{d.pushState(M,"",Z)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;o.location.assign(Z)}u&&m&&m({action:f,location:j.location,delta:1})}function v(S,k){f="REPLACE";let _=um(j.location,S,k);p=g();let M=hb(_,p),Z=j.createHref(_);d.replaceState(M,"",Z),u&&m&&m({action:f,location:j.location,delta:0})}function w(S){return bE(S)}let j={get action(){return f},get location(){return e(o,d)},listen(S){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(pb,b),m=S,()=>{o.removeEventListener(pb,b),m=null}},createHref(S){return a(o,S)},createURL:w,encodeLocation(S){let k=w(S);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:N,replace:v,go(S){return d.go(S)}};return j}function bE(e,a=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Jt(r,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:$l(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=r+l),new URL(l,r)}function d0(e,a,r="/"){return yE(e,a,r,!1)}function yE(e,a,r,l){let o=typeof a=="string"?Ri(a):a,u=va(o.pathname||"/",r);if(u==null)return null;let d=f0(e);vE(d);let f=null;for(let m=0;f==null&&m<d.length;++m){let p=RE(u);f=TE(d[m],p,l)}return f}function f0(e,a=[],r=[],l="",o=!1){let u=(d,f,m=o,p)=>{let g={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&m)return;Jt(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let b=ya([l,g.relativePath]),N=r.concat(g);d.children&&d.children.length>0&&(Jt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),f0(d.children,a,N,b,m)),!(d.path==null&&!d.index)&&a.push({path:b,score:_E(b,d.index),routesMeta:N})};return e.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,f);else for(let p of m0(d.path))u(d,f,!0,p)}),a}function m0(e){let a=e.split("/");if(a.length===0)return[];let[r,...l]=a,o=r.endsWith("?"),u=r.replace(/\?$/,"");if(l.length===0)return o?[u,""]:[u];let d=m0(l.join("/")),f=[];return f.push(...d.map(m=>m===""?u:[u,m].join("/"))),o&&f.push(...d),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function vE(e){e.sort((a,r)=>a.score!==r.score?r.score-a.score:CE(a.routesMeta.map(l=>l.childrenIndex),r.routesMeta.map(l=>l.childrenIndex)))}var NE=/^:[\w-]+$/,wE=3,EE=2,jE=1,SE=10,kE=-2,xb=e=>e==="*";function _E(e,a){let r=e.split("/"),l=r.length;return r.some(xb)&&(l+=kE),a&&(l+=EE),r.filter(o=>!xb(o)).reduce((o,u)=>o+(NE.test(u)?wE:u===""?jE:SE),l)}function CE(e,a){return e.length===a.length&&e.slice(0,-1).every((l,o)=>l===a[o])?e[e.length-1]-a[a.length-1]:0}function TE(e,a,r=!1){let{routesMeta:l}=e,o={},u="/",d=[];for(let f=0;f<l.length;++f){let m=l[f],p=f===l.length-1,g=u==="/"?a:a.slice(u.length)||"/",b=Gc({path:m.relativePath,caseSensitive:m.caseSensitive,end:p},g),N=m.route;if(!b&&p&&r&&!l[l.length-1].route.index&&(b=Gc({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!b)return null;Object.assign(o,b.params),d.push({params:o,pathname:ya([u,b.pathname]),pathnameBase:LE(ya([u,b.pathnameBase])),route:N}),b.pathnameBase!=="/"&&(u=ya([u,b.pathnameBase]))}return d}function Gc(e,a){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,l]=AE(e.path,e.caseSensitive,e.end),o=a.match(r);if(!o)return null;let u=o[0],d=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:l.reduce((p,{paramName:g,isOptional:b},N)=>{if(g==="*"){let w=f[N]||"";d=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[N];return b&&!v?p[g]=void 0:p[g]=(v||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:d,pattern:e}}function AE(e,a=!1,r=!0){As(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m)=>(l.push({paramName:f,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),l]}function RE(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return As(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function va(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,l=e.charAt(r);return l&&l!=="/"?null:e.slice(r)||"/"}var ME=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function OE(e,a="/"){let{pathname:r,search:l="",hash:o=""}=typeof e=="string"?Ri(e):e,u;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?u=gb(r.substring(1),"/"):u=gb(r,a)):u=a,{pathname:u,search:zE(l),hash:IE(o)}}function gb(e,a){let r=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ef(e,a,r,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function DE(e){return e.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function p0(e){let a=DE(e);return a.map((r,l)=>l===a.length-1?r.pathname:r.pathnameBase)}function h0(e,a,r,l=!1){let o;typeof e=="string"?o=Ri(e):(o={...e},Jt(!o.pathname||!o.pathname.includes("?"),Ef("?","pathname","search",o)),Jt(!o.pathname||!o.pathname.includes("#"),Ef("#","pathname","hash",o)),Jt(!o.search||!o.search.includes("#"),Ef("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,f;if(d==null)f=r;else{let b=a.length-1;if(!l&&d.startsWith("..")){let N=d.split("/");for(;N[0]==="..";)N.shift(),b-=1;o.pathname=N.join("/")}f=b>=0?a[b]:"/"}let m=OE(o,f),p=d&&d!=="/"&&d.endsWith("/"),g=(u||d===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(p||g)&&(m.pathname+="/"),m}var ya=e=>e.join("/").replace(/\/\/+/g,"/"),LE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,UE=class{constructor(e,a,r,l=!1){this.status=e,this.statusText=a||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function BE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $E(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var x0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g0(e,a){let r=e;if(typeof r!="string"||!ME.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let l=r,o=!1;if(x0)try{let u=new URL(window.location.href),d=r.startsWith("//")?new URL(u.protocol+r):new URL(r),f=va(d.pathname,a);d.origin===u.origin&&f!=null?r=f+d.search+d.hash:o=!0}catch{As(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var b0=["POST","PUT","PATCH","DELETE"];new Set(b0);var PE=["GET",...b0];new Set(PE);var Mi=y.createContext(null);Mi.displayName="DataRouter";var ru=y.createContext(null);ru.displayName="DataRouterState";var FE=y.createContext(!1),y0=y.createContext({isTransitioning:!1});y0.displayName="ViewTransition";var HE=y.createContext(new Map);HE.displayName="Fetchers";var qE=y.createContext(null);qE.displayName="Await";var vs=y.createContext(null);vs.displayName="Navigation";var Yl=y.createContext(null);Yl.displayName="Location";var Ys=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ys.displayName="Route";var Fm=y.createContext(null);Fm.displayName="RouteError";var v0="REACT_ROUTER_ERROR",GE="REDIRECT",KE="ROUTE_ERROR_RESPONSE";function YE(e){if(e.startsWith(`${v0}:${GE}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function VE(e){if(e.startsWith(`${v0}:${KE}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new UE(a.status,a.statusText,a.data)}catch{}}function XE(e,{relative:a}={}){Jt(Vl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:l}=y.useContext(vs),{hash:o,pathname:u,search:d}=Xl(e,{relative:a}),f=u;return r!=="/"&&(f=u==="/"?r:ya([r,u])),l.createHref({pathname:f,search:d,hash:o})}function Vl(){return y.useContext(Yl)!=null}function Na(){return Jt(Vl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Yl).location}var N0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function w0(e){y.useContext(vs).static||y.useLayoutEffect(e)}function Rs(){let{isDataRoute:e}=y.useContext(Ys);return e?oj():ZE()}function ZE(){Jt(Vl(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Mi),{basename:a,navigator:r}=y.useContext(vs),{matches:l}=y.useContext(Ys),{pathname:o}=Na(),u=JSON.stringify(p0(l)),d=y.useRef(!1);return w0(()=>{d.current=!0}),y.useCallback((m,p={})=>{if(As(d.current,N0),!d.current)return;if(typeof m=="number"){r.go(m);return}let g=h0(m,JSON.parse(u),o,p.relative==="path");e==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:ya([a,g.pathname])),(p.replace?r.replace:r.push)(g,p.state,p)},[a,r,u,o,e])}y.createContext(null);function E0(){let{matches:e}=y.useContext(Ys),a=e[e.length-1];return a?a.params:{}}function Xl(e,{relative:a}={}){let{matches:r}=y.useContext(Ys),{pathname:l}=Na(),o=JSON.stringify(p0(r));return y.useMemo(()=>h0(e,JSON.parse(o),l,a==="path"),[e,o,l,a])}function QE(e,a){return j0(e,a)}function j0(e,a,r,l,o){var _;Jt(Vl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=y.useContext(vs),{matches:d}=y.useContext(Ys),f=d[d.length-1],m=f?f.params:{},p=f?f.pathname:"/",g=f?f.pathnameBase:"/",b=f&&f.route;{let M=b&&b.path||"";k0(p,!b||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
65
-
66
- Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let N=Na(),v;if(a){let M=typeof a=="string"?Ri(a):a;Jt(g==="/"||((_=M.pathname)==null?void 0:_.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${M.pathname}" was given in the \`location\` prop.`),v=M}else v=N;let w=v.pathname||"/",j=w;if(g!=="/"){let M=g.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(M.length).join("/")}let S=d0(e,{pathname:j});As(b||S!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),As(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=nj(S&&S.map(M=>Object.assign({},M,{params:Object.assign({},m,M.params),pathname:ya([g,u.encodeLocation?u.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?g:ya([g,u.encodeLocation?u.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),d,r,l,o);return a&&k?y.createElement(Yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},k):k}function WE(){let e=lj(),a=BE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),r?y.createElement("pre",{style:o},r):null,d)}var JE=y.createElement(WE,null),S0=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=VE(e.digest);r&&(e=r)}let a=e!==void 0?y.createElement(Ys.Provider,{value:this.props.routeContext},y.createElement(Fm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(ej,{error:e},a):a}};S0.contextType=FE;var jf=new WeakMap;function ej({children:e,error:a}){let{basename:r}=y.useContext(vs);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=YE(a.digest);if(l){let o=jf.get(a);if(o)throw o;let u=g0(l.location,r);if(x0&&!jf.get(a))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw jf.set(a,d),d}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function tj({routeContext:e,match:a,children:r}){let l=y.useContext(Mi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(Ys.Provider,{value:e},r)}function nj(e,a=[],r=null,l=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(a.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,d=r==null?void 0:r.errors;if(d!=null){let g=u.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);Jt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let f=!1,m=-1;if(r)for(let g=0;g<u.length;g++){let b=u[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=g),b.route.id){let{loaderData:N,errors:v}=r,w=b.route.loader&&!N.hasOwnProperty(b.route.id)&&(!v||v[b.route.id]===void 0);if(b.route.lazy||w){f=!0,m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}let p=r&&l?(g,b)=>{var N,v;l(g,{location:r.location,params:((v=(N=r.matches)==null?void 0:N[0])==null?void 0:v.params)??{},unstable_pattern:$E(r.matches),errorInfo:b})}:void 0;return u.reduceRight((g,b,N)=>{let v,w=!1,j=null,S=null;r&&(v=d&&b.route.id?d[b.route.id]:void 0,j=b.route.errorElement||JE,f&&(m<0&&N===0?(k0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,S=null):m===N&&(w=!0,S=b.route.hydrateFallbackElement||null)));let k=a.concat(u.slice(0,N+1)),_=()=>{let M;return v?M=j:w?M=S:b.route.Component?M=y.createElement(b.route.Component,null):b.route.element?M=b.route.element:M=g,y.createElement(tj,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:r!=null},children:M})};return r&&(b.route.ErrorBoundary||b.route.errorElement||N===0)?y.createElement(S0,{location:r.location,revalidation:r.revalidation,component:j,error:v,children:_(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:p}):_()},null)}function Hm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sj(e){let a=y.useContext(Mi);return Jt(a,Hm(e)),a}function aj(e){let a=y.useContext(ru);return Jt(a,Hm(e)),a}function rj(e){let a=y.useContext(Ys);return Jt(a,Hm(e)),a}function qm(e){let a=rj(e),r=a.matches[a.matches.length-1];return Jt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ij(){return qm("useRouteId")}function lj(){var l;let e=y.useContext(Fm),a=aj("useRouteError"),r=qm("useRouteError");return e!==void 0?e:(l=a.errors)==null?void 0:l[r]}function oj(){let{router:e}=sj("useNavigate"),a=qm("useNavigate"),r=y.useRef(!1);return w0(()=>{r.current=!0}),y.useCallback(async(o,u={})=>{As(r.current,N0),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:a,...u}))},[e,a])}var bb={};function k0(e,a,r){!a&&!bb[e]&&(bb[e]=!0,As(!1,r))}y.memo(cj);function cj({routes:e,future:a,state:r,onError:l}){return j0(e,void 0,r,l,a)}function Wt(e){Jt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function uj({basename:e="/",children:a=null,location:r,navigationType:l="POP",navigator:o,static:u=!1,unstable_useTransitions:d}){Jt(!Vl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:f,navigator:o,static:u,unstable_useTransitions:d,future:{}}),[f,o,u,d]);typeof r=="string"&&(r=Ri(r));let{pathname:p="/",search:g="",hash:b="",state:N=null,key:v="default"}=r,w=y.useMemo(()=>{let j=va(p,f);return j==null?null:{location:{pathname:j,search:g,hash:b,state:N,key:v},navigationType:l}},[f,p,g,b,N,v,l]);return As(w!=null,`<Router basename="${f}"> is not able to match the URL "${p}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(vs.Provider,{value:m},y.createElement(Yl.Provider,{children:a,value:w}))}function dj({children:e,location:a}){return QE(dm(e),a)}function dm(e,a=[]){let r=[];return y.Children.forEach(e,(l,o)=>{if(!y.isValidElement(l))return;let u=[...a,o];if(l.type===y.Fragment){r.push.apply(r,dm(l.props.children,u));return}Jt(l.type===Wt,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Jt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let d={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(d.children=dm(l.props.children,u)),r.push(d)}),r}var Ic="get",Uc="application/x-www-form-urlencoded";function iu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function fj(e){return iu(e)&&e.tagName.toLowerCase()==="button"}function mj(e){return iu(e)&&e.tagName.toLowerCase()==="form"}function pj(e){return iu(e)&&e.tagName.toLowerCase()==="input"}function hj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xj(e,a){return e.button===0&&(!a||a==="_self")&&!hj(e)}function fm(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,r)=>{let l=e[r];return a.concat(Array.isArray(l)?l.map(o=>[r,o]):[[r,l]])},[]))}function gj(e,a){let r=fm(e);return a&&a.forEach((l,o)=>{r.has(o)||a.getAll(o).forEach(u=>{r.append(o,u)})}),r}var vc=null;function bj(){if(vc===null)try{new FormData(document.createElement("form"),0),vc=!1}catch{vc=!0}return vc}var yj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sf(e){return e!=null&&!yj.has(e)?(As(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Uc}"`),null):e}function vj(e,a){let r,l,o,u,d;if(mj(e)){let f=e.getAttribute("action");l=f?va(f,a):null,r=e.getAttribute("method")||Ic,o=Sf(e.getAttribute("enctype"))||Uc,u=new FormData(e)}else if(fj(e)||pj(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(l=m?va(m,a):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Ic,o=Sf(e.getAttribute("formenctype"))||Sf(f.getAttribute("enctype"))||Uc,u=new FormData(f,e),!bj()){let{name:p,type:g,value:b}=e;if(g==="image"){let N=p?`${p}.`:"";u.append(`${N}x`,"0"),u.append(`${N}y`,"0")}else p&&u.append(p,b)}}else{if(iu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ic,l=null,o=Uc,d=e}return u&&o==="text/plain"&&(d=u,u=void 0),{action:l,method:r.toLowerCase(),encType:o,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Gm(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Nj(e,a,r,l){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:a&&va(o.pathname,a)==="/"?o.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function wj(e,a){if(e.id in a)return a[e.id];try{let r=await import(e.module);return a[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ej(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function jj(e,a,r){let l=await Promise.all(e.map(async o=>{let u=a.routes[o.route.id];if(u){let d=await wj(u,r);return d.links?d.links():[]}return[]}));return Cj(l.flat(1).filter(Ej).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function yb(e,a,r,l,o,u){let d=(m,p)=>r[p]?m.route.id!==r[p].route.id:!0,f=(m,p)=>{var g;return r[p].pathname!==m.pathname||((g=r[p].route.path)==null?void 0:g.endsWith("*"))&&r[p].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,p)=>d(m,p)||f(m,p)):u==="data"?a.filter((m,p)=>{var b;let g=l.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(d(m,p)||f(m,p))return!0;if(m.route.shouldRevalidate){let N=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function Sj(e,a,{includeHydrateFallback:r}={}){return kj(e.map(l=>{let o=a.routes[l.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function kj(e){return[...new Set(e)]}function _j(e){let a={},r=Object.keys(e).sort();for(let l of r)a[l]=e[l];return a}function Cj(e,a){let r=new Set;return new Set(a),e.reduce((l,o)=>{let u=JSON.stringify(_j(o));return r.has(u)||(r.add(u),l.push({key:u,link:o})),l},[])}function _0(){let e=y.useContext(Mi);return Gm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Tj(){let e=y.useContext(ru);return Gm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Km=y.createContext(void 0);Km.displayName="FrameworkContext";function C0(){let e=y.useContext(Km);return Gm(e,"You must render this element inside a <HydratedRouter> element"),e}function Aj(e,a){let r=y.useContext(Km),[l,o]=y.useState(!1),[u,d]=y.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:p,onMouseLeave:g,onTouchStart:b}=a,N=y.useRef(null);y.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let j=k=>{k.forEach(_=>{d(_.isIntersecting)})},S=new IntersectionObserver(j,{threshold:.5});return N.current&&S.observe(N.current),()=>{S.disconnect()}}},[e]),y.useEffect(()=>{if(l){let j=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(j)}}},[l]);let v=()=>{o(!0)},w=()=>{o(!1),d(!1)};return r?e!=="intent"?[u,N,{}]:[u,N,{onFocus:_l(f,v),onBlur:_l(m,w),onMouseEnter:_l(p,v),onMouseLeave:_l(g,w),onTouchStart:_l(b,v)}]:[!1,N,{}]}function _l(e,a){return r=>{e&&e(r),r.defaultPrevented||a(r)}}function Rj({page:e,...a}){let{router:r}=_0(),l=y.useMemo(()=>d0(r.routes,e,r.basename),[r.routes,e,r.basename]);return l?y.createElement(Oj,{page:e,matches:l,...a}):null}function Mj(e){let{manifest:a,routeModules:r}=C0(),[l,o]=y.useState([]);return y.useEffect(()=>{let u=!1;return jj(e,a,r).then(d=>{u||o(d)}),()=>{u=!0}},[e,a,r]),l}function Oj({page:e,matches:a,...r}){let l=Na(),{future:o,manifest:u,routeModules:d}=C0(),{basename:f}=_0(),{loaderData:m,matches:p}=Tj(),g=y.useMemo(()=>yb(e,a,p,u,l,"data"),[e,a,p,u,l]),b=y.useMemo(()=>yb(e,a,p,u,l,"assets"),[e,a,p,u,l]),N=y.useMemo(()=>{if(e===l.pathname+l.search+l.hash)return[];let j=new Set,S=!1;if(a.forEach(_=>{var Z;let M=u.routes[_.route.id];!M||!M.hasLoader||(!g.some(Y=>Y.route.id===_.route.id)&&_.route.id in m&&((Z=d[_.route.id])!=null&&Z.shouldRevalidate)||M.hasClientLoader?S=!0:j.add(_.route.id))}),j.size===0)return[];let k=Nj(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return S&&j.size>0&&k.searchParams.set("_routes",a.filter(_=>j.has(_.route.id)).map(_=>_.route.id).join(",")),[k.pathname+k.search]},[f,o.unstable_trailingSlashAwareDataRequests,m,l,u,g,a,e,d]),v=y.useMemo(()=>Sj(b,u),[b,u]),w=Mj(b);return y.createElement(y.Fragment,null,N.map(j=>y.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),v.map(j=>y.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),w.map(({key:j,link:S})=>y.createElement("link",{key:j,nonce:r.nonce,...S,crossOrigin:S.crossOrigin??r.crossOrigin})))}function Dj(...e){return a=>{e.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var Lj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lj&&(window.__reactRouterVersion="7.13.0")}catch{}function zj({basename:e,children:a,unstable_useTransitions:r,window:l}){let o=y.useRef();o.current==null&&(o.current=hE({window:l,v5Compat:!0}));let u=o.current,[d,f]=y.useState({action:u.action,location:u.location}),m=y.useCallback(p=>{r===!1?f(p):y.startTransition(()=>f(p))},[r]);return y.useLayoutEffect(()=>u.listen(m),[u,m]),y.createElement(uj,{basename:e,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:r})}var T0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_s=y.forwardRef(function({onClick:a,discover:r="render",prefetch:l="none",relative:o,reloadDocument:u,replace:d,state:f,target:m,to:p,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:N,...v},w){let{basename:j,unstable_useTransitions:S}=y.useContext(vs),k=typeof p=="string"&&T0.test(p),_=g0(p,j);p=_.to;let M=XE(p,{relative:o}),[Z,Y,C]=Aj(l,v),I=Bj(p,{replace:d,state:f,target:m,preventScrollReset:g,relative:o,viewTransition:b,unstable_defaultShouldRevalidate:N,unstable_useTransitions:S});function D(R){a&&a(R),R.defaultPrevented||I(R)}let F=y.createElement("a",{...v,...C,href:_.absoluteURL||M,onClick:_.isExternal||u?a:D,ref:Dj(w,Y),target:m,"data-discover":!k&&r==="render"?"true":void 0});return Z&&!k?y.createElement(y.Fragment,null,F,y.createElement(Rj,{page:M})):F});_s.displayName="Link";var Bc=y.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:l="",end:o=!1,style:u,to:d,viewTransition:f,children:m,...p},g){let b=Xl(d,{relative:p.relative}),N=Na(),v=y.useContext(ru),{navigator:w,basename:j}=y.useContext(vs),S=v!=null&&qj(b)&&f===!0,k=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,_=N.pathname,M=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(_=_.toLowerCase(),M=M?M.toLowerCase():null,k=k.toLowerCase()),M&&j&&(M=va(M,j)||M);const Z=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let Y=_===k||!o&&_.startsWith(k)&&_.charAt(Z)==="/",C=M!=null&&(M===k||!o&&M.startsWith(k)&&M.charAt(k.length)==="/"),I={isActive:Y,isPending:C,isTransitioning:S},D=Y?a:void 0,F;typeof l=="function"?F=l(I):F=[l,Y?"active":null,C?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let R=typeof u=="function"?u(I):u;return y.createElement(_s,{...p,"aria-current":D,className:F,ref:g,style:R,to:d,viewTransition:f},typeof m=="function"?m(I):m)});Bc.displayName="NavLink";var Ij=y.forwardRef(({discover:e="render",fetcherKey:a,navigate:r,reloadDocument:l,replace:o,state:u,method:d=Ic,action:f,onSubmit:m,relative:p,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:N,...v},w)=>{let{unstable_useTransitions:j}=y.useContext(vs),S=Fj(),k=Hj(f,{relative:p}),_=d.toLowerCase()==="get"?"get":"post",M=typeof f=="string"&&T0.test(f),Z=Y=>{if(m&&m(Y),Y.defaultPrevented)return;Y.preventDefault();let C=Y.nativeEvent.submitter,I=(C==null?void 0:C.getAttribute("formmethod"))||d,D=()=>S(C||Y.currentTarget,{fetcherKey:a,method:I,navigate:r,replace:o,state:u,relative:p,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:N});j&&r!==!1?y.startTransition(()=>D()):D()};return y.createElement("form",{ref:w,method:_,action:k,onSubmit:l?m:Z,...v,"data-discover":!M&&e==="render"?"true":void 0})});Ij.displayName="Form";function Uj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function A0(e){let a=y.useContext(Mi);return Jt(a,Uj(e)),a}function Bj(e,{target:a,replace:r,state:l,preventScrollReset:o,relative:u,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:m}={}){let p=Rs(),g=Na(),b=Xl(e,{relative:u});return y.useCallback(N=>{if(xj(N,a)){N.preventDefault();let v=r!==void 0?r:$l(g)===$l(b),w=()=>p(e,{replace:v,state:l,preventScrollReset:o,relative:u,viewTransition:d,unstable_defaultShouldRevalidate:f});m?y.startTransition(()=>w()):w()}},[g,p,b,r,l,a,e,o,u,d,f,m])}function Zl(e){As(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=y.useRef(fm(e)),r=y.useRef(!1),l=Na(),o=y.useMemo(()=>gj(l.search,r.current?null:a.current),[l.search]),u=Rs(),d=y.useCallback((f,m)=>{const p=fm(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,u("?"+p,m)},[u,o]);return[o,d]}var $j=0,Pj=()=>`__${String(++$j)}__`;function Fj(){let{router:e}=A0("useSubmit"),{basename:a}=y.useContext(vs),r=ij(),l=e.fetch,o=e.navigate;return y.useCallback(async(u,d={})=>{let{action:f,method:m,encType:p,formData:g,body:b}=vj(u,a);if(d.navigate===!1){let N=d.fetcherKey||Pj();await l(N,r,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:b,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await o(d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:b,formMethod:d.method||m,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[l,o,a,r])}function Hj(e,{relative:a}={}){let{basename:r}=y.useContext(vs),l=y.useContext(Ys);Jt(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),u={...Xl(e||".",{relative:a})},d=Na();if(e==null){u.search=d.search;let f=new URLSearchParams(u.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(b=>b).forEach(b=>f.append("index",b));let g=f.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:ya([r,u.pathname])),$l(u)}function qj(e,{relative:a}={}){let r=y.useContext(y0);Jt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=A0("useViewTransitionState"),o=Xl(e,{relative:a});if(!r.isTransitioning)return!1;let u=va(r.currentLocation.pathname,l)||r.currentLocation.pathname,d=va(r.nextLocation.pathname,l)||r.nextLocation.pathname;return Gc(o.pathname,d)!=null||Gc(o.pathname,u)!=null}var Ms=u0(),Gj=12e4,Kj=1e3;function Yj(e){return e instanceof TypeError||e instanceof DOMException&&e.name==="AbortError"}async function vb(e,a,r){const l=new AbortController,o=setTimeout(()=>l.abort(),r);try{return await fetch(e,{...a,signal:l.signal})}finally{clearTimeout(o)}}var Vj=class{constructor(e){Vn(this,"baseUrl");Vn(this,"timeoutMs");Vn(this,"secret");this.baseUrl=e.baseUrl.replace(/\/+$/,""),this.timeoutMs=e.timeoutMs??Gj,this.secret=e.secret}async request(e,a,r){const l=(a==null?void 0:a.method)??"GET",o={"Content-Type":"application/json"};this.secret&&(o["X-Ulpi-Secret"]=this.secret);const u={headers:o,...a},d=`${this.baseUrl}${e}`,f=r??this.timeoutMs;let m;try{m=await vb(d,u,f)}catch(p){if(l==="GET"&&Yj(p))await new Promise(g=>setTimeout(g,Kj)),m=await vb(d,u,f);else throw p}if(!m.ok){const p=await m.text().catch(()=>"Unknown error");throw new Error(`API ${m.status}: ${p}`)}if(m.status!==204)return m.json()}async rawFetch(e,a,r){const l=`${this.baseUrl}${e}`,o=r??this.timeoutMs,u=new AbortController,d=setTimeout(()=>u.abort(),o);try{const m={...this.secret?{"X-Ulpi-Secret":this.secret}:{},...a==null?void 0:a.headers},p=await fetch(l,{...a,headers:m,signal:u.signal});if(!p.ok){const g=await p.text().catch(()=>"Unknown error");throw new Error(`API ${p.status}: ${g}`)}return p}finally{clearTimeout(d)}}async get(e,a){return this.request(e,void 0,a)}async post(e,a,r){return this.request(e,{method:"POST",body:a!==void 0?JSON.stringify(a):void 0},r)}async put(e,a,r){return this.request(e,{method:"PUT",body:a!==void 0?JSON.stringify(a):void 0},r)}async del(e,a){return this.request(e,{method:"DELETE"},a)}url(e){return`${this.baseUrl}${e}`}authenticatedUrl(e){const a=this.url(e);if(!this.secret)return a;const r=a.includes("?")?"&":"?";return`${a}${r}secret=${encodeURIComponent(this.secret)}`}},kf="claude-sonnet-4-20250514";function nt(e){return e?`?project=${encodeURIComponent(e)}`:""}var Xj=class{constructor(e){Vn(this,"http");this.http=new Vj(e)}async fetchRules(e){return this.http.get(`/api/rules${nt(e)}`)}async fetchRule(e){return this.http.get(`/api/rules/${encodeURIComponent(e)}`)}async toggleRule(e,a,r){return this.http.post(`/api/rules/${encodeURIComponent(e)}/toggle${nt(r)}`,{enabled:a})}async createRule(e,a){return this.http.post(`/api/rules${nt(a)}`,e)}async deleteRule(e,a){return this.http.del(`/api/rules/${encodeURIComponent(e)}${nt(a)}`)}async updateRule(e,a,r){return this.http.put(`/api/rules/${encodeURIComponent(e)}${nt(r)}`,a)}async fetchTemplates(e){return this.http.get(`/api/templates${nt(e)}`)}async fetchSkills(e){return this.http.get(`/api/skills${nt(e)}`)}async fetchSessions(){return this.http.get("/api/sessions")}async fetchSession(e,a){const r=new URLSearchParams;a?r.set("session",a):e&&r.set("project",e);const l=r.toString()?`?${r}`:"";return this.http.get(`/api/session${l}`)}async fetchEvents(e,a){const r=new URLSearchParams;a?r.set("session",a):e&&r.set("project",e);const l=r.toString()?`?${r}`:"";return this.http.get(`/api/events${l}`)}async fetchStack(e){return this.http.get(`/api/stack${nt(e)}`)}async runInit(e,a){return this.http.post(`/api/init${nt(a)}`,e??{})}async fetchProjects(){return this.http.get("/api/projects")}async fetchProject(e){return this.http.get(`/api/projects/${encodeURIComponent(e)}`)}async setDefaultProject(e){return this.http.post("/api/projects/default",{id:e})}async initProject(e){return this.http.post(`/api/projects/${encodeURIComponent(e)}/init`)}async addProject(e){return(await this.http.post("/api/projects",{path:e})).project}async updateProject(e,a){return(await this.http.put(`/api/projects/${encodeURIComponent(e)}`,a)).project}async deleteProject(e){return this.http.del(`/api/projects/${encodeURIComponent(e)}`)}async scanProjects(e,a){const r=await this.http.post("/api/projects/scan",{rootDir:e,maxDepth:a});return{projects:r.projects,registered:r.registered}}async generateWithAI(e,a){return this.http.post(`/api/generate${nt(a)}`,{model:e??kf})}async getGenerationStatus(e){return this.http.get(`/api/generate/status${nt(e)}`)}async fetchResponses(e){return this.http.get(`/api/responses${nt(e)}`)}async updateResponses(e,a){return this.http.put(`/api/responses${nt(a)}`,e)}async fetchVersion(){return this.http.get("/api/version")}async fetchHistoryStatus(e){return this.http.get(`/api/history/status${nt(e)}`)}async fetchHistoryConfig(e){return this.http.get(`/api/history/config${nt(e)}`)}async updateHistoryConfig(e,a){return this.http.put(`/api/history/config${nt(a)}`,e)}async initHistory(e,a){return this.http.post(`/api/history/init${nt(a)}`,e??{})}async fetchHistoryEntries(e,a){const r=new URLSearchParams;e&&r.set("project",e),a&&r.set("tag",a);const l=r.toString()?`?${r}`:"";return this.http.get(`/api/history/entries${l}`)}async fetchHistoryEntry(e,a){return this.http.get(`/api/history/entries/${encodeURIComponent(e)}${nt(a)}`)}async fetchHistoryStats(e){return this.http.get(`/api/history/stats${nt(e)}`)}async updateEntryTags(e,a,r){return this.http.put(`/api/history/entries/${encodeURIComponent(e)}/tags${nt(r)}`,{tags:a})}async fetchHistoryTranscript(e,a){return this.http.get(`/api/history/entries/${encodeURIComponent(e)}/transcript${nt(a)}`)}async rewindToCommit(e,a,r){return this.http.post(`/api/history/rewind${nt(r)}`,{sha:e,confirm:a})}async backfillHistory(e,a){return this.http.post(`/api/history/backfill${nt(a)}`,e??{})}async exportHistory(e){return this.http.rawFetch(`/api/history/export${nt(e)}`)}async startEnrichment(e,a,r){await this.http.post(`/api/history/enrich${nt(r)}`,{sha:e,model:a??kf})}async getEnrichmentStatus(e){return this.http.get(`/api/history/enrich/status${nt(e)}`)}async clearEnrichmentStatus(e){await this.http.del(`/api/history/enrich/status${nt(e)}`)}async fetchReviewConfig(){return this.http.get("/api/review/config")}async updateReviewConfig(e){return this.http.put("/api/review/config",e)}async fetchReviewPlans(e){const a=new URLSearchParams;e&&a.set("project",e);const r=a.toString()?`?${a}`:"";return this.http.get(`/api/review/plans${r}`)}async fetchAllPendingPlans(){return this.http.get("/api/review/plans/pending-all")}async fetchReviewPlan(e,a){const r=new URLSearchParams;a&&r.set("project",a);const l=r.toString()?`?${r}`:"";return this.http.get(`/api/review/plans/${encodeURIComponent(e)}${l}`)}async fetchReviewSessions(){return this.http.get("/api/review/hub/sessions")}async fetchReviewSession(e){return this.http.get(`/api/review/hub/session/${encodeURIComponent(e)}`)}async fetchSessionToken(e){try{return(await this.http.get(`/api/review/hub/session/${encodeURIComponent(e)}/token`)).token??null}catch{return null}}async submitReviewDecision(e,a,r,l){return this.http.post(`/api/review/hub/session/${encodeURIComponent(e)}/decision`,{behavior:a.behavior,message:a.message,feedback:a.feedback,clearContext:a.clearContext,annotations:r==null?void 0:r.annotations,inlineEdits:r==null?void 0:r.inlineEdits,instructions:r==null?void 0:r.instructions,priorities:r==null?void 0:r.priorities,risks:r==null?void 0:r.risks,token:l})}async submitCodeReviewDecision(e,a,r){const l=a.comments.length>0?a.comments.map(o=>`${o.file==="global"?"[General]":`[${o.file}:${o.line}]`} [${o.type}] ${o.text}`).join(`
67
- `):a.summary;return this.http.post(`/api/review/hub/session/${encodeURIComponent(e)}/decision`,{approved:a.approved,feedback:l,message:a.summary,comments:a.comments,token:r})}async saveReviewVersion(e,a,r){const l=r?{...a,token:r}:a;return this.http.post(`/api/review/hub/session/${encodeURIComponent(e)}/save`,l)}async saveStoredPlanVersion(e,a){return this.http.post(`/api/review/plans/${encodeURIComponent(e)}/save`,a)}async scoreReviewQuality(e){return this.http.post("/api/review/quality",{markdown:e})}async scoreReviewQualityAi(e,a){return this.http.post("/api/review/quality",{markdown:e,ai:!0,model:a??kf},180*1e3)}async checkAiScoringAvailable(){try{return(await this.http.get("/api/review/quality/ai-available")).available}catch{return!1}}reviewImageUrl(e,a){return this.http.authenticatedUrl(`/api/review/images/${encodeURIComponent(e)}?session=${encodeURIComponent(a)}`)}async uploadReviewImage(e,a){const r=new FormData;return r.append("image",e),(await this.http.rawFetch(`/api/review/images?session=${encodeURIComponent(a)}`,{method:"POST",body:r})).json()}async fetchCodeMapStatus(e){return this.http.get(`/api/codemap/status${nt(e)}`)}async searchCodeMap(e,a,r){const l=new URLSearchParams;r&&l.set("project",r);const o=l.toString()?`?${l}`:"";return this.http.post(`/api/codemap/search${o}`,{query:e,...a})}async runCodeMapAction(e,a,r){return this.http.post(`/api/codemap/action${nt(r)}`,{action:e,...a??{}})}async fetchCodemapConfig(e){return this.http.get(`/api/codemap/config${nt(e)}`)}async updateCodemapConfig(e,a){return this.http.put(`/api/codemap/config${nt(a)}`,e)}async fetchDepGraphStatus(e){return this.http.get(`/api/codemap/depgraph/status${nt(e)}`)}async searchDepGraph(e,a){return this.http.post(`/api/codemap/depgraph/search${nt(a)}`,e)}async fetchDepGraphRanking(e,a){const r=new URLSearchParams;return a&&r.set("project",a),r.set("limit",String(e??20)),this.http.get(`/api/codemap/depgraph/ranking?${r}`)}async fetchDepGraphCycles(e,a){const r=new URLSearchParams;return a&&r.set("project",a),r.set("limit",String(e??20)),this.http.get(`/api/codemap/depgraph/cycles?${r}`)}async fetchDepGraphMetrics(e,a){return this.http.post(`/api/codemap/depgraph/metrics${nt(a)}`,e)}async fetchUlpiModels(){return this.http.get("/api/ulpi/models")}async fetchMemoryStatus(e){return this.http.get(`/api/memory/status${nt(e)}`)}async searchMemory(e,a,r){return this.http.post(`/api/memory/search${nt(r)}`,{query:e,...a})}async rememberMemory(e,a){return this.http.post(`/api/memory/remember${nt(a)}`,e)}async fetchMemoryTimeline(e,a){const r=new URLSearchParams;a&&r.set("project",a),e!=null&&e.limit&&r.set("limit",String(e.limit)),e!=null&&e.type&&r.set("type",e.type),e!=null&&e.since&&r.set("since",e.since);const l=r.toString()?`?${r}`:"";return this.http.get(`/api/memory/timeline${l}`)}async fetchMemoryEntry(e,a){return this.http.get(`/api/memory/entries/${encodeURIComponent(e)}${nt(a)}`)}async forgetMemory(e,a){return this.http.post(`/api/memory/entries/${encodeURIComponent(e)}/forget${nt(a)}`,{})}async runMemoryAction(e,a,r){return this.http.post(`/api/memory/action${nt(r)}`,{action:e,...a??{}})}async fetchMemoryConfig(e){return this.http.get(`/api/memory/config${nt(e)}`)}async updateMemoryConfig(e,a){return this.http.put(`/api/memory/config${nt(a)}`,e)}};function Zj(e){return new Xj(e)}var Qj=class{constructor(a){Vn(this,"wsUrl");Vn(this,"ws",null);Vn(this,"eventListeners",new Set);Vn(this,"sessionUpdateListeners",new Set);Vn(this,"reconnectListeners",new Set);Vn(this,"reconnectDelay",1e3);Vn(this,"maxReconnectDelay",3e4);Vn(this,"shouldReconnect",!1);Vn(this,"reconnectTimer",null);const r=new URLSearchParams;a.projectId&&r.set("project",a.projectId),a.sessionId&&r.set("session",a.sessionId),a.secret&&r.set("secret",a.secret);const l=r.toString();this.wsUrl=l?`${a.url}?${l}`:a.url}get isConnected(){var a;return((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN}connect(){this.shouldReconnect=!0,this.reconnectDelay=1e3,this.open()}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}onEvent(a){return this.eventListeners.add(a),()=>{this.eventListeners.delete(a)}}onSessionUpdate(a){return this.sessionUpdateListeners.add(a),()=>{this.sessionUpdateListeners.delete(a)}}onReconnect(a){return this.reconnectListeners.add(a),()=>{this.reconnectListeners.delete(a)}}open(){this.ws&&this.ws.close(),this.ws=new WebSocket(this.wsUrl),this.ws.onopen=()=>{const a=this.reconnectDelay>1e3;if(this.reconnectDelay=1e3,a)for(const r of this.reconnectListeners)r()},this.ws.onmessage=a=>{try{const r=JSON.parse(a.data);if(r.type==="event"){const l=r.data;for(const o of this.eventListeners)o(l)}else if(r.type==="session-update"){const l=r.data;for(const o of this.sessionUpdateListeners)o(l)}}catch{}},this.ws.onclose=()=>{this.ws=null,this.scheduleReconnect()},this.ws.onerror=()=>{var a;(a=this.ws)==null||a.close()}}scheduleReconnect(){this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2,this.maxReconnectDelay))}};function Vs(){return localStorage.getItem("ulpi-api-base-url")||window.location.origin}function Ql(){return window.__ULPI_API_SECRET__}function Wl(e){const a=Vs(),r=Ql(),l=e.includes("?")?"&":"?";return r?`${a}${e}${l}secret=${encodeURIComponent(r)}`:`${a}${e}`}const Re=Zj({baseUrl:Vs(),secret:Ql()}),Wj="claude-sonnet-4-20250514";function R0(){return localStorage.getItem("ulpi-ai-model")||Wj}async function Ym(e){return Re.fetchRules(e)}async function Jj(e,a,r){return Re.toggleRule(e,a,r)}async function e2(e,a){return Re.createRule(e,a)}async function t2(e,a){return Re.deleteRule(e,a)}async function n2(e,a,r){return Re.updateRule(e,a,r)}async function s2(e){return Re.fetchTemplates(e)}async function Vm(e){return Re.fetchSkills(e)}async function a2(){return Re.fetchSessions()}async function M0(e,a){return Re.fetchSession(e,a)}async function O0(e,a){return Re.fetchEvents(e,a)}async function r2(e){return Re.fetchStack(e)}async function i2(e,a){return Re.runInit(e,a)}async function l2(){return Re.fetchProjects()}async function o2(e){return Re.setDefaultProject(e)}async function c2(e){return Re.initProject(e)}async function u2(e){return Re.addProject(e)}async function d2(e,a){return Re.updateProject(e,a)}async function f2(e){return Re.deleteProject(e)}async function m2(e,a){return Re.scanProjects(e,a)}async function Nb(e){return Re.getGenerationStatus(e)}async function mm(e){return Re.fetchResponses(e)}async function p2(e,a){return Re.updateResponses(e,a)}async function D0(){return Re.fetchVersion()}async function Pl(e){return Re.fetchHistoryStatus(e)}async function wb(e){return Re.fetchHistoryConfig(e)}async function h2(e,a){return Re.updateHistoryConfig(e,a)}async function Xm(e,a){return Re.initHistory(e,a)}async function x2(e,a){return Re.fetchHistoryEntries(e,a)}async function L0(e,a){return Re.fetchHistoryEntry(e,a)}async function g2(e){return Re.fetchHistoryStats(e)}async function Eb(e,a,r){return Re.updateEntryTags(e,a,r)}async function z0(e,a){return Re.fetchHistoryTranscript(e,a)}async function jb(e,a,r){return Re.rewindToCommit(e,a,r)}async function I0(e,a){return Re.backfillHistory(e,a)}async function b2(e){return(await Re.exportHistory(e)).blob()}async function Sb(e,a){return Re.startEnrichment(e,R0(),a)}async function kb(e){return Re.getEnrichmentStatus(e)}async function y2(e){return Re.clearEnrichmentStatus(e)}async function Zm(){return Re.fetchReviewConfig()}async function _b(e){return Re.updateReviewConfig(e)}async function Cb(e){return Re.fetchReviewPlans(e)}async function Tb(){return Re.fetchAllPendingPlans()}async function v2(e,a){return Re.fetchReviewPlan(e,a)}async function Tr(){return Re.fetchReviewSessions()}async function U0(e){return Re.fetchReviewSession(e)}async function Ar(e){return Re.fetchSessionToken(e)}async function N2(e,a,r,l){return Re.submitReviewDecision(e,a,r,l)}async function w2(e,a,r){return Re.submitCodeReviewDecision(e,a,r)}async function Ab(e,a,r){return Re.saveReviewVersion(e,a,r)}async function _f(e,a){return Re.saveStoredPlanVersion(e,a)}async function E2(e){return Re.scoreReviewQuality(e)}async function j2(e){return Re.scoreReviewQualityAi(e,R0())}async function S2(){return Re.checkAiScoringAvailable()}function Ci(e,a){return Re.reviewImageUrl(e,a)}async function Rb(e,a){return Re.uploadReviewImage(e,a)}async function Qm(e){return Re.fetchCodeMapStatus(e)}async function k2(e,a,r){return Re.searchCodeMap(e,a,r)}async function B0(e,a,r){return Re.runCodeMapAction(e,a,r)}async function _2(e){return Re.fetchCodemapConfig(e)}async function C2(e,a){return Re.updateCodemapConfig(e,a)}async function T2(){return Re.fetchUlpiModels()}async function $0(e){return Re.fetchMemoryStatus(e)}async function A2(e,a,r){return Re.searchMemory(e,a,r)}async function P0(e,a){return Re.fetchMemoryTimeline(e,a)}async function F0(e,a){return Re.forgetMemory(e,a)}async function $c(e,a,r){return Re.runMemoryAction(e,a,r)}async function H0(e){return Re.fetchMemoryConfig(e)}async function q0(e,a){return Re.updateMemoryConfig(e,a)}function Jl(){const e={},a=Ql();return a&&(e["X-Ulpi-Secret"]=a),e}async function R2(e){const a=new URLSearchParams;e&&a.set("project",e);const r=a.toString(),l=await fetch(`${Vs()}/api/codemap/depgraph/status${r?`?${r}`:""}`,{headers:Jl()});if(!l.ok)throw new Error(`DepGraph status failed: ${l.status}`);return l.json()}async function M2(e=20,a){const r=new URLSearchParams;a&&r.set("project",a),r.set("limit",String(e));const l=await fetch(`${Vs()}/api/codemap/depgraph/ranking?${r}`,{headers:Jl()});if(!l.ok)throw new Error(`DepGraph ranking failed: ${l.status}`);return l.json()}async function O2(e=20,a){const r=new URLSearchParams;a&&r.set("project",a),r.set("limit",String(e));const l=await fetch(`${Vs()}/api/codemap/depgraph/cycles?${r}`,{headers:Jl()});if(!l.ok)throw new Error(`DepGraph cycles failed: ${l.status}`);return l.json()}async function D2(e,a){const r=new URLSearchParams;a&&r.set("project",a);const l=r.toString(),o=await fetch(`${Vs()}/api/codemap/depgraph/metrics${l?`?${l}`:""}`,{method:"POST",headers:{...Jl(),"Content-Type":"application/json"},body:JSON.stringify({modulePath:e})});if(!o.ok)throw new Error(`DepGraph metrics failed: ${o.status}`);return o.json()}async function L2(e,a,r){const l=new URLSearchParams;r&&l.set("project",r);const o=l.toString(),u=await fetch(`${Vs()}/api/codemap/depgraph/search${o?`?${o}`:""}`,{method:"POST",headers:{...Jl(),"Content-Type":"application/json"},body:JSON.stringify({filePath:e,direction:a})});if(!u.ok)throw new Error(`DepGraph search failed: ${u.status}`);return u.json()}async function z2(){const e={},a=Ql();a&&(e["X-Ulpi-Secret"]=a);const r=await fetch(`${Vs()}/api/settings/username`,{headers:e});if(!r.ok)throw new Error("Failed to fetch username settings");return r.json()}async function I2(e){const a={"Content-Type":"application/json"},r=Ql();r&&(a["X-Ulpi-Secret"]=r);const l=await fetch(`${Vs()}/api/settings/username`,{method:"PUT",headers:a,body:JSON.stringify({username:e})});if(!l.ok)throw new Error("Failed to update username settings");return l.json()}const G0=y.createContext(null);function U2({children:e}){const[a,r]=Zl(),[l,o]=y.useState([]),[u,d]=y.useState(null),[f,m]=y.useState(void 0),[p,g]=y.useState(!0),[b,N]=y.useState(null),v=y.useCallback(async()=>{var _;g(!0),N(null);try{const M=await l2();o(M.projects),m(M.defaultProject);const Z=a.get("project"),Y=new Set(M.projects.map(C=>C.id));if(Z&&Y.has(Z))d(Z);else{const C=M.defaultProject??((_=M.projects[0])==null?void 0:_.id);C&&(d(C),r(I=>{const D=new URLSearchParams(I);return D.set("project",C),D},{replace:!0}))}}catch(M){N(M instanceof Error?M.message:"Failed to load projects")}finally{g(!1)}},[a,r]),w=a.get("project");y.useEffect(()=>{v()},[w]);const j=y.useCallback(_=>{if(!_||typeof _!="string"){console.error("Invalid project ID:",_);return}d(_),r(M=>{const Z=new URLSearchParams(M);return Z.set("project",_),Z})},[r]),S=y.useCallback(async _=>{try{await o2(_),m(_)}catch(M){N(M instanceof Error?M.message:"Failed to set default project")}},[]),k=l.find(_=>_.id===u)??null;return n.jsx(G0.Provider,{value:{projects:l,currentProject:k,defaultProjectId:f,isLoading:p,error:b,setCurrentProject:j,setDefaultProject:S,refreshProjects:v},children:e})}function on(){const e=y.useContext(G0);if(!e)throw new Error("useProjects must be used within a ProjectProvider");return e}const K0=y.createContext({pendingCount:0,refresh:()=>{}});function B2({children:e}){const[a,r]=y.useState(0),l=y.useCallback(()=>{Tr().then(o=>{const u=o.filter(d=>d.status==="pending"||d.status==="active").length;r(u)}).catch(()=>{})},[]);return y.useEffect(()=>{l()},[l]),y.useEffect(()=>{let o=null,u=null;function d(){try{o=new EventSource(Wl("/api/review/hub/events")),o.addEventListener("session-added",l),o.addEventListener("session-decided",l),o.addEventListener("session-updated",l),o.onerror=()=>{o==null||o.close(),o=null,u=setTimeout(d,5e3)}}catch{}}return d(),()=>{o==null||o.close(),u&&clearTimeout(u)}},[l]),n.jsx(K0.Provider,{value:{pendingCount:a,refresh:l},children:e})}function $2(){return y.useContext(K0)}/**
68
- * @license lucide-react v0.474.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const P2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Y0=(...e)=>e.filter((a,r,l)=>!!a&&a.trim()!==""&&l.indexOf(a)===r).join(" ").trim();/**
73
- * @license lucide-react v0.474.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */var F2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
78
- * @license lucide-react v0.474.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const H2=y.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:o="",children:u,iconNode:d,...f},m)=>y.createElement("svg",{ref:m,...F2,width:a,height:a,stroke:e,strokeWidth:l?Number(r)*24/Number(a):r,className:Y0("lucide",o),...f},[...d.map(([p,g])=>y.createElement(p,g)),...Array.isArray(u)?u:[u]]));/**
83
- * @license lucide-react v0.474.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const be=(e,a)=>{const r=y.forwardRef(({className:l,...o},u)=>y.createElement(H2,{ref:u,iconNode:a,className:Y0(`lucide-${P2(e)}`,l),...o}));return r.displayName=`${e}`,r};/**
88
- * @license lucide-react v0.474.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const q2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],tr=be("Activity",q2);/**
93
- * @license lucide-react v0.474.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const G2=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]],V0=be("ArrowDownUp",G2);/**
98
- * @license lucide-react v0.474.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const K2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],eo=be("ArrowLeft",K2);/**
103
- * @license lucide-react v0.474.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const Y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],X0=be("ArrowRight",Y2);/**
108
- * @license lucide-react v0.474.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const V2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],X2=be("ArrowUpRight",V2);/**
113
- * @license lucide-react v0.474.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const Z2=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Kc=be("Bell",Z2);/**
118
- * @license lucide-react v0.474.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const Q2=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Rr=be("Brain",Q2);/**
123
- * @license lucide-react v0.474.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const W2=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],J2=be("ChartColumn",W2);/**
128
- * @license lucide-react v0.474.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const eS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bn=be("Check",eS);/**
133
- * @license lucide-react v0.474.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const tS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Pn=be("ChevronDown",tS);/**
138
- * @license lucide-react v0.474.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const nS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wa=be("ChevronRight",nS);/**
143
- * @license lucide-react v0.474.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const sS=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wm=be("ChevronUp",sS);/**
148
- * @license lucide-react v0.474.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const aS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Z0=be("CircleArrowUp",aS);/**
153
- * @license lucide-react v0.474.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const rS=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],iS=be("CircleCheckBig",rS);/**
158
- * @license lucide-react v0.474.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const lS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mr=be("CircleCheck",lS);/**
163
- * @license lucide-react v0.474.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const oS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],cS=be("CircleHelp",oS);/**
168
- * @license lucide-react v0.474.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const uS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],dS=be("CirclePlus",uS);/**
173
- * @license lucide-react v0.474.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const fS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Or=be("CircleX",fS);/**
178
- * @license lucide-react v0.474.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const mS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pS=be("Circle",mS);/**
183
- * @license lucide-react v0.474.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const hS=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],Pc=be("ClipboardCheck",hS);/**
188
- * @license lucide-react v0.474.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const xS=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],gS=be("ClipboardList",xS);/**
193
- * @license lucide-react v0.474.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const bS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]],Jm=be("Clock3",bS);/**
198
- * @license lucide-react v0.474.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const yS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],lu=be("Clock",yS);/**
203
- * @license lucide-react v0.474.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const vS=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],NS=be("CodeXml",vS);/**
208
- * @license lucide-react v0.474.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const wS=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],ES=be("Cpu",wS);/**
213
- * @license lucide-react v0.474.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const jS=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ep=be("Database",jS);/**
218
- * @license lucide-react v0.474.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const SS=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],to=be("Download",SS);/**
223
- * @license lucide-react v0.474.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const kS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],_S=be("ExternalLink",kS);/**
228
- * @license lucide-react v0.474.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const CS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Q0=be("Eye",CS);/**
233
- * @license lucide-react v0.474.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const TS=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],AS=be("FileCode2",TS);/**
238
- * @license lucide-react v0.474.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const RS=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],W0=be("FileCode",RS);/**
243
- * @license lucide-react v0.474.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const MS=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],OS=be("FileDown",MS);/**
248
- * @license lucide-react v0.474.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const DS=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],LS=be("FilePen",DS);/**
253
- * @license lucide-react v0.474.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const zS=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Fl=be("FileText",zS);/**
258
- * @license lucide-react v0.474.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const IS=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],US=be("Filter",IS);/**
263
- * @license lucide-react v0.474.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const BS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],no=be("FolderOpen",BS);/**
268
- * @license lucide-react v0.474.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const $S=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],PS=be("FolderPlus",$S);/**
273
- * @license lucide-react v0.474.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const FS=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],HS=be("FolderSearch",FS);/**
278
- * @license lucide-react v0.474.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const qS=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Dr=be("FolderTree",qS);/**
283
- * @license lucide-react v0.474.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const GS=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],KS=be("Gauge",GS);/**
288
- * @license lucide-react v0.474.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const YS=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],$n=be("GitBranch",YS);/**
293
- * @license lucide-react v0.474.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const VS=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],XS=be("GitCommitHorizontal",VS);/**
298
- * @license lucide-react v0.474.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const ZS=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ou=be("GitPullRequest",ZS);/**
303
- * @license lucide-react v0.474.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const QS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],J0=be("Globe",QS);/**
308
- * @license lucide-react v0.474.0 - ISC
309
- *
310
- * This source code is licensed under the ISC license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const WS=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],JS=be("GripVertical",WS);/**
313
- * @license lucide-react v0.474.0 - ISC
314
- *
315
- * This source code is licensed under the ISC license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const ek=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ev=be("Hash",ek);/**
318
- * @license lucide-react v0.474.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const tk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],nk=be("History",tk);/**
323
- * @license lucide-react v0.474.0 - ISC
324
- *
325
- * This source code is licensed under the ISC license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const sk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ak=be("Info",sk);/**
328
- * @license lucide-react v0.474.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const rk=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],tv=be("Keyboard",rk);/**
333
- * @license lucide-react v0.474.0 - ISC
334
- *
335
- * This source code is licensed under the ISC license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */const ik=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],nv=be("Layers",ik);/**
338
- * @license lucide-react v0.474.0 - ISC
339
- *
340
- * This source code is licensed under the ISC license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */const lk=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],sv=be("LayoutDashboard",lk);/**
343
- * @license lucide-react v0.474.0 - ISC
344
- *
345
- * This source code is licensed under the ISC license.
346
- * See the LICENSE file in the root directory of this source tree.
347
- */const ok=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ck=be("Link2",ok);/**
348
- * @license lucide-react v0.474.0 - ISC
349
- *
350
- * This source code is licensed under the ISC license.
351
- * See the LICENSE file in the root directory of this source tree.
352
- */const uk=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],pm=be("ListChecks",uk);/**
353
- * @license lucide-react v0.474.0 - ISC
354
- *
355
- * This source code is licensed under the ISC license.
356
- * See the LICENSE file in the root directory of this source tree.
357
- */const dk=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],fk=be("ListTodo",dk);/**
358
- * @license lucide-react v0.474.0 - ISC
359
- *
360
- * This source code is licensed under the ISC license.
361
- * See the LICENSE file in the root directory of this source tree.
362
- */const mk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Je=be("LoaderCircle",mk);/**
363
- * @license lucide-react v0.474.0 - ISC
364
- *
365
- * This source code is licensed under the ISC license.
366
- * See the LICENSE file in the root directory of this source tree.
367
- */const pk=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],hm=be("Lock",pk);/**
368
- * @license lucide-react v0.474.0 - ISC
369
- *
370
- * This source code is licensed under the ISC license.
371
- * See the LICENSE file in the root directory of this source tree.
372
- */const hk=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],xk=be("Map",hk);/**
373
- * @license lucide-react v0.474.0 - ISC
374
- *
375
- * This source code is licensed under the ISC license.
376
- * See the LICENSE file in the root directory of this source tree.
377
- */const gk=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],bk=be("MessageCircle",gk);/**
378
- * @license lucide-react v0.474.0 - ISC
379
- *
380
- * This source code is licensed under the ISC license.
381
- * See the LICENSE file in the root directory of this source tree.
382
- */const yk=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Ti=be("MessageSquare",yk);/**
383
- * @license lucide-react v0.474.0 - ISC
384
- *
385
- * This source code is licensed under the ISC license.
386
- * See the LICENSE file in the root directory of this source tree.
387
- */const vk=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Nk=be("Monitor",vk);/**
388
- * @license lucide-react v0.474.0 - ISC
389
- *
390
- * This source code is licensed under the ISC license.
391
- * See the LICENSE file in the root directory of this source tree.
392
- */const wk=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ll=be("Network",wk);/**
393
- * @license lucide-react v0.474.0 - ISC
394
- *
395
- * This source code is licensed under the ISC license.
396
- * See the LICENSE file in the root directory of this source tree.
397
- */const Ek=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],jk=be("Package",Ek);/**
398
- * @license lucide-react v0.474.0 - ISC
399
- *
400
- * This source code is licensed under the ISC license.
401
- * See the LICENSE file in the root directory of this source tree.
402
- */const Sk=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],kk=be("Paintbrush",Sk);/**
403
- * @license lucide-react v0.474.0 - ISC
404
- *
405
- * This source code is licensed under the ISC license.
406
- * See the LICENSE file in the root directory of this source tree.
407
- */const _k=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Ck=be("PanelLeftClose",_k);/**
408
- * @license lucide-react v0.474.0 - ISC
409
- *
410
- * This source code is licensed under the ISC license.
411
- * See the LICENSE file in the root directory of this source tree.
412
- */const Tk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Ak=be("PanelLeftOpen",Tk);/**
413
- * @license lucide-react v0.474.0 - ISC
414
- *
415
- * This source code is licensed under the ISC license.
416
- * See the LICENSE file in the root directory of this source tree.
417
- */const Rk=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Mk=be("Paperclip",Rk);/**
418
- * @license lucide-react v0.474.0 - ISC
419
- *
420
- * This source code is licensed under the ISC license.
421
- * See the LICENSE file in the root directory of this source tree.
422
- */const Ok=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Dk=be("Pen",Ok);/**
423
- * @license lucide-react v0.474.0 - ISC
424
- *
425
- * This source code is licensed under the ISC license.
426
- * See the LICENSE file in the root directory of this source tree.
427
- */const Lk=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],cu=be("Pencil",Lk);/**
428
- * @license lucide-react v0.474.0 - ISC
429
- *
430
- * This source code is licensed under the ISC license.
431
- * See the LICENSE file in the root directory of this source tree.
432
- */const zk=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],tp=be("Play",zk);/**
433
- * @license lucide-react v0.474.0 - ISC
434
- *
435
- * This source code is licensed under the ISC license.
436
- * See the LICENSE file in the root directory of this source tree.
437
- */const Ik=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cs=be("Plus",Ik);/**
438
- * @license lucide-react v0.474.0 - ISC
439
- *
440
- * This source code is licensed under the ISC license.
441
- * See the LICENSE file in the root directory of this source tree.
442
- */const Uk=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],rs=be("RefreshCw",Uk);/**
443
- * @license lucide-react v0.474.0 - ISC
444
- *
445
- * This source code is licensed under the ISC license.
446
- * See the LICENSE file in the root directory of this source tree.
447
- */const Bk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$k=be("RotateCcw",Bk);/**
448
- * @license lucide-react v0.474.0 - ISC
449
- *
450
- * This source code is licensed under the ISC license.
451
- * See the LICENSE file in the root directory of this source tree.
452
- */const Pk=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Fk=be("RotateCw",Pk);/**
453
- * @license lucide-react v0.474.0 - ISC
454
- *
455
- * This source code is licensed under the ISC license.
456
- * See the LICENSE file in the root directory of this source tree.
457
- */const Hk=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],np=be("Save",Hk);/**
458
- * @license lucide-react v0.474.0 - ISC
459
- *
460
- * This source code is licensed under the ISC license.
461
- * See the LICENSE file in the root directory of this source tree.
462
- */const qk=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ks=be("Search",qk);/**
463
- * @license lucide-react v0.474.0 - ISC
464
- *
465
- * This source code is licensed under the ISC license.
466
- * See the LICENSE file in the root directory of this source tree.
467
- */const Gk=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Kk=be("Server",Gk);/**
468
- * @license lucide-react v0.474.0 - ISC
469
- *
470
- * This source code is licensed under the ISC license.
471
- * See the LICENSE file in the root directory of this source tree.
472
- */const Yk=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sp=be("Settings",Yk);/**
473
- * @license lucide-react v0.474.0 - ISC
474
- *
475
- * This source code is licensed under the ISC license.
476
- * See the LICENSE file in the root directory of this source tree.
477
- */const Vk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],av=be("ShieldCheck",Vk);/**
478
- * @license lucide-react v0.474.0 - ISC
479
- *
480
- * This source code is licensed under the ISC license.
481
- * See the LICENSE file in the root directory of this source tree.
482
- */const Xk=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],rv=be("ShieldOff",Xk);/**
483
- * @license lucide-react v0.474.0 - ISC
484
- *
485
- * This source code is licensed under the ISC license.
486
- * See the LICENSE file in the root directory of this source tree.
487
- */const Zk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Yc=be("Shield",Zk);/**
488
- * @license lucide-react v0.474.0 - ISC
489
- *
490
- * This source code is licensed under the ISC license.
491
- * See the LICENSE file in the root directory of this source tree.
492
- */const Qk=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],En=be("Sparkles",Qk);/**
493
- * @license lucide-react v0.474.0 - ISC
494
- *
495
- * This source code is licensed under the ISC license.
496
- * See the LICENSE file in the root directory of this source tree.
497
- */const Wk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Jk=be("Square",Wk);/**
498
- * @license lucide-react v0.474.0 - ISC
499
- *
500
- * This source code is licensed under the ISC license.
501
- * See the LICENSE file in the root directory of this source tree.
502
- */const e_=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Hl=be("Star",e_);/**
503
- * @license lucide-react v0.474.0 - ISC
504
- *
505
- * This source code is licensed under the ISC license.
506
- * See the LICENSE file in the root directory of this source tree.
507
- */const t_=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],n_=be("Tag",t_);/**
508
- * @license lucide-react v0.474.0 - ISC
509
- *
510
- * This source code is licensed under the ISC license.
511
- * See the LICENSE file in the root directory of this source tree.
512
- */const s_=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],Cr=be("Terminal",s_);/**
513
- * @license lucide-react v0.474.0 - ISC
514
- *
515
- * This source code is licensed under the ISC license.
516
- * See the LICENSE file in the root directory of this source tree.
517
- */const a_=[["path",{d:"M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3",key:"1ub6xw"}],["path",{d:"m16 2 6 6",key:"1gw87d"}],["path",{d:"M12 16H4",key:"1cjfip"}]],r_=be("TestTubeDiagonal",a_);/**
518
- * @license lucide-react v0.474.0 - ISC
519
- *
520
- * This source code is licensed under the ISC license.
521
- * See the LICENSE file in the root directory of this source tree.
522
- */const i_=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],sr=be("Trash2",i_);/**
523
- * @license lucide-react v0.474.0 - ISC
524
- *
525
- * This source code is licensed under the ISC license.
526
- * See the LICENSE file in the root directory of this source tree.
527
- */const l_=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],Vc=be("TrendingUp",l_);/**
528
- * @license lucide-react v0.474.0 - ISC
529
- *
530
- * This source code is licensed under the ISC license.
531
- * See the LICENSE file in the root directory of this source tree.
532
- */const o_=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],It=be("TriangleAlert",o_);/**
533
- * @license lucide-react v0.474.0 - ISC
534
- *
535
- * This source code is licensed under the ISC license.
536
- * See the LICENSE file in the root directory of this source tree.
537
- */const c_=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],u_=be("Type",c_);/**
538
- * @license lucide-react v0.474.0 - ISC
539
- *
540
- * This source code is licensed under the ISC license.
541
- * See the LICENSE file in the root directory of this source tree.
542
- */const d_=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],f_=be("Undo2",d_);/**
543
- * @license lucide-react v0.474.0 - ISC
544
- *
545
- * This source code is licensed under the ISC license.
546
- * See the LICENSE file in the root directory of this source tree.
547
- */const m_=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],ap=be("Upload",m_);/**
548
- * @license lucide-react v0.474.0 - ISC
549
- *
550
- * This source code is licensed under the ISC license.
551
- * See the LICENSE file in the root directory of this source tree.
552
- */const p_=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],rp=be("User",p_);/**
553
- * @license lucide-react v0.474.0 - ISC
554
- *
555
- * This source code is licensed under the ISC license.
556
- * See the LICENSE file in the root directory of this source tree.
557
- */const h_=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],zl=be("Wrench",h_);/**
558
- * @license lucide-react v0.474.0 - ISC
559
- *
560
- * This source code is licensed under the ISC license.
561
- * See the LICENSE file in the root directory of this source tree.
562
- */const x_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ln=be("X",x_);/**
563
- * @license lucide-react v0.474.0 - ISC
564
- *
565
- * This source code is licensed under the ISC license.
566
- * See the LICENSE file in the root directory of this source tree.
567
- */const g_=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],b_=be("Zap",g_),Mb="ulpi-update-dismissed";function y_(){const[e,a]=y.useState(null),[r,l]=y.useState(!1);if(y.useEffect(()=>{D0().then(a).catch(()=>{})},[]),y.useEffect(()=>{e!=null&&e.updateAvailable&&localStorage.getItem(Mb)===e.latest&&l(!0)},[e]),!(e!=null&&e.updateAvailable)||r)return null;const o=()=>{localStorage.setItem(Mb,e.latest),l(!0)};return n.jsx("div",{className:"mx-3 mt-3 p-3 rounded-lg bg-amber-500/15 border border-amber-500/30",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Z0,{size:16,className:"text-amber-300 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs font-medium text-amber-300",children:"Update available"}),n.jsxs("p",{className:"text-xs text-amber-300/70 mt-0.5",children:["v",e.current," → v",e.latest]}),n.jsx("p",{className:"text-xs text-text-muted mt-1.5 font-mono",children:"ulpi update"})]}),n.jsx("button",{onClick:o,className:"text-amber-300/50 hover:text-amber-300 transition-colors flex-shrink-0","aria-label":"Dismiss update notification",children:n.jsx(ln,{size:14})})]})})}const Ob="ulpi-sidebar-collapsed",v_=[{to:"/",label:"Dashboard",icon:sv},{to:"/review/queue",label:"Reviews",icon:ou}],N_=[{label:"Guards",items:[{to:"/rules",label:"Rules",icon:pm},{to:"/responses",label:"Responses",icon:Kc}]},{label:"Monitor",items:[{to:"/session",label:"Session",icon:tr},{to:"/codemap",label:"CodeMap",icon:Dr},{to:"/memory",label:"Memory",icon:Rr},{to:"/history",label:"History",icon:nk}]}],w_=[{to:"/skills",label:"Skills",icon:En},{to:"/projects",label:"Projects",icon:no},{to:"/settings",label:"Settings",icon:sp}];function Db({status:e}){switch(e){case"configured":return n.jsx(bn,{size:12,className:"text-success"});case"partial":return n.jsx(It,{size:12,className:"text-warning"});case"none":return n.jsx(Or,{size:12,className:"text-text-muted"})}}function E_(){const{projects:e,currentProject:a,defaultProjectId:r,setCurrentProject:l}=on(),[o,u]=y.useState(!1),d=y.useRef(null);return y.useEffect(()=>{const f=m=>{d.current&&!d.current.contains(m.target)&&u(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),e.length===0?n.jsx("div",{className:"px-4 py-3 border-b border-border-subtle",children:n.jsx("p",{className:"text-xs text-text-muted",children:"No projects registered"})}):n.jsxs("div",{ref:d,className:"relative px-3 py-3 border-b border-border-subtle",children:[n.jsxs("button",{onClick:()=>u(!o),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-2 hover:bg-surface-3 transition-colors",children:[n.jsx(no,{size:16,className:"text-text-secondary flex-shrink-0"}),n.jsx("span",{className:"flex-1 text-left text-sm font-medium text-text-primary truncate",children:(a==null?void 0:a.name)??"Select project"}),a&&n.jsx(Db,{status:a.configStatus}),n.jsx(Pn,{size:16,className:`text-text-muted transition-transform ${o?"rotate-180":""}`})]}),o&&n.jsx("div",{className:"absolute left-3 right-3 top-full mt-1 z-50 py-1 rounded-lg bg-surface-2 border border-border shadow-lg max-h-64 overflow-y-auto",children:e.map(f=>n.jsxs("button",{onClick:()=>{l(f.id),u(!1)},className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-surface-3 transition-colors",children:[n.jsx("span",{className:"w-4 flex-shrink-0",children:(a==null?void 0:a.id)===f.id&&n.jsx(bn,{size:14,className:"text-accent"})}),n.jsx("span",{className:"flex-1 text-left text-sm text-text-primary truncate",children:f.name}),n.jsx(Db,{status:f.configStatus}),f.id===r&&n.jsx(Hl,{size:12,className:"text-accent flex-shrink-0"})]},f.id))})]})}function j_(){const[e]=Zl(),a=e.get("project"),{pendingCount:r}=$2(),[l,o]=y.useState(()=>localStorage.getItem(Ob)==="true"),u=y.useCallback(()=>{o(f=>{const m=!f;return localStorage.setItem(Ob,String(m)),m})},[]);y.useEffect(()=>{const f=m=>{const p=m.target.tagName;p==="INPUT"||p==="TEXTAREA"||m.target.isContentEditable||m.key==="["&&!m.metaKey&&!m.ctrlKey&&!m.altKey&&(m.preventDefault(),u())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[u]);const d=f=>a?`${f}?project=${encodeURIComponent(a)}`:f;return n.jsxs("aside",{className:`${l?"w-[52px]":"w-72"} transition-all duration-200 bg-surface-1 border-r border-border flex flex-col overflow-hidden`,children:[l?n.jsxs("div",{className:"flex flex-col items-center gap-2 py-4 border-b border-border-subtle",children:[n.jsx("img",{src:"https://www.ulpi.io/media/ulpi-icon-512x512.png",width:"26",height:"26",alt:"Ulpi",className:"shrink-0 rounded"}),n.jsx("button",{onClick:u,className:"p-1 rounded-md text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Expand sidebar",children:n.jsx(Ak,{size:16})})]}):n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-4 border-b border-border-subtle",children:[n.jsx("img",{src:"https://www.ulpi.io/media/ulpi-icon-512x512.png",width:"26",height:"26",alt:"Ulpi",className:"shrink-0 rounded"}),n.jsx("h1",{className:"text-base font-semibold font-display text-text-primary tracking-tight",children:"ULPI"}),n.jsx("span",{className:"text-xs font-medium text-text-muted bg-surface-3 px-2 py-0.5 rounded-full uppercase tracking-widest",children:"alpha"}),n.jsx("button",{onClick:u,className:"ml-auto p-1 rounded-md text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Collapse sidebar",children:n.jsx(Ck,{size:16})})]}),n.jsx("div",{className:`py-2 ${l?"px-1":"px-3"} border-b border-border-subtle`,children:v_.map(f=>{const m=f.to==="/review/queue"&&r>0;return n.jsxs(Bc,{to:f.to,end:f.to==="/",title:l?`${f.label}${m?` (${r})`:""}`:void 0,className:({isActive:p})=>["flex items-center rounded-lg text-sm font-medium transition-colors relative",l?"justify-center px-0 py-2":"gap-3 px-3 py-2",p?"bg-accent/15 text-accent":"text-text-secondary hover:bg-surface-2 hover:text-text-primary"].join(" "),children:[n.jsxs("span",{className:"relative",children:[n.jsx(f.icon,{size:18}),m&&l&&n.jsx("span",{className:"absolute -top-1.5 -right-1.5 w-4 h-4 flex items-center justify-center rounded-full bg-red-500 text-white text-[9px] font-bold leading-none",children:r>9?"9+":r})]}),!l&&n.jsxs(n.Fragment,{children:[f.label,m&&n.jsx("span",{className:"ml-auto w-5 h-5 flex items-center justify-center rounded-full bg-red-500 text-white text-[10px] font-bold leading-none",children:r>9?"9+":r})]})]},f.to)})}),!l&&n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted font-semibold px-6 pt-3 pb-0",children:"Project"}),!l&&n.jsx(E_,{}),!l&&n.jsx(y_,{}),n.jsxs("nav",{className:`flex-1 flex flex-col py-3 ${l?"px-1":"px-3"}`,children:[n.jsx("div",{className:"space-y-1",children:N_.map((f,m)=>n.jsxs("div",{children:[!l&&f.label&&n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted font-semibold px-3 pt-4 pb-1",children:f.label}),f.items.map(p=>n.jsxs(Bc,{to:d(p.to),end:p.to==="/",title:l?p.label:void 0,className:({isActive:g})=>["flex items-center rounded-lg text-sm font-medium transition-colors",l?"justify-center px-0 py-2":"gap-3 px-3 py-2",g?"bg-accent/15 text-accent":"text-text-secondary hover:bg-surface-2 hover:text-text-primary"].join(" "),children:[n.jsx(p.icon,{size:18}),!l&&p.label]},p.to))]},f.label??m))}),n.jsx("div",{className:"mt-auto space-y-1 border-t border-border-subtle pt-3",children:w_.map(f=>n.jsxs(Bc,{to:d(f.to),title:l?f.label:void 0,className:({isActive:m})=>["flex items-center rounded-lg text-sm font-medium transition-colors",l?"justify-center px-0 py-2":"gap-3 px-3 py-2",m?"bg-accent/15 text-accent":"text-text-secondary hover:bg-surface-2 hover:text-text-primary"].join(" "),children:[n.jsx(f.icon,{size:18}),!l&&f.label]},f.to))})]})]})}var Cf={exports:{}},Tf={};/**
568
- * @license React
569
- * use-sync-external-store-shim.production.js
570
- *
571
- * Copyright (c) Meta Platforms, Inc. and affiliates.
572
- *
573
- * This source code is licensed under the MIT license found in the
574
- * LICENSE file in the root directory of this source tree.
575
- */var Lb;function S_(){if(Lb)return Tf;Lb=1;var e=su();function a(b,N){return b===N&&(b!==0||1/b===1/N)||b!==b&&N!==N}var r=typeof Object.is=="function"?Object.is:a,l=e.useState,o=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(b,N){var v=N(),w=l({inst:{value:v,getSnapshot:N}}),j=w[0].inst,S=w[1];return u(function(){j.value=v,j.getSnapshot=N,m(j)&&S({inst:j})},[b,v,N]),o(function(){return m(j)&&S({inst:j}),b(function(){m(j)&&S({inst:j})})},[b]),d(v),v}function m(b){var N=b.getSnapshot;b=b.value;try{var v=N();return!r(b,v)}catch{return!0}}function p(b,N){return N()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Tf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Tf}var zb;function k_(){return zb||(zb=1,Cf.exports=S_()),Cf.exports}var Ib=k_();const iv=0,lv=1,ov=2,Ub=3;var Bb=Object.prototype.hasOwnProperty;function xm(e,a){var r,l;if(e===a)return!0;if(e&&a&&(r=e.constructor)===a.constructor){if(r===Date)return e.getTime()===a.getTime();if(r===RegExp)return e.toString()===a.toString();if(r===Array){if((l=e.length)===a.length)for(;l--&&xm(e[l],a[l]););return l===-1}if(!r||typeof e=="object"){l=0;for(r in e)if(Bb.call(e,r)&&++l&&!Bb.call(a,r)||!(r in a)||!xm(e[r],a[r]))return!1;return Object.keys(a).length===l}}return e!==e&&a!==a}const ga=new WeakMap,ba=()=>{},Dn=ba(),gm=Object,xt=e=>e===Dn,Ks=e=>typeof e=="function",nr=(e,a)=>({...e,...a}),cv=e=>Ks(e.then),Af={},Nc={},ip="undefined",so=typeof window!=ip,bm=typeof document!=ip,__=so&&"Deno"in window,C_=()=>so&&typeof window.requestAnimationFrame!=ip,uv=(e,a)=>{const r=ga.get(e);return[()=>!xt(a)&&e.get(a)||Af,l=>{if(!xt(a)){const o=e.get(a);a in Nc||(Nc[a]=o),r[5](a,nr(o,l),o||Af)}},r[6],()=>!xt(a)&&a in Nc?Nc[a]:!xt(a)&&e.get(a)||Af]};let ym=!0;const T_=()=>ym,[vm,Nm]=so&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ba,ba],A_=()=>{const e=bm&&document.visibilityState;return xt(e)||e!=="hidden"},R_=e=>(bm&&document.addEventListener("visibilitychange",e),vm("focus",e),()=>{bm&&document.removeEventListener("visibilitychange",e),Nm("focus",e)}),M_=e=>{const a=()=>{ym=!0,e()},r=()=>{ym=!1};return vm("online",a),vm("offline",r),()=>{Nm("online",a),Nm("offline",r)}},O_={isOnline:T_,isVisible:A_},D_={initFocus:R_,initReconnect:M_},$b=!au.useId,ki=!so||__,L_=e=>C_()?window.requestAnimationFrame(e):setTimeout(e,1),Rf=ki?y.useEffect:y.useLayoutEffect,Mf=typeof navigator<"u"&&navigator.connection,Pb=!ki&&Mf&&(["slow-2g","2g"].includes(Mf.effectiveType)||Mf.saveData),wc=new WeakMap,z_=e=>gm.prototype.toString.call(e),Of=(e,a)=>e===`[object ${a}]`;let I_=0;const wm=e=>{const a=typeof e,r=z_(e),l=Of(r,"Date"),o=Of(r,"RegExp"),u=Of(r,"Object");let d,f;if(gm(e)===e&&!l&&!o){if(d=wc.get(e),d)return d;if(d=++I_+"~",wc.set(e,d),Array.isArray(e)){for(d="@",f=0;f<e.length;f++)d+=wm(e[f])+",";wc.set(e,d)}if(u){d="#";const m=gm.keys(e).sort();for(;!xt(f=m.pop());)xt(e[f])||(d+=f+":"+wm(e[f])+",");wc.set(e,d)}}else d=l?e.toJSON():a=="symbol"?e.toString():a=="string"?JSON.stringify(e):""+e;return d},lp=e=>{if(Ks(e))try{e=e()}catch{e=""}const a=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?wm(e):"",[e,a]};let U_=0;const Em=()=>++U_;async function dv(...e){const[a,r,l,o]=e,u=nr({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let d=u.populateCache;const f=u.rollbackOnError;let m=u.optimisticData;const p=N=>typeof f=="function"?f(N):f!==!1,g=u.throwOnError;if(Ks(r)){const N=r,v=[],w=a.keys();for(const j of w)!/^\$(inf|sub)\$/.test(j)&&N(a.get(j)._k)&&v.push(j);return Promise.all(v.map(b))}return b(r);async function b(N){const[v]=lp(N);if(!v)return;const[w,j]=uv(a,v),[S,k,_,M]=ga.get(a),Z=()=>{const $=S[v];return(Ks(u.revalidate)?u.revalidate(w().data,N):u.revalidate!==!1)&&(delete _[v],delete M[v],$&&$[0])?$[0](ov).then(()=>w().data):w().data};if(e.length<3)return Z();let Y=l,C,I=!1;const D=Em();k[v]=[D,0];const F=!xt(m),R=w(),z=R.data,P=R._c,q=xt(P)?z:P;if(F&&(m=Ks(m)?m(q,z):m,j({data:m,_c:q})),Ks(Y))try{Y=Y(q)}catch($){C=$,I=!0}if(Y&&cv(Y))if(Y=await Y.catch($=>{C=$,I=!0}),D!==k[v][0]){if(I)throw C;return Y}else I&&F&&p(C)&&(d=!0,j({data:q,_c:Dn}));if(d&&!I)if(Ks(d)){const $=d(Y,q);j({data:$,error:Dn,_c:Dn})}else j({data:Y,error:Dn,_c:Dn});if(k[v][1]=Em(),Promise.resolve(Z()).then(()=>{j({_c:Dn})}),I){if(g)throw C;return}return Y}}const Fb=(e,a)=>{for(const r in e)e[r][0]&&e[r][0](a)},B_=(e,a)=>{if(!ga.has(e)){const r=nr(D_,a),l=Object.create(null),o=dv.bind(Dn,e);let u=ba;const d=Object.create(null),f=(g,b)=>{const N=d[g]||[];return d[g]=N,N.push(b),()=>N.splice(N.indexOf(b),1)},m=(g,b,N)=>{e.set(g,b);const v=d[g];if(v)for(const w of v)w(b,N)},p=()=>{if(!ga.has(e)&&(ga.set(e,[l,Object.create(null),Object.create(null),Object.create(null),o,m,f]),!ki)){const g=r.initFocus(setTimeout.bind(Dn,Fb.bind(Dn,l,iv))),b=r.initReconnect(setTimeout.bind(Dn,Fb.bind(Dn,l,lv)));u=()=>{g&&g(),b&&b(),ga.delete(e)}}};return p(),[e,o,p,u]}return[e,ga.get(e)[4]]},$_=(e,a,r,l,o)=>{const u=r.errorRetryCount,d=o.retryCount,f=~~((Math.random()+.5)*(1<<(d<8?d:8)))*r.errorRetryInterval;!xt(u)&&d>u||setTimeout(l,f,o)},P_=xm,[fv,F_]=B_(new Map),H_=nr({onLoadingSlow:ba,onSuccess:ba,onError:ba,onErrorRetry:$_,onDiscarded:ba,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Pb?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Pb?5e3:3e3,compare:P_,isPaused:()=>!1,cache:fv,mutate:F_,fallback:{}},O_),q_=(e,a)=>{const r=nr(e,a);if(a){const{use:l,fallback:o}=e,{use:u,fallback:d}=a;l&&u&&(r.use=l.concat(u)),o&&d&&(r.fallback=nr(o,d))}return r},G_=y.createContext({}),K_="$inf$",mv=so&&window.__SWR_DEVTOOLS_USE__,Y_=mv?window.__SWR_DEVTOOLS_USE__:[],V_=()=>{mv&&(window.__SWR_DEVTOOLS_REACT__=au)},X_=e=>Ks(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Z_=()=>{const e=y.useContext(G_);return y.useMemo(()=>nr(H_,e),[e])},Q_=e=>(a,r,l)=>e(a,r&&((...u)=>{const[d]=lp(a),[,,,f]=ga.get(fv);if(d.startsWith(K_))return r(...u);const m=f[d];return xt(m)?r(...u):(delete f[d],m)}),l),W_=Y_.concat(Q_),J_=e=>function(...r){const l=Z_(),[o,u,d]=X_(r),f=q_(l,d);let m=e;const{use:p}=f,g=(p||[]).concat(W_);for(let b=g.length;b--;)m=g[b](m);return m(o,u||f.fetcher||null,f)},eC=(e,a,r)=>{const l=a[e]||(a[e]=[]);return l.push(r),()=>{const o=l.indexOf(r);o>=0&&(l[o]=l[l.length-1],l.pop())}};V_();const Df=au.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(a=>{e.status="fulfilled",e.value=a},a=>{e.status="rejected",e.reason=a}),e}}),Lf={dedupe:!0},Hb=Promise.resolve(Dn),tC=()=>ba,nC=(e,a,r)=>{const{cache:l,compare:o,suspense:u,fallbackData:d,revalidateOnMount:f,revalidateIfStale:m,refreshInterval:p,refreshWhenHidden:g,refreshWhenOffline:b,keepPreviousData:N,strictServerPrefetchWarning:v}=r,[w,j,S,k]=ga.get(l),[_,M]=lp(e),Z=y.useRef(!1),Y=y.useRef(!1),C=y.useRef(_),I=y.useRef(a),D=y.useRef(r),F=()=>D.current,R=()=>F().isVisible()&&F().isOnline(),[z,P,q,$]=uv(l,_),U=y.useRef({}).current,B=xt(d)?xt(r.fallback)?Dn:r.fallback[_]:d,Q=(he,Xe)=>{for(const Qe in U){const lt=Qe;if(lt==="data"){if(!o(he[lt],Xe[lt])&&(!xt(he[lt])||!o(re,Xe[lt])))return!1}else if(Xe[lt]!==he[lt])return!1}return!0},ee=!Z.current,ie=y.useMemo(()=>{const he=z(),Xe=$(),Qe=gt=>{const Vt=nr(gt);return delete Vt._k,(()=>{if(!_||!a||F().isPaused())return!1;if(ee&&!xt(f))return f;const yn=xt(B)?Vt.data:B;return xt(yn)||m})()?{isValidating:!0,isLoading:!0,...Vt}:Vt},lt=Qe(he),At=he===Xe?lt:Qe(Xe);let Yt=lt;return[()=>{const gt=Qe(z());return Q(gt,Yt)?(Yt.data=gt.data,Yt.isLoading=gt.isLoading,Yt.isValidating=gt.isValidating,Yt.error=gt.error,Yt):(Yt=gt,gt)},()=>At]},[l,_]),T=Ib.useSyncExternalStore(y.useCallback(he=>q(_,(Xe,Qe)=>{Q(Qe,Xe)||he()}),[l,_]),ie[0],ie[1]),L=w[_]&&w[_].length>0,G=T.data,O=xt(G)?B&&cv(B)?Df(B):B:G,H=T.error,V=y.useRef(O),re=N?xt(G)?xt(V.current)?O:V.current:G:O,xe=_&&xt(O),je=y.useRef(null);!ki&&Ib.useSyncExternalStore(tC,()=>(je.current=!1,je),()=>(je.current=!0,je));const Be=je.current;v&&Be&&!u&&xe&&console.warn(`Missing pre-initiated data for serialized key "${_}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const we=!_||!a||F().isPaused()||L&&!xt(H)?!1:ee&&!xt(f)?f:u?xt(O)?!1:m:xt(O)||m,Ye=xt(T.isValidating)?we:T.isValidating,jt=xt(T.isLoading)?we:T.isLoading,en=y.useCallback(async he=>{const Xe=I.current;if(!_||!Xe||Y.current||F().isPaused())return!1;let Qe,lt,At=!0;const Yt=he||{},gt=!S[_]||!Yt.dedupe,Vt=()=>$b?!Y.current&&_===C.current&&Z.current:_===C.current,ct={isValidating:!1,isLoading:!1},yn=()=>{P(ct)},ue=()=>{const Ae=S[_];Ae&&Ae[1]===lt&&delete S[_]},ve={isValidating:!0};xt(z().data)&&(ve.isLoading=!0);try{if(gt&&(P(ve),r.loadingTimeout&&xt(z().data)&&setTimeout(()=>{At&&Vt()&&F().onLoadingSlow(_,r)},r.loadingTimeout),S[_]=[Xe(M),Em()]),[Qe,lt]=S[_],Qe=await Qe,gt&&setTimeout(ue,r.dedupingInterval),!S[_]||S[_][1]!==lt)return gt&&Vt()&&F().onDiscarded(_),!1;ct.error=Dn;const Ae=j[_];if(!xt(Ae)&&(lt<=Ae[0]||lt<=Ae[1]||Ae[1]===0))return yn(),gt&&Vt()&&F().onDiscarded(_),!1;const Pe=z().data;ct.data=o(Pe,Qe)?Pe:Qe,gt&&Vt()&&F().onSuccess(Qe,_,r)}catch(Ae){ue();const Pe=F(),{shouldRetryOnError:ot}=Pe;Pe.isPaused()||(ct.error=Ae,gt&&Vt()&&(Pe.onError(Ae,_,Pe),(ot===!0||Ks(ot)&&ot(Ae))&&(!F().revalidateOnFocus||!F().revalidateOnReconnect||R())&&Pe.onErrorRetry(Ae,_,Pe,cn=>{const jn=w[_];jn&&jn[0]&&jn[0](Ub,cn)},{retryCount:(Yt.retryCount||0)+1,dedupe:!0})))}return At=!1,yn(),!0},[_,l]),oe=y.useCallback((...he)=>dv(l,C.current,...he),[]);if(Rf(()=>{I.current=a,D.current=r,xt(G)||(V.current=G)}),Rf(()=>{if(!_)return;const he=en.bind(Dn,Lf);let Xe=0;F().revalidateOnFocus&&(Xe=Date.now()+F().focusThrottleInterval);const lt=eC(_,w,(At,Yt={})=>{if(At==iv){const gt=Date.now();F().revalidateOnFocus&&gt>Xe&&R()&&(Xe=gt+F().focusThrottleInterval,he())}else if(At==lv)F().revalidateOnReconnect&&R()&&he();else{if(At==ov)return en();if(At==Ub)return en(Yt)}});return Y.current=!1,C.current=_,Z.current=!0,P({_k:M}),we&&(S[_]||(xt(O)||ki?he():L_(he))),()=>{Y.current=!0,lt()}},[_]),Rf(()=>{let he;function Xe(){const lt=Ks(p)?p(z().data):p;lt&&he!==-1&&(he=setTimeout(Qe,lt))}function Qe(){!z().error&&(g||F().isVisible())&&(b||F().isOnline())?en(Lf).then(Xe):Xe()}return Xe(),()=>{he&&(clearTimeout(he),he=-1)}},[p,g,b,_]),y.useDebugValue(re),u){if(!$b&&ki&&xe)throw new Error("Fallback data is required when using Suspense in SSR.");xe&&(I.current=a,D.current=r,Y.current=!1);const he=k[_],Xe=!xt(he)&&xe?oe(he):Hb;if(Df(Xe),!xt(H)&&xe)throw H;const Qe=xe?en(Lf):Hb;!xt(re)&&xe&&(Qe.status="fulfilled",Qe.value=!0),Df(Qe)}return{mutate:oe,get data(){return U.data=!0,re},get error(){return U.error=!0,H},get isValidating(){return U.isValidating=!0,Ye},get isLoading(){return U.isLoading=!0,jt}}},Et=J_(nC);class pv extends Qj{constructor(a,r,l){const u=Vs().replace(/^http/,"ws")+"/ws",d=window.__ULPI_API_SECRET__;super({url:a??u,projectId:r,sessionId:l,secret:d})}}function hv({isOpen:e,onClose:a,onSuccess:r}){const[l,o]=y.useState("manual"),[u,d]=y.useState(""),[f,m]=y.useState(!1),[p,g]=y.useState(null),[b,N]=y.useState(""),[v,w]=y.useState(3),[j,S]=y.useState(!1),[k,_]=y.useState(null),[M,Z]=y.useState(null),Y=y.useRef(null),C=y.useRef(null),I=y.useRef(null),D=y.useRef(null),F=y.useRef(null);y.useEffect(()=>{if(e){o("manual"),d(""),m(!1),g(null),N(""),w(3),S(!1),_(null),Z(null);const T=setTimeout(()=>{var L;(L=D.current)==null||L.focus()},50);return()=>clearTimeout(T)}},[e]),y.useEffect(()=>{if(!e)return;function T(L){L.key==="Escape"&&(L.preventDefault(),a())}return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e,a]);const R=y.useCallback(T=>{if(T.key!=="Tab"||!Y.current)return;const L=Y.current.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(L.length===0)return;const G=L[0],O=L[L.length-1];T.shiftKey?document.activeElement===G&&(T.preventDefault(),O.focus()):document.activeElement===O&&(T.preventDefault(),G.focus())},[]);y.useEffect(()=>{if(e)return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[e,R]);const z=T=>{const L=T.startsWith("/"),G=/^[a-zA-Z]:[/\\]/.test(T);return L||G},[P,q]=y.useState([]);y.useEffect(()=>{e&&fetch(`${window.location.origin}/api/paths`).then(T=>T.json()).then(T=>{T.suggestions&&q(T.suggestions)}).catch(()=>{})},[e]);const $=async T=>{T.preventDefault(),g(null);const L=u.trim();if(!L){g("Project path is required");return}if(!z(L)){g("Must be an absolute path (starts with / or drive letter)");return}m(!0);try{const G=await u2(L);r(G)}catch(G){const O=G instanceof Error?G.message:"Failed to add project";g(O)}finally{m(!1)}},U=async T=>{T.preventDefault(),_(null),Z(null);const L=b.trim();if(!L){_("Root directory is required");return}if(!z(L)){_("Must be an absolute path (starts with / or drive letter)");return}if(v<1||v>10){_("Max depth must be between 1 and 10");return}S(!0);try{const G=await m2(L,v);Z(G)}catch(G){const O=G instanceof Error?G.message:"Scan failed";_(O)}finally{S(!1)}},B=()=>{r()},Q=T=>{T.target===T.currentTarget&&a()},ee=T=>{o(T),setTimeout(()=>{var L,G;T==="manual"?(L=D.current)==null||L.focus():(G=F.current)==null||G.focus()},50)},ie=(T,L)=>{(T.key==="ArrowLeft"||T.key==="ArrowRight")&&(T.preventDefault(),ee(L==="manual"?"scan":"manual"))};return e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 backdrop-blur-sm flex items-center justify-center transition-opacity duration-150",onClick:Q,"aria-hidden":"true"}),n.jsxs("div",{ref:Y,role:"dialog","aria-modal":"true","aria-labelledby":"add-project-modal-title",className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-[500px] bg-surface-1 border border-border rounded-xl shadow-xl transition-all duration-150",children:[n.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[n.jsx("h2",{id:"add-project-modal-title",className:"text-xl font-semibold text-text-primary",children:"Add Project"}),n.jsx("button",{ref:C,onClick:a,className:"p-1.5 rounded-lg hover:bg-surface-3 text-text-muted hover:text-text-primary transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50","aria-label":"Close modal",children:n.jsx(ln,{size:20})})]}),n.jsxs("div",{role:"tablist","aria-label":"Add project methods",className:"flex px-6 border-b border-border",children:[n.jsxs("button",{role:"tab","aria-selected":l==="manual","aria-controls":"manual-panel",id:"manual-tab",tabIndex:l==="manual"?0:-1,onClick:()=>ee("manual"),onKeyDown:T=>ie(T,"manual"),className:["flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 -mb-px transition-colors focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent/50",l==="manual"?"border-accent text-accent bg-accent/10":"border-transparent text-text-secondary hover:text-text-primary hover:bg-surface-2"].join(" "),children:[n.jsx(PS,{size:16}),"Manual Path"]}),n.jsxs("button",{role:"tab","aria-selected":l==="scan","aria-controls":"scan-panel",id:"scan-tab",tabIndex:l==="scan"?0:-1,onClick:()=>ee("scan"),onKeyDown:T=>ie(T,"scan"),className:["flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 -mb-px transition-colors focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent/50",l==="scan"?"border-accent text-accent bg-accent/10":"border-transparent text-text-secondary hover:text-text-primary hover:bg-surface-2"].join(" "),children:[n.jsx(HS,{size:16}),"Scan Directory"]})]}),n.jsxs("div",{className:"min-h-[200px]",children:[n.jsx("div",{role:"tabpanel",id:"manual-panel","aria-labelledby":"manual-tab",hidden:l!=="manual",className:"p-6",children:n.jsxs("form",{onSubmit:$,children:[n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{children:[n.jsx("label",{htmlFor:"manual-path-input",className:"block text-sm font-medium text-text-primary mb-2",children:"Project Path"}),n.jsx("input",{ref:D,id:"manual-path-input",type:"text",value:u,onChange:T=>{d(T.target.value),g(null)},placeholder:"/absolute/path/to/your/project",disabled:f,"aria-describedby":"manual-path-helper manual-path-error","aria-invalid":p?"true":void 0,className:["w-full px-3.5 py-2.5 bg-surface-2 border rounded-lg text-sm text-text-primary placeholder:text-text-muted transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",p?"border-danger":"border-border hover:border-border-strong",f?"opacity-60 cursor-not-allowed":""].join(" ")}),P.length>0&&!u&&n.jsxs("div",{className:"mt-2",children:[n.jsx("p",{className:"text-xs text-text-secondary mb-1",children:"Quick suggestions:"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:P.slice(0,3).map(T=>n.jsx("button",{type:"button",onClick:()=>{d(T),g(null)},className:"px-2 py-1 text-xs bg-surface-2 hover:bg-surface-3 border border-border rounded text-text-secondary hover:text-text-primary transition-colors",children:T.length>30?`...${T.slice(-27)}`:T},T))})]}),n.jsx("p",{id:"manual-path-helper",className:"mt-2 text-xs text-text-secondary",children:"Enter the absolute path to your project directory"}),p&&n.jsx("p",{id:"manual-path-error",role:"alert","aria-live":"assertive",className:"mt-2 text-xs font-medium text-danger",children:p})]})}),n.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[n.jsx("button",{type:"button",onClick:a,disabled:f,className:"px-4 py-2.5 text-sm font-medium text-text-primary bg-surface-2 border border-border rounded-lg hover:bg-surface-3 transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),n.jsx("button",{ref:l==="manual"?I:void 0,type:"submit",disabled:f,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium text-white bg-accent rounded-lg hover:bg-accent-hover transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 focus:ring-offset-2 focus:ring-offset-surface-1 disabled:opacity-60 disabled:cursor-not-allowed",children:f?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx("div",{role:"tabpanel",id:"scan-panel","aria-labelledby":"scan-tab",hidden:l!=="scan",className:"p-6",children:n.jsxs("form",{onSubmit:U,children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"scan-root-input",className:"block text-sm font-medium text-text-primary mb-2",children:"Root Directory"}),n.jsx("input",{ref:F,id:"scan-root-input",type:"text",value:b,onChange:T=>{N(T.target.value),_(null)},placeholder:"/path/to/scan/for/projects",disabled:j,"aria-describedby":"scan-root-helper scan-error","aria-invalid":k?"true":void 0,className:["w-full px-3.5 py-2.5 bg-surface-2 border rounded-lg text-sm text-text-primary placeholder:text-text-muted transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",k?"border-danger":"border-border hover:border-border-strong",j?"opacity-60 cursor-not-allowed":""].join(" ")}),P.length>0&&!b&&n.jsxs("div",{className:"mt-2",children:[n.jsx("p",{className:"text-xs text-text-secondary mb-1",children:"Quick suggestions:"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:P.slice(0,3).map(T=>n.jsx("button",{type:"button",onClick:()=>{N(T),_(null)},className:"px-2 py-1 text-xs bg-surface-2 hover:bg-surface-3 border border-border rounded text-text-secondary hover:text-text-primary transition-colors",children:T.length>30?`...${T.slice(-27)}`:T},T))})]}),n.jsx("p",{id:"scan-root-helper",className:"mt-2 text-xs text-text-secondary",children:"Directory to scan for ULPI projects (searches subdirectories)"})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"scan-depth-input",className:"block text-sm font-medium text-text-primary mb-2",children:"Max Depth"}),n.jsx("input",{id:"scan-depth-input",type:"number",min:1,max:10,value:v,onChange:T=>{w(parseInt(T.target.value,10)||3),_(null)},disabled:j,className:["w-24 px-3.5 py-2.5 bg-surface-2 border border-border rounded-lg text-sm text-text-primary transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent hover:border-border-strong",j?"opacity-60 cursor-not-allowed":""].join(" ")}),n.jsx("p",{className:"mt-2 text-xs text-text-secondary",children:"How deep to search (1-10 levels)"})]}),k&&n.jsx("p",{id:"scan-error",role:"alert","aria-live":"assertive",className:"text-xs font-medium text-danger",children:k}),M&&n.jsxs("div",{className:"mt-4 p-4 bg-success/10 border border-success/20 rounded-lg",role:"status","aria-live":"polite",children:[n.jsxs("div",{className:"flex items-center gap-2 text-success font-medium mb-2",children:[n.jsx(bn,{size:16}),n.jsxs("span",{children:["Found ",M.projects.length," project",M.projects.length!==1?"s":"",", registered"," ",M.registered," new"]})]}),M.projects.length>0&&n.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:M.projects.map(T=>n.jsx("div",{className:"text-xs text-text-secondary truncate",title:T,children:T},T))}),M.projects.length===0&&n.jsx("p",{className:"text-xs text-text-secondary",children:"No ULPI projects found in this directory"})]})]}),n.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[n.jsx("button",{type:"button",onClick:a,disabled:j,className:"px-4 py-2.5 text-sm font-medium text-text-primary bg-surface-2 border border-border rounded-lg hover:bg-surface-3 transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),M?n.jsx("button",{ref:l==="scan"?I:void 0,type:"button",onClick:B,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium text-white bg-accent rounded-lg hover:bg-accent-hover transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 focus:ring-offset-2 focus:ring-offset-surface-1",children:"Done"}):n.jsx("button",{ref:l==="scan"?I:void 0,type:"submit",disabled:j,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium text-white bg-accent rounded-lg hover:bg-accent-hover transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 focus:ring-offset-2 focus:ring-offset-surface-1 disabled:opacity-60 disabled:cursor-not-allowed",children:j?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Scanning..."]}):"Scan"})]})]})})]}),n.jsxs("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:[f&&"Adding project, please wait",j&&"Scanning directory, please wait"]})]})]}):null}function ls(){const e=Rs(),{projects:a,currentProject:r,defaultProjectId:l,isLoading:o,setCurrentProject:u,refreshProjects:d}=on(),[f,m]=y.useState(!1),[p,g]=y.useState(-1),[b,N]=y.useState(!1),[v,w]=y.useState(!1),j=y.useRef(null),S=y.useRef(null),k=y.useRef(null);y.useEffect(()=>{function C(I){j.current&&!j.current.contains(I.target)&&(m(!1),g(-1))}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const _=y.useCallback(C=>{var I;if(!f){(C.key==="Enter"||C.key===" "||C.key==="ArrowDown")&&(C.preventDefault(),m(!0),g(0));return}switch(C.key){case"Escape":C.preventDefault(),m(!1),g(-1),(I=S.current)==null||I.focus();break;case"ArrowDown":C.preventDefault(),g(D=>D<a.length-1?D+1:D);break;case"ArrowUp":C.preventDefault(),g(D=>D>0?D-1:0);break;case"Enter":case" ":C.preventDefault(),p>=0&&p<a.length&&(u(a[p].id),m(!1),g(-1));break;case"Tab":m(!1),g(-1);break}},[f,p,a,u]);y.useEffect(()=>{var C;f&&p>=0&&k.current&&((C=k.current.querySelectorAll("[data-project-item]")[p])==null||C.scrollIntoView({block:"nearest"}))},[f,p]);const M=async C=>{C.stopPropagation(),N(!0);try{await d()}finally{N(!1)}},Z=C=>{C.stopPropagation(),m(!1),w(!0)};function Y({status:C}){switch(C){case"configured":return n.jsx("span",{className:"inline-flex items-center text-success",title:"Configured",children:n.jsx(bn,{size:14})});case"partial":return n.jsx("span",{className:"inline-flex items-center text-warning",title:"Partially configured",children:n.jsx(It,{size:14})});case"none":return n.jsx("span",{className:"inline-flex items-center text-text-muted",title:"Not configured",children:n.jsx(Or,{size:14})})}}return o?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-text-muted text-sm",children:[n.jsx(rs,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Loading..."})]}):a.length===0?n.jsxs("button",{onClick:()=>e("/projects"),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-2 border border-border text-text-secondary hover:text-text-primary transition-colors text-sm",children:[n.jsx(Cs,{size:16}),n.jsx("span",{children:"Add Project"})]}):n.jsxs("div",{ref:j,className:"relative",children:[n.jsxs("button",{ref:S,onClick:()=>m(!f),onKeyDown:_,"aria-haspopup":"listbox","aria-expanded":f,"aria-label":"Select project",className:["flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors text-sm","bg-surface-1 hover:bg-surface-2",f?"border-accent":"border-border hover:border-border-strong"].join(" "),children:[n.jsx(no,{size:16,className:"text-text-secondary flex-shrink-0"}),n.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-[200px]",children:[n.jsx("span",{className:"truncate font-medium text-text-primary",children:(r==null?void 0:r.name)??"Select project"}),r&&n.jsx(Y,{status:r.configStatus})]}),n.jsx(Pn,{size:16,className:["text-text-muted flex-shrink-0 transition-transform",f?"rotate-180":""].join(" ")})]}),f&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{role:"listbox","aria-label":"Projects",className:"hidden sm:block absolute right-0 top-full mt-1 z-50 w-80 max-h-96 overflow-hidden rounded-xl bg-surface-1 border border-border shadow-xl",children:[n.jsx("div",{ref:k,className:"max-h-64 overflow-y-auto py-1",children:a.map((C,I)=>{const D=(r==null?void 0:r.id)===C.id,F=C.id===l,R=p===I;return n.jsxs("button",{"data-project-item":!0,role:"option","aria-selected":D,onClick:()=>{u(C.id),m(!1),g(-1)},className:["w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",R||D?"bg-surface-2":"hover:bg-surface-2"].join(" "),children:[n.jsx("span",{className:"w-5 flex-shrink-0",children:D&&n.jsx(bn,{size:16,className:"text-accent"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:C.name}),F&&n.jsx(Hl,{size:12,className:"text-accent flex-shrink-0"})]}),n.jsx("p",{className:"text-xs text-text-muted truncate mt-0.5",children:C.path})]}),n.jsx(Y,{status:C.configStatus})]},C.id)})}),n.jsx("div",{className:"border-t border-border"}),n.jsxs("div",{className:"p-1",children:[n.jsxs("button",{onClick:Z,className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-text-secondary hover:bg-surface-2 hover:text-text-primary transition-colors",children:[n.jsx(Cs,{size:16}),n.jsx("span",{children:"Add Project"})]}),n.jsxs("button",{onClick:M,disabled:b,className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-text-secondary hover:bg-surface-2 hover:text-text-primary transition-colors disabled:opacity-50",children:[n.jsx(rs,{size:16,className:b?"animate-spin":""}),n.jsx("span",{children:"Refresh"})]})]})]}),n.jsx("div",{className:"sm:hidden fixed inset-0 z-50 bg-surface-0/95 backdrop-blur-sm",children:n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Select Project"}),n.jsx("button",{onClick:()=>m(!1),className:"p-2 rounded-lg hover:bg-surface-2 text-text-secondary",children:n.jsx(Or,{size:20})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:a.map(C=>{const I=(r==null?void 0:r.id)===C.id,D=C.id===l;return n.jsxs("button",{onClick:()=>{u(C.id),m(!1)},className:["w-full flex items-center gap-3 px-4 py-3 text-left transition-colors",I?"bg-accent/10":"hover:bg-surface-2"].join(" "),children:[n.jsx("span",{className:"w-6 flex-shrink-0",children:I&&n.jsx(bn,{size:18,className:"text-accent"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-base font-medium text-text-primary truncate",children:C.name}),D&&n.jsx(Hl,{size:14,className:"text-accent flex-shrink-0"})]}),n.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:C.path})]}),n.jsx(Y,{status:C.configStatus})]},C.id)})}),n.jsxs("div",{className:"border-t border-border p-3 space-y-2",children:[n.jsxs("button",{onClick:Z,className:"w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg bg-surface-2 text-text-primary font-medium transition-colors hover:bg-surface-3",children:[n.jsx(Cs,{size:18}),n.jsx("span",{children:"Add Project"})]}),n.jsxs("button",{onClick:M,disabled:b,className:"w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg bg-surface-2 text-text-secondary transition-colors hover:bg-surface-3 disabled:opacity-50",children:[n.jsx(rs,{size:18,className:b?"animate-spin":""}),n.jsx("span",{children:"Refresh"})]})]})]})})]}),n.jsx(hv,{isOpen:v,onClose:()=>w(!1),onSuccess:()=>{d(),w(!1)}})]})}function sC(e,a){if(!e)return{status:"no_project",dotClass:"bg-gray-400",text:"No project selected",subtitle:"Select or register a project to get started",link:{to:"/projects",label:"Projects"}};if(!e.hooksInstalled)return{status:"not_installed",dotClass:"bg-red-400",text:"Hooks not installed",subtitle:"Guardian hooks are not installed for this project",link:{to:"/setup",label:"Setup"}};if(e.configStatus==="none")return{status:"unconfigured",dotClass:"bg-amber-400",text:"Rules not configured",subtitle:"Hooks are installed but no rules are defined",link:{to:"/setup",label:"Setup"}};if(a&&a.phase!=="ended"){const r=Date.now()-new Date(a.startedAt).getTime(),l=r<6e4?"just started":r<36e5?`${Math.floor(r/6e4)}m ago`:`${Math.floor(r/36e5)}h ago`,o=a.branch?` on ${a.branch}`:"";return{status:"active",dotClass:"bg-emerald-400 animate-pulse shadow-[0_0_8px_rgba(52,211,153,0.5)]",text:"Guardian is active",subtitle:`Session started ${l}${o}`,link:{to:"/session",label:"Session"}}}return{status:"watching",dotClass:"bg-blue-400",text:"Guardian is watching",subtitle:"Waiting for a coding session to start"}}function aC(e,a,r,l){const o=[];return e&&e.consecutiveBlocks>=3&&o.push({id:"consecutive-blocks",variant:"warning",title:`${e.consecutiveBlocks} consecutive actions blocked`,description:"Guardian is repeatedly blocking actions — review your rules",link:{to:"/rules",label:"Review Rules"}}),e!=null&&e.testsRun&&e.testsPassed===!1&&o.push({id:"tests-failing",variant:"warning",title:"Tests are failing",description:"Test suite reported failures in the current session"}),e!=null&&e.buildRun&&e.buildPassed===!1&&o.push({id:"build-failing",variant:"warning",title:"Build is failing",description:"Build reported failures in the current session"}),l==="none"&&o.push({id:"no-config",variant:"info",title:"No rules configured",description:"Set up rules to start protecting your project",link:{to:"/setup",label:"Setup"}}),r&&!r.exists&&o.push({id:"no-history",variant:"info",title:"History not initialized",description:"Enable shadow branch history to track coding sessions",link:{to:"/history",label:"History"}}),a&&a.length>0&&a.every(u=>!u.enabled)&&o.push({id:"all-disabled",variant:"warning",title:"All rules are disabled",description:"No rules are currently enforcing — Guardian is effectively passive",link:{to:"/rules",label:"Enable Rules"}}),o}const rC={PreToolUse:"bg-blue-400",PostToolUse:"bg-emerald-400",PermissionRequest:"bg-amber-400",Notification:"bg-violet-400",Stop:"bg-orange-400",SessionStart:"bg-cyan-400",SessionEnd:"bg-gray-400"};function iC(e){const a=[];if(e.toolName&&a.push(`tool: ${e.toolName}`),e.filePath&&a.push(e.filePath),e.command){const r=e.command.length>50?e.command.slice(0,47)+"...":e.command;a.push(r)}return e.ruleName&&a.push(`rule: ${e.ruleName}`),a.length===0&&e.message&&a.push(e.message),a.join(" | ")}function lC(e){const a=Date.now()-new Date(e).getTime();if(a<0)return"just now";const r=Math.floor(a/1e3);if(r<60)return`${r}s ago`;const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Ec(e){return`${e.ts}-${e.event}-${e.hookEvent}`}const oC={success:"bg-emerald-500/15 text-emerald-400",warning:"bg-amber-500/15 text-amber-400",error:"bg-red-500/15 text-red-400",neutral:"bg-surface-3 text-text-muted",info:"bg-blue-500/15 text-blue-400"};function cC({info:e}){return n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-5 flex items-center gap-4",children:[n.jsx("div",{className:`w-4 h-4 rounded-full shrink-0 ${e.dotClass}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:e.text}),n.jsx("p",{className:"text-sm text-text-secondary truncate",children:e.subtitle})]}),e.link&&n.jsxs(_s,{to:e.link.to,className:"shrink-0 text-sm text-accent hover:text-accent/80 transition-colors flex items-center gap-1",children:[e.link.label," ",n.jsx(X0,{size:14})]})]})}function uC({item:e}){const a=e.variant==="warning";return n.jsxs("div",{className:`flex items-center gap-3 rounded-lg px-4 py-3 ${a?"bg-amber-500/10 border border-amber-500/20":"bg-blue-500/10 border border-blue-500/20"}`,children:[a?n.jsx(It,{size:16,className:"text-amber-400 shrink-0"}):n.jsx(ak,{size:16,className:"text-blue-400 shrink-0"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:`text-sm font-medium ${a?"text-amber-300":"text-blue-300"}`,children:e.title}),n.jsx("span",{className:"text-xs text-text-muted ml-2",children:e.description})]}),e.link&&n.jsxs(_s,{to:e.link.to,className:`shrink-0 text-xs font-medium ${a?"text-amber-400 hover:text-amber-300":"text-blue-400 hover:text-blue-300"} transition-colors`,children:[e.link.label," →"]})]})}function Ja({to:e,icon:a,iconColor:r,label:l,loading:o,status:u,primary:d,secondary:f,breakdown:m,badges:p}){return n.jsxs(_s,{to:e,className:"bg-surface-1 border border-border rounded-lg p-4 hover:border-accent/30 transition-colors group flex flex-col gap-2.5 min-h-[120px]",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx(a,{size:18,className:`${r} shrink-0`,"aria-hidden":!0}),n.jsx("span",{className:"text-sm font-semibold text-text-primary flex-1 truncate",children:l}),n.jsx(X0,{size:14,className:"text-text-muted group-hover:text-accent transition-colors shrink-0"})]}),o?n.jsx("div",{className:"h-5 w-20 rounded-full bg-surface-3 animate-pulse","aria-busy":"true"}):u?n.jsxs("span",{className:`inline-flex items-center self-start gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium ${oC[u.variant]}`,children:[u.pulse&&n.jsx("span",{className:`w-1.5 h-1.5 rounded-full animate-pulse ${u.variant==="success"?"bg-emerald-400":u.variant==="info"?"bg-blue-400":"bg-current"}`}),u.text]}):null,o?n.jsxs("div",{className:"flex gap-4 mt-auto",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-surface-3 animate-pulse"}),n.jsx("div",{className:"h-4 w-12 rounded bg-surface-3 animate-pulse"})]}):d||f?n.jsxs("div",{className:"flex items-baseline gap-4 mt-auto",children:[d&&n.jsxs("div",{children:[n.jsx("span",{className:"text-lg font-semibold text-text-primary",children:d.value}),n.jsx("span",{className:"text-xs text-text-muted ml-1",children:d.label})]}),f&&n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-text-secondary",children:f.value}),n.jsx("span",{className:"text-xs text-text-muted ml-1",children:f.label})]})]}):null,m&&m.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-surface-3",children:m.map(g=>{const b=m.reduce((N,v)=>N+v.count,0);return n.jsx("div",{className:g.color,style:{width:`${g.count/b*100}%`}},g.label)})}),n.jsx("div",{className:"flex flex-wrap gap-x-2.5 gap-y-0.5 mt-1.5",children:m.map(g=>n.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${g.color}`}),g.label," (",g.count,")"]},g.label))})]}),p&&p.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1",children:p.map(g=>n.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${g.className??"bg-surface-3 text-text-muted"}`,children:g.text},g.text))})]})}function dC(){const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,isLoading:l}=Et(a?["rules",a]:"rules",()=>Ym(a)),{data:o,mutate:u}=Et(a?["session",a]:"session",()=>M0(a),{refreshInterval:5e3}),{data:d,mutate:f}=Et(a?["events",a]:"events",()=>O0(a),{refreshInterval:5e3}),{data:m}=Et(a?["historyStatus",a]:"historyStatus",()=>Pl(a).catch(()=>null)),{data:p}=Et(a?["responses",a]:"responses",()=>mm(a).catch(()=>null)),{data:g,isLoading:b}=Et(a?["codemapStatus",a]:"codemapStatus",()=>Qm(a).catch(()=>null)),{data:N,isLoading:v}=Et(a?["memoryStatus",a]:"memoryStatus",()=>$0(a).catch(()=>null)),{data:w,isLoading:j}=Et("reviewSessions",()=>Tr().catch(()=>[])),{data:S}=Et("reviewConfig",()=>Zm().catch(()=>null)),{data:k,isLoading:_}=Et(a?["skills",a]:"skills",()=>Vm(a).catch(()=>[])),[M,Z]=y.useState([]),Y=y.useRef(new Set),[C,I]=y.useState(!1),D=y.useRef(null),F=y.useCallback(V=>{const re=Ec(V);Y.current.has(re)||(Y.current.add(re),Z(xe=>[V,...xe]))},[]),R=y.useCallback(()=>{u()},[u]),z=y.useCallback(()=>{f(),u()},[f,u]);y.useEffect(()=>{if(d)for(const V of d)Y.current.add(Ec(V))},[d]),y.useEffect(()=>{Z([]),Y.current.clear()},[a]),y.useEffect(()=>{const V=new pv(void 0,a??void 0);D.current=V;const re=V.onEvent(F),xe=V.onSessionUpdate(R),je=V.onReconnect(z);V.connect();const Be=setInterval(()=>{I(V.isConnected)},1e3);return()=>{clearInterval(Be),re(),xe(),je(),V.disconnect()}},[F,R,z,a]);const P=y.useMemo(()=>{const V=[],re=new Set;for(const xe of M){const je=Ec(xe);re.has(je)||(re.add(je),V.push(xe))}if(d)for(const xe of d){const je=Ec(xe);re.has(je)||(re.add(je),V.push(xe))}return V.sort((xe,je)=>new Date(je.ts).getTime()-new Date(xe.ts).getTime()),V.slice(0,15)},[d,M]),q=sC(e,o??null),$=aC(o??null,r,m??null,e==null?void 0:e.configStatus),U=(r==null?void 0:r.length)??0,B=(r==null?void 0:r.filter(V=>V.enabled).length)??0,Q=o!=null&&o.phase!=="ended",ee=y.useMemo(()=>{if(!r||r.length===0)return[];const V={precondition:0,postcondition:0,permission:0,pipeline:0};for(const re of r)re.type in V&&V[re.type]++;return[{label:"Pre",count:V.precondition,color:"bg-blue-400"},{label:"Post",count:V.postcondition,color:"bg-amber-400"},{label:"Perm",count:V.permission,color:"bg-violet-400"},{label:"Pipe",count:V.pipeline,color:"bg-cyan-400"}].filter(re=>re.count>0)},[r]),ie=y.useMemo(()=>!Q||!o?[]:[{label:"Tests",done:o.testsRun,passed:o.testsPassed},{label:"Lint",done:o.lintRun,passed:o.lintPassed},{label:"Build",done:o.buildRun,passed:o.buildPassed}].filter(re=>re.done).map(re=>({text:re.label,className:re.passed===!1?"bg-red-500/15 text-red-400":"bg-emerald-500/15 text-emerald-400"})),[Q,o]),T=["permission_prompt","idle_prompt","task_complete","task_failed","rule_blocked","repeated_failures","rapid_permission_requests","sensitive_path_access"],L=y.useMemo(()=>{if(!p)return null;let V=0;const re=new Set;for(const xe of T){const je=p[xe];if(je&&(V++,je.notify))for(const Be of je.notify)re.add(Be.type)}return{configuredCount:V,totalCount:T.length,channels:[...re]}},[p]),G=y.useMemo(()=>w?w.filter(V=>V.status==="pending"||V.status==="active").length:0,[w]),O=y.useMemo(()=>{if(!S)return null;const V=[];return S.plan_review&&V.push("plan"),S.code_review&&V.push("code"),V.length>0?V.join(" + "):"none"},[S]),H=y.useMemo(()=>{if(!k)return null;const V=k.filter(je=>je.source==="bundled").length,re=k.filter(je=>je.source==="project").length,xe=k.filter(je=>je.source==="global").length;return{total:k.length,bundled:V,project:re,global:xe}},[k]);return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(sv,{size:22,className:"text-accent"})}),n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Dashboard"})]}),n.jsx(ls,{})]}),n.jsx(cC,{info:q}),$.length>0&&n.jsx("div",{className:"mt-4 space-y-2",children:$.map(V=>n.jsx(uC,{item:V},V.id))}),n.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-5 gap-6",children:[n.jsx("div",{className:"lg:col-span-3",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[n.jsx(Ja,{to:"/rules",icon:Yc,iconColor:"text-cyan-400",label:"Guards",loading:l&&!r,status:r?{text:`${B}/${U} active`,variant:B>0?"success":"neutral"}:void 0,primary:r?{value:B,label:"enabled"}:void 0,secondary:r?{value:U,label:"total"}:void 0,breakdown:ee}),n.jsx(Ja,{to:"/session",icon:tr,iconColor:"text-emerald-400",label:"Session",status:Q?{text:o.phase==="active_committed"?"Committed":"Active",variant:"success",pulse:!0}:(o==null?void 0:o.phase)==="ended"?{text:"Ended",variant:"neutral"}:{text:"Idle",variant:"info"},primary:Q?{value:o.rulesEnforced,label:"enforced"}:void 0,secondary:Q?{value:o.actionsBlocked,label:"blocked"}:void 0,badges:ie}),n.jsx(Ja,{to:"/review/queue",icon:ou,iconColor:"text-violet-400",label:"Review",loading:j&&!w,status:S?{text:S.enabled?"Enabled":"Disabled",variant:S.enabled?"success":"neutral"}:void 0,primary:w?{value:G,label:"pending"}:void 0,secondary:O?{value:O,label:"reviews"}:void 0}),n.jsx(Ja,{to:"/codemap",icon:Dr,iconColor:"text-teal-400",label:"CodeMap",loading:b&&!g,status:g?g.initialized?g.mode==="indexing"?{text:"Indexing",variant:"info",pulse:!0}:{text:"Ready",variant:"success"}:{text:"Not initialized",variant:"neutral"}:void 0,primary:g!=null&&g.initialized?{value:g.totalFiles,label:"files"}:void 0,secondary:g!=null&&g.initialized?{value:g.totalChunks,label:"chunks"}:void 0,badges:g!=null&&g.initialized&&g.staleFiles>0?[{text:`${g.staleFiles} stale`,className:"bg-amber-500/15 text-amber-400"}]:void 0}),n.jsx(Ja,{to:"/memory",icon:Rr,iconColor:"text-rose-400",label:"Memory",loading:v&&!N,status:N?N.initialized?{text:"Active",variant:"success"}:{text:"Not initialized",variant:"neutral"}:void 0,primary:N!=null&&N.initialized?{value:N.stats.totalMemories,label:"memories"}:void 0,secondary:N!=null&&N.initialized?{value:N.stats.sessionsCaptured,label:"sessions"}:void 0}),n.jsx(Ja,{to:"/history",icon:$n,iconColor:"text-violet-400",label:"History",status:m?m.exists?{text:"Initialized",variant:"success"}:{text:"Not initialized",variant:"neutral"}:void 0,primary:m!=null&&m.exists?{value:m.totalEntries,label:"entries"}:void 0}),n.jsx(Ja,{to:"/skills",icon:En,iconColor:"text-amber-400",label:"Skills",loading:_&&!k,status:{text:"Available",variant:"neutral"},primary:H?{value:H.total,label:"skills"}:void 0,badges:H?[...H.bundled>0?[{text:`${H.bundled} bundled`}]:[],...H.project>0?[{text:`${H.project} project`}]:[],...H.global>0?[{text:`${H.global} global`}]:[]]:void 0}),n.jsx(Ja,{to:"/responses",icon:Kc,iconColor:"text-amber-400",label:"Responses",status:L?{text:`${L.configuredCount}/${L.totalCount} configured`,variant:L.configuredCount>0?"success":"neutral"}:void 0,primary:L?{value:L.configuredCount,label:"events"}:void 0,badges:L&&L.channels.length>0?L.channels.map(V=>({text:V})):void 0})]})}),n.jsx("div",{className:"lg:col-span-2",children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl overflow-hidden h-full flex flex-col",children:[n.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(tr,{size:14,className:"text-text-muted"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Activity"}),n.jsx("div",{className:`w-2 h-2 rounded-full ${C?"bg-emerald-400":"bg-surface-3"}`})]}),n.jsx(_s,{to:"/session",className:"text-xs text-accent hover:text-accent/80 transition-colors",children:"View All →"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:P.length===0?n.jsx("div",{className:"flex items-center justify-center py-12 text-text-muted text-sm",children:"No events yet"}):n.jsx("div",{className:"divide-y divide-border-subtle",children:P.map(V=>{const re=rC[V.hookEvent]??"bg-surface-3",xe=iC(V),je=V.hookEvent==="PermissionRequest"?"Perm":V.hookEvent==="PreToolUse"?"Pre":V.hookEvent==="PostToolUse"?"Post":V.hookEvent==="SessionStart"?"Start":V.hookEvent==="SessionEnd"?"End":V.hookEvent;return n.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 text-xs",children:[n.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${re}`}),n.jsx("span",{className:"text-text-muted w-10 shrink-0 font-medium",children:je}),n.jsx("span",{className:"text-text-secondary font-mono truncate flex-1 min-w-0",children:xe||V.event.replace(/_/g," ")}),n.jsx("span",{className:"text-text-muted/60 shrink-0",children:lC(V.ts)})]},`${V.ts}-${V.event}-${V.toolName??""}`)})})})]})})]}),l&&!r&&n.jsxs("div",{className:"flex items-center justify-center py-8 mt-4",children:[n.jsx(Je,{size:20,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-2 text-sm text-text-secondary",children:"Loading dashboard..."})]})]})}const fC={high:"bg-emerald-500/15 text-emerald-400",medium:"bg-amber-500/15 text-amber-400",low:"bg-red-500/15 text-red-400"},mC=[{key:"runtime",label:"Runtime",icon:Kk},{key:"language",label:"Language",icon:NS},{key:"framework",label:"Framework",icon:nv},{key:"packageManager",label:"Package Manager",icon:jk},{key:"formatter",label:"Formatter",icon:kk},{key:"linter",label:"Linter",icon:av},{key:"testRunner",label:"Test Runner",icon:r_},{key:"orm",label:"ORM",icon:ep},{key:"gitWorkflow",label:"Git Workflow",icon:$n}];function pC({label:e,item:a,Icon:r}){return n.jsxs("div",{className:"bg-surface-1 border border-border rounded-lg p-3 flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-surface-2",children:n.jsx(r,{size:18,className:a?"text-accent":"text-text-muted"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:e}),a?n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:a.name}),n.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium ${fC[a.confidence]}`,children:a.confidence})]}):n.jsx("div",{className:"text-sm text-text-muted mt-0.5",children:"Not detected"})]})]})}function hC({stack:e}){return n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:mC.map(a=>{const r=e[a.key];return a.key==="features"?null:n.jsx(pC,{label:a.label,item:r,Icon:a.icon},a.key)})})}const xC=["universal","runtime","language","framework","package-manager","formatter","linter","test-runner","orm","git-workflow","deployment"],gC={universal:"Universal",runtime:"Runtime",language:"Language",framework:"Framework","package-manager":"Package Manager",formatter:"Formatter",linter:"Linter","test-runner":"Test Runner",orm:"ORM","git-workflow":"Git Workflow",deployment:"Deployment"};function bC(){var R;const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,isLoading:l,error:o}=Et(a?["stack",a]:"stack",()=>r2(a)),{data:u,isLoading:d}=Et(a?["templates",a]:"templates",()=>s2(a)),[f,m]=y.useState("detected"),[p,g]=y.useState(null),[b,N]=y.useState(new Set),[v,w]=y.useState(null),[j,S]=y.useState(null),[k,_]=y.useState(!1),M=y.useRef(null),Z=l||d,Y=Z?"loading":f,C=(e==null?void 0:e.configStatus)==="configured"&&!k;y.useEffect(()=>{async function z(){try{const P=await Nb(a);P.status==="generating"?(m("generating"),w(null),M.current||(M.current=window.setInterval(async()=>{const q=await Nb(a);q.status==="done"?(m("done"),S({input:0,output:0}),M.current&&(clearInterval(M.current),M.current=null)):q.status==="error"&&(m("detected"),w(q.error??"Generation failed"),M.current&&(clearInterval(M.current),M.current=null))},2e3))):P.status==="done"?(m("done"),S({input:0,output:0})):P.status==="error"&&(m("detected"),w(P.error??"Generation failed"))}catch(P){console.error("Failed to check generation status:",P)}}return z(),()=>{M.current&&(clearInterval(M.current),M.current=null)}},[a]),y.useEffect(()=>{var q,$,U,B,Q,ee,ie,T,L;if(!r||!u)return;const z=new Set;z.add("quality-of-life");const P=[(q=r.runtime)==null?void 0:q.id,($=r.language)==null?void 0:$.id,(U=r.framework)==null?void 0:U.id,(B=r.packageManager)==null?void 0:B.id,(Q=r.formatter)==null?void 0:Q.id,(ee=r.linter)==null?void 0:ee.id,(ie=r.testRunner)==null?void 0:ie.id,(T=r.orm)==null?void 0:T.id,(L=r.gitWorkflow)==null?void 0:L.id].filter(Boolean);for(const G of P)z.add(G);N(z)},[r,u]);const I=y.useMemo(()=>{if(!u)return[];const z=[...u.bundled,...u.user],P=new Map;for(const q of z){const $=q.category??"universal";P.has($)||P.set($,[]),P.get($).push(q)}return xC.filter(q=>P.has(q)).map(q=>({category:q,label:gC[q]??q,templates:P.get(q)}))},[u]);function D(z){N(P=>{const q=new Set(P);return q.has(z)?q.delete(z):q.add(z),q})}async function F(){m("initializing"),g(null);try{await i2({templateIds:Array.from(b)},a),m("done")}catch(z){g(z instanceof Error?z.message:"Initialization failed"),m("detected")}}return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(zl,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Project Setup"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:e?`Configure ${e.name}`:"Detect your project stack and initialize hooks"})]})]}),n.jsx(ls,{})]}),Y==="loading"&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Detecting project stack..."})]}),o&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-400 text-sm",children:["Failed to detect stack: ",o.message??"Unknown error"]}),!Z&&C&&Y==="detected"&&n.jsxs("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-6",children:[n.jsx(Mr,{size:40,className:"text-blue-400 mx-auto mb-3"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary text-center",children:"Rules Already Configured"}),n.jsx("p",{className:"text-sm text-text-secondary mt-2 text-center",children:"This project already has a rules configuration file."}),n.jsxs("div",{className:"mt-6 space-y-3",children:[n.jsx("a",{href:`/rules${a?`?project=${a}`:""}`,className:"block w-full text-center px-6 py-3 rounded-lg bg-accent text-white font-medium hover:bg-accent-hover transition-colors",children:"View & Edit Rules"}),n.jsx("button",{onClick:()=>{confirm("This will overwrite your existing guards.yml file. Continue?")&&_(!0)},className:"block w-full text-center px-6 py-3 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-primary font-medium transition-colors",children:"Regenerate Rules (Overwrite)"}),n.jsx("a",{href:`/${a?`?project=${a}`:""}`,className:"block w-full text-center px-6 py-3 rounded-lg border border-border hover:bg-surface-2 text-text-secondary font-medium transition-colors",children:"Go to Dashboard"})]})]}),Y==="done"&&n.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg p-6 text-center",children:[n.jsx(Mr,{size:40,className:"text-emerald-400 mx-auto mb-3"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Setup Complete"}),n.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Your project hooks have been initialized successfully."}),j&&n.jsxs("div",{className:"mt-3 text-xs text-text-muted",children:["AI Generation: ",j.input.toLocaleString()," input tokens, ",j.output.toLocaleString()," output tokens"]}),n.jsxs("a",{href:"/",className:"inline-flex items-center gap-1 mt-4 text-sm text-accent hover:text-accent/80 transition-colors",children:["Go to Dashboard ",n.jsx(wa,{size:14})]})]}),Y==="generating"&&n.jsxs("div",{className:"bg-purple-500/10 border border-purple-500/30 rounded-lg p-6 text-center",children:[n.jsx(Je,{size:40,className:"text-purple-400 mx-auto mb-3 animate-spin"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"AI Analysis in Progress"}),n.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Deep codebase analysis is running. This typically takes 5-10 minutes..."}),n.jsx("div",{className:"mt-4 text-xs text-text-muted",children:"Please wait while AI generates comprehensive, project-specific rules."})]}),(Y==="detected"||Y==="initializing")&&!C&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-surface-1 border border-border rounded-lg p-4",children:[n.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(zl,{size:18,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Quick Setup"}),n.jsx("p",{className:"text-xs text-text-secondary font-medium mt-0.5",children:"Template-Based"})]})]}),n.jsx("p",{className:"text-sm text-text-secondary",children:"Select from pre-built templates matched to your detected stack. Fast and simple."}),n.jsxs("ul",{className:"mt-3 space-y-1 text-xs text-text-secondary",children:[n.jsx("li",{children:"✓ Instant generation (<1 second)"}),n.jsx("li",{children:"✓ Choose from 28 templates"}),n.jsx("li",{children:"✓ Good for getting started"})]})]}),n.jsxs("div",{className:"bg-surface-1 border border-border rounded-lg p-4",children:[n.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[n.jsx("div",{className:"p-2 rounded-lg bg-purple-500/15",children:n.jsx(En,{size:18,className:"text-purple-400"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"AI-Powered Generation"}),n.jsx("p",{className:"text-xs text-purple-400 font-medium mt-0.5",children:"Comprehensive Analysis"})]})]}),n.jsx("p",{className:"text-sm text-text-secondary",children:"Deep codebase analysis with comprehensive, project-specific rules tailored to your architecture."}),n.jsxs("ul",{className:"mt-3 space-y-1 text-xs text-text-secondary",children:[n.jsx("li",{children:"• 5-10 minute analysis"}),n.jsx("li",{children:"• Monorepo-aware"}),n.jsx("li",{children:"• Architecture-specific rules"})]}),n.jsxs("div",{className:"mt-4 p-4 bg-surface-2/50 border border-surface-3 rounded-lg",children:[n.jsx("p",{className:"text-xs font-medium text-text-primary mb-2",children:"To generate with AI, run this in your Claude Code session:"}),n.jsx("code",{className:"block px-3 py-2 bg-surface-1 rounded text-xs text-purple-400 font-mono border border-surface-3",children:"/ulpi-generate-guards"}),n.jsx("p",{className:"text-xs text-text-secondary mt-2",children:'Or type: "generate guards for this project"'})]})]})]}),r&&n.jsxs("section",{className:"mb-8",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary mb-4",children:"Detected Stack"}),n.jsx(hC,{stack:r}),r.features&&r.features.length>0&&n.jsxs("div",{className:"mt-4",children:[n.jsx("h3",{className:"text-sm font-medium text-text-secondary mb-2",children:"Features"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:r.features.map(z=>n.jsx("span",{className:"bg-surface-2 text-text-secondary rounded-full px-3 py-1 text-xs",children:z},z))})]})]}),!r&&!l&&!o&&n.jsx("div",{className:"bg-surface-1 border border-border rounded-lg p-6 mb-8 text-center text-text-muted text-sm",children:"No stack detected. Point to a project directory to get started."}),u&&n.jsxs("section",{className:"mb-8",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Templates"}),n.jsxs("span",{className:"text-xs text-text-muted",children:[b.size," selected"]})]}),n.jsx("p",{className:"text-sm text-text-secondary mb-4",children:"✅ Pre-selected based on your detected stack. Click to toggle any template on/off."}),I.length===0?n.jsx("p",{className:"text-sm text-text-muted",children:"No templates available."}):n.jsx("div",{className:"space-y-4",children:I.map(({category:z,label:P,templates:q})=>n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-text-tertiary uppercase tracking-wider mb-2",children:P}),n.jsx("div",{className:"flex flex-wrap gap-2",children:q.map($=>{const U=b.has($.id);return n.jsxs("button",{type:"button",onClick:()=>D($.id),className:`inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium border transition-colors cursor-pointer ${U?"bg-accent/15 text-accent border-accent/30":"bg-surface-2 text-text-secondary border-border hover:border-accent/30"}`,children:[U&&n.jsx(bn,{size:12}),$.name]},$.id)})})]},z))})]}),p&&n.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 text-red-400 text-sm mb-4",children:p}),v&&n.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 text-red-400 text-sm mb-4",children:v}),n.jsx("div",{className:"border-t border-border pt-6",children:n.jsx("div",{className:"flex items-start gap-4",children:n.jsxs("div",{className:"flex-1",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary mb-1",children:"Ready to Initialize?"}),n.jsxs("p",{className:"text-sm text-text-secondary mb-4",children:["This will generate a ",n.jsx("code",{className:"px-1.5 py-0.5 bg-surface-2 rounded text-xs",children:".ulpi/guards.yml"})," file with the selected templates, configured for your ",((R=r==null?void 0:r.runtime)==null?void 0:R.name)??"project","."]}),n.jsx("button",{type:"button",onClick:F,disabled:Y==="initializing"||b.size===0,className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:Y==="initializing"?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Generating Configuration..."]}):n.jsxs(n.Fragment,{children:[n.jsx(zl,{size:16}),"Initialize Guardian (",b.size," templates)"]})}),b.size===0&&n.jsx("p",{className:"text-xs text-yellow-400 mt-2",children:"Select at least one template to continue"})]})})})]})]})}const yC=[{key:"preconditions",type:"precondition",label:"Preconditions",color:"text-blue-400"},{key:"postconditions",type:"postcondition",label:"Postconditions",color:"text-amber-400"},{key:"permissions",type:"permission",label:"Permissions",color:"text-violet-400"},{key:"pipelines",type:"pipeline",label:"Pipelines",color:"text-cyan-400"}],xv={precondition:"bg-blue-500/15 text-blue-400",postcondition:"bg-amber-500/15 text-amber-400",permission:"bg-violet-500/15 text-violet-400",pipeline:"bg-cyan-500/15 text-cyan-400"},Sr="w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm focus:border-accent focus:outline-none text-text-primary placeholder:text-text-muted";function vC(){Zl();const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,isLoading:l,error:o,mutate:u}=Et(a?["rules",a]:"rules",()=>Ym(a)),[d,f]=y.useState(new Set(["preconditions","postconditions","permissions","pipelines"])),[m,p]=y.useState(null),[g,b]=y.useState(null),[N,v]=y.useState(!1),[w,j]=y.useState(!1),S=y.useCallback(D=>{f(F=>{const R=new Set(F);return R.has(D)?R.delete(D):R.add(D),R})},[]),k=y.useCallback(async(D,F)=>{if(r){const R=r.map(z=>z.id===D?{...z,enabled:F}:z);u(R,!1)}try{await Jj(D,F,a),u()}catch{u()}},[r,u,a]),_=y.useCallback(D=>{const F={ruleId:D.id,ruleType:D.type,file_pattern:D.file_pattern??"",command_pattern:D.command_pattern??"",priority:D.priority};if(D.type==="precondition"){const R=D;F.message=R.message,F.requires_read=R.requires_read}else if(D.type==="postcondition"){const R=D;F.run=R.run,F.timeout=R.timeout,F.block_on_failure=R.block_on_failure}else if(D.type==="permission"){const R=D;F.message=R.message,F.decision=R.decision}p(F)},[]),M=y.useCallback(()=>{p(null)},[]),Z=y.useCallback(async()=>{if(m){v(!0);try{const D={};m.message!==void 0&&(D.message=m.message),m.file_pattern!==void 0&&(D.file_pattern=m.file_pattern||void 0),m.command_pattern!==void 0&&(D.command_pattern=m.command_pattern||void 0),m.priority!==void 0&&(D.priority=m.priority),m.decision!==void 0&&(D.decision=m.decision),m.run!==void 0&&(D.run=m.run),m.timeout!==void 0&&(D.timeout=m.timeout),m.block_on_failure!==void 0&&(D.block_on_failure=m.block_on_failure),m.requires_read!==void 0&&(D.requires_read=m.requires_read),await n2(m.ruleId,D,a),p(null),u()}catch(D){console.error("Failed to update rule:",D)}finally{v(!1)}}},[m,a,u]),Y=y.useCallback(async D=>{j(!0);try{await t2(D,a),b(null),u()}catch(F){console.error("Failed to delete rule:",F)}finally{j(!1)}},[a,u]),C=yC.map(D=>({...D,rules:(r==null?void 0:r.filter(F=>F.type===D.type))??[]})),I=a?`/rules/new?project=${encodeURIComponent(a)}`:"/rules/new";return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(pm,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Rules"}),e&&n.jsxs("p",{className:"text-sm text-text-secondary mt-0.5",children:["Manage rules for ",e.name]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs(_s,{to:I,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors",children:[n.jsx(Cs,{size:16}),"New Rule"]}),n.jsx(ls,{})]})]}),l&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading rules..."})]}),o&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsxs("span",{className:"text-red-400 text-sm",children:["Failed to load rules: ",o.message??"Unknown error"]})]}),!l&&!o&&r&&r.length===0&&n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 text-center",children:[n.jsx(pm,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("p",{className:"text-text-secondary text-sm",children:"No rules configured. Run setup or add a new rule to get started."}),n.jsxs("div",{className:"flex items-center justify-center gap-3 mt-4",children:[n.jsx(_s,{to:"/settings",className:"inline-flex items-center gap-1 text-sm text-accent hover:text-accent/80 transition-colors",children:"Go to Settings"}),n.jsx("span",{className:"text-text-muted",children:"or"}),n.jsxs(_s,{to:I,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors",children:[n.jsx(Cs,{size:14}),"Add Rule"]})]})]}),!l&&!o&&r&&r.length>0&&n.jsx("div",{className:"space-y-4",children:C.map(D=>n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl overflow-hidden",children:[n.jsx("button",{type:"button",onClick:()=>S(D.key),className:"w-full flex items-center justify-between px-5 py-4 hover:bg-surface-2/50 transition-colors",children:n.jsxs("div",{className:"flex items-center gap-3",children:[d.has(D.key)?n.jsx(Pn,{size:18,className:"text-text-muted"}):n.jsx(wa,{size:18,className:"text-text-muted"}),n.jsx("span",{className:`font-semibold ${D.color}`,children:D.label}),n.jsxs("span",{className:"text-sm text-text-muted",children:["(",D.rules.length," rule",D.rules.length!==1?"s":"",")"]})]})}),d.has(D.key)&&D.rules.length>0&&n.jsx("div",{className:"border-t border-border-subtle divide-y divide-border-subtle",children:D.rules.map(F=>n.jsxs("div",{className:"px-5 py-4",children:[(m==null?void 0:m.ruleId)===F.id?n.jsx(wC,{rule:F,editState:m,setEditState:p,onSave:Z,onCancel:M,saving:N}):n.jsx(NC,{rule:F,onToggle:k,onEdit:_,onDelete:()=>b(F.id)}),g===F.id&&n.jsxs("div",{className:"mt-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[n.jsxs("p",{className:"text-sm text-red-400 mb-3",children:['Are you sure you want to delete "',F.id,'"? This cannot be undone.']}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>Y(F.id),disabled:w,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-red-500 text-white text-sm font-medium hover:bg-red-600 transition-colors disabled:opacity-50",children:[w?n.jsx(Je,{size:14,className:"animate-spin"}):n.jsx(sr,{size:14}),"Delete"]}),n.jsx("button",{type:"button",onClick:()=>b(null),className:"px-3 py-1.5 rounded-md text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"})]})]})]},F.id))}),d.has(D.key)&&D.rules.length===0&&n.jsx("div",{className:"px-5 py-6 text-center border-t border-border-subtle",children:n.jsxs("p",{className:"text-sm text-text-muted",children:["No ",D.label.toLowerCase()," configured"]})})]},D.key))})]})}function NC({rule:e,onToggle:a,onEdit:r,onDelete:l}){const o=e.locked;return n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:e.id}),o&&n.jsx(hm,{size:14,className:"text-text-muted"}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${xv[e.type]}`,children:e.trigger}),e.source&&n.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium bg-surface-3 text-text-secondary",children:e.source})]}),n.jsxs("div",{className:"space-y-1.5 text-xs text-text-secondary",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Cr,{size:12,className:"shrink-0"}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-muted",children:"Matcher:"})," ",e.matcher]})]}),e.file_pattern&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(W0,{size:12,className:"shrink-0"}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-muted",children:"File:"})," ",e.file_pattern]})]}),e.command_pattern&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Cr,{size:12,className:"shrink-0"}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-muted",children:"Command:"})," ",e.command_pattern]})]}),e.type==="precondition"&&e.message&&n.jsx("p",{className:"text-text-secondary mt-1.5 line-clamp-2",children:e.message}),e.type==="precondition"&&e.requires_read&&n.jsx("div",{className:"flex items-center gap-1.5 mt-1",children:n.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium bg-blue-500/15 text-blue-400",children:"Requires Read"})}),e.type==="postcondition"&&n.jsxs("div",{className:"space-y-1 mt-1.5",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Cr,{size:12,className:"shrink-0"}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-muted",children:"Run:"})," ",e.run]})]}),e.timeout&&n.jsxs("span",{className:"text-text-muted text-xs",children:["Timeout: ",e.timeout,"ms"]}),e.block_on_failure&&n.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium bg-red-500/15 text-red-400",children:"Blocks on failure"})]}),e.type==="permission"&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${e.decision==="allow"?"bg-emerald-500/15 text-emerald-400":e.decision==="deny"?"bg-red-500/15 text-red-400":"bg-amber-500/15 text-amber-400"}`,children:e.decision==="ask_user"?"Ask User":e.decision}),e.message&&n.jsx("span",{className:"text-text-muted truncate",children:e.message})]}),e.priority!==void 0&&n.jsxs("div",{className:"text-text-muted",children:["Priority: ",e.priority]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o&&n.jsx("div",{className:"p-1.5 text-text-muted",title:"Originally a locked rule",children:n.jsx(hm,{size:14})}),n.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,"aria-label":`${e.enabled?"Disable":"Enable"} ${e.id}`,onClick:()=>a(e.id,!e.enabled),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${e.enabled?"bg-accent":"bg-surface-3"}`,children:n.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${e.enabled?"translate-x-4":"translate-x-0"}`})}),n.jsx("button",{type:"button",onClick:()=>r(e),className:"p-1.5 rounded-lg hover:bg-surface-3 text-text-secondary hover:text-accent transition-colors",title:"Edit rule",children:n.jsx(cu,{size:14})}),n.jsx("button",{type:"button",onClick:l,className:"p-1.5 rounded-lg hover:bg-surface-3 text-text-secondary hover:text-red-400 transition-colors",title:"Delete rule",children:n.jsx(sr,{size:14})})]})]})}function wC({rule:e,editState:a,setEditState:r,onSave:l,onCancel:o,saving:u}){const d=(f,m)=>{r(p=>p?{...p,[f]:m}:null)};return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("h3",{className:"text-sm font-semibold text-text-primary",children:["Editing: ",e.id]}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${xv[e.type]}`,children:e.type})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(e.type==="precondition"||e.type==="permission")&&n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Message"}),n.jsx("textarea",{value:a.message??"",onChange:f=>d("message",f.target.value),rows:2,className:Sr+" resize-none",placeholder:"Enter message..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"File Pattern"}),n.jsx("input",{type:"text",value:a.file_pattern??"",onChange:f=>d("file_pattern",f.target.value),className:Sr,placeholder:"e.g., src/**/*.ts"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Command Pattern"}),n.jsx("input",{type:"text",value:a.command_pattern??"",onChange:f=>d("command_pattern",f.target.value),className:Sr,placeholder:"e.g., pnpm|yarn (pipe-separated)"})]}),a.ruleType==="postcondition"&&n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Run Command"}),n.jsx("input",{type:"text",value:a.run??"",onChange:f=>d("run",f.target.value),className:Sr,placeholder:"e.g., npm test, npx tsc --noEmit"})]}),a.ruleType==="postcondition"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Timeout (ms)"}),n.jsx("input",{type:"number",value:a.timeout??3e4,onChange:f=>d("timeout",parseInt(f.target.value)||3e4),className:Sr,placeholder:"30000"})]}),a.ruleType==="postcondition"&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",id:"block-on-failure",checked:a.block_on_failure??!1,onChange:f=>d("block_on_failure",f.target.checked),className:"w-4 h-4 rounded border-border bg-surface-2 text-accent focus:ring-accent focus:ring-offset-0"}),n.jsx("label",{htmlFor:"block-on-failure",className:"text-sm text-text-primary cursor-pointer",children:"Block on failure"})]}),a.ruleType==="precondition"&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",id:"requires-read",checked:a.requires_read??!1,onChange:f=>d("requires_read",f.target.checked),className:"w-4 h-4 rounded border-border bg-surface-2 text-accent focus:ring-accent focus:ring-offset-0"}),n.jsx("label",{htmlFor:"requires-read",className:"text-sm text-text-primary cursor-pointer",children:"Requires file to be read first"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Priority"}),n.jsx("input",{type:"number",value:a.priority??"",onChange:f=>d("priority",f.target.value?Number(f.target.value):void 0),className:Sr,placeholder:"100"})]}),e.type==="permission"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Decision"}),n.jsxs("select",{value:a.decision??"ask_user",onChange:f=>d("decision",f.target.value),className:Sr,children:[n.jsx("option",{value:"allow",children:"Allow"}),n.jsx("option",{value:"deny",children:"Deny"}),n.jsx("option",{value:"ask_user",children:"Ask User"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx("button",{type:"button",onClick:l,disabled:u,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors disabled:opacity-50",children:u?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:14,className:"animate-spin"}),"Saving..."]}):n.jsxs(n.Fragment,{children:[n.jsx(bn,{size:14}),"Save"]})}),n.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",children:[n.jsx(ln,{size:14}),"Cancel"]})]})]})}function gv({value:e,onChange:a}){const{currentProject:r}=on(),l=r==null?void 0:r.id,{data:o,isLoading:u}=Et(l?["skills",l]:"skills",()=>Vm(l)),[d,f]=y.useState(!1),[m,p]=y.useState(""),g=y.useRef(null),b=o==null?void 0:o.find(v=>v.id===e),N=o==null?void 0:o.filter(v=>v.name.toLowerCase().includes(m.toLowerCase())||v.description.toLowerCase().includes(m.toLowerCase()));return y.useEffect(()=>{function v(w){g.current&&!g.current.contains(w.target)&&f(!1)}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[]),n.jsxs("div",{ref:g,className:"relative",children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Skill (optional)"}),n.jsxs("button",{type:"button",onClick:()=>f(!d),className:"w-full flex items-center justify-between bg-surface-2 border border-border rounded-md px-3 py-2.5 text-sm text-text-primary hover:border-accent/50 transition-colors",children:[n.jsx("span",{className:b?"text-text-primary":"text-text-muted",children:u?"Loading skills...":b?b.name:"Select a skill..."}),n.jsxs("div",{className:"flex items-center gap-1",children:[e&&n.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),a(void 0)},className:"p-0.5 hover:bg-surface-3 rounded",children:n.jsx(ln,{size:14,className:"text-text-muted"})}),n.jsx(Pn,{size:16,className:"text-text-muted"})]})]}),d&&n.jsxs("div",{className:"absolute z-50 mt-1 w-full bg-surface-2 border border-border rounded-lg shadow-xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-subtle",children:[n.jsx(ks,{size:14,className:"text-text-muted shrink-0"}),n.jsx("input",{type:"text",value:m,onChange:v=>p(v.target.value),placeholder:"Search skills...",className:"w-full bg-transparent text-sm text-text-primary placeholder:text-text-muted outline-none",autoFocus:!0})]}),n.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:!N||N.length===0?n.jsx("div",{className:"px-3 py-4 text-sm text-text-muted text-center",children:u?"Loading...":"No skills found"}):N.map(v=>n.jsxs("button",{type:"button",onClick:()=>{a(v.id),f(!1),p("")},className:`w-full text-left px-3 py-2 hover:bg-surface-3 transition-colors ${v.id===e?"bg-accent/10":""}`,children:[n.jsx("div",{className:"text-sm font-medium text-text-primary",children:v.name}),n.jsx("div",{className:"text-xs text-text-muted mt-0.5 line-clamp-1",children:v.description})]},v.id))})]})]})}function EC({steps:e,onChange:a}){function r(u,d){const f=e.map((m,p)=>p===u?{...m,...d}:m);a(f)}function l(u){a(e.filter((d,f)=>f!==u))}function o(){a([...e,{name:"",run:"",timeout:void 0}])}return n.jsxs("div",{className:"space-y-0",children:[e.map((u,d)=>n.jsxs("div",{children:[d>0&&n.jsx("div",{className:"flex justify-center py-1",children:n.jsx("div",{className:"w-px h-6 border-l-2 border-dotted border-border"})}),n.jsxs("div",{className:"bg-surface-2 border border-border rounded-lg p-4 relative group",children:[n.jsx("button",{type:"button",onClick:()=>l(d),className:"absolute top-2 right-2 p-1 rounded hover:bg-surface-3 text-text-muted hover:text-red-400 transition-colors opacity-0 group-hover:opacity-100","aria-label":`Remove step ${d+1}`,children:n.jsx(ln,{size:14})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(JS,{size:14,className:"text-text-muted"}),n.jsxs("span",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:["Step ",d+1]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1",children:"Name"}),n.jsx("input",{type:"text",value:u.name,onChange:f=>r(d,{name:f.target.value}),placeholder:"Step name",className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2.5 text-sm focus:border-accent focus:outline-none text-text-primary placeholder:text-text-muted"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1",children:"Timeout (ms)"}),n.jsx("input",{type:"number",value:u.timeout??"",onChange:f=>r(d,{timeout:f.target.value?Number(f.target.value):void 0}),placeholder:"30000",className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2.5 text-sm focus:border-accent focus:outline-none text-text-primary placeholder:text-text-muted"})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1",children:"Run command"}),n.jsx("input",{type:"text",value:u.run??"",onChange:f=>r(d,{run:f.target.value||void 0}),placeholder:"npm run lint",className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2.5 text-sm font-mono focus:border-accent focus:outline-none text-text-primary placeholder:text-text-muted"})]}),n.jsx("div",{className:"md:col-span-2",children:n.jsx(gv,{value:u.skill,onChange:f=>r(d,{skill:f})})})]})]})]},d)),n.jsx("div",{className:"flex justify-center pt-3",children:e.length>0&&n.jsx("div",{className:"w-px h-4 border-l-2 border-dotted border-border mb-2"})}),n.jsxs("button",{type:"button",onClick:o,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg border border-dashed border-border hover:border-accent text-text-secondary hover:text-accent transition-colors text-sm",children:[n.jsx(Cs,{size:16}),"Add Step"]})]})}const jC=[{key:"precondition",label:"Precondition"},{key:"postcondition",label:"Postcondition"},{key:"permission",label:"Permission"},{key:"pipeline",label:"Pipeline"}],qb=["PreToolUse","PostToolUse","PermissionRequest","Notification","Stop","SubAgentSpawn","TaskStart","TaskComplete"],SC=["testsRun","testsPassed","lintRun","lintPassed","buildRun","buildPassed","formatterRun","branchCreated","planApproved"],xa="w-full bg-surface-2 border border-border rounded-md px-3 py-2.5 text-sm focus:border-accent focus:outline-none text-text-primary placeholder:text-text-muted";function kC(){const e=Rs(),{currentProject:a}=on(),r=a==null?void 0:a.id,[l,o]=y.useState("precondition"),[u,d]=y.useState(qb[0]),[f,m]=y.useState(""),[p,g]=y.useState(""),[b,N]=y.useState(""),[v,w]=y.useState(),[j,S]=y.useState(""),[k,_]=y.useState([]),[M,Z]=y.useState(!1),[Y,C]=y.useState(""),[I,D]=y.useState(),[F,R]=y.useState(!1),[z,P]=y.useState("ask_user"),[q,$]=y.useState(""),[U,B]=y.useState([{name:"",run:""}]),[Q,ee]=y.useState("block"),[ie,T]=y.useState(!1),[L,G]=y.useState(null);function O(V){_(re=>re.includes(V)?re.filter(xe=>xe!==V):[...re,V])}async function H(){if(!f.trim()){G("Matcher is required.");return}T(!0),G(null);const re={id:`${l}-${f.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}`,type:l,trigger:u,matcher:f,enabled:!0,...p&&{file_pattern:p},...b&&{command_pattern:b},...v&&{skill:v}};let xe;switch(l){case"precondition":if(!j.trim()){G("Message is required for precondition rules."),T(!1);return}xe={...re,message:j,requires:k.length>0?k:void 0,requires_read:M||void 0};break;case"postcondition":if(!Y.trim()){G("Run command is required for postcondition rules."),T(!1);return}xe={...re,run:Y,timeout:I??void 0,block_on_failure:F||void 0};break;case"permission":xe={...re,decision:z,message:q||void 0};break;case"pipeline":if(U.length===0||!U.some(je=>je.name.trim())){G("At least one named step is required."),T(!1);return}xe={...re,steps:U.filter(je=>je.name.trim()),on_failure:Q};break;default:xe=re}try{await e2(xe,r),e("/")}catch(je){G(je instanceof Error?je.message:"Failed to create rule")}finally{T(!1)}}return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:()=>e("/"),className:"p-2 rounded-lg hover:bg-surface-2 text-text-secondary hover:text-text-primary transition-colors",children:n.jsx(eo,{size:18})}),n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(dS,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"New Rule"}),a&&n.jsxs("p",{className:"text-sm text-text-secondary mt-0.5",children:["Project: ",a.name]})]})]}),n.jsx(ls,{})]}),n.jsx("div",{className:"flex items-center gap-1 mb-8 bg-surface-1 rounded-lg p-1 inline-flex",children:jC.map(V=>n.jsx("button",{type:"button",onClick:()=>o(V.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${l===V.key?"bg-accent/15 text-accent":"text-text-secondary hover:text-text-primary hover:bg-surface-2"}`,children:V.label},V.key))}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Trigger"}),n.jsx("select",{value:u,onChange:V=>d(V.target.value),className:xa,children:qb.map(V=>n.jsx("option",{value:V,children:V},V))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Matcher"}),n.jsx("input",{type:"text",value:f,onChange:V=>m(V.target.value),placeholder:"e.g., Write, Bash, *.test.ts",className:xa})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"File Pattern (optional)"}),n.jsx("input",{type:"text",value:p,onChange:V=>g(V.target.value),placeholder:"e.g., src/**/*.ts",className:xa})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Command Pattern (optional)"}),n.jsx("input",{type:"text",value:b,onChange:V=>N(V.target.value),placeholder:"e.g., git status|git log|git diff (pipe-separated)",className:xa})]})]}),n.jsx(gv,{value:v,onChange:w}),n.jsx("div",{className:"border-t border-border-subtle"}),l==="precondition"&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Precondition Settings"}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Message"}),n.jsx("textarea",{value:j,onChange:V=>S(V.target.value),placeholder:"Message shown when precondition is not met...",rows:3,className:xa+" resize-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-2",children:"Requires (state flags)"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:SC.map(V=>n.jsxs("label",{className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-md border cursor-pointer text-xs font-medium transition-colors ${k.includes(V)?"bg-accent/15 border-accent/30 text-accent":"bg-surface-2 border-border text-text-secondary hover:border-accent/30"}`,children:[n.jsx("input",{type:"checkbox",checked:k.includes(V),onChange:()=>O(V),className:"sr-only"}),V]},V))})]}),n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[n.jsx("button",{type:"button",role:"switch","aria-checked":M,onClick:()=>Z(!M),className:`relative inline-flex h-5 w-9 shrink-0 rounded-full border-2 border-transparent transition-colors ${M?"bg-accent":"bg-surface-3"}`,children:n.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${M?"translate-x-4":"translate-x-0"}`})}),n.jsx("span",{className:"text-sm text-text-secondary",children:"Requires file read"})]})]}),l==="postcondition"&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Postcondition Settings"}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Run command"}),n.jsx("input",{type:"text",value:Y,onChange:V=>C(V.target.value),placeholder:"e.g., npm run lint, npm test",className:xa+" font-mono"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Timeout (ms)"}),n.jsx("input",{type:"number",value:I??"",onChange:V=>D(V.target.value?Number(V.target.value):void 0),placeholder:"30000",className:xa})]}),n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[n.jsx("button",{type:"button",role:"switch","aria-checked":F,onClick:()=>R(!F),className:`relative inline-flex h-5 w-9 shrink-0 rounded-full border-2 border-transparent transition-colors ${F?"bg-accent":"bg-surface-3"}`,children:n.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${F?"translate-x-4":"translate-x-0"}`})}),n.jsx("span",{className:"text-sm text-text-secondary",children:"Block on failure"})]})]}),l==="permission"&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Permission Settings"}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-2",children:"Decision"}),n.jsx("div",{className:"flex gap-3",children:["allow","deny","ask_user"].map(V=>n.jsxs("label",{className:`inline-flex items-center gap-2 px-4 py-2 rounded-md border cursor-pointer text-sm font-medium transition-colors ${z===V?"bg-accent/15 border-accent/30 text-accent":"bg-surface-2 border-border text-text-secondary hover:border-accent/30"}`,children:[n.jsx("input",{type:"radio",name:"decision",value:V,checked:z===V,onChange:()=>P(V),className:"sr-only"}),V==="ask_user"?"Ask User":V.charAt(0).toUpperCase()+V.slice(1)]},V))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Message (optional)"}),n.jsx("textarea",{value:q,onChange:V=>$(V.target.value),placeholder:"Custom message for permission prompt...",rows:3,className:xa+" resize-none"})]})]}),l==="pipeline"&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Pipeline Settings"}),n.jsx(EC,{steps:U,onChange:B}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"On Failure"}),n.jsxs("select",{value:Q,onChange:V=>ee(V.target.value),className:xa,children:[n.jsx("option",{value:"block",children:"Block"}),n.jsx("option",{value:"warn",children:"Warn"}),n.jsx("option",{value:"continue",children:"Continue"})]})]})]}),L&&n.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 text-red-400 text-sm",children:L}),n.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[n.jsx("button",{type:"button",onClick:H,disabled:ie,className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:ie?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Saving..."]}):"Save Rule"}),n.jsx("button",{type:"button",onClick:()=>e("/"),className:"px-6 py-2.5 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"})]})]})]})}const _C={block:"bg-red-500/15 text-red-400",warn:"bg-amber-500/15 text-amber-400",continue:"bg-emerald-500/15 text-emerald-400"};function CC(){const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,isLoading:l,error:o}=Et(a?["rules",a]:"rules",()=>Ym(a)),u=(r==null?void 0:r.filter(d=>d.type==="pipeline"))??[];return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx($n,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Pipelines"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:e?`Multi-step rule pipelines for ${e.name}`:"Multi-step rule pipelines"})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ls,{}),n.jsxs("a",{href:"/rules/new",className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors",children:[n.jsx(Cs,{size:16}),"Add Pipeline"]})]})]}),l&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading pipelines..."})]}),o&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsxs("span",{className:"text-red-400 text-sm",children:["Failed to load pipelines: ",o.message??"Unknown error"]})]}),!l&&!o&&u.length===0&&n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 text-center",children:[n.jsx($n,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("p",{className:"text-text-secondary text-sm",children:"No pipelines configured yet."}),n.jsx("a",{href:"/rules/new",className:"inline-flex items-center gap-1 mt-3 text-sm text-accent hover:text-accent/80 transition-colors",children:"Create your first pipeline"})]}),n.jsx("div",{className:"space-y-6",children:u.map(d=>n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:d.id}),n.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-text-muted",children:[n.jsxs("span",{children:["Trigger: ",d.trigger]}),n.jsxs("span",{children:["Matcher: ",d.matcher]})]})]}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${d.enabled?"bg-emerald-500/15 text-emerald-400":"bg-surface-3 text-text-muted"}`,children:d.enabled?"Enabled":"Disabled"})]}),n.jsx("div",{className:"pl-4",children:d.steps.map((f,m)=>n.jsxs("div",{children:[m>0&&n.jsx("div",{className:"flex items-center ml-4 py-0.5",children:n.jsx("div",{className:"w-px h-5 border-l-2 border-dotted border-border"})}),n.jsxs("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-3 flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-accent/15 text-accent text-xs font-bold shrink-0",children:m+1}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-text-primary",children:f.name||"Unnamed step"}),n.jsxs("div",{className:"flex items-center gap-3 mt-0.5 text-xs text-text-muted",children:[f.run&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Cr,{size:10})," ",f.run]}),f.skill&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(En,{size:10})," ",f.skill]}),f.timeout&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(lu,{size:10})," ",f.timeout,"ms"]})]})]})]})]},m))}),n.jsx("div",{className:"mt-3 pl-4 flex items-center gap-2",children:n.jsx("div",{className:"w-px h-4 border-l-2 border-dotted border-border ml-4"})}),n.jsxs("div",{className:"pl-4 flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-text-muted",children:"On failure:"}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${_C[d.on_failure]??"bg-surface-3 text-text-secondary"}`,children:d.on_failure})]})]},d.id))})]})}function zf({skill:e}){const[a,r]=y.useState(!1);return n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl overflow-hidden",children:[n.jsx("button",{type:"button",onClick:()=>r(!a),className:"w-full text-left p-4 hover:bg-surface-2/50 transition-colors",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:e.name}),n.jsx("p",{className:"text-xs text-text-secondary mt-1 line-clamp-2",children:e.description}),e.tags.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:e.tags.map(l=>n.jsx("span",{className:"bg-surface-3 text-text-secondary rounded-full px-2.5 py-0.5 text-xs",children:l},l))})]}),n.jsx("div",{className:"shrink-0 mt-0.5 text-text-muted",children:a?n.jsx(Wm,{size:16}):n.jsx(Pn,{size:16})})]})}),a&&n.jsx("div",{className:"border-t border-border-subtle px-4 py-3",children:n.jsxs("div",{className:"space-y-2 text-xs",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-text-muted",children:"ID:"}),n.jsx("span",{className:"text-text-secondary font-mono",children:e.id})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-text-muted",children:"File:"}),n.jsx("span",{className:"text-text-secondary font-mono",children:e.filename})]})]})})]})}function TC(){const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,isLoading:l,error:o}=Et(a?["skills",a]:"skills",()=>Vm(a)),u=(r==null?void 0:r.filter(m=>m.source==="bundled"))??[],d=(r==null?void 0:r.filter(m=>m.source==="project"))??[],f=(r==null?void 0:r.filter(m=>m.source==="global"))??[];return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(En,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Skills"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:e?`Skill definitions available for rules in ${e.name}`:"Browse available skill definitions for rules"})]})]}),n.jsx(ls,{})]}),l&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading skills..."})]}),o&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsxs("span",{className:"text-red-400 text-sm",children:["Failed to load skills: ",o.message??"Unknown error"]})]}),!l&&!o&&r&&n.jsxs(n.Fragment,{children:[u.length>0&&n.jsxs("section",{className:"mb-8",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary mb-4",children:"Bundled Skills"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:u.map(m=>n.jsx(zf,{skill:m},m.id))})]}),d.length>0&&n.jsxs("section",{className:"mb-8",children:[n.jsxs("h2",{className:"text-lg font-semibold text-text-primary mb-4",children:["Project Skills",n.jsx("span",{className:"ml-2 text-sm font-normal text-text-muted",children:"(.claude/skills/)"})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:d.map(m=>n.jsx(zf,{skill:m},m.id))})]}),f.length>0&&n.jsxs("section",{className:"mb-8",children:[n.jsxs("h2",{className:"text-lg font-semibold text-text-primary mb-4",children:["Global Skills",n.jsx("span",{className:"ml-2 text-sm font-normal text-text-muted",children:"(~/.claude/skills/)"})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(m=>n.jsx(zf,{skill:m},m.id))})]}),r.length===0&&n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 text-center",children:[n.jsx(En,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("p",{className:"text-text-secondary text-sm",children:"No skills available."})]})]})]})}const AC={PreToolUse:"bg-blue-500/15 text-blue-400 border-blue-500/30",PostToolUse:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",PermissionRequest:"bg-amber-500/15 text-amber-400 border-amber-500/30",Notification:"bg-violet-500/15 text-violet-400 border-violet-500/30",Stop:"bg-orange-500/15 text-orange-400 border-orange-500/30",SessionStart:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",SessionEnd:"bg-gray-500/15 text-gray-400 border-gray-500/30"},RC={PreToolUse:"bg-blue-400",PostToolUse:"bg-emerald-400",PermissionRequest:"bg-amber-400",Notification:"bg-violet-400",Stop:"bg-orange-400",SessionStart:"bg-cyan-400",SessionEnd:"bg-gray-400"};function MC(e){if(!e)return"just now";const a=new Date(e).getTime();if(Number.isNaN(a))return e;const l=Date.now()-a;if(l<0)return"just now";const o=Math.floor(l/1e3);if(o<60)return`${o}s ago`;const u=Math.floor(o/60);if(u<60)return`${u}m ago`;const d=Math.floor(u/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function OC(e){const a=[];if(e.message&&a.push(e.message),e.toolName&&a.push(`tool: ${e.toolName}`),e.filePath&&a.push(e.filePath),e.command){const r=e.command.length>60?e.command.slice(0,57)+"...":e.command;a.push(r)}return e.ruleName&&a.push(`rule: ${e.ruleName}`),a.join(" | ")}function DC({events:e}){const[a,r]=y.useState(!1),l=e.length===0;return y.useEffect(()=>{if(!l)return;r(!1);const o=setTimeout(()=>r(!0),3e3);return()=>clearTimeout(o)},[l]),e.length===0?a?n.jsx("div",{className:"text-center py-8 text-text-muted text-sm",children:"No events recorded yet."}):n.jsx("div",{className:"text-center py-8 text-text-muted text-sm",children:"Loading events..."}):n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-3 top-3 bottom-3 w-px bg-border"}),n.jsx("div",{className:"space-y-3",children:e.map((o,u)=>{const d=RC[o.hookEvent]??"bg-surface-3",f=AC[o.hookEvent]??"bg-surface-3 text-text-secondary border-border",m=OC(o);return n.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[n.jsx("div",{className:"relative z-10 mt-3.5",children:n.jsx("div",{className:`w-5 h-5 rounded-full ${d} ring-4 ring-surface-0`})}),n.jsxs("div",{className:"flex-1 min-w-0 bg-surface-1 border border-border-subtle rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium border shrink-0 ${f}`,children:o.hookEvent}),n.jsx("span",{className:"text-xs text-text-muted/60 truncate",children:o.event.replace(/_/g," ")})]}),n.jsx("span",{className:"text-xs text-text-muted shrink-0",children:MC(o.ts)})]}),m&&n.jsx("p",{className:"mt-1.5 text-xs text-text-secondary font-mono break-all",children:m})]})]},`${o.ts}-${o.event}-${o.toolName??""}`)})})]})}function Cl({icon:e,label:a,value:r,filterKey:l,activeFilter:o,onFilter:u}){const d=o===l;return n.jsxs("button",{type:"button",onClick:()=>u(d?"all":l),className:`bg-surface-1 border rounded-lg p-3 flex items-center gap-3 w-full text-left transition-colors ${d?"border-accent ring-1 ring-accent/30 bg-accent/5":"border-border hover:bg-surface-2/50 cursor-pointer"}`,children:[n.jsx(e,{size:18,className:d?"text-accent shrink-0":"text-accent/60 shrink-0"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-lg font-semibold text-text-primary",children:r}),n.jsx("div",{className:"text-xs text-text-muted",children:a})]})]})}function bi({label:e,active:a}){return n.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium ${a?"bg-emerald-500/15 text-emerald-400":"bg-surface-3 text-text-muted"}`,children:[a?n.jsx(Mr,{size:12}):n.jsx(Or,{size:12}),e]})}function LC(e){const a=Date.now()-new Date(e).getTime();if(a<0)return"just now";const r=Math.floor(a/1e3);if(r<60)return`${r}s ago`;const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function zC(e){return Date.now()-new Date(e.startedAt).getTime()<7200*1e3}function jc(e){return`${e.ts}-${e.event}-${e.hookEvent}`}function IC({summary:e,isSelected:a,onClick:r}){const l=zC(e),o=e.filesRead>0||e.filesWritten>0||e.commandsRun>0||e.rulesEnforced>0,u=new Date(e.startedAt),d=u.toLocaleDateString(void 0,{month:"short",day:"numeric"}),f=u.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return n.jsxs("button",{type:"button",onClick:r,className:["w-full text-left px-3 py-3 rounded-lg transition-colors",a?"bg-accent/10 border border-accent/30":"hover:bg-surface-2 border border-transparent"].join(" "),children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${l&&o?"bg-emerald-400 shadow-[0_0_4px_rgba(52,211,153,0.5)]":"bg-surface-3"}`}),n.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:e.sessionName||`${d} ${f}`})]}),n.jsx("span",{className:"text-xs text-text-muted shrink-0",children:LC(e.startedAt)})]}),e.sessionName&&n.jsxs("div",{className:"mt-0.5 ml-4 text-[10px] text-text-muted/60",children:[d," ",f]}),n.jsxs("div",{className:"mt-1.5 ml-4 text-xs text-text-muted",children:[e.filesRead,"r / ",e.filesWritten,"w / ",e.commandsRun,"cmd",e.rulesEnforced>0&&` / ${e.rulesEnforced} rules`,e.actionsBlocked>0&&n.jsxs("span",{className:"text-red-400",children:[" / ",e.actionsBlocked," blocked"]})]}),n.jsx("div",{className:"mt-1 ml-4 text-[10px] text-text-muted/60 font-mono truncate",children:e.sessionId.slice(0,8)})]})}function UC(){const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r}=Et("sessions",a2,{refreshInterval:1e4}),l=y.useMemo(()=>!r||!e?[]:r.filter(R=>R.projectDir===e.path),[r,e]),[o,u]=y.useState(null);y.useEffect(()=>{if(l.length>0&&!o){const R=l.find(z=>z.filesRead>0||z.filesWritten>0||z.commandsRun>0||z.rulesEnforced>0);R&&u(R.sessionId)}},[l,o]),y.useEffect(()=>{u(null)},[a]);const{data:d,isLoading:f,error:m,mutate:p}=Et(o?["session",o]:null,()=>M0(void 0,o),{refreshInterval:5e3}),{data:g,mutate:b}=Et(o?["events",o]:null,()=>O0(void 0,o),{refreshInterval:5e3}),[N,v]=y.useState([]),w=y.useRef(new Set),[j,S]=y.useState(!1),k=y.useRef(null),[_,M]=y.useState("all"),Z=y.useMemo(()=>{const R=[],z=new Set;for(const P of N){const q=jc(P);z.has(q)||(z.add(q),R.push(P))}if(g)for(const P of g){const q=jc(P);z.has(q)||(z.add(q),R.push(P))}return R.sort((P,q)=>new Date(q.ts).getTime()-new Date(P.ts).getTime()),R},[g,N]),Y=y.useMemo(()=>_==="all"?Z:Z.filter(R=>{switch(_){case"files_read":return R.toolName==="Read"||R.hookEvent==="PreToolUse"&&!!R.filePath;case"files_written":return R.toolName==="Write"||R.toolName==="Edit"||R.hookEvent==="PostToolUse";case"commands":return R.toolName==="Bash"||!!R.command;case"rules":return!!R.ruleName||R.event.includes("permission")||R.event.includes("tool_blocked");case"blocked":return R.event.includes("blocked")||R.event.includes("deny")||R.event.includes("failed");default:return!0}}),[Z,_]),C=y.useCallback(R=>{const z=jc(R);w.current.has(z)||(w.current.add(z),v(P=>[R,...P]))},[]),I=y.useCallback(()=>{p()},[p]),D=y.useCallback(()=>{b(),p()},[b,p]);y.useEffect(()=>{if(g)for(const R of g)w.current.add(jc(R))},[g]),y.useEffect(()=>{v([]),w.current.clear(),M("all")},[o]),y.useEffect(()=>{if(!o)return;const R=new pv(void 0,a??void 0,o);k.current=R;const z=R.onEvent(C),P=R.onSessionUpdate(I),q=R.onReconnect(D);R.connect();const $=setInterval(()=>{S(R.isConnected)},1e3);return()=>{clearInterval($),z(),P(),q(),R.disconnect()}},[C,I,D,o,a]);const F=o!==null;return n.jsxs("div",{className:"p-6 lg:p-8 h-full flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(tr,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Session Monitor"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:e?`Sessions for ${e.name}`:"Session activity and events"})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ls,{}),F&&n.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${j?"bg-emerald-400 shadow-[0_0_6px_rgba(52,211,153,0.5)]":"bg-red-400"}`}),n.jsx("span",{className:j?"text-emerald-400":"text-red-400",children:j?"Connected":"Disconnected"})]})]})]}),n.jsxs("div",{className:"flex-1 flex gap-6 min-h-0",children:[n.jsx("div",{className:["w-full lg:w-80 lg:shrink-0 flex flex-col",F?"hidden lg:flex":"flex"].join(" "),children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border-subtle",children:n.jsxs("h2",{className:"text-sm font-semibold text-text-primary",children:["Sessions (",l.length,")"]})}),l.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:n.jsxs("div",{className:"text-center",children:[n.jsx(tr,{size:28,className:"text-text-muted mx-auto mb-2"}),n.jsx("p",{className:"text-text-muted text-sm",children:"No sessions yet for this project."}),n.jsx("p",{className:"text-text-muted/60 text-xs mt-1",children:"Start a coding session to see activity here."})]})}):n.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:l.map(R=>n.jsx(IC,{summary:R,isSelected:o===R.sessionId,onClick:()=>u(R.sessionId)},R.sessionId))})]})}),n.jsxs("div",{className:["flex-1 min-w-0 overflow-y-auto",F?"flex flex-col":"hidden lg:flex lg:flex-col"].join(" "),children:[F&&n.jsxs("button",{type:"button",onClick:()=>u(null),className:"lg:hidden flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4 transition-colors",children:[n.jsx(eo,{size:16}),"Back to sessions"]}),!F&&n.jsx("div",{className:"hidden lg:flex flex-1 items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx(tr,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("p",{className:"text-text-secondary text-sm",children:"Select a session from the list to view its activity."})]})}),F&&f&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading session..."})]}),F&&m&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3 mb-6",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsxs("span",{className:"text-red-400 text-sm",children:["Failed to load session: ",m.message??"Unknown error"]})]}),F&&d&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-4",children:[n.jsx("h2",{className:"text-sm font-semibold text-text-primary mb-3",children:"Session Info"}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[d.sessionName&&n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx("span",{className:"text-text-muted",children:"Name: "}),n.jsx("span",{className:"text-text-primary font-medium",children:d.sessionName})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-text-muted",children:"Session ID: "}),n.jsx("span",{className:"text-text-secondary font-mono text-xs",children:d.sessionId})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-text-muted",children:"Started: "}),n.jsx("span",{className:"text-text-secondary",children:new Date(d.startedAt).toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-text-muted",children:"Project: "}),n.jsx("span",{className:"text-text-secondary font-mono text-xs",children:d.projectDir})]}),d.branch&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-text-muted",children:"Branch: "}),n.jsx($n,{size:12,className:"text-text-muted"}),n.jsx("span",{className:"text-text-secondary",children:d.branch})]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3",children:[n.jsx(Cl,{icon:Fl,label:"Files Read",value:d.filesRead.length,filterKey:"files_read",activeFilter:_,onFilter:M}),n.jsx(Cl,{icon:LS,label:"Files Written",value:d.filesWritten.length,filterKey:"files_written",activeFilter:_,onFilter:M}),n.jsx(Cl,{icon:Cr,label:"Commands Run",value:d.commandsRun.length,filterKey:"commands",activeFilter:_,onFilter:M}),n.jsx(Cl,{icon:Yc,label:"Rules Enforced",value:d.rulesEnforced,filterKey:"rules",activeFilter:_,onFilter:M}),n.jsx(Cl,{icon:rv,label:"Actions Blocked",value:d.actionsBlocked,filterKey:"blocked",activeFilter:_,onFilter:M})]}),n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-4",children:[n.jsx("h2",{className:"text-sm font-semibold text-text-primary mb-3",children:"Status Flags"}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx(bi,{label:"Tests Run",active:d.testsRun}),n.jsx(bi,{label:"Lint Run",active:d.lintRun}),n.jsx(bi,{label:"Build Run",active:d.buildRun}),n.jsx(bi,{label:"Formatter Run",active:d.formatterRun}),n.jsx(bi,{label:"Branch Created",active:d.branchCreated}),n.jsx(bi,{label:"Plan Approved",active:d.planApproved})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 mt-3 pt-3 border-t border-border-subtle",children:[d.testsPassed!==null&&n.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${d.testsPassed?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:[n.jsx(Pc,{size:12}),"Tests ",d.testsPassed?"Passed":"Failed"]}),d.lintPassed!==null&&n.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${d.lintPassed?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:[n.jsx(Pc,{size:12}),"Lint ",d.lintPassed?"Passed":"Failed"]}),d.buildPassed!==null&&n.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${d.buildPassed?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:[n.jsx(Pc,{size:12}),"Build ",d.buildPassed?"Passed":"Failed"]})]})]}),n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h2",{className:"text-sm font-semibold text-text-primary",children:"Event Timeline"}),_!=="all"&&n.jsxs("button",{type:"button",onClick:()=>M("all"),className:"text-xs text-accent hover:text-accent/80 transition-colors",children:["Clear filter (",Y.length,"/",Z.length,")"]})]}),n.jsx(DC,{events:Y})]})]})]})]})]})}const Gb=[{key:"permission_prompt",label:"Permission Prompt",description:"When a tool requests permission that needs user approval",icon:av,defaultUrgency:"critical",detection:"Sent by Claude Code"},{key:"idle_prompt",label:"Idle Prompt",description:"When the session is idle and waiting for user input",icon:lu,defaultUrgency:"low",detection:"Sent by Claude Code"}],Kb=[{key:"task_complete",label:"Task Complete",description:"When a coding task finishes successfully",icon:iS,defaultUrgency:"low",detection:"Detected at session end"},{key:"task_failed",label:"Task Failed",description:"When a coding task fails or encounters an error",icon:Or,defaultUrgency:"high",detection:"Detected from postcondition failures"},{key:"rule_blocked",label:"Rule Blocked",description:"When a rule blocks an action from proceeding",icon:rv,defaultUrgency:"high",detection:"Detected from rule evaluation"},{key:"repeated_failures",label:"Repeated Failures",description:"When multiple failures occur in quick succession",icon:It,defaultUrgency:"high",detection:"Triggered when consecutive blocks exceed threshold"},{key:"rapid_permission_requests",label:"Rapid Permission Requests",description:"When many permission prompts fire rapidly",icon:b_,defaultUrgency:"critical",detection:"Triggered when permission rate exceeds threshold"},{key:"sensitive_path_access",label:"Sensitive Path Access",description:"When a sensitive file path is accessed",icon:hm,defaultUrgency:"high",detection:"Triggered by file pattern matching"}],Yb={critical:"bg-red-500/15 text-red-400",high:"bg-amber-500/15 text-amber-400",low:"bg-surface-3 text-text-muted"},BC=["critical","high","low"],$C=[{type:"desktop",label:"Desktop",icon:Nk},{type:"terminal",label:"Terminal",icon:Cr},{type:"webhook",label:"Webhook",icon:J0},{type:"log",label:"Log",icon:Fl}];function If(e,a){return e[a]}function PC(e,a){return(e==null?void 0:e.some(r=>r.type===a))??!1}function FC(e,a){return e==null?void 0:e.find(r=>r.type===a)}function Uf(){return{dedup_window_seconds:30,permission_prompt:{urgency:"critical",notify:[{type:"desktop"},{type:"terminal"}]},task_complete:{urgency:"low",notify:[{type:"terminal"}]},task_failed:{urgency:"high",notify:[{type:"desktop"},{type:"terminal"}]},rule_blocked:{urgency:"high",notify:[{type:"terminal"}]}}}function Bf({enabled:e,onToggle:a,disabled:r,label:l}){return n.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":l,onClick:a,disabled:r,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e?"bg-accent":"bg-surface-3"} ${r?"opacity-50 cursor-not-allowed":""}`,children:n.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e?"translate-x-6":"translate-x-1"}`})})}function Vb({meta:e,config:a,expanded:r,onToggleExpand:l,onUpdateConfig:o}){var Y,C;const u=e.icon,d=(a==null?void 0:a.urgency)??e.defaultUrgency,f=(a==null?void 0:a.notify)??[],m=a!==void 0,p=a,g=(p==null?void 0:p.threshold)??3,b=(p==null?void 0:p.window_seconds)??60,N=(p==null?void 0:p.file_patterns)??[],v=I=>{const D={urgency:I,notify:(a==null?void 0:a.notify)??[],repeat_interval_seconds:a==null?void 0:a.repeat_interval_seconds,act:a==null?void 0:a.act};o(e.key,D)},w=I=>{const D=(a==null?void 0:a.notify)??[],F=D.some(P=>P.type===I);let R;F?R=D.filter(P=>P.type!==I):R=[...D,{type:I}];const z={...a,urgency:(a==null?void 0:a.urgency)??e.defaultUrgency,notify:R};o(e.key,z)},j=(I,D,F)=>{const z=((a==null?void 0:a.notify)??[]).map(q=>q.type===I?{...q,[D]:F}:q),P={...a,urgency:(a==null?void 0:a.urgency)??e.defaultUrgency,notify:z};o(e.key,P)},S=I=>{const D={...a,urgency:(a==null?void 0:a.urgency)??e.defaultUrgency,notify:(a==null?void 0:a.notify)??[],repeat_interval_seconds:I||void 0};o(e.key,D)},k=(I,D)=>{const F={...a,urgency:(a==null?void 0:a.urgency)??e.defaultUrgency,notify:(a==null?void 0:a.notify)??[],[I]:D};o(e.key,F)},_=(a==null?void 0:a.act)??{},M=(I,D)=>{const R={...(a==null?void 0:a.act)??{},[I]:D};(D===void 0||D===""||D===!1||D===0)&&delete R[I];const z={...a,urgency:(a==null?void 0:a.urgency)??e.defaultUrgency,notify:(a==null?void 0:a.notify)??[],act:Object.keys(R).length>0?R:void 0};o(e.key,z)},Z=(I,D)=>{const z={...((a==null?void 0:a.act)??{}).rate_limit??{threshold:5,window_seconds:60},[I]:D};M("rate_limit",z)};return n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:l,"aria-expanded":r,className:"w-full flex items-center gap-3 p-4 text-left hover:bg-surface-2/50 transition-colors",children:[n.jsx("div",{className:"p-1.5 rounded-lg bg-surface-2",children:n.jsx(u,{size:16,className:"text-text-secondary"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:e.label}),m&&n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ${Yb[d]}`,children:d})]}),n.jsx("p",{className:"text-xs text-text-muted",children:e.description}),n.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:e.detection})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[m&&f.length>0&&n.jsx("div",{className:"flex gap-1",children:f.map(I=>n.jsx("span",{className:"bg-surface-3 text-text-secondary rounded-full px-2.5 py-0.5 text-xs",children:I.type},I.type))}),!m&&n.jsx("span",{className:"text-xs text-text-muted",children:"Not configured"}),r?n.jsx(Pn,{size:16,className:"text-text-muted"}):n.jsx(wa,{size:16,className:"text-text-muted"})]})]}),r&&n.jsxs("div",{className:"border-t border-border p-4 space-y-5",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Urgency"}),n.jsx("div",{className:"flex gap-2",children:BC.map(I=>n.jsx("button",{type:"button",onClick:()=>v(I),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${d===I?Yb[I]+" ring-1 ring-current":"bg-surface-2 text-text-muted hover:text-text-secondary"}`,children:I},I))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Notification Channels"}),n.jsx("div",{className:"space-y-3",children:$C.map(I=>{const D=PC(f,I.type),F=FC(f,I.type),R=I.icon;return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(R,{size:14,className:"text-text-secondary"}),n.jsx("span",{className:"text-sm text-text-primary",children:I.label})]}),n.jsx(Bf,{enabled:D,onToggle:()=>w(I.type),label:`Toggle ${I.label} channel`})]}),D&&I.type==="webhook"&&n.jsx("div",{className:"mt-2 ml-6",children:n.jsx("input",{type:"url",placeholder:"https://hooks.slack.com/...",value:(F==null?void 0:F.url)??"",onChange:z=>j(I.type,"url",z.target.value),className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})}),D&&I.type==="log"&&n.jsx("div",{className:"mt-2 ml-6",children:n.jsx("input",{type:"text",placeholder:"~/.ulpi/notifications.log",value:(F==null?void 0:F.path)??"",onChange:z=>j(I.type,"path",z.target.value),className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})}),D&&(I.type==="desktop"||I.type==="terminal")&&n.jsxs("div",{className:"mt-2 ml-6 flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-text-muted",children:"Sound"}),n.jsx(Bf,{enabled:(F==null?void 0:F.sound)??!1,onToggle:()=>j(I.type,"sound",!((F==null?void 0:F.sound)??!1)),label:"Toggle sound"})]})]},I.type)})})]}),e.key==="repeated_failures"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Failure Threshold"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1,max:50,value:g,onChange:I=>k("threshold",parseInt(I.target.value,10)||3),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"consecutive blocks before alert"})]})]}),e.key==="rapid_permission_requests"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Request Threshold"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1,max:100,value:g,onChange:I=>k("threshold",parseInt(I.target.value,10)||5),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"requests within window"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Window (seconds)"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:5,max:600,value:b,onChange:I=>k("window_seconds",parseInt(I.target.value,10)||60),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"second detection window"})]})]})]}),e.key==="sensitive_path_access"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"File Patterns (comma-separated)"}),n.jsx("textarea",{rows:3,placeholder:".env*, **/secrets/*, **/credentials*",value:N.join(", "),onChange:I=>k("file_patterns",I.target.value.split(",").map(D=>D.trim()).filter(Boolean)),className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent resize-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-1.5",children:"Repeat Interval"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:0,max:3600,value:(a==null?void 0:a.repeat_interval_seconds)??0,onChange:I=>S(parseInt(I.target.value,10)||0),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"seconds (0 = no repeat)"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-text-secondary mb-3",children:"Actions"}),n.jsxs("div",{className:"space-y-3 ml-1",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] text-text-muted mb-1",children:"Inject Skill"}),n.jsx("input",{type:"text",placeholder:"path/to/skill.md or bundled skill name",value:_.inject_skill??"",onChange:I=>M("inject_skill",I.target.value||void 0),className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),(e.key==="rule_blocked"||e.key==="repeated_failures")&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] text-text-muted mb-1",children:"Inject Skill on Retry"}),n.jsx("input",{type:"text",placeholder:"Skill to inject when retrying after block",value:_.inject_skill_on_retry??"",onChange:I=>M("inject_skill_on_retry",I.target.value||void 0),className:"w-full bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),e.key==="repeated_failures"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] text-text-muted mb-1",children:"Inject Skill After N Blocks"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1,max:50,value:_.inject_skill_after_n_blocks??"",onChange:I=>M("inject_skill_after_n_blocks",parseInt(I.target.value,10)||void 0),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"consecutive blocks before skill injection"})]})]}),(e.key==="rule_blocked"||e.key==="repeated_failures")&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] text-text-muted mb-1",children:"Alert Escalation After N Blocks"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1,max:50,value:_.alert_after_n_blocks??"",onChange:I=>M("alert_after_n_blocks",parseInt(I.target.value,10)||void 0),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"blocks before escalating to extra channels"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] text-text-muted mb-1",children:"Rate Limit"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1,max:100,value:((Y=_.rate_limit)==null?void 0:Y.threshold)??"",placeholder:"5",onChange:I=>Z("threshold",parseInt(I.target.value,10)||5),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"per"}),n.jsx("input",{type:"number",min:5,max:3600,value:((C=_.rate_limit)==null?void 0:C.window_seconds)??"",placeholder:"60",onChange:I=>Z("window_seconds",parseInt(I.target.value,10)||60),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"seconds"})]})]}),(e.key==="rule_blocked"||e.key==="task_failed"||e.key==="repeated_failures")&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-text-primary",children:"Log Failure Details"}),n.jsx("p",{className:"text-xs text-text-muted",children:"Log extra context (tool input, state) to notification log"})]}),n.jsx(Bf,{enabled:_.log_failure_details??!1,onToggle:()=>M("log_failure_details",!(_.log_failure_details??!1)),label:"Toggle failure details logging"})]})]})]})]})]})}function HC(){const{currentProject:e}=on(),a=e==null?void 0:e.id,[r,l]=y.useState(null),[o,u]=y.useState(!0),[d,f]=y.useState(null),[m,p]=y.useState(!1),[g,b]=y.useState(!1),[N,v]=y.useState(null),[w,j]=y.useState(!1);y.useEffect(()=>{let C=!1;return u(!0),f(null),b(!1),v(null),mm(a).then(I=>{C||l(I)}).catch(I=>{C||(I instanceof Error&&I.message.includes("404")?l(null):f(I instanceof Error?I.message:"Failed to load responses"))}).finally(()=>{C||u(!1)}),()=>{C=!0}},[a]);const S=y.useCallback((C,I)=>{l(D=>{if(!D){const F=Uf();return F[C]=I,F}return{...D,[C]:I}}),b(!0)},[]),k=y.useCallback(C=>{l(I=>I?{...I,dedup_window_seconds:C}:{...Uf(),dedup_window_seconds:C}),b(!0)},[]),_=y.useCallback(async()=>{if(r){p(!0),j(!1);try{await p2(r,a),b(!1),j(!0),setTimeout(()=>j(!1),2e3)}catch(C){f(C instanceof Error?C.message:"Failed to save")}finally{p(!1)}}},[r,a]),M=y.useCallback(()=>{u(!0),b(!1),mm(a).then(l).catch(()=>l(null)).finally(()=>u(!1))},[a]),Z=y.useCallback(()=>{l(Uf()),b(!0)},[]),Y=r!==null&&[...Gb,...Kb].some(C=>If(r,C.key)!==void 0);return n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(Kc,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Response Settings"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:e?`Configure how Guardian notifies you for ${e.name}`:"Configure how Guardian notifies you about events"})]})]}),n.jsx(ls,{})]}),o&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading response settings..."})]}),d&&!o&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3 mb-6",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsx("span",{className:"text-red-400 text-sm",children:d})]}),!o&&!d&&!Y&&n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 text-center",children:[n.jsx(Kc,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("h3",{className:"text-base font-semibold text-text-primary mb-1",children:"No response settings configured"}),n.jsx("p",{className:"text-sm text-text-secondary mb-4",children:"Response settings control how Guardian notifies you about events like permission prompts, task completions, and rule blocks."}),n.jsx("button",{type:"button",onClick:Z,className:"bg-accent hover:bg-accent/90 text-white rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Configure Defaults"})]}),!o&&r!==null&&Y&&n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-surface-1 border border-border rounded-xl p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Deduplication Window"}),n.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Suppress duplicate notifications within this time window"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:0,max:600,value:r.dedup_window_seconds,onChange:C=>k(parseInt(C.target.value,10)||0),className:"w-20 bg-surface-2 border border-border rounded-md px-3 py-2 text-sm text-text-primary text-right focus:outline-none focus:border-accent"}),n.jsx("span",{className:"text-xs text-text-muted",children:"seconds"})]})]})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-3",children:"Claude Code Events"}),n.jsx("div",{className:"space-y-3",children:Gb.map(C=>n.jsx(Vb,{meta:C,config:If(r,C.key),expanded:N===C.key,onToggleExpand:()=>v(N===C.key?null:C.key),onUpdateConfig:S},C.key))})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-3",children:"Guardian-Detected Events"}),n.jsx("div",{className:"space-y-3",children:Kb.map(C=>n.jsx(Vb,{meta:C,config:If(r,C.key),expanded:N===C.key,onToggleExpand:()=>v(N===C.key?null:C.key),onUpdateConfig:S},C.key))})]})]})]}),g&&n.jsx("div",{className:"fixed bottom-0 left-72 right-0 z-40 border-t border-border bg-surface-1 px-6 py-3",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:M,disabled:m,className:"px-4 py-2 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors disabled:opacity-50",children:"Discard"}),n.jsx("button",{type:"button",onClick:_,disabled:m,className:"bg-accent hover:bg-accent/90 text-white rounded-lg px-4 py-2 text-sm font-medium transition-colors flex items-center gap-2 disabled:opacity-50",children:m?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:14,className:"animate-spin"}),"Saving..."]}):w?n.jsxs(n.Fragment,{children:[n.jsx(bn,{size:14}),"Saved"]}):n.jsxs(n.Fragment,{children:[n.jsx(np,{size:14}),"Save Changes"]})})]})]})})]})}function qC(e){const a=new Date(e),l=new Date().getTime()-a.getTime(),o=Math.floor(l/6e4),u=Math.floor(l/36e5),d=Math.floor(l/864e5);return o<1?"just now":o<60?`${o}m ago`:u<24?`${u}h ago`:d<7?`${d}d ago`:a.toLocaleDateString()}function GC({status:e}){const a={configured:"bg-success/15 text-success",partial:"bg-warning/15 text-warning",none:"bg-surface-3 text-text-secondary"},r={configured:"Configured",partial:"Partial",none:"Not configured"};return n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${a[e]}`,children:r[e]})}function KC({exists:e,totalEntries:a}){return e?n.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-violet-500/15 text-violet-400 text-xs font-medium",children:[n.jsx($n,{size:11}),"History (",a,")"]}):null}function YC({initialized:e,totalFiles:a}){return e?n.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-cyan-500/15 text-cyan-400 text-xs font-medium",children:[n.jsx(Dr,{size:11}),"CodeMap (",a,")"]}):null}function VC({project:e,isSelected:a,isDefault:r,historyStatus:l,codemapStatus:o,onSelect:u,onSetDefault:d,onInit:f,onInitHistory:m,onInitCodemap:p,onDelete:g,onRename:b,initializing:N,initializingHistory:v,initializingCodemap:w,deletingId:j,deleteConfirmId:S}){var F,R,z;const[k,_]=y.useState(!1),[M,Z]=y.useState(""),Y=()=>{const P=M.trim();P&&b(P),_(!1)},C=!e.hooksInstalled||e.configStatus==="none",I=l!==null&&!l.exists,D=o!==null&&!o.initialized;return n.jsx("div",{className:["group p-4 rounded-xl border transition-all cursor-pointer",a?"bg-accent/10 border-accent/40":"bg-surface-1 border-border hover:border-border-strong"].join(" "),onClick:u,children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-lg bg-surface-2 flex items-center justify-center",children:n.jsx(no,{size:20,className:"text-text-secondary"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[k?n.jsx("form",{className:"flex items-center gap-2",onSubmit:P=>{P.preventDefault(),Y()},onClick:P=>P.stopPropagation(),children:n.jsx("input",{autoFocus:!0,value:M,onChange:P=>Z(P.target.value),onKeyDown:P=>{P.key==="Escape"&&_(!1)},onBlur:Y,className:"px-2 py-0.5 rounded bg-surface-2 border border-accent/40 text-text-primary text-sm font-medium focus:outline-none focus:ring-1 focus:ring-accent w-48"})}):n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"font-medium text-text-primary truncate",children:e.name}),n.jsx("button",{onClick:P=>{P.stopPropagation(),_(!0),Z(e.name)},className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-surface-3 text-text-muted hover:text-text-primary transition-all",title:"Rename project",children:n.jsx(cu,{size:13})})]}),r&&n.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded bg-accent/15 text-accent text-xs font-medium",children:[n.jsx(Hl,{size:12})," Default"]}),n.jsx(GC,{status:e.configStatus}),l&&n.jsx(KC,{exists:l.exists,totalEntries:l.totalEntries}),o&&n.jsx(YC,{initialized:o.initialized,totalFiles:o.totalFiles})]}),n.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:e.path}),n.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-text-secondary",children:[((F=e.stack)==null?void 0:F.runtime)&&n.jsx("span",{children:e.stack.runtime}),((R=e.stack)==null?void 0:R.framework)&&n.jsx("span",{children:e.stack.framework}),((z=e.stack)==null?void 0:z.packageManager)&&n.jsx("span",{children:e.stack.packageManager}),n.jsxs("span",{children:["Last accessed: ",qC(e.lastAccessed)]})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-3 flex-wrap",children:[C&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),f()},disabled:N,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-accent text-white hover:bg-accent-hover text-xs font-medium disabled:opacity-50 transition-colors",children:[N?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx(Yc,{size:13}),"Enable Guardian"]}),!C&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),f()},disabled:N,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-text-primary text-xs font-medium disabled:opacity-50 transition-colors",children:[N?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx(Yc,{size:13}),"Re-init Guardian"]}),I&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),m()},disabled:v,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-violet-600 text-white hover:bg-violet-700 text-xs font-medium disabled:opacity-50 transition-colors",children:[v?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx($n,{size:13}),"Enable History"]}),(l==null?void 0:l.exists)&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),m()},disabled:v,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-text-primary text-xs font-medium disabled:opacity-50 transition-colors",children:[v?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx($n,{size:13}),"Re-init History"]}),D&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),p()},disabled:w,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-cyan-600 text-white hover:bg-cyan-700 text-xs font-medium disabled:opacity-50 transition-colors",children:[w?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx(Dr,{size:13}),"Init CodeMap"]}),(o==null?void 0:o.initialized)&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),p()},disabled:w,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-text-primary text-xs font-medium disabled:opacity-50 transition-colors",children:[w?n.jsx(rs,{size:13,className:"animate-spin"}):n.jsx(Dr,{size:13}),"Re-init CodeMap"]}),C&&I&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),f(),m(),D&&p()},disabled:N||v||w,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-emerald-600 text-white hover:bg-emerald-700 text-xs font-medium disabled:opacity-50 transition-colors",children:[n.jsx(tp,{size:13}),"Enable All"]}),!r&&n.jsxs("button",{onClick:P=>{P.stopPropagation(),d()},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-text-primary text-xs font-medium transition-colors",children:[n.jsx(Hl,{size:13}),"Set Default"]}),n.jsxs("button",{onClick:P=>{P.stopPropagation(),g()},disabled:j,className:["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",S?"bg-red-600 hover:bg-red-700 text-white":"bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-red-400"].join(" "),title:S?"Click again to confirm":"Remove project",children:[n.jsx(sr,{size:13}),S?"Confirm?":"Remove"]})]})]})]})})}function XC(){const{projects:e,currentProject:a,defaultProjectId:r,isLoading:l,error:o,setCurrentProject:u,setDefaultProject:d,refreshProjects:f}=on(),[m,p]=y.useState(null),[g,b]=y.useState(null),[N,v]=y.useState(null),[w,j]=y.useState(!1),[S,k]=y.useState(null),[_,M]=y.useState(null),{data:Z,mutate:Y}=Et(e.length>0?["historyStatusAll",e.map(q=>q.id).join(",")]:null,async()=>{const q={},$=await Promise.allSettled(e.map(async U=>{const B=await Pl(U.id);return{id:U.id,status:B}}));for(const U of $)U.status==="fulfilled"&&(q[U.value.id]=U.value.status);return q}),{data:C,mutate:I}=Et(e.length>0?["codemapStatusAll",e.map(q=>q.id).join(",")]:null,async()=>{const q={},$=await Promise.allSettled(e.map(async U=>{const B=await Qm(U.id);return{id:U.id,status:B}}));for(const U of $)U.status==="fulfilled"&&(q[U.value.id]=U.value.status);return q});y.useEffect(()=>{if(_){const q=setTimeout(()=>M(null),3e3);return()=>clearTimeout(q)}},[_]);const D=async q=>{p(q);try{await c2(q),await f()}catch($){console.error("Init failed:",$)}finally{p(null)}},F=async q=>{b(q);try{await Xm({collectReviewPlans:!0},q),await Y()}catch($){console.error("History init failed:",$)}finally{b(null)}},R=async q=>{v(q);try{await B0("init",{},q),await I()}catch($){console.error("CodeMap init failed:",$)}finally{v(null)}},z=async(q,$)=>{try{await d2(q,{name:$}),await f()}catch(U){console.error("Rename failed:",U)}},P=async q=>{if(_!==q){M(q);return}k(q);try{if(await f2(q),(a==null?void 0:a.id)===q){const $=e.find(U=>U.id!==q);$!=null&&$.id&&u($.id)}await f(),M(null)}catch($){console.error("Delete failed:",$)}finally{k(null)}};return l?n.jsx("div",{className:"p-6 flex items-center justify-center h-64",children:n.jsx(rs,{size:24,className:"animate-spin text-text-muted"})}):n.jsxs("div",{className:"p-6 lg:p-8",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Projects"}),n.jsx("p",{className:"text-text-secondary text-sm mt-1",children:"Manage your registered projects"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-accent hover:bg-accent-hover text-white font-medium transition-colors",children:[n.jsx(Cs,{size:16})," Add Project"]}),n.jsxs("button",{onClick:()=>f(),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-2 hover:bg-surface-3 text-text-secondary hover:text-text-primary transition-colors",children:[n.jsx(rs,{size:16})," Refresh"]})]})]}),o&&n.jsx("div",{className:"mb-4 p-3 rounded-lg bg-error/10 border border-error/20 text-error text-sm",children:o}),e.length===0?n.jsxs("div",{className:"text-center py-12 text-text-muted",children:[n.jsx(no,{size:48,className:"mx-auto mb-3 opacity-50"}),n.jsx("p",{children:"No projects registered yet."}),n.jsxs("p",{className:"text-sm mt-1",children:["Run ",n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi init"})," in a project directory to get started."]})]}):n.jsx("div",{className:"space-y-3",children:e.map(q=>n.jsx(VC,{project:q,isSelected:(a==null?void 0:a.id)===q.id,isDefault:q.id===r,historyStatus:(Z==null?void 0:Z[q.id])??null,codemapStatus:(C==null?void 0:C[q.id])??null,onSelect:()=>u(q.id),onSetDefault:()=>d(q.id),onInit:()=>D(q.id),onInitHistory:()=>F(q.id),onInitCodemap:()=>R(q.id),onDelete:()=>P(q.id),onRename:$=>z(q.id,$),initializing:m===q.id,initializingHistory:g===q.id,initializingCodemap:N===q.id,deletingId:S===q.id,deleteConfirmId:_===q.id},q.id))}),n.jsxs("div",{className:"mt-8 p-4 rounded-lg bg-surface-1 border border-border",children:[n.jsx("h3",{className:"font-medium text-text-primary mb-3",children:"CLI Reference"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1.5",children:"Projects"}),n.jsxs("div",{className:"space-y-1.5 text-sm text-text-secondary font-mono",children:[n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi projects list"})," — List all registered projects"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi projects add /path"})," — Register a project"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi projects remove <id>"})," — Unregister a project"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi projects default <id>"})," — Set default project"]})]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1.5",children:"Guardian"}),n.jsxs("div",{className:"space-y-1.5 text-sm text-text-secondary font-mono",children:[n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi init"})," — Detect stack, install hooks, generate rules"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi rules list"})," — List all active rules"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi status"})," — Show current session state"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi uninstall"})," — Remove hooks from project"]})]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1.5",children:"History"}),n.jsxs("div",{className:"space-y-1.5 text-sm text-text-secondary font-mono",children:[n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi history init"})," — Initialize shadow branch + install git hooks"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi history list"})," — Show captured entries"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi history backfill"})," — Capture recent commits retroactively"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi history enrich <sha>"})," — AI-enrich a history entry"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi history rewind <sha>"})," — Rewind to a previous commit"]})]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1.5",children:"CodeMap"}),n.jsxs("div",{className:"space-y-1.5 text-sm text-text-secondary font-mono",children:[n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi codemap init"})," — Initialize semantic code index"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi codemap search <query>"})," — Search code with natural language"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi codemap watch"})," — Start watching for file changes"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi codemap serve"})," — Start MCP server for agent access"]})]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1.5",children:"Cross-project"}),n.jsxs("div",{className:"space-y-1.5 text-sm text-text-secondary font-mono",children:[n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi --project <id> <command>"})," — Run any command against a specific project"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi ui --port 9800"})," — Start the web UI server"]}),n.jsxs("p",{children:[n.jsx("code",{className:"bg-surface-2 px-1.5 py-0.5 rounded",children:"ulpi update"})," — Check for and install updates"]})]})]})]})]}),n.jsx(hv,{isOpen:w,onClose:()=>j(!1),onSuccess:()=>{f(),j(!1)}})]})}function uu({icon:e,title:a,description:r}){return n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(e,{size:18,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:a}),n.jsx("p",{className:"text-sm text-text-secondary",children:r})]})]})}function ZC(){const[e,a]=y.useState(null),[r,l]=y.useState(null),[o,u]=y.useState(""),[d,f]=y.useState(!1);return y.useEffect(()=>{D0().then(a).catch(()=>{}),z2().then(m=>{l(m),u(m.username)}).catch(()=>{})},[]),n.jsxs("section",{children:[n.jsx(uu,{icon:rp,title:"General",description:"Version and identity"}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 space-y-5",children:[n.jsx("div",{className:"flex items-center justify-between",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Z0,{size:16,className:"text-text-muted"}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-sm text-text-secondary",children:["Version:"," ",n.jsx("span",{className:"font-mono font-medium text-text-primary",children:(e==null?void 0:e.current)??"..."})]}),(e==null?void 0:e.updateAvailable)&&n.jsxs("p",{className:"text-xs text-amber-300 mt-0.5",children:["Update available:"," ",n.jsxs("span",{className:"font-mono font-medium",children:["v",e.latest]})," ","—"," ",n.jsx("span",{className:"font-mono",children:"ulpi update"})]}),e&&!e.updateAvailable&&n.jsx("p",{className:"text-xs text-emerald-400 mt-0.5",children:"Up to date"})]})]})}),n.jsxs("div",{className:"pt-4 border-t border-border",children:[n.jsx("div",{className:"flex items-center justify-between mb-2",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Username"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Used for per-user branch naming. Leave empty to auto-detect."})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"text",placeholder:"e.g. your-github-username",value:o,onChange:m=>u(m.target.value),onBlur:async()=>{const m=o.trim();if(m!==((r==null?void 0:r.username)??"")){f(!0);try{const p=await I2(m);l(p),u(p.username)}catch{}finally{f(!1)}}},onKeyDown:m=>{m.key==="Enter"&&m.target.blur()},disabled:d,className:`flex-1 px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent ${d?"opacity-50":""}`}),d&&n.jsx("span",{className:"text-xs text-text-secondary",children:"Saving..."})]}),r&&n.jsxs("div",{className:"mt-3 space-y-0.5",children:[n.jsxs("p",{className:"text-xs text-text-secondary",children:["History branch:"," ",n.jsx("span",{className:"font-mono text-text-primary",children:r.resolvedHistoryBranch})]}),n.jsxs("p",{className:"text-xs text-text-secondary",children:["CodeMap branch:"," ",n.jsx("span",{className:"font-mono text-text-primary",children:r.resolvedCodemapBranch})]})]})]})]})]})}const QC=[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",description:"Balanced performance and speed",recommended:!0},{id:"claude-opus-4-20250514",name:"Claude Opus 4",description:"Most capable, best for complex analysis",recommended:!1},{id:"claude-haiku-4-20250514",name:"Claude Haiku 4",description:"Fastest, good for simple projects",recommended:!1}],Xb=[{value:"openai",label:"OpenAI"},{value:"ollama",label:"Ollama"},{value:"ulpi",label:"Ulpi"}],Sc=[{id:"text-embedding-3-small",label:"text-embedding-3-small",dimensions:1536},{id:"text-embedding-3-large",label:"text-embedding-3-large",dimensions:3072},{id:"text-embedding-ada-002",label:"text-embedding-ada-002 (legacy)",dimensions:1536}],Zb="ulpi-ai-model";function WC({projectId:e}){const[a,r]=y.useState(()=>localStorage.getItem(Zb)||"claude-sonnet-4-20250514"),[l,o]=y.useState(null),[u,d]=y.useState("openai"),[f,m]=y.useState("text-embedding-3-small"),[p,g]=y.useState(1536),[b,N]=y.useState(!1),[v,w]=y.useState(null),[j,S]=y.useState("openai"),[k,_]=y.useState("text-embedding-3-small"),[M,Z]=y.useState(1536),[Y,C]=y.useState(!1),[I,D]=y.useState([]),[F,R]=y.useState(!1),[z,P]=y.useState(null);y.useEffect(()=>{_2(e).then(U=>{o(U),d(U.embedding.provider),m(U.embedding.model),g(U.embedding.dimensions)}).catch(()=>{}),H0(e).then(U=>{w(U),S(U.embedding.provider),_(U.embedding.model),Z(U.embedding.dimensions)}).catch(()=>{})},[e]),y.useEffect(()=>{localStorage.setItem(Zb,a)},[a]),y.useEffect(()=>{u!=="ulpi"&&j!=="ulpi"||I.length>0||(R(!0),P(null),T2().then(U=>D(U.data??[])).catch(U=>{const B=U instanceof Error?U.message:"Failed to fetch models";P(B)}).finally(()=>R(!1)))},[u,j]);const q=async U=>{if(l){N(!0);try{const B={...l.embedding,...U},Q=await C2({embedding:B},e);o(Q)}catch{}finally{N(!1)}}},$=async U=>{if(v){C(!0);try{const B={...v.embedding,...U},Q=await q0({embedding:B},e);w(Q),S(Q.embedding.provider),_(Q.embedding.model),Z(Q.embedding.dimensions)}catch{}finally{C(!1)}}};return n.jsxs("section",{children:[n.jsx(uu,{icon:En,title:"AI & Embeddings",description:"Models for generation, code search, and memory"}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Rr,{size:15,className:"text-text-muted"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"AI Generation Model"})]}),n.jsx("p",{className:"text-xs text-text-secondary mb-3",children:"Claude model for AI-powered rules generation, enrichment, and quality scoring."}),n.jsx("div",{className:"space-y-2",children:QC.map(U=>n.jsx("button",{type:"button",onClick:()=>r(U.id),className:`w-full text-left p-3 rounded-lg border-2 transition-colors ${a===U.id?"border-accent bg-accent/10":"border-border bg-surface-2 hover:border-accent/30"}`,children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h4",{className:"text-sm font-medium text-text-primary",children:U.name}),U.recommended&&n.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-[10px] font-medium",children:"Recommended"}),n.jsx("span",{className:"text-xs text-text-secondary",children:U.description})]}),a===U.id&&n.jsx("div",{className:"p-0.5 rounded-full bg-accent",children:n.jsx(bn,{size:12,className:"text-white"})})]})},U.id))})]}),n.jsxs("div",{className:"pt-5 border-t border-border",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(xk,{size:15,className:"text-text-muted"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"CodeMap Embeddings"}),b&&n.jsx("span",{className:"text-[10px] text-text-tertiary",children:"saving..."})]}),n.jsx("p",{className:"text-xs text-text-secondary mb-3",children:"Embedding provider for semantic code search indexing."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Provider"}),n.jsx("select",{value:u,onChange:U=>{const B=U.target.value;d(B),B==="ulpi"?(m("code"),g(768),q({provider:B,model:"code",dimensions:768})):B==="openai"?(m("text-embedding-3-small"),g(1536),q({provider:B,model:"text-embedding-3-small",dimensions:1536})):q({provider:B})},disabled:!l||b,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:Xb.map(U=>n.jsx("option",{value:U.value,children:U.label},U.value))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Model"}),u==="ulpi"?n.jsxs("select",{value:f,onChange:U=>{m(U.target.value),q({model:U.target.value})},disabled:!l||b||F,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:[F&&n.jsx("option",{children:"Loading..."}),z&&n.jsx("option",{children:"Error loading models"}),!F&&I.length===0&&!z&&n.jsx("option",{value:f,children:f}),I.map(U=>n.jsx("option",{value:U.id,children:U.id},U.id))]}):u==="openai"?n.jsx("select",{value:f,onChange:U=>{const B=Sc.find(Q=>Q.id===U.target.value);m(U.target.value),B&&g(B.dimensions),q({model:U.target.value,...B?{dimensions:B.dimensions}:{}})},disabled:!l||b,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:Sc.map(U=>n.jsx("option",{value:U.id,children:U.label},U.id))}):n.jsx("input",{type:"text",value:f,onChange:U=>m(U.target.value),onBlur:()=>{f!==(l==null?void 0:l.embedding.model)&&q({model:f})},onKeyDown:U=>{U.key==="Enter"&&U.target.blur()},disabled:!l||b,placeholder:"nomic-embed-text",className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent disabled:opacity-50"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Dimensions"}),n.jsx("input",{type:"number",value:p,min:1,max:4096,onChange:U=>g(parseInt(U.target.value,10)||0),onBlur:()=>{const U=Math.min(Math.max(1,p),4096);g(U),U!==(l==null?void 0:l.embedding.dimensions)&&q({dimensions:U})},disabled:!l||b,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50"})]})]})]}),n.jsxs("div",{className:"pt-5 border-t border-border",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(ES,{size:15,className:"text-text-muted"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Memory Embeddings"}),Y&&n.jsx("span",{className:"text-[10px] text-text-tertiary",children:"saving..."})]}),n.jsx("p",{className:"text-xs text-text-secondary mb-3",children:"Embedding provider for agent memory vector search."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Provider"}),n.jsx("select",{value:j,onChange:U=>{const B=U.target.value;S(B),B==="ulpi"?(_("memories"),Z(768),$({provider:B,model:"memories",dimensions:768})):B==="openai"?(_("text-embedding-3-small"),Z(1536),$({provider:B,model:"text-embedding-3-small",dimensions:1536})):$({provider:B})},disabled:!v||Y,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:Xb.map(U=>n.jsx("option",{value:U.value,children:U.label},U.value))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Model"}),j==="ulpi"?n.jsxs("select",{value:k,onChange:U=>{_(U.target.value),$({model:U.target.value})},disabled:!v||Y||F,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:[F&&n.jsx("option",{children:"Loading..."}),z&&n.jsx("option",{children:"Error loading models"}),!F&&I.length===0&&!z&&n.jsx("option",{value:k,children:k}),I.map(U=>n.jsx("option",{value:U.id,children:U.id},U.id))]}):j==="openai"?n.jsx("select",{value:k,onChange:U=>{const B=Sc.find(Q=>Q.id===U.target.value);_(U.target.value),B&&Z(B.dimensions),$({model:U.target.value,...B?{dimensions:B.dimensions}:{}})},disabled:!v||Y,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50",children:Sc.map(U=>n.jsx("option",{value:U.id,children:U.label},U.id))}):n.jsx("input",{type:"text",value:k,onChange:U=>_(U.target.value),onBlur:()=>{k!==(v==null?void 0:v.embedding.model)&&$({model:k})},onKeyDown:U=>{U.key==="Enter"&&U.target.blur()},disabled:!v||Y,placeholder:"nomic-embed-text",className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent disabled:opacity-50"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-text-secondary mb-1 block",children:"Dimensions"}),n.jsx("input",{type:"number",value:M,min:1,max:4096,onChange:U=>Z(parseInt(U.target.value,10)||0),onBlur:()=>{const U=Math.min(Math.max(1,M),4096);Z(U),U!==(v==null?void 0:v.embedding.dimensions)&&$({dimensions:U})},disabled:!v||Y,className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent disabled:opacity-50"})]})]})]})]})]})}function _r({label:e,description:a,children:r}){return n.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border first:pt-0 first:border-t-0",children:[n.jsxs("div",{className:"flex-1 mr-4",children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:e}),a&&n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:a})]}),r]})}function jm({enabled:e,onChange:a,disabled:r}){return n.jsx("button",{type:"button",onClick:a,disabled:r,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e?"bg-accent":"bg-surface-3"} ${r?"opacity-50":""}`,children:n.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e?"translate-x-6":"translate-x-1"}`})})}function JC({projectId:e}){const[a,r]=y.useState(null),[l,o]=y.useState(null),[u,d]=y.useState(!1);y.useEffect(()=>{Pl(e).then(r).catch(()=>{}),wb(e).then(o).catch(()=>{})},[e]);const f=async p=>{if(!(!l||!(a!=null&&a.exists))){d(!0);try{const g=await h2(p,e);o(g)}catch{}finally{d(!1)}}},m=async()=>{d(!0);try{await Xm(void 0,e);const p=await Pl(e);r(p);const g=await wb(e);o(g)}catch(p){console.error("Init failed:",p)}finally{d(!1)}};return n.jsxs("section",{children:[n.jsx(uu,{icon:$n,title:"History",description:"Shadow branch session recording"}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 space-y-4",children:[n.jsx("div",{className:"flex items-center justify-between",children:n.jsxs("div",{children:[n.jsxs("p",{className:"text-sm text-text-secondary",children:["Status:"," ",a!=null&&a.exists?n.jsxs("span",{className:"font-medium text-emerald-400",children:["Active — ",a.totalEntries," entries"]}):n.jsx("span",{className:"font-medium text-text-tertiary",children:"Not initialized"})]}),(a==null?void 0:a.exists)&&n.jsx(_s,{to:"/history",className:"text-sm text-accent hover:underline mt-1 inline-block",children:"View history →"}),!(a!=null&&a.exists)&&n.jsx("button",{onClick:m,disabled:u,className:`mt-2 px-4 py-2 rounded-lg bg-accent text-white text-sm font-medium hover:opacity-90 transition-opacity ${u?"opacity-50":""}`,children:u?"Initializing...":"Initialize History"})]})}),(a==null?void 0:a.exists)&&n.jsxs(n.Fragment,{children:[n.jsx(_r,{label:"Capture Transcripts",description:"Store full Claude Code conversation alongside each entry",children:n.jsx(jm,{enabled:!!(l!=null&&l.captureTranscript),onChange:()=>f({captureTranscript:!(l!=null&&l.captureTranscript)}),disabled:u})}),n.jsx(_r,{label:"Capture Strategy",description:"When to capture history entries for commits",children:n.jsxs("select",{value:(l==null?void 0:l.captureStrategy)??"session-end",onChange:p=>f({captureStrategy:p.target.value}),disabled:u,className:`px-3 py-1.5 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent ${u?"opacity-50":""}`,children:[n.jsx("option",{value:"session-end",children:"Session End"}),n.jsx("option",{value:"on-commit",children:"On Commit"}),n.jsx("option",{value:"manual",children:"Manual Only"})]})}),n.jsx(_r,{label:"Collect Review Plans",description:"Include review plans and screenshots in history entries",children:n.jsx(jm,{enabled:!!(l!=null&&l.collectReviewPlans),onChange:()=>f({collectReviewPlans:!(l!=null&&l.collectReviewPlans)}),disabled:u})})]})]})]})}function eT(){const[e,a]=y.useState(null),[r,l]=y.useState(!1),o=(e==null?void 0:e.webhook_url)??"",u=(e==null?void 0:e.default_export_format)??"markdown",d=(e==null?void 0:e.review_timeout_seconds)??0,f=(e==null?void 0:e.timeout_behavior)??"allow";y.useEffect(()=>{Zm().then(a).catch(()=>a({enabled:!0,plan_review:!0,code_review:!0,auto_open_browser:!0,require_server:!1,review_timeout_seconds:0,timeout_behavior:"allow",default_export_format:"markdown",webhook_url:""}))},[]);const m=async p=>{if(!e)return;const g={...e,...p};a(g),l(!0);try{await _b(g)}catch{}finally{l(!1)}};return n.jsxs("section",{children:[n.jsx(uu,{icon:ou,title:"Review",description:"Plan and code review interception"}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 space-y-4",children:[e&&[{key:"enabled",label:"Review Enabled",desc:"Enable review interception for plan and code changes"},{key:"plan_review",label:"Plan Review",desc:"Review plans when ExitPlanMode is triggered"},{key:"code_review",label:"Code Review",desc:"Review code diffs before git commits"},{key:"auto_open_browser",label:"Auto-open Browser",desc:"Automatically open the review UI in your browser"},{key:"require_server",label:"Require Server",desc:"Block plan exits and commits when no ULPI server is running"}].map(({key:p,label:g,desc:b})=>n.jsx(_r,{label:g,description:b,children:n.jsx(jm,{enabled:!!e[p],onChange:()=>{const N={...e,[p]:!e[p]};a(N),l(!0),_b(N).catch(()=>{}).finally(()=>l(!1))},disabled:r})},p)),n.jsx(_r,{label:"Review Timeout (seconds)",description:"Max time to wait for a review decision. 0 = indefinitely.",children:n.jsx("input",{type:"number",min:0,max:600,step:30,value:d,onChange:p=>{const g=Math.max(0,Math.min(600,parseInt(p.target.value,10)||0));m({review_timeout_seconds:g})},className:"w-24 px-3 py-1.5 rounded-lg bg-surface-2 border border-border text-sm text-text-primary text-right focus:outline-none focus:border-accent"})}),n.jsx(_r,{label:"On Timeout",description:"What happens when review timeout expires",children:n.jsxs("select",{value:f,onChange:p=>m({timeout_behavior:p.target.value}),className:"px-3 py-1.5 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent",children:[n.jsx("option",{value:"allow",children:"Allow (approve)"}),n.jsx("option",{value:"deny",children:"Deny (block)"})]})}),n.jsxs("div",{className:"pt-4 border-t border-border",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(J0,{size:14,className:"text-text-muted"}),n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Webhook URL"})]}),n.jsx("p",{className:"text-xs text-text-secondary mb-2",children:"POST review data to this URL when exporting via webhook"}),n.jsx("input",{type:"url",placeholder:"https://hooks.example.com/reviews",value:o,onChange:p=>m({webhook_url:p.target.value}),className:"w-full px-3 py-2 rounded-lg bg-surface-2 border border-border text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent"})]}),n.jsx(_r,{label:"Default Export Format",description:"Pre-selected format when opening the export dialog",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(OS,{size:14,className:"text-text-muted"}),n.jsxs("select",{value:u,onChange:p=>m({default_export_format:p.target.value}),className:"px-3 py-1.5 rounded-lg bg-surface-2 border border-border text-sm text-text-primary focus:outline-none focus:border-accent",children:[n.jsx("option",{value:"markdown",children:"Markdown"}),n.jsx("option",{value:"github",children:"GitHub Issue"}),n.jsx("option",{value:"jira",children:"Jira"}),n.jsx("option",{value:"json",children:"JSON"})]})]})})]})]})}function tT(){const{currentProject:e}=on(),a=e==null?void 0:e.id;return n.jsxs("div",{className:"p-6 lg:p-8 space-y-10",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(sp,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Settings"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Configure ULPI preferences"})]})]}),n.jsx(ls,{})]}),n.jsx(ZC,{}),n.jsx(WC,{projectId:a}),n.jsx(JC,{projectId:a}),n.jsx(eT,{}),n.jsx("div",{className:"pt-4 border-t border-border",children:n.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-400",children:[n.jsx(bn,{size:16}),n.jsx("span",{children:"Settings saved automatically"})]})})]})}function Tl(e){if(typeof e=="string")return e;if(e==null)return"";const a=e;if(a.message!=null){const r=a.message;if(typeof r.content=="string")return r.content;if(Array.isArray(r.content))return r.content.map(l=>{if(typeof l=="string")return l;const o=l;return o.type==="thinking"||o.type==="tool_use"||o.type==="tool_result"?"":o.type==="text"&&typeof o.text=="string"?o.text.includes("<system-reminder>")?"":o.text:""}).filter(Boolean).join(`
576
- `);if(typeof r=="string")return r}return typeof a.content=="string"?a.content:Array.isArray(a.content)?a.content.map(r=>typeof r=="string"?r:typeof r.text=="string"?r.text.includes("<system-reminder>")?"":r.text:"").filter(Boolean).join(`
577
- `):typeof a.text=="string"?a.text:""}const nT=new Set(["file-history-snapshot","progress","system","metadata","config","summary","result","error","thinking"]);function sT(e){const a=e.type??"";return!!(nT.has(a)||("sessionId"in e||"parentUuid"in e||"isSidechain"in e)&&!("role"in e)&&!("content"in e||"message"in e)||"isSnapshotUpdate"in e&&"snapshot"in e)}function aT(e){var l,o;if(sT(e))return null;const r=(e.type??e.role??"").toLowerCase();if(r==="human"||r==="user"){const u=Tl(e);return u.trim()?{type:"human",content:u,raw:e}:null}if(r==="assistant"){const u=Tl(e);return u.trim()?{type:"assistant",content:u,raw:e}:null}if(r==="tool_use"){const u=e.name??((l=e.message)==null?void 0:l.name)??"Tool",d=e.input??((o=e.message)==null?void 0:o.input);return{type:"tool_use",content:`${u}`,toolName:u,toolInput:d!=null?JSON.stringify(d,null,2):void 0,raw:e}}if(r==="tool_result")return{type:"tool_result",content:Tl(e),raw:e};if(e.role==="user"||e.role==="human"){const u=Tl(e);return u.trim()?{type:"human",content:u,raw:e}:null}if(e.role==="assistant"){const u=Tl(e);return u.trim()?{type:"assistant",content:u,raw:e}:null}return null}function bv(e){const a=e.split(`
578
- `).filter(o=>o.trim().length>0);if(a.length===0)return null;const r=[];let l=0;for(const o of a)try{const u=JSON.parse(o),d=aT(u);d!==null&&r.push(d),l++}catch{}return l===0||l/a.length<.2?null:r}function rT(e,a){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const iT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oT={};function Qb(e,a){return(oT.jsx?lT:iT).test(e)}const cT=/[ \t\n\f\r]/g;function uT(e){return typeof e=="object"?e.type==="text"?Wb(e.value):!1:Wb(e)}function Wb(e){return e.replace(cT,"")===""}class ao{constructor(a,r,l){this.normal=r,this.property=a,l&&(this.space=l)}}ao.prototype.normal={};ao.prototype.property={};ao.prototype.space=void 0;function yv(e,a){const r={},l={};for(const o of e)Object.assign(r,o.property),Object.assign(l,o.normal);return new ao(r,l,a)}function Sm(e){return e.toLowerCase()}class Zn{constructor(a,r){this.attribute=r,this.property=a}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let dT=0;const rt=zr(),xn=zr(),km=zr(),Ne=zr(),Pt=zr(),_i=zr(),as=zr();function zr(){return 2**++dT}const _m=Object.freeze(Object.defineProperty({__proto__:null,boolean:rt,booleanish:xn,commaOrSpaceSeparated:as,commaSeparated:_i,number:Ne,overloadedBoolean:km,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),$f=Object.keys(_m);class op extends Zn{constructor(a,r,l,o){let u=-1;if(super(a,r),Jb(this,"space",o),typeof l=="number")for(;++u<$f.length;){const d=$f[u];Jb(this,$f[u],(l&_m[d])===_m[d])}}}op.prototype.defined=!0;function Jb(e,a,r){r&&(e[a]=r)}function Oi(e){const a={},r={};for(const[l,o]of Object.entries(e.properties)){const u=new op(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(u.mustUseProperty=!0),a[l]=u,r[Sm(l)]=l,r[Sm(u.attribute)]=l}return new ao(a,r,e.space)}const vv=Oi({properties:{ariaActiveDescendant:null,ariaAtomic:xn,ariaAutoComplete:null,ariaBusy:xn,ariaChecked:xn,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:xn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:xn,ariaFlowTo:Pt,ariaGrabbed:xn,ariaHasPopup:null,ariaHidden:xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:Ne,ariaLive:null,ariaModal:xn,ariaMultiLine:xn,ariaMultiSelectable:xn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:xn,ariaReadOnly:xn,ariaRelevant:null,ariaRequired:xn,ariaRoleDescription:Pt,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:xn,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,a){return a==="role"?a:"aria-"+a.slice(4).toLowerCase()}});function Nv(e,a){return a in e?e[a]:a}function wv(e,a){return Nv(e,a.toLowerCase())}const fT=Oi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_i,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:rt,allowPaymentRequest:rt,allowUserMedia:rt,alt:null,as:null,async:rt,autoCapitalize:null,autoComplete:Pt,autoFocus:rt,autoPlay:rt,blocking:Pt,capture:null,charSet:null,checked:rt,cite:null,className:Pt,cols:Ne,colSpan:null,content:null,contentEditable:xn,controls:rt,controlsList:Pt,coords:Ne|_i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rt,defer:rt,dir:null,dirName:null,disabled:rt,download:km,draggable:xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rt,formTarget:null,headers:Pt,height:Ne,hidden:km,high:Ne,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:rt,inputMode:null,integrity:null,is:null,isMap:rt,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:rt,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rt,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:rt,muted:rt,name:null,nonce:null,noModule:rt,noValidate:rt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:rt,optimum:Ne,pattern:null,ping:Pt,placeholder:null,playsInline:rt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rt,referrerPolicy:null,rel:Pt,required:rt,reversed:rt,rows:Ne,rowSpan:Ne,sandbox:Pt,scope:null,scoped:rt,seamless:rt,selected:rt,shadowRootClonable:rt,shadowRootDelegatesFocus:rt,shadowRootMode:null,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:rt,useMap:null,value:xn,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:rt,declare:rt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:rt,noHref:rt,noShade:rt,noWrap:rt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:xn,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:rt,disableRemotePlayback:rt,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:wv}),mT=Oi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:as,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:Pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:rt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_i,g2:_i,glyphName:_i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:as,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ne,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:as,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:as,rev:as,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:as,requiredFeatures:as,requiredFonts:as,requiredFormats:as,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:as,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:as,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:as,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nv}),Ev=Oi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,a){return"xlink:"+a.slice(5).toLowerCase()}}),jv=Oi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wv}),Sv=Oi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,a){return"xml:"+a.slice(3).toLowerCase()}}),pT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hT=/[A-Z]/g,ey=/-[a-z]/g,xT=/^data[-\w.:]+$/i;function gT(e,a){const r=Sm(a);let l=a,o=Zn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&xT.test(a)){if(a.charAt(4)==="-"){const u=a.slice(5).replace(ey,yT);l="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=a.slice(4);if(!ey.test(u)){let d=u.replace(hT,bT);d.charAt(0)!=="-"&&(d="-"+d),a="data"+d}}o=op}return new o(l,a)}function bT(e){return"-"+e.toLowerCase()}function yT(e){return e.charAt(1).toUpperCase()}const vT=yv([vv,fT,Ev,jv,Sv],"html"),cp=yv([vv,mT,Ev,jv,Sv],"svg");function NT(e){return e.join(" ").trim()}var yi={},Pf,ty;function wT(){if(ty)return Pf;ty=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
579
- `,p="/",g="*",b="",N="comment",v="declaration";function w(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var _=1,M=1;function Z($){var U=$.match(a);U&&(_+=U.length);var B=$.lastIndexOf(m);M=~B?$.length-B:M+$.length}function Y(){var $={line:_,column:M};return function(U){return U.position=new C($),F(),U}}function C($){this.start=$,this.end={line:_,column:M},this.source=k.source}C.prototype.content=S;function I($){var U=new Error(k.source+":"+_+":"+M+": "+$);if(U.reason=$,U.filename=k.source,U.line=_,U.column=M,U.source=S,!k.silent)throw U}function D($){var U=$.exec(S);if(U){var B=U[0];return Z(B),S=S.slice(B.length),U}}function F(){D(r)}function R($){var U;for($=$||[];U=z();)U!==!1&&$.push(U);return $}function z(){var $=Y();if(!(p!=S.charAt(0)||g!=S.charAt(1))){for(var U=2;b!=S.charAt(U)&&(g!=S.charAt(U)||p!=S.charAt(U+1));)++U;if(U+=2,b===S.charAt(U-1))return I("End of comment missing");var B=S.slice(2,U-2);return M+=2,Z(B),S=S.slice(U),M+=2,$({type:N,comment:B})}}function P(){var $=Y(),U=D(l);if(U){if(z(),!D(o))return I("property missing ':'");var B=D(u),Q=$({type:v,property:j(U[0].replace(e,b)),value:B?j(B[0].replace(e,b)):b});return D(d),Q}}function q(){var $=[];R($);for(var U;U=P();)U!==!1&&($.push(U),R($));return $}return F(),q()}function j(S){return S?S.replace(f,b):b}return Pf=w,Pf}var ny;function ET(){if(ny)return yi;ny=1;var e=yi&&yi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(yi,"__esModule",{value:!0}),yi.default=r;const a=e(wT());function r(l,o){let u=null;if(!l||typeof l!="string")return u;const d=(0,a.default)(l),f=typeof o=="function";return d.forEach(m=>{if(m.type!=="declaration")return;const{property:p,value:g}=m;f?o(p,g,m):g&&(u=u||{},u[p]=g)}),u}return yi}var Al={},sy;function jT(){if(sy)return Al;sy=1,Object.defineProperty(Al,"__esModule",{value:!0}),Al.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(p){return!p||r.test(p)||e.test(p)},d=function(p,g){return g.toUpperCase()},f=function(p,g){return"".concat(g,"-")},m=function(p,g){return g===void 0&&(g={}),u(p)?p:(p=p.toLowerCase(),g.reactCompat?p=p.replace(o,f):p=p.replace(l,f),p.replace(a,d))};return Al.camelCase=m,Al}var Rl,ay;function ST(){if(ay)return Rl;ay=1;var e=Rl&&Rl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},a=e(ET()),r=jT();function l(o,u){var d={};return!o||typeof o!="string"||(0,a.default)(o,function(f,m){f&&m&&(d[(0,r.camelCase)(f,u)]=m)}),d}return l.default=l,Rl=l,Rl}var kT=ST();const _T=nu(kT),kv=_v("end"),up=_v("start");function _v(e){return a;function a(r){const l=r&&r.position&&r.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function CT(e){const a=up(e),r=kv(e);if(a&&r)return{start:a,end:r}}function Il(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ry(e.position):"start"in e||"end"in e?ry(e):"line"in e||"column"in e?Cm(e):""}function Cm(e){return iy(e&&e.line)+":"+iy(e&&e.column)}function ry(e){return Cm(e&&e.start)+"-"+Cm(e&&e.end)}function iy(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(a,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let o="",u={},d=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof a=="string"?o=a:!u.cause&&a&&(d=!0,o=a.message,u.cause=a),!u.ruleId&&!u.source&&typeof l=="string"){const m=l.indexOf(":");m===-1?u.ruleId=l:(u.source=l.slice(0,m),u.ruleId=l.slice(m+1))}if(!u.place&&u.ancestors&&u.ancestors){const m=u.ancestors[u.ancestors.length-1];m&&(u.place=m.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=Il(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const dp={}.hasOwnProperty,TT=new Map,AT=/[A-Z]/g,RT=new Set(["table","tbody","thead","tfoot","tr"]),MT=new Set(["td","th"]),Cv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OT(e,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=a.filePath||void 0;let l;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=PT(r,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=$T(r,a.jsx,a.jsxs)}const o={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:l,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?cp:vT,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},u=Tv(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function Tv(e,a,r){if(a.type==="element")return DT(e,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return LT(e,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return IT(e,a,r);if(a.type==="mdxjsEsm")return zT(e,a);if(a.type==="root")return UT(e,a,r);if(a.type==="text")return BT(e,a)}function DT(e,a,r){const l=e.schema;let o=l;a.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=cp,e.schema=o),e.ancestors.push(a);const u=Rv(e,a.tagName,!1),d=FT(e,a);let f=mp(e,a);return RT.has(a.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!uT(m):!0})),Av(e,d,u,a),fp(d,f),e.ancestors.pop(),e.schema=l,e.create(a,u,d,r)}function LT(e,a){if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}ql(e,a.position)}function zT(e,a){if(a.data&&a.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(a.data.estree);ql(e,a.position)}function IT(e,a,r){const l=e.schema;let o=l;a.name==="svg"&&l.space==="html"&&(o=cp,e.schema=o),e.ancestors.push(a);const u=a.name===null?e.Fragment:Rv(e,a.name,!0),d=HT(e,a),f=mp(e,a);return Av(e,d,u,a),fp(d,f),e.ancestors.pop(),e.schema=l,e.create(a,u,d,r)}function UT(e,a,r){const l={};return fp(l,mp(e,a)),e.create(a,e.Fragment,l,r)}function BT(e,a){return a.value}function Av(e,a,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(a.node=l)}function fp(e,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(e.children=r)}}function $T(e,a,r){return l;function l(o,u,d,f){const p=Array.isArray(d.children)?r:a;return f?p(u,d,f):p(u,d)}}function PT(e,a){return r;function r(l,o,u,d){const f=Array.isArray(u.children),m=up(l);return a(o,u,d,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function FT(e,a){const r={};let l,o;for(o in a.properties)if(o!=="children"&&dp.call(a.properties,o)){const u=qT(e,o,a.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&MT.has(a.tagName)?l=f:r[d]=f}}if(l){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function HT(e,a){const r={};for(const l of a.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const u=l.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else ql(e,a.position);else{const o=l.name;let u;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else ql(e,a.position);else u=l.value===null?!0:l.value;r[o]=u}return r}function mp(e,a){const r=[];let l=-1;const o=e.passKeys?new Map:TT;for(;++l<a.children.length;){const u=a.children[l];let d;if(e.passKeys){const m=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(m){const p=o.get(m)||0;d=m+"-"+p,o.set(m,p+1)}}const f=Tv(e,u,d);f!==void 0&&r.push(f)}return r}function qT(e,a,r){const l=gT(e.schema,a);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?rT(r):NT(r)),l.property==="style"){let o=typeof r=="object"?r:GT(e,String(r));return e.stylePropertyNameCase==="css"&&(o=KT(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?pT[l.property]||l.property:l.attribute,r]}}function GT(e,a){try{return _T(a,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,o=new zn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Cv+"#cannot-parse-style-attribute",o}}function Rv(e,a,r){let l;if(!r)l={type:"Literal",value:a};else if(a.includes(".")){const o=a.split(".");let u=-1,d;for(;++u<o.length;){const f=Qb(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}l=d}else l=Qb(a)&&!/^[a-z]/.test(a)?{type:"Identifier",name:a}:{type:"Literal",value:a};if(l.type==="Literal"){const o=l.value;return dp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);ql(e)}function ql(e,a){const r=new zn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:a,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Cv+"#cannot-handle-mdx-estrees-without-createevaluater",r}function KT(e){const a={};let r;for(r in e)dp.call(e,r)&&(a[YT(r)]=e[r]);return a}function YT(e){let a=e.replace(AT,VT);return a.slice(0,3)==="ms-"&&(a="-"+a),a}function VT(e){return"-"+e.toLowerCase()}const Ff={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},XT={};function pp(e,a){const r=XT,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Mv(e,l,o)}function Mv(e,a,r){if(ZT(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(a&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ly(e.children,a,r)}return Array.isArray(e)?ly(e,a,r):""}function ly(e,a,r){const l=[];let o=-1;for(;++o<e.length;)l[o]=Mv(e[o],a,r);return l.join("")}function ZT(e){return!!(e&&typeof e=="object")}const oy=document.createElement("i");function hp(e){const a="&"+e+";";oy.innerHTML=a;const r=oy.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===a?!1:r}function is(e,a,r,l){const o=e.length;let u=0,d;if(a<0?a=-a>o?0:o+a:a=a>o?o:a,r=r>0?r:0,l.length<1e4)d=Array.from(l),d.unshift(a,r),e.splice(...d);else for(r&&e.splice(a,r);u<l.length;)d=l.slice(u,u+1e4),d.unshift(a,0),e.splice(...d),u+=1e4,a+=1e4}function ys(e,a){return e.length>0?(is(e,e.length,0,a),e):a}const cy={}.hasOwnProperty;function Ov(e){const a={};let r=-1;for(;++r<e.length;)QT(a,e[r]);return a}function QT(e,a){let r;for(r in a){const o=(cy.call(e,r)?e[r]:void 0)||(e[r]={}),u=a[r];let d;if(u)for(d in u){cy.call(o,d)||(o[d]=[]);const f=u[d];WT(o[d],Array.isArray(f)?f:f?[f]:[])}}}function WT(e,a){let r=-1;const l=[];for(;++r<a.length;)(a[r].add==="after"?e:l).push(a[r]);is(e,0,0,l)}function Dv(e,a){const r=Number.parseInt(e,a);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ts(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=ar(/[A-Za-z]/),Ln=ar(/[\dA-Za-z]/),JT=ar(/[#-'*+\--9=?A-Z^-~]/);function Xc(e){return e!==null&&(e<32||e===127)}const Tm=ar(/\d/),eA=ar(/[\dA-Fa-f]/),tA=ar(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Bt(e){return e!==null&&(e<0||e===32)}function ft(e){return e===-2||e===-1||e===32}const du=ar(new RegExp("\\p{P}|\\p{S}","u")),Lr=ar(/\s/);function ar(e){return a;function a(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Di(e){const a=[];let r=-1,l=0,o=0;for(;++r<e.length;){const u=e.charCodeAt(r);let d="";if(u===37&&Ln(e.charCodeAt(r+1))&&Ln(e.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(r+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(a.push(e.slice(l,r),encodeURIComponent(d)),l=r+o+1,d=""),o&&(r+=o,o=0)}return a.join("")+e.slice(l)}function yt(e,a,r,l){const o=l?l-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(m){return ft(m)?(e.enter(r),f(m)):a(m)}function f(m){return ft(m)&&u++<o?(e.consume(m),f):(e.exit(r),a(m))}}const nA={tokenize:sA};function sA(e){const a=e.attempt(this.parser.constructs.contentInitial,l,o);let r;return a;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),yt(e,a,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const m=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=m),r=m,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return He(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const aA={tokenize:rA},uy={tokenize:iA};function rA(e){const a=this,r=[];let l=0,o,u,d;return f;function f(M){if(l<r.length){const Z=r[l];return a.containerState=Z[1],e.attempt(Z[0].continuation,m,p)(M)}return p(M)}function m(M){if(l++,a.containerState._closeFlow){a.containerState._closeFlow=void 0,o&&_();const Z=a.events.length;let Y=Z,C;for(;Y--;)if(a.events[Y][0]==="exit"&&a.events[Y][1].type==="chunkFlow"){C=a.events[Y][1].end;break}k(l);let I=Z;for(;I<a.events.length;)a.events[I][1].end={...C},I++;return is(a.events,Y+1,0,a.events.slice(Z)),a.events.length=I,p(M)}return f(M)}function p(M){if(l===r.length){if(!o)return N(M);if(o.currentConstruct&&o.currentConstruct.concrete)return w(M);a.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(uy,g,b)(M)}function g(M){return o&&_(),k(l),N(M)}function b(M){return a.parser.lazy[a.now().line]=l!==r.length,d=a.now().offset,w(M)}function N(M){return a.containerState={},e.attempt(uy,v,w)(M)}function v(M){return l++,r.push([a.currentConstruct,a.containerState]),N(M)}function w(M){if(M===null){o&&_(),k(0),e.consume(M);return}return o=o||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),j(M)}function j(M){if(M===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(M);return}return He(M)?(e.consume(M),S(e.exit("chunkFlow")),l=0,a.interrupt=void 0,f):(e.consume(M),j)}function S(M,Z){const Y=a.sliceStream(M);if(Z&&Y.push(null),M.previous=u,u&&(u.next=M),u=M,o.defineSkip(M.start),o.write(Y),a.parser.lazy[M.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<d&&(!o.events[C][1].end||o.events[C][1].end.offset>d))return;const I=a.events.length;let D=I,F,R;for(;D--;)if(a.events[D][0]==="exit"&&a.events[D][1].type==="chunkFlow"){if(F){R=a.events[D][1].end;break}F=!0}for(k(l),C=I;C<a.events.length;)a.events[C][1].end={...R},C++;is(a.events,D+1,0,a.events.slice(I)),a.events.length=C}}function k(M){let Z=r.length;for(;Z-- >M;){const Y=r[Z];a.containerState=Y[1],Y[0].exit.call(a,e)}r.length=M}function _(){o.write([null]),u=void 0,o=void 0,a.containerState._closeFlow=void 0}}function iA(e,a,r){return yt(e,e.attempt(this.parser.constructs.document,a,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ai(e){if(e===null||Bt(e)||Lr(e))return 1;if(du(e))return 2}function fu(e,a,r){const l=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!l.includes(u)&&(a=u(a,r),l.push(u))}return a}const Am={name:"attention",resolveAll:lA,tokenize:oA};function lA(e,a){let r=-1,l,o,u,d,f,m,p,g;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&a.sliceSerialize(e[l][1]).charCodeAt(0)===a.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;m=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const b={...e[l][1].end},N={...e[r][1].start};dy(b,-m),dy(N,m),d={type:m>1?"strongSequence":"emphasisSequence",start:b,end:{...e[l][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:N},u={type:m>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},o={type:m>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[l][1].end={...d.start},e[r][1].start={...f.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=ys(p,[["enter",e[l][1],a],["exit",e[l][1],a]])),p=ys(p,[["enter",o,a],["enter",d,a],["exit",d,a],["enter",u,a]]),p=ys(p,fu(a.parser.constructs.insideSpan.null,e.slice(l+1,r),a)),p=ys(p,[["exit",u,a],["enter",f,a],["exit",f,a],["exit",o,a]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,p=ys(p,[["enter",e[r][1],a],["exit",e[r][1],a]])):g=0,is(e,l-1,r-l+3,p),r=l+p.length-g-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function oA(e,a){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,o=Ai(l);let u;return d;function d(m){return u=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===u)return e.consume(m),f;const p=e.exit("attentionSequence"),g=Ai(m),b=!g||g===2&&o||r.includes(m),N=!o||o===2&&g||r.includes(l);return p._open=!!(u===42?b:b&&(o||!N)),p._close=!!(u===42?N:N&&(g||!b)),a(m)}}function dy(e,a){e.column+=a,e.offset+=a,e._bufferIndex+=a}const cA={name:"autolink",tokenize:uA};function uA(e,a,r){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return Bn(v)?(e.consume(v),d):v===64?r(v):p(v)}function d(v){return v===43||v===45||v===46||Ln(v)?(l=1,f(v)):p(v)}function f(v){return v===58?(e.consume(v),l=0,m):(v===43||v===45||v===46||Ln(v))&&l++<32?(e.consume(v),f):(l=0,p(v))}function m(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),a):v===null||v===32||v===60||Xc(v)?r(v):(e.consume(v),m)}function p(v){return v===64?(e.consume(v),g):JT(v)?(e.consume(v),p):r(v)}function g(v){return Ln(v)?b(v):r(v)}function b(v){return v===46?(e.consume(v),l=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),a):N(v)}function N(v){if((v===45||Ln(v))&&l++<63){const w=v===45?N:b;return e.consume(v),w}return r(v)}}const ro={partial:!0,tokenize:dA};function dA(e,a,r){return l;function l(u){return ft(u)?yt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||He(u)?a(u):r(u)}}const Lv={continuation:{tokenize:mA},exit:pA,name:"blockQuote",tokenize:fA};function fA(e,a,r){const l=this;return o;function o(d){if(d===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return r(d)}function u(d){return ft(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),a):(e.exit("blockQuotePrefix"),a(d))}}function mA(e,a,r){const l=this;return o;function o(d){return ft(d)?yt(e,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Lv,a,r)(d)}}function pA(e){e.exit("blockQuote")}const zv={name:"characterEscape",tokenize:hA};function hA(e,a,r){return l;function l(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return tA(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),a):r(u)}}const Iv={name:"characterReference",tokenize:xA};function xA(e,a,r){const l=this;let o=0,u,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),m}function m(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),u=31,d=Ln,g(b))}function p(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=eA,g):(e.enter("characterReferenceValue"),u=7,d=Tm,g(b))}function g(b){if(b===59&&o){const N=e.exit("characterReferenceValue");return d===Ln&&!hp(l.sliceSerialize(N))?r(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),a)}return d(b)&&o++<u?(e.consume(b),g):r(b)}}const fy={partial:!0,tokenize:bA},my={concrete:!0,name:"codeFenced",tokenize:gA};function gA(e,a,r){const l=this,o={partial:!0,tokenize:Y};let u=0,d=0,f;return m;function m(C){return p(C)}function p(C){const I=l.events[l.events.length-1];return u=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(C)}function g(C){return C===f?(d++,e.consume(C),g):d<3?r(C):(e.exit("codeFencedFenceSequence"),ft(C)?yt(e,b,"whitespace")(C):b(C))}function b(C){return C===null||He(C)?(e.exit("codeFencedFence"),l.interrupt?a(C):e.check(fy,j,Z)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),N(C))}function N(C){return C===null||He(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(C)):ft(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yt(e,v,"whitespace")(C)):C===96&&C===f?r(C):(e.consume(C),N)}function v(C){return C===null||He(C)?b(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(C))}function w(C){return C===null||He(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(C)):C===96&&C===f?r(C):(e.consume(C),w)}function j(C){return e.attempt(o,Z,S)(C)}function S(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),k}function k(C){return u>0&&ft(C)?yt(e,_,"linePrefix",u+1)(C):_(C)}function _(C){return C===null||He(C)?e.check(fy,j,Z)(C):(e.enter("codeFlowValue"),M(C))}function M(C){return C===null||He(C)?(e.exit("codeFlowValue"),_(C)):(e.consume(C),M)}function Z(C){return e.exit("codeFenced"),a(C)}function Y(C,I,D){let F=0;return R;function R(U){return C.enter("lineEnding"),C.consume(U),C.exit("lineEnding"),z}function z(U){return C.enter("codeFencedFence"),ft(U)?yt(C,P,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):P(U)}function P(U){return U===f?(C.enter("codeFencedFenceSequence"),q(U)):D(U)}function q(U){return U===f?(F++,C.consume(U),q):F>=d?(C.exit("codeFencedFenceSequence"),ft(U)?yt(C,$,"whitespace")(U):$(U)):D(U)}function $(U){return U===null||He(U)?(C.exit("codeFencedFence"),I(U)):D(U)}}}function bA(e,a,r){const l=this;return o;function o(d){return d===null?r(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return l.parser.lazy[l.now().line]?r(d):a(d)}}const Hf={name:"codeIndented",tokenize:vA},yA={partial:!0,tokenize:NA};function vA(e,a,r){const l=this;return o;function o(p){return e.enter("codeIndented"),yt(e,u,"linePrefix",5)(p)}function u(p){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?d(p):r(p)}function d(p){return p===null?m(p):He(p)?e.attempt(yA,d,m)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||He(p)?(e.exit("codeFlowValue"),d(p)):(e.consume(p),f)}function m(p){return e.exit("codeIndented"),a(p)}}function NA(e,a,r){const l=this;return o;function o(d){return l.parser.lazy[l.now().line]?r(d):He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):yt(e,u,"linePrefix",5)(d)}function u(d){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):He(d)?o(d):r(d)}}const wA={name:"codeText",previous:jA,resolve:EA,tokenize:SA};function EA(e){let a=e.length-4,r=3,l,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[a][1].type==="lineEnding"||e[a][1].type==="space")){for(l=r;++l<a;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[a][1].type="codeTextPadding",r+=2,a-=2;break}}for(l=r-1,a++;++l<=a;)o===void 0?l!==a&&e[l][1].type!=="lineEnding"&&(o=l):(l===a||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),a-=l-o-2,l=o+2),o=void 0);return e}function jA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SA(e,a,r){let l=0,o,u;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),l++,f):(e.exit("codeTextSequence"),m(b))}function m(b){return b===null?r(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),m):b===96?(u=e.enter("codeTextSequence"),o=0,g(b)):He(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("codeTextData"),p(b))}function p(b){return b===null||b===32||b===96||He(b)?(e.exit("codeTextData"),m(b)):(e.consume(b),p)}function g(b){return b===96?(e.consume(b),o++,g):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),a(b)):(u.type="codeTextData",p(b))}}class kA{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,r){const l=r??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(a,l):a>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(a,r,l){const o=r||0;this.setCursor(Math.trunc(a));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&Ml(this.left,l),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),Ml(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),Ml(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a<this.left.length){const r=this.left.splice(a,Number.POSITIVE_INFINITY);Ml(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-a,Number.POSITIVE_INFINITY);Ml(this.left,r.reverse())}}}function Ml(e,a){let r=0;if(a.length<1e4)e.push(...a);else for(;r<a.length;)e.push(...a.slice(r,r+1e4)),r+=1e4}function Uv(e){const a={};let r=-1,l,o,u,d,f,m,p;const g=new kA(e);for(;++r<g.length;){for(;r in a;)r=a[r];if(l=g.get(r),r&&l[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(m=l[1]._tokenizer.events,u=0,u<m.length&&m[u][1].type==="lineEndingBlank"&&(u+=2),u<m.length&&m[u][1].type==="content"))for(;++u<m.length&&m[u][1].type!=="content";)m[u][1].type==="chunkText"&&(m[u][1]._isInFirstContentOfListItem=!0,u++);if(l[0]==="enter")l[1].contentType&&(Object.assign(a,_A(g,r)),r=a[r],p=!0);else if(l[1]._container){for(u=r,o=void 0;u--;)if(d=g.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(l[1].end={...g.get(o)[1].start},f=g.slice(o,r),f.unshift(l),g.splice(o,r-o+1,f))}}return is(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!p}function _A(e,a){const r=e.get(a)[1],l=e.get(a)[2];let o=a-1;const u=[];let d=r._tokenizer;d||(d=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,m=[],p={};let g,b,N=-1,v=r,w=0,j=0;const S=[j];for(;v;){for(;e.get(++o)[1]!==v;);u.push(o),v._tokenizer||(g=l.sliceStream(v),v.next||g.push(null),b&&d.defineSkip(v.start),v._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(g),v._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=v,v=v.next}for(v=r;++N<f.length;)f[N][0]==="exit"&&f[N-1][0]==="enter"&&f[N][1].type===f[N-1][1].type&&f[N][1].start.line!==f[N][1].end.line&&(j=N+1,S.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(d.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),N=S.length;N--;){const k=f.slice(S[N],S[N+1]),_=u.pop();m.push([_,_+k.length-1]),e.splice(_,2,k)}for(m.reverse(),N=-1;++N<m.length;)p[w+m[N][0]]=w+m[N][1],w+=m[N][1]-m[N][0]-1;return p}const CA={resolve:AA,tokenize:RA},TA={partial:!0,tokenize:MA};function AA(e){return Uv(e),e}function RA(e,a){let r;return l;function l(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):He(f)?e.check(TA,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),a(f)}function d(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function MA(e,a,r){const l=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),yt(e,u,"linePrefix")}function u(d){if(d===null||He(d))return r(d);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):e.interrupt(l.parser.constructs.flow,r,a)(d)}}function Bv(e,a,r,l,o,u,d,f,m){const p=m||Number.POSITIVE_INFINITY;let g=0;return b;function b(k){return k===60?(e.enter(l),e.enter(o),e.enter(u),e.consume(k),e.exit(u),N):k===null||k===32||k===41||Xc(k)?r(k):(e.enter(l),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(k))}function N(k){return k===62?(e.enter(u),e.consume(k),e.exit(u),e.exit(o),e.exit(l),a):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(f),N(k)):k===null||k===60||He(k)?r(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function j(k){return!g&&(k===null||k===41||Bt(k))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(l),a(k)):g<p&&k===40?(e.consume(k),g++,j):k===41?(e.consume(k),g--,j):k===null||k===32||k===40||Xc(k)?r(k):(e.consume(k),k===92?S:j)}function S(k){return k===40||k===41||k===92?(e.consume(k),j):j(k)}}function $v(e,a,r,l,o,u){const d=this;let f=0,m;return p;function p(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(u),g}function g(v){return f>999||v===null||v===91||v===93&&!m||v===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?r(v):v===93?(e.exit(u),e.enter(o),e.consume(v),e.exit(o),e.exit(l),a):He(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===null||v===91||v===93||He(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),m||(m=!ft(v)),v===92?N:b)}function N(v){return v===91||v===92||v===93?(e.consume(v),f++,b):b(v)}}function Pv(e,a,r,l,o,u){let d;return f;function f(N){return N===34||N===39||N===40?(e.enter(l),e.enter(o),e.consume(N),e.exit(o),d=N===40?41:N,m):r(N)}function m(N){return N===d?(e.enter(o),e.consume(N),e.exit(o),e.exit(l),a):(e.enter(u),p(N))}function p(N){return N===d?(e.exit(u),m(d)):N===null?r(N):He(N)?(e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),yt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===d||N===null||He(N)?(e.exit("chunkString"),p(N)):(e.consume(N),N===92?b:g)}function b(N){return N===d||N===92?(e.consume(N),g):g(N)}}function Ul(e,a){let r;return l;function l(o){return He(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,l):ft(o)?yt(e,l,r?"linePrefix":"lineSuffix")(o):a(o)}}const OA={name:"definition",tokenize:LA},DA={partial:!0,tokenize:zA};function LA(e,a,r){const l=this;let o;return u;function u(v){return e.enter("definition"),d(v)}function d(v){return $v.call(l,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=Ts(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),m):r(v)}function m(v){return Bt(v)?Ul(e,p)(v):p(v)}function p(v){return Bv(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(DA,b,b)(v)}function b(v){return ft(v)?yt(e,N,"whitespace")(v):N(v)}function N(v){return v===null||He(v)?(e.exit("definition"),l.parser.defined.push(o),a(v)):r(v)}}function zA(e,a,r){return l;function l(f){return Bt(f)?Ul(e,o)(f):r(f)}function o(f){return Pv(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return ft(f)?yt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||He(f)?a(f):r(f)}}const IA={name:"hardBreakEscape",tokenize:UA};function UA(e,a,r){return l;function l(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return He(u)?(e.exit("hardBreakEscape"),a(u)):r(u)}}const BA={name:"headingAtx",resolve:$A,tokenize:PA};function $A(e,a){let r=e.length-2,l=3,o,u;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},u={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},is(e,l,r-l+1,[["enter",o,a],["enter",u,a],["exit",u,a],["exit",o,a]])),e}function PA(e,a,r){let l=0;return o;function o(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),d(g)}function d(g){return g===35&&l++<6?(e.consume(g),d):g===null||Bt(g)?(e.exit("atxHeadingSequence"),f(g)):r(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),m(g)):g===null||He(g)?(e.exit("atxHeading"),a(g)):ft(g)?yt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),p(g))}function m(g){return g===35?(e.consume(g),m):(e.exit("atxHeadingSequence"),f(g))}function p(g){return g===null||g===35||Bt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),p)}}const FA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],py=["pre","script","style","textarea"],HA={concrete:!0,name:"htmlFlow",resolveTo:KA,tokenize:YA},qA={partial:!0,tokenize:XA},GA={partial:!0,tokenize:VA};function KA(e){let a=e.length;for(;a--&&!(e[a][0]==="enter"&&e[a][1].type==="htmlFlow"););return a>1&&e[a-2][1].type==="linePrefix"&&(e[a][1].start=e[a-2][1].start,e[a+1][1].start=e[a-2][1].start,e.splice(a-2,2)),e}function YA(e,a,r){const l=this;let o,u,d,f,m;return p;function p(O){return g(O)}function g(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),b}function b(O){return O===33?(e.consume(O),N):O===47?(e.consume(O),u=!0,j):O===63?(e.consume(O),o=3,l.interrupt?a:T):Bn(O)?(e.consume(O),d=String.fromCharCode(O),S):r(O)}function N(O){return O===45?(e.consume(O),o=2,v):O===91?(e.consume(O),o=5,f=0,w):Bn(O)?(e.consume(O),o=4,l.interrupt?a:T):r(O)}function v(O){return O===45?(e.consume(O),l.interrupt?a:T):r(O)}function w(O){const H="CDATA[";return O===H.charCodeAt(f++)?(e.consume(O),f===H.length?l.interrupt?a:P:w):r(O)}function j(O){return Bn(O)?(e.consume(O),d=String.fromCharCode(O),S):r(O)}function S(O){if(O===null||O===47||O===62||Bt(O)){const H=O===47,V=d.toLowerCase();return!H&&!u&&py.includes(V)?(o=1,l.interrupt?a(O):P(O)):FA.includes(d.toLowerCase())?(o=6,H?(e.consume(O),k):l.interrupt?a(O):P(O)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(O):u?_(O):M(O))}return O===45||Ln(O)?(e.consume(O),d+=String.fromCharCode(O),S):r(O)}function k(O){return O===62?(e.consume(O),l.interrupt?a:P):r(O)}function _(O){return ft(O)?(e.consume(O),_):R(O)}function M(O){return O===47?(e.consume(O),R):O===58||O===95||Bn(O)?(e.consume(O),Z):ft(O)?(e.consume(O),M):R(O)}function Z(O){return O===45||O===46||O===58||O===95||Ln(O)?(e.consume(O),Z):Y(O)}function Y(O){return O===61?(e.consume(O),C):ft(O)?(e.consume(O),Y):M(O)}function C(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),m=O,I):ft(O)?(e.consume(O),C):D(O)}function I(O){return O===m?(e.consume(O),m=null,F):O===null||He(O)?r(O):(e.consume(O),I)}function D(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Bt(O)?Y(O):(e.consume(O),D)}function F(O){return O===47||O===62||ft(O)?M(O):r(O)}function R(O){return O===62?(e.consume(O),z):r(O)}function z(O){return O===null||He(O)?P(O):ft(O)?(e.consume(O),z):r(O)}function P(O){return O===45&&o===2?(e.consume(O),B):O===60&&o===1?(e.consume(O),Q):O===62&&o===4?(e.consume(O),L):O===63&&o===3?(e.consume(O),T):O===93&&o===5?(e.consume(O),ie):He(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(qA,G,q)(O)):O===null||He(O)?(e.exit("htmlFlowData"),q(O)):(e.consume(O),P)}function q(O){return e.check(GA,$,G)(O)}function $(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),U}function U(O){return O===null||He(O)?q(O):(e.enter("htmlFlowData"),P(O))}function B(O){return O===45?(e.consume(O),T):P(O)}function Q(O){return O===47?(e.consume(O),d="",ee):P(O)}function ee(O){if(O===62){const H=d.toLowerCase();return py.includes(H)?(e.consume(O),L):P(O)}return Bn(O)&&d.length<8?(e.consume(O),d+=String.fromCharCode(O),ee):P(O)}function ie(O){return O===93?(e.consume(O),T):P(O)}function T(O){return O===62?(e.consume(O),L):O===45&&o===2?(e.consume(O),T):P(O)}function L(O){return O===null||He(O)?(e.exit("htmlFlowData"),G(O)):(e.consume(O),L)}function G(O){return e.exit("htmlFlow"),a(O)}}function VA(e,a,r){const l=this;return o;function o(d){return He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):r(d)}function u(d){return l.parser.lazy[l.now().line]?r(d):a(d)}}function XA(e,a,r){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ro,a,r)}}const ZA={name:"htmlText",tokenize:QA};function QA(e,a,r){const l=this;let o,u,d;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),Y):T===63?(e.consume(T),M):Bn(T)?(e.consume(T),D):r(T)}function p(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),u=0,w):Bn(T)?(e.consume(T),_):r(T)}function g(T){return T===45?(e.consume(T),v):r(T)}function b(T){return T===null?r(T):T===45?(e.consume(T),N):He(T)?(d=b,Q(T)):(e.consume(T),b)}function N(T){return T===45?(e.consume(T),v):b(T)}function v(T){return T===62?B(T):T===45?N(T):b(T)}function w(T){const L="CDATA[";return T===L.charCodeAt(u++)?(e.consume(T),u===L.length?j:w):r(T)}function j(T){return T===null?r(T):T===93?(e.consume(T),S):He(T)?(d=j,Q(T)):(e.consume(T),j)}function S(T){return T===93?(e.consume(T),k):j(T)}function k(T){return T===62?B(T):T===93?(e.consume(T),k):j(T)}function _(T){return T===null||T===62?B(T):He(T)?(d=_,Q(T)):(e.consume(T),_)}function M(T){return T===null?r(T):T===63?(e.consume(T),Z):He(T)?(d=M,Q(T)):(e.consume(T),M)}function Z(T){return T===62?B(T):M(T)}function Y(T){return Bn(T)?(e.consume(T),C):r(T)}function C(T){return T===45||Ln(T)?(e.consume(T),C):I(T)}function I(T){return He(T)?(d=I,Q(T)):ft(T)?(e.consume(T),I):B(T)}function D(T){return T===45||Ln(T)?(e.consume(T),D):T===47||T===62||Bt(T)?F(T):r(T)}function F(T){return T===47?(e.consume(T),B):T===58||T===95||Bn(T)?(e.consume(T),R):He(T)?(d=F,Q(T)):ft(T)?(e.consume(T),F):B(T)}function R(T){return T===45||T===46||T===58||T===95||Ln(T)?(e.consume(T),R):z(T)}function z(T){return T===61?(e.consume(T),P):He(T)?(d=z,Q(T)):ft(T)?(e.consume(T),z):F(T)}function P(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),o=T,q):He(T)?(d=P,Q(T)):ft(T)?(e.consume(T),P):(e.consume(T),$)}function q(T){return T===o?(e.consume(T),o=void 0,U):T===null?r(T):He(T)?(d=q,Q(T)):(e.consume(T),q)}function $(T){return T===null||T===34||T===39||T===60||T===61||T===96?r(T):T===47||T===62||Bt(T)?F(T):(e.consume(T),$)}function U(T){return T===47||T===62||Bt(T)?F(T):r(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),a):r(T)}function Q(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ee}function ee(T){return ft(T)?yt(e,ie,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ie(T)}function ie(T){return e.enter("htmlTextData"),d(T)}}const xp={name:"labelEnd",resolveAll:tR,resolveTo:nR,tokenize:sR},WA={tokenize:aR},JA={tokenize:rR},eR={tokenize:iR};function tR(e){let a=-1;const r=[];for(;++a<e.length;){const l=e[a][1];if(r.push(e[a]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",a+=o}}return e.length!==r.length&&is(e,0,e.length,r),e}function nR(e,a){let r=e.length,l=0,o,u,d,f;for(;r--;)if(o=e[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(d=r);const m={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},g={type:"labelText",start:{...e[u+l+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",m,a],["enter",p,a]],f=ys(f,e.slice(u+1,u+l+3)),f=ys(f,[["enter",g,a]]),f=ys(f,fu(a.parser.constructs.insideSpan.null,e.slice(u+l+4,d-3),a)),f=ys(f,[["exit",g,a],e[d-2],e[d-1],["exit",p,a]]),f=ys(f,e.slice(d+1)),f=ys(f,[["exit",m,a]]),is(e,u,e.length,f),e}function sR(e,a,r){const l=this;let o=l.events.length,u,d;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){u=l.events[o][1];break}return f;function f(N){return u?u._inactive?b(N):(d=l.parser.defined.includes(Ts(l.sliceSerialize({start:u.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(N),e.exit("labelMarker"),e.exit("labelEnd"),m):r(N)}function m(N){return N===40?e.attempt(WA,g,d?g:b)(N):N===91?e.attempt(JA,g,d?p:b)(N):d?g(N):b(N)}function p(N){return e.attempt(eR,g,b)(N)}function g(N){return a(N)}function b(N){return u._balanced=!0,r(N)}}function aR(e,a,r){return l;function l(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),o}function o(b){return Bt(b)?Ul(e,u)(b):u(b)}function u(b){return b===41?g(b):Bv(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Bt(b)?Ul(e,m)(b):g(b)}function f(b){return r(b)}function m(b){return b===34||b===39||b===40?Pv(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):g(b)}function p(b){return Bt(b)?Ul(e,g)(b):g(b)}function g(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),a):r(b)}}function rR(e,a,r){const l=this;return o;function o(f){return $v.call(l,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return l.parser.defined.includes(Ts(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?a(f):r(f)}function d(f){return r(f)}}function iR(e,a,r){return l;function l(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),a):r(u)}}const lR={name:"labelStartImage",resolveAll:xp.resolveAll,tokenize:oR};function oR(e,a,r){const l=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):r(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(f):a(f)}}const cR={name:"labelStartLink",resolveAll:xp.resolveAll,tokenize:uR};function uR(e,a,r){const l=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):a(d)}}const qf={name:"lineEnding",tokenize:dR};function dR(e,a){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),yt(e,a,"linePrefix")}}const Fc={name:"thematicBreak",tokenize:fR};function fR(e,a,r){let l=0,o;return u;function u(p){return e.enter("thematicBreak"),d(p)}function d(p){return o=p,f(p)}function f(p){return p===o?(e.enter("thematicBreakSequence"),m(p)):l>=3&&(p===null||He(p))?(e.exit("thematicBreak"),a(p)):r(p)}function m(p){return p===o?(e.consume(p),l++,m):(e.exit("thematicBreakSequence"),ft(p)?yt(e,f,"whitespace")(p):f(p))}}const Xn={continuation:{tokenize:xR},exit:bR,name:"list",tokenize:hR},mR={partial:!0,tokenize:yR},pR={partial:!0,tokenize:gR};function hR(e,a,r){const l=this,o=l.events[l.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(v){const w=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:Tm(v)){if(l.containerState.type||(l.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Fc,r,p)(v):p(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(v)}return r(v)}function m(v){return Tm(v)&&++d<10?(e.consume(v),m):(!l.interrupt||d<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):r(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(ro,l.interrupt?r:g,e.attempt(mR,N,b))}function g(v){return l.containerState.initialBlankLine=!0,u++,N(v)}function b(v){return ft(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),N):r(v)}function N(v){return l.containerState.size=u+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,a(v)}}function xR(e,a,r){const l=this;return l.containerState._closeFlow=void 0,e.check(ro,o,u);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,yt(e,a,"listItemIndent",l.containerState.size+1)(f)}function u(f){return l.containerState.furtherBlankLines||!ft(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,d(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(pR,a,d)(f))}function d(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,yt(e,e.attempt(Xn,a,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function gR(e,a,r){const l=this;return yt(e,o,"listItemIndent",l.containerState.size+1);function o(u){const d=l.events[l.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===l.containerState.size?a(u):r(u)}}function bR(e){e.exit(this.containerState.type)}function yR(e,a,r){const l=this;return yt(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=l.events[l.events.length-1];return!ft(u)&&d&&d[1].type==="listItemPrefixWhitespace"?a(u):r(u)}}const hy={name:"setextUnderline",resolveTo:vR,tokenize:NR};function vR(e,a){let r=e.length,l,o,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const d={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,a]),e.splice(u+1,0,["exit",e[l][1],a]),e[l][1].end={...e[u][1].end}):e[l][1]=d,e.push(["exit",d,a]),e}function NR(e,a,r){const l=this;let o;return u;function u(p){let g=l.events.length,b;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){b=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||b)?(e.enter("setextHeadingLine"),o=p,d(p)):r(p)}function d(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===o?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),ft(p)?yt(e,m,"lineSuffix")(p):m(p))}function m(p){return p===null||He(p)?(e.exit("setextHeadingLine"),a(p)):r(p)}}const wR={tokenize:ER};function ER(e){const a=this,r=e.attempt(ro,l,e.attempt(this.parser.constructs.flowInitial,o,yt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(CA,o)),"linePrefix")));return r;function l(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),a.currentConstruct=void 0,r}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a.currentConstruct=void 0,r}}const jR={resolveAll:Hv()},SR=Fv("string"),kR=Fv("text");function Fv(e){return{resolveAll:Hv(e==="text"?_R:void 0),tokenize:a};function a(r){const l=this,o=this.parser.constructs[e],u=r.attempt(o,d,f);return d;function d(g){return p(g)?u(g):f(g)}function f(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),m}function m(g){return p(g)?(r.exit("data"),u(g)):(r.consume(g),m)}function p(g){if(g===null)return!0;const b=o[g];let N=-1;if(b)for(;++N<b.length;){const v=b[N];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function Hv(e){return a;function a(r,l){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(r,l):r}}function _R(e,a){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],o=a.sliceStream(l);let u=o.length,d=-1,f=0,m;for(;u--;){const p=o[u];if(typeof p=="string"){for(d=p.length;p.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(p===-2)m=!0,f++;else if(p!==-1){u++;break}}if(a._contentTypeTextTrailing&&r===e.length&&(f=0),f){const p={type:r===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:l.start._bufferIndex+d,_index:l.start._index+u,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(e.splice(r,0,["enter",p,a],["exit",p,a]),r+=2)}r++}return e}const CR={42:Xn,43:Xn,45:Xn,48:Xn,49:Xn,50:Xn,51:Xn,52:Xn,53:Xn,54:Xn,55:Xn,56:Xn,57:Xn,62:Lv},TR={91:OA},AR={[-2]:Hf,[-1]:Hf,32:Hf},RR={35:BA,42:Fc,45:[hy,Fc],60:HA,61:hy,95:Fc,96:my,126:my},MR={38:Iv,92:zv},OR={[-5]:qf,[-4]:qf,[-3]:qf,33:lR,38:Iv,42:Am,60:[cA,ZA],91:cR,92:[IA,zv],93:xp,95:Am,96:wA},DR={null:[Am,jR]},LR={null:[42,95]},zR={null:[]},IR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LR,contentInitial:TR,disable:zR,document:CR,flow:RR,flowInitial:AR,insideSpan:DR,string:MR,text:OR},Symbol.toStringTag,{value:"Module"}));function UR(e,a,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let d=[],f=[];const m={attempt:I(Y),check:I(C),consume:_,enter:M,exit:Z,interrupt:I(C,{interrupt:!0})},p={code:null,containerState:{},defineSkip:j,events:[],now:w,parser:e,previous:null,sliceSerialize:N,sliceStream:v,write:b};let g=a.tokenize.call(p,m);return a.resolveAll&&u.push(a),p;function b(z){return d=ys(d,z),S(),d[d.length-1]!==null?[]:(D(a,0),p.events=fu(u,p.events,p),p.events)}function N(z,P){return $R(v(z),P)}function v(z){return BR(d,z)}function w(){const{_bufferIndex:z,_index:P,line:q,column:$,offset:U}=l;return{_bufferIndex:z,_index:P,line:q,column:$,offset:U}}function j(z){o[z.line]=z.column,R()}function S(){let z;for(;l._index<d.length;){const P=d[l._index];if(typeof P=="string")for(z=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===z&&l._bufferIndex<P.length;)k(P.charCodeAt(l._bufferIndex));else k(P)}}function k(z){g=g(z)}function _(z){He(z)?(l.line++,l.column=1,l.offset+=z===-3?2:1,R()):z!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===d[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=z}function M(z,P){const q=P||{};return q.type=z,q.start=w(),p.events.push(["enter",q,p]),f.push(q),q}function Z(z){const P=f.pop();return P.end=w(),p.events.push(["exit",P,p]),P}function Y(z,P){D(z,P.from)}function C(z,P){P.restore()}function I(z,P){return q;function q($,U,B){let Q,ee,ie,T;return Array.isArray($)?G($):"tokenize"in $?G([$]):L($);function L(re){return xe;function xe(je){const Be=je!==null&&re[je],we=je!==null&&re.null,Ye=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(we)?we:we?[we]:[]];return G(Ye)(je)}}function G(re){return Q=re,ee=0,re.length===0?B:O(re[ee])}function O(re){return xe;function xe(je){return T=F(),ie=re,re.partial||(p.currentConstruct=re),re.name&&p.parser.constructs.disable.null.includes(re.name)?V():re.tokenize.call(P?Object.assign(Object.create(p),P):p,m,H,V)(je)}}function H(re){return z(ie,T),U}function V(re){return T.restore(),++ee<Q.length?O(Q[ee]):B}}}function D(z,P){z.resolveAll&&!u.includes(z)&&u.push(z),z.resolve&&is(p.events,P,p.events.length-P,z.resolve(p.events.slice(P),p)),z.resolveTo&&(p.events=z.resolveTo(p.events,p))}function F(){const z=w(),P=p.previous,q=p.currentConstruct,$=p.events.length,U=Array.from(f);return{from:$,restore:B};function B(){l=z,p.previous=P,p.currentConstruct=q,p.events.length=$,f=U,R()}}function R(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function BR(e,a){const r=a.start._index,l=a.start._bufferIndex,o=a.end._index,u=a.end._bufferIndex;let d;if(r===o)d=[e[r].slice(l,u)];else{if(d=e.slice(r,o),l>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(l):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function $R(e,a){let r=-1;const l=[];let o;for(;++r<e.length;){const u=e[r];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
580
- `;break}case-3:{d=`\r
581
- `;break}case-2:{d=a?" ":" ";break}case-1:{if(!a&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,l.push(d)}return l.join("")}function PR(e){const l={constructs:Ov([IR,...(e||{}).extensions||[]]),content:o(nA),defined:[],document:o(aA),flow:o(wR),lazy:{},string:o(SR),text:o(kR)};return l;function o(u){return d;function d(f){return UR(l,u,f)}}}function FR(e){for(;!Uv(e););return e}const xy=/[\0\t\n\r]/g;function HR(){let e=1,a="",r=!0,l;return o;function o(u,d,f){const m=[];let p,g,b,N,v;for(u=a+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),b=0,a="",r&&(u.charCodeAt(0)===65279&&b++,r=void 0);b<u.length;){if(xy.lastIndex=b,p=xy.exec(u),N=p&&p.index!==void 0?p.index:u.length,v=u.charCodeAt(N),!p){a=u.slice(b);break}if(v===10&&b===N&&l)m.push(-3),l=void 0;else switch(l&&(m.push(-5),l=void 0),b<N&&(m.push(u.slice(b,N)),e+=N-b),v){case 0:{m.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,m.push(-2);e++<g;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:l=!0,e=1}b=N+1}return f&&(l&&m.push(-5),a&&m.push(a),m.push(null)),m}}const qR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GR(e){return e.replace(qR,KR)}function KR(e,a,r){if(a)return a;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Dv(r.slice(u?2:1),u?16:10)}return hp(r)||e}const qv={}.hasOwnProperty;function YR(e,a,r){return typeof a!="string"&&(r=a,a=void 0),VR(r)(FR(PR(r).document().write(HR()(e,a,!0))))}function VR(e){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(lt),autolinkProtocol:F,autolinkEmail:F,atxHeading:u(ke),blockQuote:u(we),characterEscape:F,characterReference:F,codeFenced:u(Ye),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(Ye,d),codeText:u(jt,d),codeTextData:F,data:F,codeFlowValue:F,definition:u(en),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(oe),hardBreakEscape:u(he),hardBreakTrailing:u(he),htmlFlow:u(Xe,d),htmlFlowData:F,htmlText:u(Xe,d),htmlTextData:F,image:u(Qe),label:d,link:u(lt),listItem:u(Yt),listItemValue:N,listOrdered:u(At,b),listUnordered:u(At),paragraph:u(gt),reference:O,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(ke),strong:u(Vt),thematicBreak:u(yn)},exit:{atxHeading:m(),atxHeadingSequence:Y,autolink:m(),autolinkEmail:Be,autolinkProtocol:je,blockQuote:m(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:re,characterReference:xe,codeFenced:m(S),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:R,codeIndented:m(k),codeText:m(U),codeTextData:R,data:R,definition:m(),definitionDestinationString:Z,definitionLabelString:_,definitionTitleString:M,emphasis:m(),hardBreakEscape:m(P),hardBreakTrailing:m(P),htmlFlow:m(q),htmlFlowData:R,htmlText:m($),htmlTextData:R,image:m(Q),label:ie,labelText:ee,lineEnding:z,link:m(B),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:H,resourceDestinationString:T,resourceTitleString:L,resource:G,setextHeading:m(D),setextHeadingLineSequence:I,setextHeadingText:C,strong:m(),thematicBreak:m()}};Gv(a,(e||{}).mdastExtensions||[]);const r={};return l;function l(ue){let ve={type:"root",children:[]};const Ae={stack:[ve],tokenStack:[],config:a,enter:f,exit:p,buffer:d,resume:g,data:r},Pe=[];let ot=-1;for(;++ot<ue.length;)if(ue[ot][1].type==="listOrdered"||ue[ot][1].type==="listUnordered")if(ue[ot][0]==="enter")Pe.push(ot);else{const cn=Pe.pop();ot=o(ue,cn,ot)}for(ot=-1;++ot<ue.length;){const cn=a[ue[ot][0]];qv.call(cn,ue[ot][1].type)&&cn[ue[ot][1].type].call(Object.assign({sliceSerialize:ue[ot][2].sliceSerialize},Ae),ue[ot][1])}if(Ae.tokenStack.length>0){const cn=Ae.tokenStack[Ae.tokenStack.length-1];(cn[1]||gy).call(Ae,void 0,cn[0])}for(ve.position={start:er(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:er(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<a.transforms.length;)ve=a.transforms[ot](ve)||ve;return ve}function o(ue,ve,Ae){let Pe=ve-1,ot=-1,cn=!1,jn,un,et,qt;for(;++Pe<=Ae;){const Ve=ue[Pe];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ot++:ot--,qt=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(jn&&!qt&&!ot&&!et&&(et=Pe),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!ot&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ot===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(jn){let vn=Pe;for(un=void 0;vn--;){const Rt=ue[vn];if(Rt[1].type==="lineEnding"||Rt[1].type==="lineEndingBlank"){if(Rt[0]==="exit")continue;un&&(ue[un][1].type="lineEndingBlank",cn=!0),Rt[1].type="lineEnding",un=vn}else if(!(Rt[1].type==="linePrefix"||Rt[1].type==="blockQuotePrefix"||Rt[1].type==="blockQuotePrefixWhitespace"||Rt[1].type==="blockQuoteMarker"||Rt[1].type==="listItemIndent"))break}et&&(!un||et<un)&&(jn._spread=!0),jn.end=Object.assign({},un?ue[un][1].start:Ve[1].end),ue.splice(un||Pe,0,["exit",jn,Ve[2]]),Pe++,Ae++}if(Ve[1].type==="listItemPrefix"){const vn={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};jn=vn,ue.splice(Pe,0,["enter",vn,Ve[2]]),Pe++,Ae++,et=void 0,qt=!0}}}return ue[ve][1]._spread=cn,Ae}function u(ue,ve){return Ae;function Ae(Pe){f.call(this,ue(Pe),Pe),ve&&ve.call(this,Pe)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ue,ve,Ae){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ve,Ae||void 0]),ue.position={start:er(ve.start),end:void 0}}function m(ue){return ve;function ve(Ae){ue&&ue.call(this,Ae),p.call(this,Ae)}}function p(ue,ve){const Ae=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==ue.type&&(ve?ve.call(this,ue,Pe[0]):(Pe[1]||gy).call(this,ue,Pe[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Il({start:ue.start,end:ue.end})+"): it’s not open");Ae.position.end=er(ue.end)}function g(){return pp(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function N(ue){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ue}function w(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ue}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/(\r?\n|\r)$/g,"")}function _(ue){const ve=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ve,Ae.identifier=Ts(this.sliceSerialize(ue)).toLowerCase()}function M(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function Z(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function Y(ue){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Ae=this.sliceSerialize(ue).length;ve.depth=Ae}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(ue){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function F(ue){const Ae=this.stack[this.stack.length-1].children;let Pe=Ae[Ae.length-1];(!Pe||Pe.type!=="text")&&(Pe=ct(),Pe.position={start:er(ue.start),end:void 0},Ae.push(Pe)),this.stack.push(Pe)}function R(ue){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ue),ve.position.end=er(ue.end)}function z(ue){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=ve.children[ve.children.length-1];Ae.position.end=er(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&a.canContainEols.includes(ve.type)&&(F.call(this,ue),R.call(this,ue))}function P(){this.data.atHardBreak=!0}function q(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function $(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function U(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function B(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ee(ue){const ve=this.sliceSerialize(ue),Ae=this.stack[this.stack.length-2];Ae.label=GR(ve),Ae.identifier=Ts(ve).toLowerCase()}function ie(){const ue=this.stack[this.stack.length-1],ve=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Pe=ue.children;Ae.children=Pe}else Ae.alt=ve}function T(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function L(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function G(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function H(ue){const ve=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ve,Ae.identifier=Ts(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function V(ue){this.data.characterReferenceType=ue.type}function re(ue){const ve=this.sliceSerialize(ue),Ae=this.data.characterReferenceType;let Pe;Ae?(Pe=Dv(ve,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=hp(ve);const ot=this.stack[this.stack.length-1];ot.value+=Pe}function xe(ue){const ve=this.stack.pop();ve.position.end=er(ue.end)}function je(ue){R.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ue)}function Be(ue){R.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ue)}function we(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function jt(){return{type:"inlineCode",value:""}}function en(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oe(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function he(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function lt(){return{type:"link",title:null,url:"",children:[]}}function At(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Yt(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function Vt(){return{type:"strong",children:[]}}function ct(){return{type:"text",value:""}}function yn(){return{type:"thematicBreak"}}}function er(e){return{line:e.line,column:e.column,offset:e.offset}}function Gv(e,a){let r=-1;for(;++r<a.length;){const l=a[r];Array.isArray(l)?Gv(e,l):XR(e,l)}}function XR(e,a){let r;for(r in a)if(qv.call(a,r))switch(r){case"canContainEols":{const l=a[r];l&&e[r].push(...l);break}case"transforms":{const l=a[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=a[r];l&&Object.assign(e[r],l);break}}}function gy(e,a){throw e?new Error("Cannot close `"+e.type+"` ("+Il({start:e.start,end:e.end})+"): a different token (`"+a.type+"`, "+Il({start:a.start,end:a.end})+") is open"):new Error("Cannot close document, a token (`"+a.type+"`, "+Il({start:a.start,end:a.end})+") is still open")}function ZR(e){const a=this;a.parser=r;function r(l){return YR(l,{...a.data("settings"),...e,extensions:a.data("micromarkExtensions")||[],mdastExtensions:a.data("fromMarkdownExtensions")||[]})}}function QR(e,a){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(a),!0)};return e.patch(a,r),e.applyData(a,r)}function WR(e,a){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(a,r),[e.applyData(a,r),{type:"text",value:`
582
- `}]}function JR(e,a){const r=a.value?a.value+`
583
- `:"",l={},o=a.lang?a.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return a.meta&&(u.data={meta:a.meta}),e.patch(a,u),u=e.applyData(a,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(a,u),u}function e5(e,a){const r={type:"element",tagName:"del",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function t5(e,a){const r={type:"element",tagName:"em",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function n5(e,a){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(a.identifier).toUpperCase(),o=Di(l.toLowerCase()),u=e.footnoteOrder.indexOf(l);let d,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(l,f);const m={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(a,m);const p={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(a,p),e.applyData(a,p)}function s5(e,a){const r={type:"element",tagName:"h"+a.depth,properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function a5(e,a){if(e.options.allowDangerousHtml){const r={type:"raw",value:a.value};return e.patch(a,r),e.applyData(a,r)}}function Kv(e,a){const r=a.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(a.label||a.identifier)+"]"),a.type==="imageReference")return[{type:"text",value:"!["+a.alt+l}];const o=e.all(a),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=l:o.push({type:"text",value:l}),o}function r5(e,a){const r=String(a.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Kv(e,a);const o={src:Di(l.url||""),alt:a.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(a,u),e.applyData(a,u)}function i5(e,a){const r={src:Di(a.url)};a.alt!==null&&a.alt!==void 0&&(r.alt=a.alt),a.title!==null&&a.title!==void 0&&(r.title=a.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(a,l),e.applyData(a,l)}function l5(e,a){const r={type:"text",value:a.value.replace(/\r?\n|\r/g," ")};e.patch(a,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(a,l),e.applyData(a,l)}function o5(e,a){const r=String(a.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Kv(e,a);const o={href:Di(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"a",properties:o,children:e.all(a)};return e.patch(a,u),e.applyData(a,u)}function c5(e,a){const r={href:Di(a.url)};a.title!==null&&a.title!==void 0&&(r.title=a.title);const l={type:"element",tagName:"a",properties:r,children:e.all(a)};return e.patch(a,l),e.applyData(a,l)}function u5(e,a,r){const l=e.all(a),o=r?d5(r):Yv(a),u={},d=[];if(typeof a.checked=="boolean"){const g=l[0];let b;g&&g.type==="element"&&g.tagName==="p"?b=g:(b={type:"element",tagName:"p",properties:{},children:[]},l.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:a.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const g=l[f];(o||f!==0||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
584
- `}),g.type==="element"&&g.tagName==="p"&&!o?d.push(...g.children):d.push(g)}const m=l[l.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
585
- `});const p={type:"element",tagName:"li",properties:u,children:d};return e.patch(a,p),e.applyData(a,p)}function d5(e){let a=!1;if(e.type==="list"){a=e.spread||!1;const r=e.children;let l=-1;for(;!a&&++l<r.length;)a=Yv(r[l])}return a}function Yv(e){const a=e.spread;return a??e.children.length>1}function f5(e,a){const r={},l=e.all(a);let o=-1;for(typeof a.start=="number"&&a.start!==1&&(r.start=a.start);++o<l.length;){const d=l[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:a.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(a,u),e.applyData(a,u)}function m5(e,a){const r={type:"element",tagName:"p",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function p5(e,a){const r={type:"root",children:e.wrap(e.all(a))};return e.patch(a,r),e.applyData(a,r)}function h5(e,a){const r={type:"element",tagName:"strong",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function x5(e,a){const r=e.all(a),l=r.shift(),o=[];if(l){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(a.children[0],d),o.push(d)}if(r.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=up(a.children[1]),m=kv(a.children[a.children.length-1]);f&&m&&(d.position={start:f,end:m}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(a,u),e.applyData(a,u)}function g5(e,a,r){const l=r?r.children:void 0,u=(l?l.indexOf(a):1)===0?"th":"td",d=r&&r.type==="table"?r.align:void 0,f=d?d.length:a.children.length;let m=-1;const p=[];for(;++m<f;){const b=a.children[m],N={},v=d?d[m]:void 0;v&&(N.align=v);let w={type:"element",tagName:u,properties:N,children:[]};b&&(w.children=e.all(b),e.patch(b,w),w=e.applyData(b,w)),p.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(a,g),e.applyData(a,g)}function b5(e,a){const r={type:"element",tagName:"td",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}const by=9,yy=32;function y5(e){const a=String(e),r=/\r?\n|\r/g;let l=r.exec(a),o=0;const u=[];for(;l;)u.push(vy(a.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=r.exec(a);return u.push(vy(a.slice(o),o>0,!1)),u.join("")}function vy(e,a,r){let l=0,o=e.length;if(a){let u=e.codePointAt(l);for(;u===by||u===yy;)l++,u=e.codePointAt(l)}if(r){let u=e.codePointAt(o-1);for(;u===by||u===yy;)o--,u=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function v5(e,a){const r={type:"text",value:y5(String(a.value))};return e.patch(a,r),e.applyData(a,r)}function N5(e,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(a,r),e.applyData(a,r)}const w5={blockquote:QR,break:WR,code:JR,delete:e5,emphasis:t5,footnoteReference:n5,heading:s5,html:a5,imageReference:r5,image:i5,inlineCode:l5,linkReference:o5,link:c5,listItem:u5,list:f5,paragraph:m5,root:p5,strong:h5,table:x5,tableCell:b5,tableRow:g5,text:v5,thematicBreak:N5,toml:kc,yaml:kc,definition:kc,footnoteDefinition:kc};function kc(){}const Vv=-1,mu=0,Bl=1,Zc=2,gp=3,bp=4,yp=5,vp=6,Xv=7,Zv=8,Ny=typeof self=="object"?self:globalThis,E5=(e,a)=>{const r=(o,u)=>(e.set(u,o),o),l=o=>{if(e.has(o))return e.get(o);const[u,d]=a[o];switch(u){case mu:case Vv:return r(d,o);case Bl:{const f=r([],o);for(const m of d)f.push(l(m));return f}case Zc:{const f=r({},o);for(const[m,p]of d)f[l(m)]=l(p);return f}case gp:return r(new Date(d),o);case bp:{const{source:f,flags:m}=d;return r(new RegExp(f,m),o)}case yp:{const f=r(new Map,o);for(const[m,p]of d)f.set(l(m),l(p));return f}case vp:{const f=r(new Set,o);for(const m of d)f.add(l(m));return f}case Xv:{const{name:f,message:m}=d;return r(new Ny[f](m),o)}case Zv:return r(BigInt(d),o);case"BigInt":return r(Object(BigInt(d)),o);case"ArrayBuffer":return r(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return r(new DataView(f),d)}}return r(new Ny[u](d),o)};return l},wy=e=>E5(new Map,e)(0),vi="",{toString:j5}={},{keys:S5}=Object,Ol=e=>{const a=typeof e;if(a!=="object"||!e)return[mu,a];const r=j5.call(e).slice(8,-1);switch(r){case"Array":return[Bl,vi];case"Object":return[Zc,vi];case"Date":return[gp,vi];case"RegExp":return[bp,vi];case"Map":return[yp,vi];case"Set":return[vp,vi];case"DataView":return[Bl,r]}return r.includes("Array")?[Bl,r]:r.includes("Error")?[Xv,r]:[Zc,r]},_c=([e,a])=>e===mu&&(a==="function"||a==="symbol"),k5=(e,a,r,l)=>{const o=(d,f)=>{const m=l.push(d)-1;return r.set(f,m),m},u=d=>{if(r.has(d))return r.get(d);let[f,m]=Ol(d);switch(f){case mu:{let g=d;switch(m){case"bigint":f=Zv,g=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return o([Vv],d)}return o([f,g],d)}case Bl:{if(m){let N=d;return m==="DataView"?N=new Uint8Array(d.buffer):m==="ArrayBuffer"&&(N=new Uint8Array(d)),o([m,[...N]],d)}const g=[],b=o([f,g],d);for(const N of d)g.push(u(N));return b}case Zc:{if(m)switch(m){case"BigInt":return o([m,d.toString()],d);case"Boolean":case"Number":case"String":return o([m,d.valueOf()],d)}if(a&&"toJSON"in d)return u(d.toJSON());const g=[],b=o([f,g],d);for(const N of S5(d))(e||!_c(Ol(d[N])))&&g.push([u(N),u(d[N])]);return b}case gp:return o([f,d.toISOString()],d);case bp:{const{source:g,flags:b}=d;return o([f,{source:g,flags:b}],d)}case yp:{const g=[],b=o([f,g],d);for(const[N,v]of d)(e||!(_c(Ol(N))||_c(Ol(v))))&&g.push([u(N),u(v)]);return b}case vp:{const g=[],b=o([f,g],d);for(const N of d)(e||!_c(Ol(N)))&&g.push(u(N));return b}}const{message:p}=d;return o([f,{name:m,message:p}],d)};return u},Ey=(e,{json:a,lossy:r}={})=>{const l=[];return k5(!(a||r),!!a,new Map,l)(e),l},Qc=typeof structuredClone=="function"?(e,a)=>a&&("json"in a||"lossy"in a)?wy(Ey(e,a)):structuredClone(e):(e,a)=>wy(Ey(e,a));function _5(e,a){const r=[{type:"text",value:"↩"}];return a>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(a)}]}),r}function C5(e,a){return"Back to reference "+(e+1)+(a>1?"-"+a:"")}function T5(e){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||_5,l=e.options.footnoteBackLabel||C5,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[m]);if(!p)continue;const g=e.all(p),b=String(p.identifier).toUpperCase(),N=Di(b.toLowerCase());let v=0;const w=[],j=e.footnoteCounts.get(b);for(;j!==void 0&&++v<=j;){w.length>0&&w.push({type:"text",value:" "});let _=typeof r=="string"?r:r(m,v);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+N+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(m,v),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const S=g[g.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const _=S.children[S.children.length-1];_&&_.type==="text"?_.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:a+"fn-"+N},children:e.wrap(g,!0)};e.patch(p,k),f.push(k)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Qc(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
586
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
587
- `}]}}const io=(function(e){if(e==null)return O5;if(typeof e=="function")return pu(e);if(typeof e=="object")return Array.isArray(e)?A5(e):R5(e);if(typeof e=="string")return M5(e);throw new Error("Expected function, string, or object as test")});function A5(e){const a=[];let r=-1;for(;++r<e.length;)a[r]=io(e[r]);return pu(l);function l(...o){let u=-1;for(;++u<a.length;)if(a[u].apply(this,o))return!0;return!1}}function R5(e){const a=e;return pu(r);function r(l){const o=l;let u;for(u in e)if(o[u]!==a[u])return!1;return!0}}function M5(e){return pu(a);function a(r){return r&&r.type===e}}function pu(e){return a;function a(r,l,o){return!!(D5(r)&&e.call(this,r,typeof l=="number"?l:void 0,o||void 0))}}function O5(){return!0}function D5(e){return e!==null&&typeof e=="object"&&"type"in e}const Qv=[],L5=!0,Rm=!1,z5="skip";function Wv(e,a,r,l){let o;typeof a=="function"&&typeof r!="function"?(l=r,r=a):o=a;const u=io(o),d=l?-1:1;f(e,void 0,[])();function f(m,p,g){const b=m&&typeof m=="object"?m:{};if(typeof b.type=="string"){const v=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(N,"name",{value:"node ("+(m.type+(v?"<"+v+">":""))+")"})}return N;function N(){let v=Qv,w,j,S;if((!a||u(m,p,g[g.length-1]||void 0))&&(v=I5(r(m,g)),v[0]===Rm))return v;if("children"in m&&m.children){const k=m;if(k.children&&v[0]!==z5)for(j=(l?k.children.length:-1)+d,S=g.concat(k);j>-1&&j<k.children.length;){const _=k.children[j];if(w=f(_,j,S)(),w[0]===Rm)return w;j=typeof w[1]=="number"?w[1]:j+d}}return v}}}function I5(e){return Array.isArray(e)?e:typeof e=="number"?[L5,e]:e==null?Qv:[e]}function hu(e,a,r,l){let o,u,d;typeof a=="function"&&typeof r!="function"?(u=void 0,d=a,o=r):(u=a,d=r,o=l),Wv(e,u,f,o);function f(m,p){const g=p[p.length-1],b=g?g.children.indexOf(m):void 0;return d(m,b,g)}}const Mm={}.hasOwnProperty,U5={};function B5(e,a){const r=a||U5,l=new Map,o=new Map,u=new Map,d={...w5,...r.handlers},f={all:p,applyData:P5,definitionById:l,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:m,options:r,patch:$5,wrap:H5};return hu(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const b=g.type==="definition"?l:o,N=String(g.identifier).toUpperCase();b.has(N)||b.set(N,g)}}),f;function m(g,b){const N=g.type,v=f.handlers[N];if(Mm.call(f.handlers,N)&&v)return v(f,g,b);if(f.options.passThrough&&f.options.passThrough.includes(N)){if("children"in g){const{children:j,...S}=g,k=Qc(S);return k.children=f.all(g),k}return Qc(g)}return(f.options.unknownHandler||F5)(f,g,b)}function p(g){const b=[];if("children"in g){const N=g.children;let v=-1;for(;++v<N.length;){const w=f.one(N[v],g);if(w){if(v&&N[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=jy(w.value)),!Array.isArray(w)&&w.type==="element")){const j=w.children[0];j&&j.type==="text"&&(j.value=jy(j.value))}Array.isArray(w)?b.push(...w):b.push(w)}}}return b}}function $5(e,a){e.position&&(a.position=CT(e))}function P5(e,a){let r=a;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const d="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:d}}r.type==="element"&&u&&Object.assign(r.properties,Qc(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function F5(e,a){const r=a.data||{},l="value"in a&&!(Mm.call(r,"hProperties")||Mm.call(r,"hChildren"))?{type:"text",value:a.value}:{type:"element",tagName:"div",properties:{},children:e.all(a)};return e.patch(a,l),e.applyData(a,l)}function H5(e,a){const r=[];let l=-1;for(a&&r.push({type:"text",value:`
588
- `});++l<e.length;)l&&r.push({type:"text",value:`
589
- `}),r.push(e[l]);return a&&e.length>0&&r.push({type:"text",value:`
590
- `}),r}function jy(e){let a=0,r=e.charCodeAt(a);for(;r===9||r===32;)a++,r=e.charCodeAt(a);return e.slice(a)}function Sy(e,a){const r=B5(e,a),l=r.one(e,void 0),o=T5(r),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
591
- `},o),u}function q5(e,a){return e&&"run"in e?async function(r,l){const o=Sy(r,{file:l,...a});await e.run(o,l)}:function(r,l){return Sy(r,{file:l,...e||a})}}function ky(e){if(e)throw e}var Gf,_y;function G5(){if(_y)return Gf;_y=1;var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},u=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var g=e.call(p,"constructor"),b=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!b)return!1;var N;for(N in p);return typeof N>"u"||e.call(p,N)},d=function(p,g){r&&g.name==="__proto__"?r(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},f=function(p,g){if(g==="__proto__")if(e.call(p,g)){if(l)return l(p,g).value}else return;return p[g]};return Gf=function m(){var p,g,b,N,v,w,j=arguments[0],S=1,k=arguments.length,_=!1;for(typeof j=="boolean"&&(_=j,j=arguments[1]||{},S=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});S<k;++S)if(p=arguments[S],p!=null)for(g in p)b=f(j,g),N=f(p,g),j!==N&&(_&&N&&(u(N)||(v=o(N)))?(v?(v=!1,w=b&&o(b)?b:[]):w=b&&u(b)?b:{},d(j,{name:g,newValue:m(_,w,N)})):typeof N<"u"&&d(j,{name:g,newValue:N}));return j},Gf}var K5=G5();const Kf=nu(K5);function Om(e){if(typeof e!="object"||e===null)return!1;const a=Object.getPrototypeOf(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Y5(){const e=[],a={run:r,use:l};return a;function r(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(m,...p){const g=e[++u];let b=-1;if(m){d(m);return}for(;++b<o.length;)(p[b]===null||p[b]===void 0)&&(p[b]=o[b]);o=p,g?V5(g,f)(...p):d(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),a}}function V5(e,a){let r;return l;function l(...d){const f=e.length>d.length;let m;f&&d.push(o);try{m=e.apply(this,d)}catch(p){const g=p;if(f&&r)throw g;return o(g)}f||(m&&m.then&&typeof m.then=="function"?m.then(u,o):m instanceof Error?o(m):u(m))}function o(d,...f){r||(r=!0,a(d,...f))}function u(d){o(null,d)}}const Gs={basename:X5,dirname:Z5,extname:Q5,join:W5,sep:"/"};function X5(e,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');lo(e);let r=0,l=-1,o=e.length,u;if(a===void 0||a.length===0||a.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else l<0&&(u=!0,l=o+1);return l<0?"":e.slice(r,l)}if(a===e)return"";let d=-1,f=a.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===a.codePointAt(f--)?f<0&&(l=o):(f=-1,l=d));return r===l?l=d:l<0&&(l=e.length),e.slice(r,l)}function Z5(e){if(lo(e),e.length===0)return".";let a=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){a=r;break}}else l||(l=!0);return a<0?e.codePointAt(0)===47?"/":".":a===1&&e.codePointAt(0)===47?"//":e.slice(0,a)}function Q5(e){lo(e);let a=e.length,r=-1,l=0,o=-1,u=0,d;for(;a--;){const f=e.codePointAt(a);if(f===47){if(d){l=a+1;break}continue}r<0&&(d=!0,r=a+1),f===46?o<0?o=a:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===l+1?"":e.slice(o,r)}function W5(...e){let a=-1,r;for(;++a<e.length;)lo(e[a]),e[a]&&(r=r===void 0?e[a]:r+"/"+e[a]);return r===void 0?".":J5(r)}function J5(e){lo(e);const a=e.codePointAt(0)===47;let r=e3(e,!a);return r.length===0&&!a&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),a?"/"+r:r}function e3(e,a){let r="",l=0,o=-1,u=0,d=-1,f,m;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(r.length<2||l!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(m=r.lastIndexOf("/"),m!==r.length-1){m<0?(r="",l=0):(r=r.slice(0,m),l=r.length-1-r.lastIndexOf("/")),o=d,u=0;continue}}else if(r.length>0){r="",l=0,o=d,u=0;continue}}a&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(o+1,d):r=e.slice(o+1,d),l=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return r}function lo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const t3={cwd:n3};function n3(){return"/"}function Dm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function s3(e){if(typeof e=="string")e=new URL(e);else if(!Dm(e)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(e.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return a3(e)}function a3(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const a=e.pathname;let r=-1;for(;++r<a.length;)if(a.codePointAt(r)===37&&a.codePointAt(r+1)===50){const l=a.codePointAt(r+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(a)}const Yf=["history","path","basename","stem","extname","dirname"];class Jv{constructor(a){let r;a?Dm(a)?r={path:a}:typeof a=="string"||r3(a)?r={value:a}:r=a:r={},this.cwd="cwd"in r?"":t3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Yf.length;){const u=Yf[l];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)Yf.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Gs.basename(this.path):void 0}set basename(a){Xf(a,"basename"),Vf(a,"basename"),this.path=Gs.join(this.dirname||"",a)}get dirname(){return typeof this.path=="string"?Gs.dirname(this.path):void 0}set dirname(a){Cy(this.basename,"dirname"),this.path=Gs.join(a||"",this.basename)}get extname(){return typeof this.path=="string"?Gs.extname(this.path):void 0}set extname(a){if(Vf(a,"extname"),Cy(this.dirname,"extname"),a){if(a.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(a.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gs.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){Dm(a)&&(a=s3(a)),Xf(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return typeof this.path=="string"?Gs.basename(this.path,this.extname):void 0}set stem(a){Xf(a,"stem"),Vf(a,"stem"),this.path=Gs.join(this.dirname||"",a+(this.extname||""))}fail(a,r,l){const o=this.message(a,r,l);throw o.fatal=!0,o}info(a,r,l){const o=this.message(a,r,l);return o.fatal=void 0,o}message(a,r,l){const o=new zn(a,r,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(a){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(a||void 0).decode(this.value)}}function Vf(e,a){if(e&&e.includes(Gs.sep))throw new Error("`"+a+"` cannot be a path: did not expect `"+Gs.sep+"`")}function Xf(e,a){if(!e)throw new Error("`"+a+"` cannot be empty")}function Cy(e,a){if(!e)throw new Error("Setting `"+a+"` requires `path` to be set too")}function r3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const i3=(function(e){const l=this.constructor.prototype,o=l[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,l),u}),l3={}.hasOwnProperty;class Np extends i3{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Y5()}copy(){const a=new Np;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];a.use(...l)}return a.data(Kf(!0,{},this.namespace)),a}data(a,r){return typeof a=="string"?arguments.length===2?(Wf("data",this.frozen),this.namespace[a]=r,this):l3.call(this.namespace,a)&&this.namespace[a]||void 0:a?(Wf("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;const a=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=r.call(a,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(a){this.freeze();const r=Cc(a),l=this.parser||this.Parser;return Zf("parse",l),l(String(r),r)}process(a,r){const l=this;return this.freeze(),Zf("process",this.parser||this.Parser),Qf("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,d){const f=Cc(a),m=l.parse(f);l.run(m,f,function(g,b,N){if(g||!b||!N)return p(g);const v=b,w=l.stringify(v,N);u3(w)?N.value=w:N.result=w,p(g,N)});function p(g,b){g||!b?d(g):u?u(b):r(void 0,b)}}}processSync(a){let r=!1,l;return this.freeze(),Zf("processSync",this.parser||this.Parser),Qf("processSync",this.compiler||this.Compiler),this.process(a,o),Ay("processSync","process",r),l;function o(u,d){r=!0,ky(u),l=d}}run(a,r,l){Ty(a),this.freeze();const o=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?u(void 0,l):new Promise(u);function u(d,f){const m=Cc(r);o.run(a,m,p);function p(g,b,N){const v=b||a;g?f(g):d?d(v):l(void 0,v,N)}}}runSync(a,r){let l=!1,o;return this.run(a,r,u),Ay("runSync","run",l),o;function u(d,f){ky(d),o=f,l=!0}}stringify(a,r){this.freeze();const l=Cc(r),o=this.compiler||this.Compiler;return Qf("stringify",o),Ty(a),o(a,l)}use(a,...r){const l=this.attachers,o=this.namespace;if(Wf("use",this.frozen),a!=null)if(typeof a=="function")m(a,r);else if(typeof a=="object")Array.isArray(a)?f(a):d(a);else throw new TypeError("Expected usable value, not `"+a+"`");return this;function u(p){if(typeof p=="function")m(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[g,...b]=p;m(g,b)}else d(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function d(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(p.plugins),p.settings&&(o.settings=Kf(!0,o.settings,p.settings))}function f(p){let g=-1;if(p!=null)if(Array.isArray(p))for(;++g<p.length;){const b=p[g];u(b)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function m(p,g){let b=-1,N=-1;for(;++b<l.length;)if(l[b][0]===p){N=b;break}if(N===-1)l.push([p,...g]);else if(g.length>0){let[v,...w]=g;const j=l[N][1];Om(j)&&Om(v)&&(v=Kf(!0,j,v)),l[N]=[p,v,...w]}}}}const o3=new Np().freeze();function Zf(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qf(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wf(e,a){if(a)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ty(e){if(!Om(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ay(e,a,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+a+"` instead")}function Cc(e){return c3(e)?e:new Jv(e)}function c3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function u3(e){return typeof e=="string"||d3(e)}function d3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ry=[],My={allowDangerousHtml:!0},m3=/^(https?|ircs?|mailto|xmpp)$/i,p3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Gl(e){const a=h3(e),r=x3(e);return g3(a.runSync(a.parse(r),r),e)}function h3(e){const a=e.rehypePlugins||Ry,r=e.remarkPlugins||Ry,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...My}:My;return o3().use(ZR).use(r).use(q5,l).use(a)}function x3(e){const a=e.children||"",r=new Jv;return typeof a=="string"&&(r.value=a),r}function g3(e,a){const r=a.allowedElements,l=a.allowElement,o=a.components,u=a.disallowedElements,d=a.skipHtml,f=a.unwrapDisallowed,m=a.urlTransform||b3;for(const g of p3)Object.hasOwn(a,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+f3+g.id,void 0);return hu(e,p),OT(e,{Fragment:n.Fragment,components:o,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function p(g,b,N){if(g.type==="raw"&&N&&typeof b=="number")return d?N.children.splice(b,1):N.children[b]={type:"text",value:g.value},b;if(g.type==="element"){let v;for(v in Ff)if(Object.hasOwn(Ff,v)&&Object.hasOwn(g.properties,v)){const w=g.properties[v],j=Ff[v];(j===null||j.includes(g.tagName))&&(g.properties[v]=m(String(w||""),v,g))}}if(g.type==="element"){let v=r?!r.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&l&&typeof b=="number"&&(v=!l(g,b,N)),v&&N&&typeof b=="number")return f&&g.children?N.children.splice(b,1,...g.children):N.children.splice(b,1),b}}}function b3(e){const a=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return a===-1||o!==-1&&a>o||r!==-1&&a>r||l!==-1&&a>l||m3.test(e.slice(0,a))?e:""}function y3({turn:e,defaultOpen:a}){const[r,l]=y.useState(a??!1),o=e.type==="tool_result",u=o?"Result":e.toolName??"Tool",d=o?e.content:e.toolInput??e.content,f=5e3,m=d.length>f,p=m?d.slice(0,f):d;return n.jsxs("div",{className:"my-1",children:[n.jsxs("button",{type:"button",onClick:()=>l(!r),className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors ${o?"bg-surface-2 text-text-secondary hover:bg-surface-3":"bg-cyan-500/10 text-cyan-400 hover:bg-cyan-500/15"}`,children:[n.jsx(wa,{size:12,className:`transition-transform shrink-0 ${r?"rotate-90":""}`}),n.jsx(zl,{size:12,className:"shrink-0"}),n.jsx("span",{children:u})]}),r&&n.jsx("div",{className:"mt-1 ml-4",children:n.jsxs("pre",{className:"bg-surface-2 rounded-lg p-3 font-mono text-xs text-text-secondary max-h-64 overflow-y-auto whitespace-pre-wrap break-words border border-border-subtle",children:[p,m&&n.jsxs("span",{className:"text-text-muted block mt-2",children:["... (",d.length-f," more characters)"]})]})})]})}function v3({turn:e}){if(e.type==="tool_use"||e.type==="tool_result")return n.jsx(y3,{turn:e});const a=e.type==="human",r=a?rp:En,l=a?"border-l-accent":"border-l-violet-500",o=a?"bg-surface-3":"bg-surface-2",u=a?"text-accent":"text-violet-400",d=a?"User":"Assistant";return n.jsxs("div",{className:`my-2 ${o} rounded-lg border-l-2 ${l} overflow-hidden`,children:[n.jsxs("div",{className:"flex items-center gap-1.5 px-3 pt-2 pb-1",children:[n.jsx(r,{size:12,className:u}),n.jsx("span",{className:`text-xs font-medium ${u}`,children:d})]}),n.jsx("div",{className:"px-3 pb-2.5",children:a?n.jsx("div",{className:"text-sm text-text-primary whitespace-pre-wrap break-words leading-relaxed",children:e.content}):n.jsx("div",{className:"md-render",children:n.jsx(Gl,{children:e.content})})})]})}function N3({transcript:e,maxHeight:a="32rem"}){const r=y.useMemo(()=>bv(e),[e]),l=e.startsWith("...")||e.includes('"truncated"')||e.includes("[earlier messages trimmed]");return r===null?n.jsx("pre",{className:"bg-surface-2 rounded-lg p-4 font-mono text-xs text-text-secondary overflow-y-auto whitespace-pre-wrap",style:{maxHeight:a},children:e}):r.length===0?n.jsx("div",{className:"bg-surface-2 rounded-lg p-4 text-sm text-text-muted text-center",children:"No conversation turns found."}):n.jsxs("div",{className:"overflow-y-auto rounded-lg",style:{maxHeight:a},children:[l&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mb-2 bg-amber-500/10 rounded-lg border border-amber-500/20",children:[n.jsx(It,{size:14,className:"text-amber-400 shrink-0"}),n.jsx("span",{className:"text-xs text-amber-400",children:"Earlier messages were trimmed from this transcript."})]}),n.jsx("div",{className:"space-y-0.5",children:r.map((o,u)=>n.jsx(v3,{turn:o},u))})]})}function w3({plan:e}){var o,u,d;const[a,r]=y.useState(!1),l=!!((o=e.version)!=null&&o.markdown);return n.jsxs("div",{className:"bg-surface-2 rounded-lg overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>l&&r(!a),className:["w-full flex items-center justify-between px-3 py-2 text-left",l?"cursor-pointer hover:bg-surface-3/50 transition-colors":"cursor-default"].join(" "),children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&n.jsx(Pn,{size:12,className:`text-text-muted shrink-0 transition-transform ${a?"rotate-180":""}`}),n.jsx("span",{className:"text-sm text-text-primary truncate",children:e.title})]}),((u=e.version)==null?void 0:u.decision)&&n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium shrink-0 ml-2 ${e.version.decision.behavior==="allow"?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.version.decision.behavior==="allow"?"Approved":"Denied"})]}),a&&((d=e.version)==null?void 0:d.markdown)&&n.jsx("div",{className:"px-3 pb-3 border-t border-border-subtle",children:n.jsx("div",{className:"md-render mt-2 max-h-96 overflow-y-auto",children:n.jsx(Gl,{children:e.version.markdown})})})]})}function Ni({icon:e,title:a,subtitle:r,defaultOpen:l=!0,open:o,onToggle:u,children:d}){const[f,m]=y.useState(l),p=o!==void 0,g=p?o:f,b=()=>{const N=!g;u&&u(N),p||m(N)};return n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:b,className:"w-full flex items-center justify-between px-4 py-3 hover:bg-surface-2/50 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(e,{size:16,className:"text-accent"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:a}),r&&n.jsx("span",{className:"text-xs text-text-muted",children:r})]}),n.jsx(Pn,{size:14,className:`text-text-muted transition-transform ${g?"rotate-180":""}`})]}),g&&n.jsx("div",{className:"px-4 pb-4 border-t border-border-subtle",children:d})]})}const E3={added:"bg-emerald-500/15 text-emerald-400",modified:"bg-amber-500/15 text-amber-400",deleted:"bg-red-500/15 text-red-400",renamed:"bg-cyan-500/15 text-cyan-400",copied:"bg-violet-500/15 text-violet-400"};function j3({entry:e,projectId:a,onClose:r}){const[l,o]=y.useState(null),[u,d]=y.useState(!0),[f,m]=y.useState(!1),[p,g]=y.useState(null),[b,N]=y.useState(!1);y.useEffect(()=>{d(!0),g(null),o(null),jb(e.commit.sha,!1,a).then(w=>{o(w),d(!1)}).catch(w=>{const j=w instanceof Error?w.message:String(w);j.includes("409")?g("You have uncommitted changes. Commit or stash before rewinding."):g(j),d(!1)})},[e.commit.sha,a]);const v=async()=>{m(!0),g(null);try{await jb(e.commit.sha,!0,a),N(!0)}catch(w){const j=w instanceof Error?w.message:String(w);j.includes("409")?g("You have uncommitted changes. Commit or stash before rewinding."):g(j)}finally{m(!1)}};return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),n.jsxs("div",{className:"relative z-10 bg-surface-1 border border-border rounded-xl p-6 max-w-md w-full shadow-xl",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-lg font-display font-semibold text-text-primary",children:"Rewind to Commit"}),n.jsx("button",{type:"button",onClick:r,className:"text-text-muted hover:text-text-primary transition-colors",children:n.jsx(ln,{size:18})})]}),u&&n.jsxs("div",{className:"flex items-center gap-3 py-8 justify-center",children:[n.jsx(Je,{size:20,className:"text-accent animate-spin"}),n.jsx("span",{className:"text-text-secondary text-sm",children:"Loading preview..."})]}),b&&n.jsxs("div",{className:"py-4",children:[n.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg p-4 flex items-center gap-3",children:[n.jsx(Mr,{size:18,className:"text-emerald-400 shrink-0"}),n.jsxs("span",{className:"text-emerald-400 text-sm",children:["Successfully rewound to"," ",n.jsx("span",{className:"font-mono",children:e.commit.shortSha})]})]}),n.jsx("button",{type:"button",onClick:r,className:"mt-4 w-full px-4 py-2 rounded-lg border border-border text-text-secondary hover:bg-surface-2 text-sm transition-colors",children:"Close"})]}),!u&&!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-surface-2 rounded-lg p-3 mb-4 space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-amber-400 font-mono text-xs",children:(l==null?void 0:l.shortSha)??e.commit.shortSha}),n.jsx("span",{className:"text-text-primary text-sm truncate",children:(l==null?void 0:l.subject)??e.commit.subject})]}),(l==null?void 0:l.date)&&n.jsx("div",{className:"text-xs text-text-muted",children:new Date(l.date).toLocaleString()}),(l==null?void 0:l.diffStat)&&n.jsx("div",{className:"text-xs text-text-muted font-mono",children:l.diffStat})]}),p&&n.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3 flex items-start gap-2 mb-4",children:[n.jsx(It,{size:16,className:"text-amber-400 shrink-0 mt-0.5"}),n.jsx("span",{className:"text-amber-400 text-sm",children:p})]}),!p&&n.jsx("p",{className:"text-amber-400 text-sm mb-4",children:"This action cannot be undone. The working tree will be reset to this commit."}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:r,className:"flex-1 px-4 py-2 rounded-lg border border-border text-text-secondary hover:bg-surface-2 text-sm transition-colors",children:"Cancel"}),!p&&n.jsx("button",{type:"button",onClick:v,disabled:f,className:"flex-1 px-4 py-2 rounded-lg bg-red-500 text-white text-sm font-medium hover:bg-red-600 disabled:opacity-50 transition-colors",children:f?n.jsxs("span",{className:"flex items-center justify-center gap-2",children:[n.jsx(Je,{size:14,className:"animate-spin"}),"Rewinding..."]}):"Confirm Rewind"})]})]})]})]})}function S3({entry:e,projectId:a,autoExpandTranscript:r=!1,onEnrich:l,enriching:o=!1}){const u=Rs(),[d,f]=y.useState(""),[m,p]=y.useState(Object.keys(e.tags??{})),[g,b]=y.useState(null),[N,v]=y.useState(!1),[w,j]=y.useState(r),[S,k]=y.useState(!1),_=y.useRef(null);y.useEffect(()=>{p(Object.keys(e.tags??{}))},[e]);const M=y.useCallback(async $=>{const U=$.trim().toLowerCase();if(!U||m.includes(U))return;const B=[...m,U];p(B),f("");try{await Eb(e.commit.sha,B,a)}catch{p(m)}},[m,e.commit.sha,a]),Z=y.useCallback(async $=>{const U=m.filter(B=>B!==$);p(U);try{await Eb(e.commit.sha,U,a)}catch{p(m)}},[m,e.commit.sha,a]),Y=y.useCallback(async()=>{if(g===null){v(!0);try{const $=await z0(e.commit.sha,a);b($.transcript)}catch{b("Failed to load transcript.")}finally{v(!1)}}},[e.commit.sha,a,g]);y.useEffect(()=>{r&&e.transcriptSize!=null&&e.transcriptSize>0&&Y()},[r,e.transcriptSize,Y]);const{commit:C,diff:I,session:D,enrichment:F,reviewPlans:R}=e,z=I.insertions+I.deletions,P=z>0?I.insertions/z*100:50,q=e.transcriptSize!=null?(e.transcriptSize/1024).toFixed(1):null;return n.jsxs("div",{className:"space-y-4",children:[!F&&l&&n.jsx("div",{className:"bg-surface-1 border border-border rounded-xl px-4 py-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(En,{size:16,className:"text-text-muted"}),n.jsx("span",{className:"text-sm text-text-muted",children:"No AI summary yet"})]}),n.jsx("button",{type:"button",onClick:()=>l(e.commit.sha),disabled:o,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-accent text-white text-xs font-medium hover:bg-accent/90 disabled:opacity-50 transition-colors",children:o?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:12,className:"animate-spin"}),"Enriching..."]}):n.jsxs(n.Fragment,{children:[n.jsx(En,{size:12}),"Enrich with AI"]})})]})}),F&&n.jsx(Ni,{icon:En,title:"AI Summary",subtitle:`(${F.model})`,children:n.jsxs("div",{className:"mt-3 space-y-3",children:[n.jsx("p",{className:"text-sm text-text-secondary",children:F.summary}),F.intent&&n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Intent:"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:F.intent})]}),F.challenges&&F.challenges.length>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Challenges:"}),n.jsx("ul",{className:"mt-1 space-y-1",children:F.challenges.map(($,U)=>n.jsxs("li",{className:"flex items-start gap-2 text-sm text-text-secondary",children:[n.jsx("span",{className:"text-amber-400 mt-1 shrink-0",children:"*"}),$]},U))})]}),F.recommendations&&F.recommendations.length>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-medium text-text-muted",children:"Recommendations:"}),n.jsx("ul",{className:"mt-1 space-y-1",children:F.recommendations.map(($,U)=>n.jsxs("li",{className:"flex items-start gap-2 text-sm text-text-secondary",children:[n.jsx("span",{className:"text-accent mt-1 shrink-0",children:"*"}),$]},U))})]})]})}),n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl px-4 py-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(XS,{size:16,className:"text-accent"}),n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Commit"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-amber-400 font-mono text-sm",children:C.sha}),C.branch&&n.jsx("span",{className:"bg-surface-2 rounded-md px-2 py-0.5 text-xs font-mono text-text-secondary",children:C.branch})]}),n.jsx("p",{className:"text-text-primary text-sm font-medium",children:C.subject}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4 text-xs text-text-muted",children:[n.jsx("span",{children:C.authorName}),n.jsx("span",{children:new Date(C.authorDate).toLocaleString()})]}),e.transcriptSize!=null&&e.transcriptSize>0&&n.jsxs("button",{type:"button",onClick:()=>{j(!0),Y(),setTimeout(()=>{var $;($=_.current)==null||$.scrollIntoView({behavior:"smooth",block:"start"})},50)},className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/15 transition-colors",children:[n.jsx(Ti,{size:12}),"View Transcript"]})]})]})]}),n.jsx(Ni,{icon:W0,title:"Changes",subtitle:`${I.filesChanged} files, +${I.insertions} -${I.deletions}`,children:n.jsxs("div",{className:"mt-3 space-y-3",children:[z>0&&n.jsxs("div",{className:"flex h-2 rounded-full overflow-hidden bg-surface-3",children:[n.jsx("div",{className:"bg-emerald-500",style:{width:`${P}%`}}),n.jsx("div",{className:"bg-red-500",style:{width:`${100-P}%`}})]}),n.jsxs("div",{className:"space-y-1.5",children:[I.files.slice(0,15).map($=>n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium uppercase ${E3[$.status]??"bg-surface-3 text-text-muted"}`,children:$.status.slice(0,3)}),n.jsx("span",{className:"text-text-secondary truncate flex-1 font-mono",children:$.path}),n.jsxs("span",{className:"text-emerald-400 shrink-0",children:["+",$.additions]}),n.jsxs("span",{className:"text-red-400 shrink-0",children:["-",$.deletions]})]},$.path)),I.files.length>15&&n.jsxs("p",{className:"text-xs text-text-muted pl-1",children:["and ",I.files.length-15," more files"]})]})]})}),D&&n.jsx(Ni,{icon:tr,title:"Session",children:n.jsxs("div",{className:"mt-3 space-y-3",children:[n.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{label:"Events",value:D.totalEvents},{label:"Rules",value:D.stats.rulesEnforced},{label:"Blocked",value:D.stats.actionsBlocked},{label:"Files",value:D.stats.filesWritten}].map($=>n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:$.value}),n.jsx("div",{className:"text-[10px] text-text-muted",children:$.label})]},$.label))}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.stats.testsRun&&n.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${D.stats.testsPassed?"bg-emerald-500/15 text-emerald-400":D.stats.testsPassed===!1?"bg-red-500/15 text-red-400":"bg-surface-3 text-text-muted"}`,children:[D.stats.testsPassed?n.jsx(Mr,{size:10}):n.jsx(Or,{size:10}),"Tests"]})}),D.blockedTools.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.blockedTools.map($=>n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-red-500/15 text-red-400",children:$},$))})]})}),e.transcriptSize!=null&&e.transcriptSize>0&&n.jsx("div",{ref:_,children:n.jsx(Ni,{icon:Ti,title:`Transcript (${q} KB)`,open:w,onToggle:j,children:n.jsxs("div",{className:"mt-3",children:[g===null&&!N&&n.jsx("button",{type:"button",onClick:Y,className:"text-sm text-accent hover:text-accent/80 transition-colors",children:"Load transcript..."}),N&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Je,{size:14,className:"text-accent animate-spin"}),n.jsx("span",{className:"text-sm text-text-secondary",children:"Loading transcript..."})]}),g!==null&&n.jsxs(n.Fragment,{children:[n.jsx(N3,{transcript:g}),n.jsxs("button",{type:"button",onClick:()=>u(`/history/${e.commit.sha}/transcript`,{state:{commit:e.commit}}),className:"mt-2 flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors",children:["Open full transcript",n.jsx(_S,{size:12})]})]})]})})}),R&&R.length>0&&n.jsx(Ni,{icon:Pc,title:`Review Plans (${R.length})`,children:n.jsx("div",{className:"mt-3 space-y-2",children:R.map($=>n.jsx(w3,{plan:$},$.slug))})}),n.jsx(Ni,{icon:n_,title:"Tags",children:n.jsxs("div",{className:"mt-3 space-y-3",children:[n.jsxs("div",{className:"flex flex-wrap gap-2",children:[m.map($=>n.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-accent/15 text-accent rounded-full px-2.5 py-1 text-xs font-medium",children:[$,n.jsx("button",{type:"button",onClick:()=>Z($),className:"hover:text-red-400 transition-colors",children:n.jsx(ln,{size:12})})]},$)),m.length===0&&n.jsx("span",{className:"text-xs text-text-muted",children:"No tags"})]}),n.jsx("input",{type:"text",placeholder:"Add tag...",value:d,onChange:$=>f($.target.value),onKeyDown:$=>{$.key==="Enter"&&M(d)},className:"w-full bg-surface-2 border border-border rounded-md px-3 py-1.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-1 focus:ring-accent/50"})]})}),n.jsx("div",{className:"bg-surface-1 border border-border rounded-xl px-4 py-4",children:n.jsxs("button",{type:"button",onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-red-500/30 text-red-400 text-sm font-medium hover:bg-red-500/10 transition-colors",children:[n.jsx($k,{size:14}),"Rewind to this commit"]})}),S&&n.jsx(j3,{entry:e,projectId:a,onClose:()=>k(!1)})]})}function k3({entry:e}){return n.jsxs("div",{className:"flex gap-1 flex-wrap",children:[e.hasSession&&n.jsx("span",{className:"bg-cyan-500/15 text-cyan-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Ses"}),e.hasEnrichment&&n.jsx("span",{className:"bg-violet-500/15 text-violet-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"AI"}),e.hasReviewPlans&&n.jsx("span",{className:"bg-amber-500/15 text-amber-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Rev"}),e.hasTranscript&&n.jsx("span",{className:"bg-emerald-500/15 text-emerald-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"T"})]})}function Lm(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function _3(e,a){return`${Lm(e)} - ${Lm(a)}`}function C3({projectId:e,onDone:a}){const[r,l]=y.useState(!1),[o,u]=y.useState(!1),[d,f]=y.useState(null),m=async()=>{u(!0),f(null);try{await Xm({collectReviewPlans:r},e),a()}catch(p){f(p instanceof Error?p.message:String(p))}finally{u(!1)}};return n.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 max-w-md w-full text-center",children:[n.jsx($n,{size:40,className:"text-accent mx-auto mb-4"}),n.jsx("h2",{className:"text-xl font-display font-semibold text-text-primary mb-2",children:"Shadow Branch History"}),n.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"Track every commit with session context, AI summaries, and review plans. History is stored on a dedicated shadow branch separate from your working tree."}),n.jsxs("label",{className:"flex items-center gap-2 justify-center mb-6 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:r,onChange:p=>l(p.target.checked),className:"rounded border-border bg-surface-2 text-accent focus:ring-accent/50"}),n.jsx("span",{className:"text-sm text-text-secondary",children:"Include ULPI Review Plans"})]}),d&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 flex items-start gap-2 mb-4",children:[n.jsx(It,{size:16,className:"text-red-400 shrink-0 mt-0.5"}),n.jsx("span",{className:"text-red-400 text-sm text-left",children:d})]}),n.jsx("button",{type:"button",onClick:m,disabled:o,className:"w-full px-4 py-2.5 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 disabled:opacity-50 transition-colors",children:o?n.jsxs("span",{className:"flex items-center justify-center gap-2",children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Initializing..."]}):"Initialize History"})]})})}function T3({projectId:e,onDone:a}){const[r,l]=y.useState(!1),[o,u]=y.useState(null),[d,f]=y.useState(null),m=async()=>{l(!0),f(null);try{const p=await I0({limit:20},e);u(p),setTimeout(a,1500)}catch(p){f(p instanceof Error?p.message:String(p))}finally{l(!1)}};return n.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl p-8 max-w-md w-full text-center",children:[n.jsx(lu,{size:40,className:"text-text-muted mx-auto mb-4"}),n.jsx("h2",{className:"text-lg font-display font-semibold text-text-primary mb-2",children:"No entries captured yet"}),n.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"Backfill recent commits to populate the timeline, or wait for new entries to be captured automatically during Claude Code sessions."}),d&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 flex items-start gap-2 mb-4",children:[n.jsx(It,{size:16,className:"text-red-400 shrink-0 mt-0.5"}),n.jsx("span",{className:"text-red-400 text-sm text-left",children:d})]}),o&&n.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg p-3 mb-4",children:n.jsxs("span",{className:"text-emerald-400 text-sm",children:["Captured ",o.captured," of ",o.total," commits",o.skipped>0&&` (${o.skipped} already existed)`]})}),n.jsx("button",{type:"button",onClick:m,disabled:r||o!==null,className:"w-full px-4 py-2.5 rounded-lg bg-accent text-white font-medium text-sm hover:bg-accent/90 disabled:opacity-50 transition-colors",children:r?n.jsxs("span",{className:"flex items-center justify-center gap-2",children:[n.jsx(Je,{size:16,className:"animate-spin"}),"Capturing commits..."]}):"Backfill Recent Commits"}),n.jsx("p",{className:"text-xs text-text-muted mt-4",children:"Entries are also captured automatically during Claude Code sessions."})]})})}function A3(){const{currentProject:e}=on(),a=e==null?void 0:e.id,[r,l]=y.useState(null),[o,u]=y.useState(!0),[d,f]=y.useState(null),[m,p]=y.useState([]),[g,b]=y.useState(null),[N,v]=y.useState(null),[w,j]=y.useState(null),[S,k]=y.useState(!1),[_,M]=y.useState(null),[Z,Y]=y.useState(!1),[C,I]=y.useState(!1),[D,F]=y.useState(null),[R,z]=y.useState(null),[P,q]=y.useState(null),$=y.useRef(null),U=y.useCallback(()=>{$.current&&(clearInterval($.current),$.current=null)},[]),B=y.useCallback(async()=>{try{const[we,Ye]=await Promise.all([x2(a,_??void 0),g2(a)]);p(we),b(Ye)}catch{}},[a,_]),Q=y.useCallback(async we=>{v(we),k(!0),j(null);try{const Ye=await L0(we,a);j(Ye)}catch{j(null)}finally{k(!1)}},[a]),ee=y.useCallback(()=>{U(),$.current=setInterval(async()=>{try{const we=await kb(a);z(we),we.status!=="enriching"&&(U(),we.status==="done"&&we.completed>0&&(B(),N&&Q(N)),(we.status==="done"||we.status==="error")&&setTimeout(()=>{y2(a).catch(()=>{}),z(null)},5e3))}catch{U()}},2e3)},[a,U,N,B,Q]);y.useEffect(()=>U,[U]),y.useEffect(()=>{a&&kb(a).then(we=>{z(we),we.status==="enriching"&&ee()}).catch(()=>{})},[a]);const ie=async()=>{q(null);try{await Sb(void 0,a),z({status:"enriching",total:0,completed:0,failed:0}),ee()}catch(we){const Ye=we instanceof Error?we.message:String(we);Ye.includes("409")?(q("Enrichment already in progress"),ee()):q(Ye.replace(/^API \d+:\s*/,"").replace(/^\{"error":"(.*)"\}$/,"$1")),setTimeout(()=>q(null),4e3)}},T=async we=>{q(null);try{await Sb(we,a),z({status:"enriching",total:1,completed:0,failed:0}),ee()}catch(Ye){const jt=Ye instanceof Error?Ye.message:String(Ye);jt.includes("409")?(q("Enrichment already in progress"),ee()):q(jt.replace(/^API \d+:\s*/,"").replace(/^\{"error":"(.*)"\}$/,"$1")),setTimeout(()=>q(null),4e3)}},L=y.useCallback(async()=>{u(!0),f(null);try{const we=await Pl(a);l(we)}catch(we){f(we instanceof Error?we.message:String(we))}finally{u(!1)}},[a]);y.useEffect(()=>{l(null),p([]),b(null),v(null),j(null),M(null),L()},[a,L]),y.useEffect(()=>{r!=null&&r.exists&&r.totalEntries>0&&B()},[r,B]),y.useEffect(()=>{r!=null&&r.exists&&B()},[_]);const G=async()=>{I(!0),F(null);try{const we=await I0({limit:50},a);F(we),setTimeout(()=>{L(),B(),F(null)},2e3)}catch{}finally{I(!1)}},O=async()=>{try{const we=await b2(a),Ye=URL.createObjectURL(we),jt=document.createElement("a");jt.href=Ye,jt.download="ulpi-history-export.json",jt.click(),URL.revokeObjectURL(Ye)}catch{}};if(o)return n.jsxs("div",{className:"p-6 lg:p-8 h-full flex items-center justify-center",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading history..."})]});if(d)return n.jsx("div",{className:"p-6 lg:p-8 h-full flex items-center justify-center",children:n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsx("span",{className:"text-red-400 text-sm",children:d})]})});if(r&&!r.exists)return n.jsx("div",{className:"p-6 lg:p-8 h-full flex flex-col",children:n.jsx(C3,{projectId:a,onDone:L})});if(r&&r.exists&&r.totalEntries===0)return n.jsx("div",{className:"p-6 lg:p-8 h-full flex flex-col",children:n.jsx(T3,{projectId:a,onDone:()=>{L(),B()}})});const H=N!==null,V=g!=null&&g.dateRange?_3(g.dateRange.from,g.dateRange.to):"",re=g!=null?Math.round(g.enrichmentCoverage):0,xe=g!=null?Math.round(g.avgFilesChanged):0,je=(g==null?void 0:g.tagCounts)??{},Be=Object.entries(je).sort((we,Ye)=>Ye[1]-we[1]);return n.jsxs("div",{className:"p-6 lg:p-8 h-full flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx($n,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"History"}),n.jsxs("p",{className:"text-sm text-text-secondary mt-0.5",children:[m.length," entries",V?` · ${V}`:""]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[D&&n.jsxs("span",{className:"text-xs text-emerald-400",children:["+",D.captured," captured"]}),n.jsxs("button",{type:"button",onClick:G,disabled:C,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border text-text-secondary hover:bg-surface-2 text-sm transition-colors disabled:opacity-50",children:[n.jsx(Fk,{size:14,className:C?"animate-spin":""}),C?"Backfilling...":"Backfill"]}),n.jsxs("button",{type:"button",onClick:O,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border text-text-secondary hover:bg-surface-2 text-sm transition-colors",children:[n.jsx(to,{size:14}),"Export"]})]})]}),n.jsxs("div",{className:"flex-1 flex gap-6 min-h-0",children:[n.jsx("div",{className:["w-full lg:w-80 lg:shrink-0 flex flex-col",H?"hidden lg:flex":"flex"].join(" "),children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl flex-1 overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"px-3 py-3 border-b border-border-subtle",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:m.length}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"Entries"})]}),n.jsx("button",{type:"button",onClick:ie,disabled:(R==null?void 0:R.status)==="enriching"||re>=100,title:re>=100?"All entries enriched":"Enrich all entries with AI",className:"bg-surface-2 rounded-lg p-2 text-center hover:bg-accent/10 transition-colors disabled:opacity-60 disabled:hover:bg-surface-2 cursor-pointer disabled:cursor-default",children:(R==null?void 0:R.status)==="enriching"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-center gap-1",children:[n.jsx(Je,{size:12,className:"animate-spin text-accent"}),n.jsxs("span",{className:"text-xs font-semibold text-accent",children:[R.completed,"/",R.total]})]}),n.jsx("div",{className:"text-[10px] text-accent",children:"Enriching"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-center gap-1",children:[n.jsxs("span",{className:"text-sm font-semibold text-text-primary",children:[re,"%"]}),re<100&&n.jsx(En,{size:11,className:"text-accent"})]}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"AI"})]})}),n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:xe}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"Avg Files"})]})]}),P&&n.jsxs("div",{className:"mt-2 bg-red-500/10 border border-red-500/30 rounded-lg px-2.5 py-1.5 flex items-center gap-2",children:[n.jsx(It,{size:12,className:"text-red-400 shrink-0"}),n.jsx("span",{className:"text-red-400 text-xs",children:P})]}),(R==null?void 0:R.status)==="done"&&R.completed>0&&n.jsx("div",{className:"mt-2 bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-2.5 py-1.5",children:n.jsxs("span",{className:"text-emerald-400 text-xs",children:["Enriched ",R.completed," of ",R.total," entries",R.failed>0&&` (${R.failed} failed)`]})}),(R==null?void 0:R.status)==="error"&&n.jsxs("div",{className:"mt-2 bg-red-500/10 border border-red-500/30 rounded-lg px-2.5 py-1.5 flex items-center gap-2",children:[n.jsx(It,{size:12,className:"text-red-400 shrink-0"}),n.jsx("span",{className:"text-red-400 text-xs",children:R.error??"Enrichment failed"})]})]}),Be.length>0&&n.jsxs("div",{className:"px-3 py-2 border-b border-border-subtle flex flex-wrap gap-1.5",children:[n.jsx("button",{type:"button",onClick:()=>M(null),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${_===null?"bg-accent/15 text-accent":"bg-surface-2 text-text-muted hover:text-text-secondary"}`,children:"All"}),Be.map(([we,Ye])=>n.jsxs("button",{type:"button",onClick:()=>M(_===we?null:we),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${_===we?"bg-accent/15 text-accent":"bg-surface-2 text-text-muted hover:text-text-secondary"}`,children:[we," (",Ye,")"]},we))]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[m.map(we=>n.jsxs("div",{role:"button",tabIndex:0,onClick:Ye=>{Ye.target.closest("button")||(Y(!1),Q(we.sha))},onKeyDown:Ye=>{(Ye.key==="Enter"||Ye.key===" ")&&(Ye.preventDefault(),Y(!1),Q(we.sha))},className:["w-full text-left px-3 py-2.5 rounded-lg transition-colors cursor-pointer",N===we.sha?"bg-accent/10 border border-accent/30":"hover:bg-surface-2 border border-transparent"].join(" "),children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"text-amber-400 font-mono text-xs",children:we.shortSha}),n.jsx("span",{className:"text-[10px] text-text-muted shrink-0",children:Lm(we.date)})]}),n.jsx("p",{className:"text-sm text-text-primary truncate mt-0.5",children:we.subject}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsx(k3,{entry:we}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[we.hasTranscript&&n.jsx("button",{type:"button",title:"View transcript",onClick:Ye=>{Ye.stopPropagation(),Y(!0),Q(we.sha)},className:"p-0.5 rounded text-emerald-400 hover:text-emerald-300 hover:bg-emerald-500/10 transition-colors",children:n.jsx(Ti,{size:12})}),n.jsxs("span",{className:"text-[10px] text-text-muted",children:[we.filesChanged," files"]})]})]})]},we.sha)),m.length===0&&n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx("p",{className:"text-text-muted text-sm",children:"No entries match this filter."})})]})]})}),n.jsxs("div",{className:["flex-1 min-w-0 overflow-y-auto",H?"flex flex-col":"hidden lg:flex lg:flex-col"].join(" "),children:[H&&n.jsxs("button",{type:"button",onClick:()=>{v(null),j(null)},className:"lg:hidden flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4 transition-colors",children:[n.jsx(eo,{size:16}),"Back to list"]}),!H&&n.jsx("div",{className:"hidden lg:flex flex-1 items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx($n,{size:32,className:"text-text-muted mx-auto mb-3"}),n.jsx("p",{className:"text-text-secondary text-sm",children:"Select an entry to view details"})]})}),H&&S&&n.jsxs("div",{className:"flex items-center justify-center py-16",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading entry..."})]}),H&&w&&!S&&n.jsx(S3,{entry:w,projectId:a,autoExpandTranscript:Z,onBack:()=>{v(null),j(null)},onEnrich:T,enriching:(R==null?void 0:R.status)==="enriching"}),H&&!w&&!S&&n.jsx("div",{className:"flex items-center justify-center py-16",children:n.jsxs("div",{className:"text-center",children:[n.jsx(It,{size:24,className:"text-text-muted mx-auto mb-2"}),n.jsx("p",{className:"text-text-muted text-sm",children:"Failed to load entry details."})]})})]})]})]})}function R3({turn:e,defaultOpen:a,highlighted:r,onToggle:l,innerRef:o}){const[u,d]=y.useState(a??!1),f=e.type==="tool_result",m=f?"Result":e.toolName??"Tool",p=f?e.content:e.toolInput??e.content,g=1e4,b=p.length>g,N=b?p.slice(0,g):p;return n.jsxs("div",{ref:o,className:`my-1 transition-shadow ${r?"ring-2 ring-accent/40 rounded-lg":""}`,children:[n.jsxs("button",{type:"button",onClick:()=>{d(!u),l==null||l()},className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors ${f?"bg-surface-2 text-text-secondary hover:bg-surface-3":"bg-cyan-500/10 text-cyan-400 hover:bg-cyan-500/15"}`,children:[n.jsx(wa,{size:12,className:`transition-transform shrink-0 ${u?"rotate-90":""}`}),n.jsx(zl,{size:12,className:"shrink-0"}),n.jsx("span",{children:m})]}),u&&n.jsx("div",{className:"mt-1 ml-4",children:n.jsxs("pre",{className:"bg-surface-2 rounded-lg p-3 font-mono text-xs text-text-secondary overflow-x-auto whitespace-pre-wrap break-words border border-border-subtle",children:[N,b&&n.jsxs("span",{className:"text-text-muted block mt-2",children:["... (",p.length-g," more characters)"]})]})})]})}function M3({turn:e,highlighted:a,innerRef:r}){if(e.type==="tool_use"||e.type==="tool_result")return n.jsx(R3,{turn:e,highlighted:a,innerRef:r});const l=e.type==="human",o=l?rp:En,u=l?"border-l-accent":"border-l-violet-500",d=l?"bg-surface-3":"bg-surface-2",f=l?"text-accent":"text-violet-400",m=l?"User":"Assistant";return n.jsxs("div",{ref:r,className:`my-2 ${d} rounded-xl border-l-2 ${u} overflow-hidden transition-shadow ${a?"ring-2 ring-accent/40":""}`,style:{contentVisibility:"auto"},children:[n.jsxs("div",{className:"flex items-center gap-1.5 px-3 pt-2 pb-1",children:[n.jsx(o,{size:12,className:f}),n.jsx("span",{className:`text-xs font-medium ${f}`,children:m})]}),n.jsx("div",{className:"px-3 pb-2.5",children:l?n.jsx("div",{className:"text-sm text-text-primary whitespace-pre-wrap break-words leading-relaxed",children:e.content}):n.jsx("div",{className:"md-render",children:n.jsx(Gl,{children:e.content})})})]})}function O3(){var Q;const{sha:e}=E0(),a=Rs(),r=Na(),{currentProject:l}=on(),o=l==null?void 0:l.id,u=((Q=r.state)==null?void 0:Q.commit)??null,[d,f]=y.useState(u),[m,p]=y.useState(null),[g,b]=y.useState(!0),[N,v]=y.useState(null),[w,j]=y.useState(!1),[S,k]=y.useState(""),_=y.useRef(null),[M,Z]=y.useState(0),Y=y.useRef(null),[C,I]=y.useState(0),D=y.useRef([]),[F,R]=y.useState(-1);y.useEffect(()=>{if(!e)return;b(!0),v(null);const ee=[];ee.push(z0(e,o).then(ie=>p(ie.transcript)).catch(ie=>v(ie instanceof Error?ie.message:String(ie)))),u||ee.push(L0(e,o).then(ie=>f(ie.commit)).catch(()=>{})),Promise.all(ee).finally(()=>b(!1))},[e,o,u]);const z=y.useMemo(()=>m?bv(m):null,[m]),P=m!=null&&(m.startsWith("...")||m.includes('"truncated"')||m.includes("[earlier messages trimmed]")),q=y.useMemo(()=>(z??[]).filter(ee=>ee.type==="human"||ee.type==="assistant"),[z]),$=y.useMemo(()=>{if(!S.trim()||!z)return[];const ee=S.toLowerCase(),ie=[];return z.forEach((T,L)=>{var G,O;T.content.toLowerCase().includes(ee)&&ie.push(L),(G=T.toolName)!=null&&G.toLowerCase().includes(ee)&&ie.push(L),(O=T.toolInput)!=null&&O.toLowerCase().includes(ee)&&!ie.includes(L)&&ie.push(L)}),ie},[S,z]);y.useEffect(()=>{Z(0)},[$.length]),y.useEffect(()=>{var ie;if($.length===0)return;const ee=$[M];ee!=null&&((ie=D.current[ee])==null||ie.scrollIntoView({behavior:"smooth",block:"center"}))},[M,$]);const U=y.useCallback(()=>{$.length!==0&&Z(ee=>(ee+1)%$.length)},[$.length]),B=y.useCallback(()=>{$.length!==0&&Z(ee=>(ee-1+$.length)%$.length)},[$.length]);return y.useEffect(()=>{const ee=Y.current;if(!ee)return;const ie=()=>{const T=ee.scrollHeight<=ee.clientHeight?100:Math.round(ee.scrollTop/(ee.scrollHeight-ee.clientHeight)*100);I(T)};return ee.addEventListener("scroll",ie,{passive:!0}),()=>ee.removeEventListener("scroll",ie)},[]),y.useEffect(()=>{const ee=ie=>{var G,O;const T=ie.target;if(T.tagName==="INPUT"||T.tagName==="TEXTAREA"){ie.key==="Escape"&&(j(!1),k(""),T.blur(),ie.preventDefault()),ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),U()),ie.key==="Enter"&&ie.shiftKey&&(ie.preventDefault(),B());return}if(ie.key==="/"||ie.ctrlKey&&ie.key==="f"){ie.preventDefault(),j(!0),setTimeout(()=>{var H;return(H=_.current)==null?void 0:H.focus()},50);return}if(ie.key==="Escape"){w?(j(!1),k("")):a(-1);return}if(z){if(ie.key==="j"||ie.key==="ArrowDown"){ie.preventDefault();const H=Math.min(F+1,z.length-1);R(H),(G=D.current[H])==null||G.scrollIntoView({behavior:"smooth",block:"center"})}if(ie.key==="k"||ie.key==="ArrowUp"){ie.preventDefault();const H=Math.max(F-1,0);R(H),(O=D.current[H])==null||O.scrollIntoView({behavior:"smooth",block:"center"})}}};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[z,F,w,a,U,B]),g?n.jsxs("div",{className:"flex items-center justify-center h-full bg-surface-0",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-text-secondary",children:"Loading transcript..."})]}):N?n.jsx("div",{className:"flex items-center justify-center h-full bg-surface-0",children:n.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-center gap-3 max-w-md",children:[n.jsx(It,{size:18,className:"text-red-400 shrink-0"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-red-400 text-sm font-medium",children:"Failed to load transcript"}),n.jsx("p",{className:"text-red-400/70 text-xs mt-1",children:N})]})]})}):n.jsxs("div",{className:"flex flex-col h-full bg-surface-0",children:[n.jsxs("div",{className:"sticky top-0 z-20 bg-surface-1/95 backdrop-blur-sm border-b border-border-subtle",children:[n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("button",{type:"button",onClick:()=>a(-1),className:"shrink-0 p-1.5 rounded-lg hover:bg-surface-2 text-text-secondary hover:text-text-primary transition-colors",children:n.jsx(eo,{size:16})}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d&&n.jsx("span",{className:"text-amber-400 font-mono text-xs",children:d.shortSha}),(d==null?void 0:d.branch)&&n.jsx("span",{className:"bg-surface-2 rounded-md px-1.5 py-0.5 text-[10px] font-mono text-text-secondary",children:d.branch})]}),n.jsx("p",{className:"text-sm text-text-primary font-medium truncate mt-0.5",children:(d==null?void 0:d.subject)??"Transcript"}),(d==null?void 0:d.authorDate)&&n.jsx("p",{className:"text-[10px] text-text-muted",children:new Date(d.authorDate).toLocaleString()})]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsxs("span",{className:"text-xs text-text-muted",children:[q.length," turns"]}),n.jsx("button",{type:"button",onClick:()=>{j(!w),w||setTimeout(()=>{var ee;return(ee=_.current)==null?void 0:ee.focus()},50)},className:`p-1.5 rounded-lg transition-colors ${w?"bg-accent/15 text-accent":"hover:bg-surface-2 text-text-secondary hover:text-text-primary"}`,children:n.jsx(ks,{size:16})})]})]}),w&&n.jsx("div",{className:"max-w-4xl mx-auto px-4 pb-3",children:n.jsxs("div",{className:"flex items-center gap-2 bg-surface-2 rounded-lg px-3 py-1.5 border border-border-subtle focus-within:border-accent/50",children:[n.jsx(ks,{size:14,className:"text-text-muted shrink-0"}),n.jsx("input",{ref:_,type:"text",value:S,onChange:ee=>k(ee.target.value),placeholder:"Search transcript...",className:"flex-1 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),S&&n.jsx("span",{className:"text-xs text-text-muted shrink-0",children:$.length>0?`${M+1}/${$.length}`:"0 matches"}),$.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:B,className:"p-0.5 rounded hover:bg-surface-3 text-text-muted hover:text-text-primary transition-colors",children:n.jsx(Wm,{size:14})}),n.jsx("button",{type:"button",onClick:U,className:"p-0.5 rounded hover:bg-surface-3 text-text-muted hover:text-text-primary transition-colors",children:n.jsx(Pn,{size:14})})]}),n.jsx("button",{type:"button",onClick:()=>{j(!1),k("")},className:"p-0.5 rounded hover:bg-surface-3 text-text-muted hover:text-text-primary transition-colors",children:n.jsx(ln,{size:14})})]})}),n.jsx("div",{className:"h-0.5 bg-surface-2",children:n.jsx("div",{className:"h-full bg-accent transition-all duration-150",style:{width:`${C}%`}})})]}),n.jsx("div",{ref:Y,className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6",children:[P&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mb-4 bg-amber-500/10 rounded-lg border border-amber-500/20",children:[n.jsx(It,{size:14,className:"text-amber-400 shrink-0"}),n.jsx("span",{className:"text-xs text-amber-400",children:"Earlier messages were trimmed from this transcript."})]}),z===null&&m&&n.jsx("pre",{className:"bg-surface-2 rounded-lg p-4 font-mono text-xs text-text-secondary whitespace-pre-wrap",children:m}),z!==null&&z.length===0&&n.jsx("div",{className:"bg-surface-2 rounded-lg p-4 text-sm text-text-muted text-center",children:"No conversation turns found."}),z!==null&&z.length>0&&n.jsx("div",{className:"space-y-0.5",children:z.map((ee,ie)=>n.jsx(M3,{turn:ee,highlighted:$.includes(ie)||F===ie,innerRef:T=>{D.current[ie]=T}},ie))})]})}),n.jsx("div",{className:"border-t border-border-subtle bg-surface-1/95 backdrop-blur-sm",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-2 flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-text-muted",children:[q.length>0?`${q.length} conversation turn${q.length!==1?"s":""}`:"No turns",z&&z.length!==q.length&&n.jsxs("span",{children:[" · ",z.length," total blocks"]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-xs text-text-muted",children:[C,"%"]}),P&&n.jsx("span",{className:"text-[10px] text-amber-400",children:"Truncated"})]})]})})]})}function Oy(e,a){const r=String(e);if(typeof a!="string")throw new TypeError("Expected character");let l=0,o=r.indexOf(a);for(;o!==-1;)l++,o=r.indexOf(a,o+a.length);return l}function D3(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function L3(e,a,r){const o=io((r||{}).ignore||[]),u=z3(a);let d=-1;for(;++d<u.length;)Wv(e,"text",f);function f(p,g){let b=-1,N;for(;++b<g.length;){const v=g[b],w=N?N.children:void 0;if(o(v,w?w.indexOf(v):void 0,N))return;N=v}if(N)return m(p,g)}function m(p,g){const b=g[g.length-1],N=u[d][0],v=u[d][1];let w=0;const S=b.children.indexOf(p);let k=!1,_=[];N.lastIndex=0;let M=N.exec(p.value);for(;M;){const Z=M.index,Y={index:M.index,input:M.input,stack:[...g,p]};let C=v(...M,Y);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?N.lastIndex=Z+1:(w!==Z&&_.push({type:"text",value:p.value.slice(w,Z)}),Array.isArray(C)?_.push(...C):C&&_.push(C),w=Z+M[0].length,k=!0),!N.global)break;M=N.exec(p.value)}return k?(w<p.value.length&&_.push({type:"text",value:p.value.slice(w)}),b.children.splice(S,1,..._)):_=[p],S+_.length}}function z3(e){const a=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<r.length;){const o=r[l];a.push([I3(o[0]),U3(o[1])])}return a}function I3(e){return typeof e=="string"?new RegExp(D3(e),"g"):e}function U3(e){return typeof e=="function"?e:function(){return e}}const Jf="phrasing",em=["autolink","link","image","label"];function B3(){return{transforms:[K3],enter:{literalAutolink:P3,literalAutolinkEmail:tm,literalAutolinkHttp:tm,literalAutolinkWww:tm},exit:{literalAutolink:G3,literalAutolinkEmail:q3,literalAutolinkHttp:F3,literalAutolinkWww:H3}}}function $3(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Jf,notInConstruct:em},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Jf,notInConstruct:em},{character:":",before:"[ps]",after:"\\/",inConstruct:Jf,notInConstruct:em}]}}function P3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function tm(e){this.config.enter.autolinkProtocol.call(this,e)}function F3(e){this.config.exit.autolinkProtocol.call(this,e)}function H3(e){this.config.exit.data.call(this,e);const a=this.stack[this.stack.length-1];a.type,a.url="http://"+this.sliceSerialize(e)}function q3(e){this.config.exit.autolinkEmail.call(this,e)}function G3(e){this.exit(e)}function K3(e){L3(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Y3],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),V3]],{ignore:["link","linkReference"]})}function Y3(e,a,r,l,o){let u="";if(!e1(o)||(/^w/i.test(a)&&(r=a+r,a="",u="http://"),!X3(r)))return!1;const d=Z3(r+l);if(!d[0])return!1;const f={type:"link",title:null,url:u+a+d[0],children:[{type:"text",value:a+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function V3(e,a,r,l){return!e1(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+a+"@"+r,children:[{type:"text",value:a+"@"+r}]}}function X3(e){const a=e.split(".");return!(a.length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))}function Z3(e){const a=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!a)return[e,void 0];e=e.slice(0,a.index);let r=a[0],l=r.indexOf(")");const o=Oy(e,"(");let u=Oy(e,")");for(;l!==-1&&o>u;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),u++;return[e,r]}function e1(e,a){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(r)||du(r))&&(!a||r!==47)}t1.peek=rM;function Q3(){this.buffer()}function W3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function J3(){this.buffer()}function eM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tM(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ts(this.sliceSerialize(e)).toLowerCase(),r.label=a}function nM(e){this.exit(e)}function sM(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ts(this.sliceSerialize(e)).toLowerCase(),r.label=a}function aM(e){this.exit(e)}function rM(){return"["}function t1(e,a,r,l){const o=r.createTracker(l);let u=o.move("[^");const d=r.enter("footnoteReference"),f=r.enter("reference");return u+=o.move(r.safe(r.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function iM(){return{enter:{gfmFootnoteCallString:Q3,gfmFootnoteCall:W3,gfmFootnoteDefinitionLabelString:J3,gfmFootnoteDefinition:eM},exit:{gfmFootnoteCallString:tM,gfmFootnoteCall:nM,gfmFootnoteDefinitionLabelString:sM,gfmFootnoteDefinition:aM}}}function lM(e){let a=!1;return e&&e.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:t1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,o,u,d){const f=u.createTracker(d);let m=f.move("[^");const p=u.enter("footnoteDefinition"),g=u.enter("label");return m+=f.move(u.safe(u.associationId(l),{before:m,after:"]"})),g(),m+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),m+=f.move((a?`
592
- `:" ")+u.indentLines(u.containerFlow(l,f.current()),a?n1:oM))),p(),m}}function oM(e,a,r){return a===0?e:n1(e,a,r)}function n1(e,a,r){return(r?"":" ")+e}const cM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];s1.peek=pM;function uM(){return{canContainEols:["delete"],enter:{strikethrough:fM},exit:{strikethrough:mM}}}function dM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:cM}],handlers:{delete:s1}}}function fM(e){this.enter({type:"delete",children:[]},e)}function mM(e){this.exit(e)}function s1(e,a,r,l){const o=r.createTracker(l),u=r.enter("strikethrough");let d=o.move("~~");return d+=r.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function pM(){return"~"}function hM(e){return e.length}function xM(e,a){const r=a||{},l=(r.align||[]).concat(),o=r.stringLength||hM,u=[],d=[],f=[],m=[];let p=0,g=-1;for(;++g<e.length;){const j=[],S=[];let k=-1;for(e[g].length>p&&(p=e[g].length);++k<e[g].length;){const _=gM(e[g][k]);if(r.alignDelimiters!==!1){const M=o(_);S[k]=M,(m[k]===void 0||M>m[k])&&(m[k]=M)}j.push(_)}d[g]=j,f[g]=S}let b=-1;if(typeof l=="object"&&"length"in l)for(;++b<p;)u[b]=Dy(l[b]);else{const j=Dy(l);for(;++b<p;)u[b]=j}b=-1;const N=[],v=[];for(;++b<p;){const j=u[b];let S="",k="";j===99?(S=":",k=":"):j===108?S=":":j===114&&(k=":");let _=r.alignDelimiters===!1?1:Math.max(1,m[b]-S.length-k.length);const M=S+"-".repeat(_)+k;r.alignDelimiters!==!1&&(_=S.length+_+k.length,_>m[b]&&(m[b]=_),v[b]=_),N[b]=M}d.splice(1,0,N),f.splice(1,0,v),g=-1;const w=[];for(;++g<d.length;){const j=d[g],S=f[g];b=-1;const k=[];for(;++b<p;){const _=j[b]||"";let M="",Z="";if(r.alignDelimiters!==!1){const Y=m[b]-(S[b]||0),C=u[b];C===114?M=" ".repeat(Y):C===99?Y%2?(M=" ".repeat(Y/2+.5),Z=" ".repeat(Y/2-.5)):(M=" ".repeat(Y/2),Z=M):Z=" ".repeat(Y)}r.delimiterStart!==!1&&!b&&k.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&_==="")&&(r.delimiterStart!==!1||b)&&k.push(" "),r.alignDelimiters!==!1&&k.push(M),k.push(_),r.alignDelimiters!==!1&&k.push(Z),r.padding!==!1&&k.push(" "),(r.delimiterEnd!==!1||b!==p-1)&&k.push("|")}w.push(r.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
593
- `)}function gM(e){return e==null?"":String(e)}function Dy(e){const a=typeof e=="string"?e.codePointAt(0):0;return a===67||a===99?99:a===76||a===108?108:a===82||a===114?114:0}function bM(e,a,r,l){const o=r.enter("blockquote"),u=r.createTracker(l);u.move("> "),u.shift(2);const d=r.indentLines(r.containerFlow(e,u.current()),yM);return o(),d}function yM(e,a,r){return">"+(r?"":" ")+e}function vM(e,a){return Ly(e,a.inConstruct,!0)&&!Ly(e,a.notInConstruct,!1)}function Ly(e,a,r){if(typeof a=="string"&&(a=[a]),!a||a.length===0)return r;let l=-1;for(;++l<a.length;)if(e.includes(a[l]))return!0;return!1}function zy(e,a,r,l){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
594
- `&&vM(r.stack,r.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
595
- `}function NM(e,a){const r=String(e);let l=r.indexOf(a),o=l,u=0,d=0;if(typeof a!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++u>d&&(d=u):u=1,o=l+a.length,l=r.indexOf(a,o);return d}function wM(e,a){return!!(a.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EM(e){const a=e.options.fence||"`";if(a!=="`"&&a!=="~")throw new Error("Cannot serialize code with `"+a+"` for `options.fence`, expected `` ` `` or `~`");return a}function jM(e,a,r,l){const o=EM(r),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(wM(e,r)){const b=r.enter("codeIndented"),N=r.indentLines(u,SM);return b(),N}const f=r.createTracker(l),m=o.repeat(Math.max(NM(u,o)+1,3)),p=r.enter("codeFenced");let g=f.move(m);if(e.lang){const b=r.enter(`codeFencedLang${d}`);g+=f.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=r.enter(`codeFencedMeta${d}`);g+=f.move(" "),g+=f.move(r.safe(e.meta,{before:g,after:`
596
- `,encode:["`"],...f.current()})),b()}return g+=f.move(`
597
- `),u&&(g+=f.move(u+`
598
- `)),g+=f.move(m),p(),g}function SM(e,a,r){return(r?"":" ")+e}function wp(e){const a=e.options.quote||'"';if(a!=='"'&&a!=="'")throw new Error("Cannot serialize title with `"+a+"` for `options.quote`, expected `\"`, or `'`");return a}function kM(e,a,r,l){const o=wp(r),u=o==='"'?"Quote":"Apostrophe",d=r.enter("definition");let f=r.enter("label");const m=r.createTracker(l);let p=m.move("[");return p+=m.move(r.safe(r.associationId(e),{before:p,after:"]",...m.current()})),p+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(e.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(f=r.enter("destinationRaw"),p+=m.move(r.safe(e.url,{before:p,after:e.title?" ":`
599
- `,...m.current()}))),f(),e.title&&(f=r.enter(`title${u}`),p+=m.move(" "+o),p+=m.move(r.safe(e.title,{before:p,after:o,...m.current()})),p+=m.move(o),f()),d(),p}function _M(e){const a=e.options.emphasis||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize emphasis with `"+a+"` for `options.emphasis`, expected `*`, or `_`");return a}function Kl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wc(e,a,r){const l=Ai(e),o=Ai(a);return l===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}a1.peek=CM;function a1(e,a,r,l){const o=_M(r),u=r.enter("emphasis"),d=r.createTracker(l),f=d.move(o);let m=d.move(r.containerPhrasing(e,{after:o,before:f,...d.current()}));const p=m.charCodeAt(0),g=Wc(l.before.charCodeAt(l.before.length-1),p,o);g.inside&&(m=Kl(p)+m.slice(1));const b=m.charCodeAt(m.length-1),N=Wc(l.after.charCodeAt(0),b,o);N.inside&&(m=m.slice(0,-1)+Kl(b));const v=d.move(o);return u(),r.attentionEncodeSurroundingInfo={after:N.outside,before:g.outside},f+m+v}function CM(e,a,r){return r.options.emphasis||"*"}function TM(e,a){let r=!1;return hu(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,Rm}),!!((!e.depth||e.depth<3)&&pp(e)&&(a.options.setext||r))}function AM(e,a,r,l){const o=Math.max(Math.min(6,e.depth||1),1),u=r.createTracker(l);if(TM(e,r)){const g=r.enter("headingSetext"),b=r.enter("phrasing"),N=r.containerPhrasing(e,{...u.current(),before:`
600
- `,after:`
601
- `});return b(),g(),N+`
602
- `+(o===1?"=":"-").repeat(N.length-(Math.max(N.lastIndexOf("\r"),N.lastIndexOf(`
603
- `))+1))}const d="#".repeat(o),f=r.enter("headingAtx"),m=r.enter("phrasing");u.move(d+" ");let p=r.containerPhrasing(e,{before:"# ",after:`
604
- `,...u.current()});return/^[\t ]/.test(p)&&(p=Kl(p.charCodeAt(0))+p.slice(1)),p=p?d+" "+p:d,r.options.closeAtx&&(p+=" "+d),m(),f(),p}r1.peek=RM;function r1(e){return e.value||""}function RM(){return"<"}i1.peek=MM;function i1(e,a,r,l){const o=wp(r),u=o==='"'?"Quote":"Apostrophe",d=r.enter("image");let f=r.enter("label");const m=r.createTracker(l);let p=m.move("![");return p+=m.move(r.safe(e.alt,{before:p,after:"]",...m.current()})),p+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(e.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(f=r.enter("destinationRaw"),p+=m.move(r.safe(e.url,{before:p,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=r.enter(`title${u}`),p+=m.move(" "+o),p+=m.move(r.safe(e.title,{before:p,after:o,...m.current()})),p+=m.move(o),f()),p+=m.move(")"),d(),p}function MM(){return"!"}l1.peek=OM;function l1(e,a,r,l){const o=e.referenceType,u=r.enter("imageReference");let d=r.enter("label");const f=r.createTracker(l);let m=f.move("![");const p=r.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(p+"]["),d();const g=r.stack;r.stack=[],d=r.enter("reference");const b=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return d(),r.stack=g,u(),o==="full"||!p||p!==b?m+=f.move(b+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function OM(){return"!"}o1.peek=DM;function o1(e,a,r){let l=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++u<r.unsafe.length;){const d=r.unsafe[u],f=r.compilePattern(d);let m;if(d.atBreak)for(;m=f.exec(l);){let p=m.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(m.index+1)}}return o+l+o}function DM(){return"`"}function c1(e,a){const r=pp(e);return!!(!a.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}u1.peek=LM;function u1(e,a,r,l){const o=wp(r),u=o==='"'?"Quote":"Apostrophe",d=r.createTracker(l);let f,m;if(c1(e,r)){const g=r.stack;r.stack=[],f=r.enter("autolink");let b=d.move("<");return b+=d.move(r.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),r.stack=g,b}f=r.enter("link"),m=r.enter("label");let p=d.move("[");return p+=d.move(r.containerPhrasing(e,{before:p,after:"](",...d.current()})),p+=d.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(r.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(m=r.enter("destinationRaw"),p+=d.move(r.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),m(),e.title&&(m=r.enter(`title${u}`),p+=d.move(" "+o),p+=d.move(r.safe(e.title,{before:p,after:o,...d.current()})),p+=d.move(o),m()),p+=d.move(")"),f(),p}function LM(e,a,r){return c1(e,r)?"<":"["}d1.peek=zM;function d1(e,a,r,l){const o=e.referenceType,u=r.enter("linkReference");let d=r.enter("label");const f=r.createTracker(l);let m=f.move("[");const p=r.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(p+"]["),d();const g=r.stack;r.stack=[],d=r.enter("reference");const b=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return d(),r.stack=g,u(),o==="full"||!p||p!==b?m+=f.move(b+"]"):o==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function zM(){return"["}function Ep(e){const a=e.options.bullet||"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bullet`, expected `*`, `+`, or `-`");return a}function IM(e){const a=Ep(e),r=e.options.bulletOther;if(!r)return a==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===a)throw new Error("Expected `bullet` (`"+a+"`) and `bulletOther` (`"+r+"`) to be different");return r}function UM(e){const a=e.options.bulletOrdered||".";if(a!=="."&&a!==")")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOrdered`, expected `.` or `)`");return a}function f1(e){const a=e.options.rule||"*";if(a!=="*"&&a!=="-"&&a!=="_")throw new Error("Cannot serialize rules with `"+a+"` for `options.rule`, expected `*`, `-`, or `_`");return a}function BM(e,a,r,l){const o=r.enter("list"),u=r.bulletCurrent;let d=e.ordered?UM(r):Ep(r);const f=e.ordered?d==="."?")":".":IM(r);let m=a&&r.bulletLastUsed?d===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(m=!0),f1(r)===d&&g){let b=-1;for(;++b<e.children.length;){const N=e.children[b];if(N&&N.type==="listItem"&&N.children&&N.children[0]&&N.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(d=f),r.bulletCurrent=d;const p=r.containerFlow(e,l);return r.bulletLastUsed=d,r.bulletCurrent=u,o(),p}function $M(e){const a=e.options.listItemIndent||"one";if(a!=="tab"&&a!=="one"&&a!=="mixed")throw new Error("Cannot serialize items with `"+a+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return a}function PM(e,a,r,l){const o=$M(r);let u=r.bulletCurrent||Ep(r);a&&a.type==="list"&&a.ordered&&(u=(typeof a.start=="number"&&a.start>-1?a.start:1)+(r.options.incrementListMarker===!1?0:a.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(a&&a.type==="list"&&a.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=r.createTracker(l);f.move(u+" ".repeat(d-u.length)),f.shift(d);const m=r.enter("listItem"),p=r.indentLines(r.containerFlow(e,f.current()),g);return m(),p;function g(b,N,v){return N?(v?"":" ".repeat(d))+b:(v?u:u+" ".repeat(d-u.length))+b}}function FM(e,a,r,l){const o=r.enter("paragraph"),u=r.enter("phrasing"),d=r.containerPhrasing(e,l);return u(),o(),d}const HM=io(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qM(e,a,r,l){return(e.children.some(function(d){return HM(d)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function GM(e){const a=e.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}m1.peek=KM;function m1(e,a,r,l){const o=GM(r),u=r.enter("strong"),d=r.createTracker(l),f=d.move(o+o);let m=d.move(r.containerPhrasing(e,{after:o,before:f,...d.current()}));const p=m.charCodeAt(0),g=Wc(l.before.charCodeAt(l.before.length-1),p,o);g.inside&&(m=Kl(p)+m.slice(1));const b=m.charCodeAt(m.length-1),N=Wc(l.after.charCodeAt(0),b,o);N.inside&&(m=m.slice(0,-1)+Kl(b));const v=d.move(o+o);return u(),r.attentionEncodeSurroundingInfo={after:N.outside,before:g.outside},f+m+v}function KM(e,a,r){return r.options.strong||"*"}function YM(e,a,r,l){return r.safe(e.value,l)}function VM(e){const a=e.options.ruleRepetition||3;if(a<3)throw new Error("Cannot serialize rules with repetition `"+a+"` for `options.ruleRepetition`, expected `3` or more");return a}function XM(e,a,r){const l=(f1(r)+(r.options.ruleSpaces?" ":"")).repeat(VM(r));return r.options.ruleSpaces?l.slice(0,-1):l}const p1={blockquote:bM,break:zy,code:jM,definition:kM,emphasis:a1,hardBreak:zy,heading:AM,html:r1,image:i1,imageReference:l1,inlineCode:o1,link:u1,linkReference:d1,list:BM,listItem:PM,paragraph:FM,root:qM,strong:m1,text:YM,thematicBreak:XM};function ZM(){return{enter:{table:QM,tableData:Iy,tableHeader:Iy,tableRow:JM},exit:{codeText:e4,table:WM,tableData:nm,tableHeader:nm,tableRow:nm}}}function QM(e){const a=e._align;this.enter({type:"table",align:a.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function WM(e){this.exit(e),this.data.inTable=void 0}function JM(e){this.enter({type:"tableRow",children:[]},e)}function nm(e){this.exit(e)}function Iy(e){this.enter({type:"tableCell",children:[]},e)}function e4(e){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,t4));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(e)}function t4(e,a){return a==="|"?a:e}function n4(e){const a=e||{},r=a.tableCellPadding,l=a.tablePipeAlign,o=a.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
605
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:N,table:d,tableCell:m,tableRow:f}};function d(v,w,j,S){return p(g(v,j,S),v.align)}function f(v,w,j,S){const k=b(v,j,S),_=p([k]);return _.slice(0,_.indexOf(`
606
- `))}function m(v,w,j,S){const k=j.enter("tableCell"),_=j.enter("phrasing"),M=j.containerPhrasing(v,{...S,before:u,after:u});return _(),k(),M}function p(v,w){return xM(v,{align:w,alignDelimiters:l,padding:r,stringLength:o})}function g(v,w,j){const S=v.children;let k=-1;const _=[],M=w.enter("table");for(;++k<S.length;)_[k]=b(S[k],w,j);return M(),_}function b(v,w,j){const S=v.children;let k=-1;const _=[],M=w.enter("tableRow");for(;++k<S.length;)_[k]=m(S[k],v,w,j);return M(),_}function N(v,w,j){let S=p1.inlineCode(v,w,j);return j.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function s4(){return{exit:{taskListCheckValueChecked:Uy,taskListCheckValueUnchecked:Uy,paragraph:r4}}}function a4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:i4}}}function Uy(e){const a=this.stack[this.stack.length-2];a.type,a.checked=e.type==="taskListCheckValueChecked"}function r4(e){const a=this.stack[this.stack.length-2];if(a&&a.type==="listItem"&&typeof a.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const o=a.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function i4(e,a,r,l){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=r.createTracker(l);u&&f.move(d);let m=p1.listItem(e,a,r,{...l,...f.current()});return u&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),m;function p(g){return g+d}}function l4(){return[B3(),iM(),uM(),ZM(),s4()]}function o4(e){return{extensions:[$3(),lM(e),dM(),n4(e),a4()]}}const c4={tokenize:h4,partial:!0},h1={tokenize:x4,partial:!0},x1={tokenize:g4,partial:!0},g1={tokenize:b4,partial:!0},u4={tokenize:y4,partial:!0},b1={name:"wwwAutolink",tokenize:m4,previous:v1},y1={name:"protocolAutolink",tokenize:p4,previous:N1},Ea={name:"emailAutolink",tokenize:f4,previous:w1},Xs={};function d4(){return{text:Xs}}let kr=48;for(;kr<123;)Xs[kr]=Ea,kr++,kr===58?kr=65:kr===91&&(kr=97);Xs[43]=Ea;Xs[45]=Ea;Xs[46]=Ea;Xs[95]=Ea;Xs[72]=[Ea,y1];Xs[104]=[Ea,y1];Xs[87]=[Ea,b1];Xs[119]=[Ea,b1];function f4(e,a,r){const l=this;let o,u;return d;function d(b){return!zm(b)||!w1.call(l,l.previous)||jp(l.events)?r(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return zm(b)?(e.consume(b),f):b===64?(e.consume(b),m):r(b)}function m(b){return b===46?e.check(u4,g,p)(b):b===45||b===95||Ln(b)?(u=!0,e.consume(b),m):g(b)}function p(b){return e.consume(b),o=!0,m}function g(b){return u&&o&&Bn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),a(b)):r(b)}}function m4(e,a,r){const l=this;return o;function o(d){return d!==87&&d!==119||!v1.call(l,l.previous)||jp(l.events)?r(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(c4,e.attempt(h1,e.attempt(x1,u),r),r)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),a(d)}}function p4(e,a,r){const l=this;let o="",u=!1;return d;function d(b){return(b===72||b===104)&&N1.call(l,l.previous)&&!jp(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(b),e.consume(b),f):r(b)}function f(b){if(Bn(b)&&o.length<5)return o+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const N=o.toLowerCase();if(N==="http"||N==="https")return e.consume(b),m}return r(b)}function m(b){return b===47?(e.consume(b),u?p:(u=!0,m)):r(b)}function p(b){return b===null||Xc(b)||Bt(b)||Lr(b)||du(b)?r(b):e.attempt(h1,e.attempt(x1,g),r)(b)}function g(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),a(b)}}function h4(e,a,r){let l=0;return o;function o(d){return(d===87||d===119)&&l<3?(l++,e.consume(d),o):d===46&&l===3?(e.consume(d),u):r(d)}function u(d){return d===null?r(d):a(d)}}function x4(e,a,r){let l,o,u;return d;function d(p){return p===46||p===95?e.check(g1,m,f)(p):p===null||Bt(p)||Lr(p)||p!==45&&du(p)?m(p):(u=!0,e.consume(p),d)}function f(p){return p===95?l=!0:(o=l,l=void 0),e.consume(p),d}function m(p){return o||l||!u?r(p):a(p)}}function g4(e,a){let r=0,l=0;return o;function o(d){return d===40?(r++,e.consume(d),o):d===41&&l<r?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(g1,a,u)(d):d===null||Bt(d)||Lr(d)?a(d):(e.consume(d),o)}function u(d){return d===41&&l++,e.consume(d),o}}function b4(e,a,r){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||Bt(f)||Lr(f)?a(f):r(f)}function o(f){return f===null||f===40||f===91||Bt(f)||Lr(f)?a(f):l(f)}function u(f){return Bn(f)?d(f):r(f)}function d(f){return f===59?(e.consume(f),l):Bn(f)?(e.consume(f),d):r(f)}}function y4(e,a,r){return l;function l(u){return e.consume(u),o}function o(u){return Ln(u)?r(u):a(u)}}function v1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Bt(e)}function N1(e){return!Bn(e)}function w1(e){return!(e===47||zm(e))}function zm(e){return e===43||e===45||e===46||e===95||Ln(e)}function jp(e){let a=e.length,r=!1;for(;a--;){const l=e[a][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const v4={tokenize:C4,partial:!0};function N4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:S4,continuation:{tokenize:k4},exit:_4}},text:{91:{name:"gfmFootnoteCall",tokenize:j4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:w4,resolveTo:E4}}}}function w4(e,a,r){const l=this;let o=l.events.length;const u=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let d;for(;o--;){const m=l.events[o][1];if(m.type==="labelImage"){d=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!d||!d._balanced)return r(m);const p=Ts(l.sliceSerialize({start:d.end,end:l.now()}));return p.codePointAt(0)!==94||!u.includes(p.slice(1))?r(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),a(m))}}function E4(e,a){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[r+1],e[r+2],["enter",l,a],e[r+3],e[r+4],["enter",o,a],["exit",o,a],["enter",u,a],["enter",d,a],["exit",d,a],["exit",u,a],e[e.length-2],e[e.length-1],["exit",l,a]];return e.splice(r,e.length-r+1,...f),e}function j4(e,a,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),m}function m(b){return b!==94?r(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(b){if(u>999||b===93&&!d||b===null||b===91||Bt(b))return r(b);if(b===93){e.exit("chunkString");const N=e.exit("gfmFootnoteCallString");return o.includes(Ts(l.sliceSerialize(N)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),a):r(b)}return Bt(b)||(d=!0),u++,e.consume(b),b===92?g:p}function g(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}}function S4(e,a,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u,d=0,f;return m;function m(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(w)}function g(w){if(d>999||w===93&&!f||w===null||w===91||Bt(w))return r(w);if(w===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return u=Ts(l.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),N}return Bt(w)||(f=!0),d++,e.consume(w),w===92?b:g}function b(w){return w===91||w===92||w===93?(e.consume(w),d++,g):g(w)}function N(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(u)||o.push(u),yt(e,v,"gfmFootnoteDefinitionWhitespace")):r(w)}function v(w){return a(w)}}function k4(e,a,r){return e.check(ro,a,e.attempt(v4,a,r))}function _4(e){e.exit("gfmFootnoteDefinition")}function C4(e,a,r){const l=this;return yt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=l.events[l.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?a(u):r(u)}}function T4(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(d,f){let m=-1;for(;++m<d.length;)if(d[m][0]==="enter"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._close){let p=m;for(;p--;)if(d[p][0]==="exit"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._open&&d[m][1].end.offset-d[m][1].start.offset===d[p][1].end.offset-d[p][1].start.offset){d[m][1].type="strikethroughSequence",d[p][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},d[p][1].start),end:Object.assign({},d[m][1].end)},b={type:"strikethroughText",start:Object.assign({},d[p][1].end),end:Object.assign({},d[m][1].start)},N=[["enter",g,f],["enter",d[p][1],f],["exit",d[p][1],f],["enter",b,f]],v=f.parser.constructs.insideSpan.null;v&&is(N,N.length,0,fu(v,d.slice(p+1,m),f)),is(N,N.length,0,[["exit",b,f],["enter",d[m][1],f],["exit",d[m][1],f],["exit",g,f]]),is(d,p-1,m-p+3,N),m=p+N.length-2;break}}for(m=-1;++m<d.length;)d[m][1].type==="strikethroughSequenceTemporary"&&(d[m][1].type="data");return d}function u(d,f,m){const p=this.previous,g=this.events;let b=0;return N;function N(w){return p===126&&g[g.length-1][1].type!=="characterEscape"?m(w):(d.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const j=Ai(p);if(w===126)return b>1?m(w):(d.consume(w),b++,v);if(b<2&&!r)return m(w);const S=d.exit("strikethroughSequenceTemporary"),k=Ai(w);return S._open=!k||k===2&&!!j,S._close=!j||j===2&&!!k,f(w)}}}class A4{constructor(){this.map=[]}add(a,r,l){R4(this,a,r,l)}consume(a){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(a.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),a.length=this.map[r][0];l.push(a.slice()),a.length=0;let o=l.pop();for(;o;){for(const u of o)a.push(u);o=l.pop()}this.map.length=0}}function R4(e,a,r,l){let o=0;if(!(r===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===a){e.map[o][1]+=r,e.map[o][2].push(...l);return}o+=1}e.map.push([a,r,l])}}function M4(e,a){let r=!1;const l=[];for(;a<e.length;){const o=e[a];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[a+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[a-1][1].type==="tableDelimiterMarker"){const u=l.length-1;l[u]=l[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);a+=1}return l}function O4(){return{flow:{null:{name:"table",tokenize:D4,resolveAll:L4}}}}function D4(e,a,r){const l=this;let o=0,u=0,d;return f;function f(R){let z=l.events.length-1;for(;z>-1;){const $=l.events[z][1].type;if($==="lineEnding"||$==="linePrefix")z--;else break}const P=z>-1?l.events[z][1].type:null,q=P==="tableHead"||P==="tableRow"?C:m;return q===C&&l.parser.lazy[l.now().line]?r(R):q(R)}function m(R){return e.enter("tableHead"),e.enter("tableRow"),p(R)}function p(R){return R===124||(d=!0,u+=1),g(R)}function g(R){return R===null?r(R):He(R)?u>1?(u=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v):r(R):ft(R)?yt(e,g,"whitespace")(R):(u+=1,d&&(d=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),d=!0,g):(e.enter("data"),b(R)))}function b(R){return R===null||R===124||Bt(R)?(e.exit("data"),g(R)):(e.consume(R),R===92?N:b)}function N(R){return R===92||R===124?(e.consume(R),b):b(R)}function v(R){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(R):(e.enter("tableDelimiterRow"),d=!1,ft(R)?yt(e,w,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):w(R))}function w(R){return R===45||R===58?S(R):R===124?(d=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),j):Y(R)}function j(R){return ft(R)?yt(e,S,"whitespace")(R):S(R)}function S(R){return R===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),k):R===45?(u+=1,k(R)):R===null||He(R)?Z(R):Y(R)}function k(R){return R===45?(e.enter("tableDelimiterFiller"),_(R)):Y(R)}function _(R){return R===45?(e.consume(R),_):R===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(R))}function M(R){return ft(R)?yt(e,Z,"whitespace")(R):Z(R)}function Z(R){return R===124?w(R):R===null||He(R)?!d||o!==u?Y(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),a(R)):Y(R)}function Y(R){return r(R)}function C(R){return e.enter("tableRow"),I(R)}function I(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),I):R===null||He(R)?(e.exit("tableRow"),a(R)):ft(R)?yt(e,I,"whitespace")(R):(e.enter("data"),D(R))}function D(R){return R===null||R===124||Bt(R)?(e.exit("data"),I(R)):(e.consume(R),R===92?F:D)}function F(R){return R===92||R===124?(e.consume(R),D):D(R)}}function L4(e,a){let r=-1,l=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,m=0,p,g,b;const N=new A4;for(;++r<e.length;){const v=e[r],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,m!==0&&(By(N,a,m,p,g),g=void 0,m=0),p={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},N.add(r,0,[["enter",p,a]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=!0,b=void 0,u=[0,0,0,0],d=[0,r+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},N.add(r,0,[["enter",g,a]])),o=w.type==="tableDelimiterRow"?2:g?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(l=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],b=Tc(N,a,u,o,void 0,b),u=[0,0,0,0]),d[2]=r)):w.type==="tableCellDivider"&&(l?l=!1:(u[1]!==0&&(d[0]=d[1],b=Tc(N,a,u,o,void 0,b)),u=d,d=[u[1],r,0,0])):w.type==="tableHead"?(f=!0,m=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(m=r,u[1]!==0?(d[0]=d[1],b=Tc(N,a,u,o,r,b)):d[1]!==0&&(b=Tc(N,a,d,o,r,b)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(d[3]=r)}for(m!==0&&By(N,a,m,p,g),N.consume(a.events),r=-1;++r<a.events.length;){const v=a.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=M4(a.events,r))}return e}function Tc(e,a,r,l,o,u){const d=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(u.end=Object.assign({},Ei(a.events,r[0])),e.add(r[0],0,[["exit",u,a]]));const m=Ei(a.events,r[1]);if(u={type:d,start:Object.assign({},m),end:Object.assign({},m)},e.add(r[1],0,[["enter",u,a]]),r[2]!==0){const p=Ei(a.events,r[2]),g=Ei(a.events,r[3]),b={type:f,start:Object.assign({},p),end:Object.assign({},g)};if(e.add(r[2],0,[["enter",b,a]]),l!==2){const N=a.events[r[2]],v=a.events[r[3]];if(N[1].end=Object.assign({},v[1].end),N[1].type="chunkText",N[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,j=r[3]-r[2]-1;e.add(w,j,[])}}e.add(r[3]+1,0,[["exit",b,a]])}return o!==void 0&&(u.end=Object.assign({},Ei(a.events,o)),e.add(o,0,[["exit",u,a]]),u=void 0),u}function By(e,a,r,l,o){const u=[],d=Ei(a.events,r);o&&(o.end=Object.assign({},d),u.push(["exit",o,a])),l.end=Object.assign({},d),u.push(["exit",l,a]),e.add(r+1,0,u)}function Ei(e,a){const r=e[a],l=r[0]==="enter"?"start":"end";return r[1][l]}const z4={name:"tasklistCheck",tokenize:U4};function I4(){return{text:{91:z4}}}function U4(e,a,r){const l=this;return o;function o(m){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),u)}function u(m){return Bt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),d):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),d):r(m)}function d(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(m)}function f(m){return He(m)?a(m):ft(m)?e.check({tokenize:B4},a,r)(m):r(m)}}function B4(e,a,r){return yt(e,l,"whitespace");function l(o){return o===null?r(o):a(o)}}function $4(e){return Ov([d4(),N4(),T4(e),O4(),I4()])}const P4={};function F4(e){const a=this,r=e||P4,l=a.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),u=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),d=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push($4(r)),u.push(l4()),d.push(o4(r))}const $y=(function(e,a,r){const l=io(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof a=="number"){if(a<0||a===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(a=e.children.indexOf(a),a<0)throw new Error("Expected child node or index");for(;++a<e.children.length;)if(l(e.children[a],a,e))return e.children[a]}),Ir=(function(e){if(e==null)return G4;if(typeof e=="string")return q4(e);if(typeof e=="object")return H4(e);if(typeof e=="function")return Sp(e);throw new Error("Expected function, string, or array as `test`")});function H4(e){const a=[];let r=-1;for(;++r<e.length;)a[r]=Ir(e[r]);return Sp(l);function l(...o){let u=-1;for(;++u<a.length;)if(a[u].apply(this,o))return!0;return!1}}function q4(e){return Sp(a);function a(r){return r.tagName===e}}function Sp(e){return a;function a(r,l,o){return!!(K4(r)&&e.call(this,r,typeof l=="number"?l:void 0,o||void 0))}}function G4(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function K4(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Py=/\n/g,Fy=/[\t ]+/g,Im=Ir("br"),Hy=Ir(eO),Y4=Ir("p"),qy=Ir("tr"),V4=Ir(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",J4,tO]),E1=Ir(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function X4(e,a){const r=a||{},l="children"in e?e.children:[],o=E1(e),u=k1(e,{whitespace:r.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...S1(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<l.length;)d.push(...j1(l[f],e,{whitespace:u,breakBefore:f?void 0:o,breakAfter:f<l.length-1?Im(l[f+1]):o}));const m=[];let p;for(f=-1;++f<d.length;){const g=d[f];typeof g=="number"?p!==void 0&&g>p&&(p=g):g&&(p!==void 0&&p>-1&&m.push(`
607
- `.repeat(p)||" "),p=-1,m.push(g))}return m.join("")}function j1(e,a,r){return e.type==="element"?Z4(e,a,r):e.type==="text"?r.whitespace==="normal"?S1(e,r):Q4(e):[]}function Z4(e,a,r){const l=k1(e,r),o=e.children||[];let u=-1,d=[];if(V4(e))return d;let f,m;for(Im(e)||qy(e)&&$y(a,e,qy)?m=`
608
- `:Y4(e)?(f=2,m=2):E1(e)&&(f=1,m=1);++u<o.length;)d=d.concat(j1(o[u],e,{whitespace:l,breakBefore:u?void 0:f,breakAfter:u<o.length-1?Im(o[u+1]):m}));return Hy(e)&&$y(a,e,Hy)&&d.push(" "),f&&d.unshift(f),m&&d.push(m),d}function S1(e,a){const r=String(e.value),l=[],o=[];let u=0;for(;u<=r.length;){Py.lastIndex=u;const m=Py.exec(r),p=m&&"index"in m?m.index:r.length;l.push(W4(r.slice(u,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?a.breakBefore:!0,p===r.length?a.breakAfter:!0)),u=p+1}let d=-1,f;for(;++d<l.length;)l[d].charCodeAt(l[d].length-1)===8203||d<l.length-1&&l[d+1].charCodeAt(0)===8203?(o.push(l[d]),f=void 0):l[d]?(typeof f=="number"&&o.push(f),o.push(l[d]),f=0):(d===0||d===l.length-1)&&o.push(0);return o}function Q4(e){return[String(e.value)]}function W4(e,a,r){const l=[];let o=0,u;for(;o<e.length;){Fy.lastIndex=o;const d=Fy.exec(e);u=d?d.index:e.length,!o&&!u&&d&&!a&&l.push(""),o!==u&&l.push(e.slice(o,u)),o=d?u+d[0].length:u}return o!==u&&!r&&l.push(""),l.join(" ")}function k1(e,a){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":a.whitespace;case"textarea":return"pre-wrap"}}return a.whitespace}function J4(e){return!!(e.properties||{}).hidden}function eO(e){return e.tagName==="td"||e.tagName==="th"}function tO(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function nO(e){const a=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+l+"|"+a.optional(o)+"[a-zA-Z_]\\w*"+a.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},N={className:"title",begin:a.optional(o)+e.IDENT_RE,relevance:0},v=a.optional(o)+e.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],j=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],Z={type:j,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},Y={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:a.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,a.lookahead(/(<[^<>]+>|)\s*\(/))},C=[Y,b,f,r,e.C_BLOCK_COMMENT_MODE,g,p],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Z,contains:C.concat([{begin:/\(/,end:/\)/,keywords:Z,contains:C.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+d+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:Z,relevance:0},{begin:v,returnBegin:!0,contains:[N],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Z,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,g,f,{begin:/\(/,end:/\)/,keywords:Z,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,D,Y,C,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:Z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:Z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function sO(e){const a={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},r=nO(e),l=r.keywords;return l.type=[...l.type,...a.type],l.literal=[...l.literal,...a.literal],l.built_in=[...l.built_in,...a.built_in],l._hints=a._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function aO(e){const a=e.regex,r={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(f);const m={match:/\\"/},p={className:"string",begin:/'/,end:/'/},g={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},j=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],k={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],Z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],Y=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:j,literal:S,built_in:[..._,...M,"set","shopt",...Z,...Y]},contains:[v,e.SHEBANG(),w,b,u,d,k,f,m,p,g,r]}}function rO(e){const a=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+l+"|"+a.optional(o)+"[a-zA-Z_]\\w*"+a.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},N={className:"title",begin:a.optional(o)+e.IDENT_RE,relevance:0},v=a.optional(o)+e.IDENT_RE+"\\s*\\(",S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[b,f,r,e.C_BLOCK_COMMENT_MODE,g,p],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:k.concat([{begin:/\(/,end:/\)/,keywords:S,contains:k.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+d+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:S,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(N,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,g,f,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(_,M,k,[b,{begin:e.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:b,strings:p,keywords:S}}}function iO(e){const a=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+l+"|"+a.optional(o)+"[a-zA-Z_]\\w*"+a.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},N={className:"title",begin:a.optional(o)+e.IDENT_RE,relevance:0},v=a.optional(o)+e.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],j=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],Z={type:j,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},Y={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:a.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,a.lookahead(/(<[^<>]+>|)\s*\(/))},C=[Y,b,f,r,e.C_BLOCK_COMMENT_MODE,g,p],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Z,contains:C.concat([{begin:/\(/,end:/\)/,keywords:Z,contains:C.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+d+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:Z,relevance:0},{begin:v,returnBegin:!0,contains:[N],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Z,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,g,f,{begin:/\(/,end:/\)/,keywords:Z,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,D,Y,C,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:Z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:Z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function lO(e){const a=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],l=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(u),built_in:a,literal:l},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(g,{illegal:/\n/}),N={className:"subst",begin:/\{/,end:/\}/,keywords:d},v=e.inherit(N,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},j={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},N]},S=e.inherit(j,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});N.contains=[j,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],v.contains=[S,w,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[p,j,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},M=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",Z={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3C!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,_,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,_,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[k,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Z]}}const oO=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cO=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uO=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dO=[...cO,...uO],fO=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),pO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hO=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xO(e){const a=e.regex,r=oO(e),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",u=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,l,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+mO.join("|")+")"},{begin:":(:)?("+pO.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hO.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:fO.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+dO.join("|")+")\\b"}]}}function gO(e){const a=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:a.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:a.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function bO(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function yO(e){const a=e.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:a.concat(r,a.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function vO(e){const a=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},l=e.COMMENT();l.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[l,u,o,d,r,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,g=/'[^']*'/,b=a.either(m,p,g),N=a.concat(b,"(\\s*\\.\\s*",b,")*",a.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[l,{className:"section",begin:/\[+/,end:/\]+/},{begin:N,className:"attr",starts:{end:/$/,contains:[l,f,u,o,d,r]}}]}}var ji="[0-9](_*[0-9])*",Ac=`\\.(${ji})`,Rc="[0-9a-fA-F](_*[0-9a-fA-F])*",Gy={className:"number",variants:[{begin:`(\\b(${ji})((${Ac})|\\.)?|(${Ac}))[eE][+-]?(${ji})[fFdD]?\\b`},{begin:`\\b(${ji})((${Ac})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ac})[fFdD]?\\b`},{begin:`\\b(${ji})[fFdD]\\b`},{begin:`\\b0[xX]((${Rc})\\.?|(${Rc})?\\.(${Rc}))[pP][+-]?(${ji})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Rc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function _1(e,a,r){return r===-1?"":e.replace(a,l=>_1(e,a,r-1))}function NO(e){const a=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",l=r+_1("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),m={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:m,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[a.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[g,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+l+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:m,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Gy,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Gy,p]}}const Ky="[A-Za-z$_][0-9A-Za-z$_]*",wO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],EO=["true","false","null","undefined","NaN","Infinity"],C1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],T1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],A1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],SO=[].concat(A1,C1,T1);function kO(e){const a=e.regex,r=(ee,{after:ie})=>{const T="</"+ee[0].slice(1);return ee.input.indexOf(T,ie)!==-1},l=Ky,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ee,ie)=>{const T=ee[0].length+ee.index,L=ee.input[T];if(L==="<"||L===","){ie.ignoreMatch();return}L===">"&&(r(ee,{after:T})||ie.ignoreMatch());let G;const O=ee.input.substring(T);if(G=O.match(/^\s*=/)){ie.ignoreMatch();return}if((G=O.match(/^\s+extends\s+/))&&G.index===0){ie.ignoreMatch();return}}},f={$pattern:Ky,keyword:wO,literal:EO,built_in:SO,"variable.language":jO},m="[0-9](_?[0-9])*",p=`\\.(${m})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${m})\\b`},{begin:`\\b(${g})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},j={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,j,S,{match:/\$\d+/},b];N.contains=M.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(M)});const Z=[].concat(_,N.contains),Y=Z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(Z)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:Y},I={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,a.concat(l,"(",a.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...C1,...T1]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(ee){return a.concat("(?!",ee.join("|"),")")}const q={match:a.concat(/\b/,P([...A1,"super","import"].map(ee=>`${ee}\\s*\\(`)),l,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:Y,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,j,S,_,{match:/\$\d+/},b,D,{scope:"attr",match:l+a.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:Y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},q,z,I,U,{match:/\$[(.]/}]}}function _O(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],o={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[a,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Si="[0-9](_*[0-9])*",Mc=`\\.(${Si})`,Oc="[0-9a-fA-F](_*[0-9a-fA-F])*",CO={className:"number",variants:[{begin:`(\\b(${Si})((${Mc})|\\.)?|(${Mc}))[eE][+-]?(${Si})[fFdD]?\\b`},{begin:`\\b(${Si})((${Mc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Mc})[fFdD]?\\b`},{begin:`\\b(${Si})[fFdD]\\b`},{begin:`\\b0[xX]((${Oc})\\.?|(${Oc})?\\.(${Oc}))[pP][+-]?(${Si})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Oc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function TO(e){const a={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},l={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,o]}]};o.contains.push(d);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},p=CO,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),b={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=b;return N.variants[1].contains=[b],b.variants[1].contains=[N],{name:"Kotlin",aliases:["kt","kts"],keywords:a,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,r,l,f,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:a,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[b,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,f,m,d,e.C_NUMBER_MODE]},g]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,m]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
609
- `},p]}}const AO=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),RO=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],MO=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OO=[...RO,...MO],DO=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),R1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),M1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),LO=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),zO=R1.concat(M1).sort().reverse();function IO(e){const a=AO(e),r=zO,l="and or not only",o="[\\w-]+",u="("+o+"|@\\{"+o+"\\})",d=[],f=[],m=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},p=function(M,Z,Y){return{className:M,begin:Z,relevance:Y}},g={$pattern:/[a-z-]+/,keyword:l,attribute:DO.join(" ")},b={begin:"\\(",end:"\\)",contains:f,keywords:g,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m("'"),m('"'),a.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},a.HEXCOLOR,b,p("variable","@@?"+o,10),p("variable","@\\{"+o+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},a.IMPORTANT,{beginKeywords:"and not"},a.FUNCTION_DISPATCH);const N=f.concat({begin:/\{/,end:/\}/,contains:d}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},w={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+LO.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},j={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:f,relevance:0}},S={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:N}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,p("keyword","all\\b"),p("variable","@\\{"+o+"\\}"),{begin:"\\b("+OO.join("|")+")\\b",className:"selector-tag"},a.CSS_NUMBER_MODE,p("selector-tag",u,0),p("selector-id","#"+u),p("selector-class","\\."+u,0),p("selector-tag","&",0),a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+R1.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+M1.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:N},{begin:"!important"},a.FUNCTION_DISPATCH]},_={begin:o+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[k]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,j,S,_,w,k,v,a.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function UO(e){const a="\\[=*\\[",r="\\]=*\\]",l={begin:a,end:r,contains:["self"]},o=[e.COMMENT("--(?!"+a+")","$"),e.COMMENT("--"+a,r,{contains:[l],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:a,end:r,contains:[l],relevance:5}])}}function BO(e){const a={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a]},l={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[a,r]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[a]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,a,r,l,o,u,d]}}function $O(e){const a=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(p,{contains:[]}),N=e.inherit(g,{contains:[]});p.contains.push(N),g.contains.push(b);let v=[r,m];return[p,g,b,N].forEach(k=>{k.contains=k.contains.concat(v)}),v=v.concat(p,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},r,u,p,g,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},o,l,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function PO(e){const a={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function FO(e){const a=e.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],l=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:r.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:a.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[e.BACKSLASH_ESCAPE,u,m],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],N=(j,S,k="\\1")=>{const _=k==="\\1"?k:a.concat(k,S);return a.concat(a.concat("(?:",j,")"),S,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,k,l)},v=(j,S,k)=>a.concat(a.concat("(?:",j,")"),S,/(?:\\.|[^\\\/])*?/,k,l),w=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:N("s|tr|y",a.either(...b,{capture:!0}))},{begin:N("s|tr|y","\\(","\\)")},{begin:N("s|tr|y","\\[","\\]")},{begin:N("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",a.either(...b,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=w,d.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:w}}function HO(e){const a=e.regex,r=/(?![A-Za-z0-9])(?![$])/,l=a.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),o=a.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),u=a.concat(/[A-Z]+/,r),d={scope:"variable",match:"\\$+"+l},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(m)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(m),"on:begin":($,U)=>{U.data._beginMatch=$[1]||$[2]},"on:end":($,U)=>{U.data._beginMatch!==$[1]&&U.ignoreMatch()}},N=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
610
- ]`,w={scope:"string",variants:[g,p,b,N]},j={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},S=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],Z={keyword:k,literal:($=>{const U=[];return $.forEach(B=>{U.push(B),B.toLowerCase()===B?U.push(B.toUpperCase()):U.push(B.toLowerCase())}),U})(S),built_in:_},Y=$=>$.map(U=>U.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,a.concat(v,"+"),a.concat("(?!",Y(_).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},I=a.concat(l,"\\b(?!\\()"),D={variants:[{match:[a.concat(/::/,a.lookahead(/(?!class\b)/)),I],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,a.concat(/::/,a.lookahead(/(?!class\b)/)),I],scope:{1:"title.class",3:"variable.constant"}},{match:[o,a.concat("::",a.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},F={scope:"attr",match:a.concat(l,a.lookahead(":"),a.lookahead(/(?!::)/))},R={relevance:0,begin:/\(/,end:/\)/,keywords:Z,contains:[F,d,D,e.C_BLOCK_COMMENT_MODE,w,j,C]},z={relevance:0,match:[/\b/,a.concat("(?!fn\\b|function\\b|",Y(k).join("\\b|"),"|",Y(_).join("\\b|"),"\\b)"),l,a.concat(v,"*"),a.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[R]};R.contains.push(z);const P=[F,D,e.C_BLOCK_COMMENT_MODE,w,j,C],q={begin:a.concat(/#\[\s*\\?/,a.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...P]},...P,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:Z,contains:[q,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},d,z,D,{match:[/const/,/\s/,l],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:Z,contains:["self",q,d,D,e.C_BLOCK_COMMENT_MODE,w,j]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},w,j]}}function qO(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function GO(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function KO(e){const a=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},g={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m,g,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",v=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,w=`\\b|${l.join("|")}`,j={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${v}))[eE][+-]?(${N})[jJ]?(?=${w})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${N})[jJ](?=${w})`}]},S={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,j,b,e.HASH_COMMENT_MODE]}]};return p.contains=[b,j,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,j,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,S,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[j,k,b]}]}}function YO(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function VO(e){const a=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,l=a.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=a.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:a.lookahead(a.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,l]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,l]},{scope:{1:"punctuation",2:"number"},match:[u,l]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,l]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function XO(e){const a=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",l=a.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=a.concat(l,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},p=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:d},b={className:"string",contains:[e.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:a.concat(/<<[-~]?'?/,a.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},N="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${N})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},j={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},C=[b,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:l,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[j]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:r}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,p),relevance:0}].concat(m,p);g.contains=C,j.contains=C;const R=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:C}}];return p.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(R).concat(p).concat(C)}}function ZO(e){const a=e.regex,r=/(r#)?/,l=a.concat(r,e.UNDERSCORE_IDENT_RE),o=a.concat(r,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,a.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:g,keyword:f,literal:m,built_in:p},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,l],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,l],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,l,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:g}},{className:"punctuation",begin:"->"},u]}}const QO=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WO=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],JO=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eD=[...WO,...JO],tD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),nD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),sD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),aD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rD(e){const a=QO(e),r=sD,l=nD,o="@[a-z-]+",u="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+eD.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[a.CSS_NUMBER_MODE]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aD.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[a.BLOCK_COMMENT,f,a.HEXCOLOR,a.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,a.IMPORTANT,a.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:tD.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,a.HEXCOLOR,a.CSS_NUMBER_MODE]},a.FUNCTION_DISPATCH]}}function iD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function lD(e){const a=e.regex,r=e.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],N=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=g,w=[...p,...m].filter(Y=>!g.includes(Y)),j={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:a.concat(/\b/,a.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function _(Y){return a.concat(/\b/,a.either(...Y.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:_(N),relevance:0};function Z(Y,{exceptions:C,when:I}={}){const D=I;return C=C||[],Y.map(F=>F.match(/\|\d+$/)||C.includes(F)?F:D(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:Z(w,{when:Y=>Y.length<3}),literal:u,type:f,built_in:b},contains:[{scope:"type",match:_(d)},M,k,j,l,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,S]}}function O1(e){return e?typeof e=="string"?e:e.source:null}function Dl(e){return zt("(?=",e,")")}function zt(...e){return e.map(r=>O1(r)).join("")}function oD(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function Un(...e){return"("+(oD(e).capture?"":"?:")+e.map(l=>O1(l)).join("|")+")"}const kp=e=>zt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),cD=["Protocol","Type"].map(kp),Yy=["init","self"].map(kp),uD=["Any","Self"],sm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Vy=["false","nil","true"],dD=["assignment","associativity","higherThan","left","lowerThan","none","right"],fD=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Xy=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],D1=Un(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),L1=Un(D1,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),am=zt(D1,L1,"*"),z1=Un(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Jc=Un(z1,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qs=zt(z1,Jc,"*"),Dc=zt(/[A-Z]/,Jc,"*"),mD=["attached","autoclosure",zt(/convention\(/,Un("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",zt(/objc\(/,qs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],pD=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function hD(e){const a={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),l=[e.C_LINE_COMMENT_MODE,r],o={match:[/\./,Un(...cD,...Yy)],className:{2:"keyword"}},u={match:zt(/\./,Un(...sm)),relevance:0},d=sm.filter(he=>typeof he=="string").concat(["_|0"]),f=sm.filter(he=>typeof he!="string").concat(uD).map(kp),m={variants:[{className:"keyword",match:Un(...f,...Yy)}]},p={$pattern:Un(/\b\w+/,/#\w+/),keyword:d.concat(fD),literal:Vy},g=[o,u,m],b={match:zt(/\./,Un(...Xy)),relevance:0},N={className:"built_in",match:zt(/\b/,Un(...Xy),/(?=\()/)},v=[b,N],w={match:/->/,relevance:0},j={className:"operator",relevance:0,variants:[{match:am},{match:`\\.(\\.|${L1})+`}]},S=[w,j],k="([0-9]_*)+",_="([0-9a-fA-F]_*)+",M={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${_})(\\.(${_}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Z=(he="")=>({className:"subst",variants:[{match:zt(/\\/,he,/[0\\tnr"']/)},{match:zt(/\\/,he,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Y=(he="")=>({className:"subst",match:zt(/\\/,he,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(he="")=>({className:"subst",label:"interpol",begin:zt(/\\/,he,/\(/),end:/\)/}),I=(he="")=>({begin:zt(he,/"""/),end:zt(/"""/,he),contains:[Z(he),Y(he),C(he)]}),D=(he="")=>({begin:zt(he,/"/),end:zt(/"/,he),contains:[Z(he),C(he)]}),F={className:"string",variants:[I(),I("#"),I("##"),I("###"),D(),D("#"),D("##"),D("###")]},R=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],z={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:R},P=he=>{const Xe=zt(he,/\//),Qe=zt(/\//,he);return{begin:Xe,end:Qe,contains:[...R,{scope:"comment",begin:`#(?!.*${Qe})`,end:/$/}]}},q={scope:"regexp",variants:[P("###"),P("##"),P("#"),z]},$={match:zt(/`/,qs,/`/)},U={className:"variable",match:/\$\d+/},B={className:"variable",match:`\\$${Jc}+`},Q=[$,U,B],ee={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pD,contains:[...S,M,F]}]}},ie={scope:"keyword",match:zt(/@/,Un(...mD),Dl(Un(/\(/,/\s+/)))},T={scope:"meta",match:zt(/@/,qs)},L=[ee,ie,T],G={match:Dl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:zt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Jc,"+")},{className:"type",match:Dc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:zt(/\s+&\s+/,Dl(Dc)),relevance:0}]},O={begin:/</,end:/>/,keywords:p,contains:[...l,...g,...L,w,G]};G.contains.push(O);const H={match:zt(qs,/\s*:/),keywords:"_|0",relevance:0},V={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",H,...l,q,...g,...v,...S,M,F,...Q,...L,G]},re={begin:/</,end:/>/,keywords:"repeat each",contains:[...l,G]},xe={begin:Un(Dl(zt(qs,/\s*:/)),Dl(zt(qs,/\s+/,qs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qs}]},je={begin:/\(/,end:/\)/,keywords:p,contains:[xe,...l,...g,...S,M,F,...L,G,V],endsParent:!0,illegal:/["']/},Be={match:[/(func|macro)/,/\s+/,Un($.match,qs,am)],className:{1:"keyword",3:"title.function"},contains:[re,je,a],illegal:[/\[/,/%/]},we={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,je,a],illegal:/\[|%/},Ye={match:[/operator/,/\s+/,am],className:{1:"keyword",3:"title"}},jt={begin:[/precedencegroup/,/\s+/,Dc],className:{1:"keyword",3:"title"},contains:[G],keywords:[...dD,...Vy],end:/}/},en={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},oe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ke={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[re,...g,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:Dc},...g],relevance:0}]};for(const he of F.variants){const Xe=he.contains.find(lt=>lt.label==="interpol");Xe.keywords=p;const Qe=[...g,...v,...S,M,F,...Q];Xe.contains=[...Qe,{begin:/\(/,end:/\)/,contains:["self",...Qe]}]}return{name:"Swift",keywords:p,contains:[...l,Be,we,en,oe,ke,Ye,jt,{beginKeywords:"import",end:/$/,contains:[...l],relevance:0},q,...g,...v,...S,M,F,...Q,...L,G,V]}}const eu="[A-Za-z$_][0-9A-Za-z$_]*",I1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],U1=["true","false","null","undefined","NaN","Infinity"],B1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],$1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],P1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],F1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],H1=[].concat(P1,B1,$1);function xD(e){const a=e.regex,r=(ee,{after:ie})=>{const T="</"+ee[0].slice(1);return ee.input.indexOf(T,ie)!==-1},l=eu,o={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ee,ie)=>{const T=ee[0].length+ee.index,L=ee.input[T];if(L==="<"||L===","){ie.ignoreMatch();return}L===">"&&(r(ee,{after:T})||ie.ignoreMatch());let G;const O=ee.input.substring(T);if(G=O.match(/^\s*=/)){ie.ignoreMatch();return}if((G=O.match(/^\s+extends\s+/))&&G.index===0){ie.ignoreMatch();return}}},f={$pattern:eu,keyword:I1,literal:U1,built_in:H1,"variable.language":F1},m="[0-9](_?[0-9])*",p=`\\.(${m})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${m})\\b`},{begin:`\\b(${g})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},j={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,j,S,{match:/\$\d+/},b];N.contains=M.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(M)});const Z=[].concat(_,N.contains),Y=Z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(Z)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:Y},I={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,a.concat(l,"(",a.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...B1,...$1]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(ee){return a.concat("(?!",ee.join("|"),")")}const q={match:a.concat(/\b/,P([...P1,"super","import"].map(ee=>`${ee}\\s*\\(`)),l,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:Y,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,j,S,_,{match:/\$\d+/},b,D,{scope:"attr",match:l+a.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:Y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},q,z,I,U,{match:/\$[(.]/}]}}function gD(e){const a=e.regex,r=xD(e),l=eu,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},m=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:eu,keyword:I1.concat(m),literal:U1,built_in:H1.concat(o),"variable.language":F1},g={className:"meta",begin:"@"+l},b=(j,S,k)=>{const _=j.contains.findIndex(M=>M.label===S);if(_===-1)throw new Error("can not find mode to replace");j.contains.splice(_,1,k)};Object.assign(r.keywords,p),r.exports.PARAMS_CONTAINS.push(g);const N=r.contains.find(j=>j.scope==="attr"),v=Object.assign({},N,{match:a.concat(l,a.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,N,v]),r.contains=r.contains.concat([g,u,d,v]),b(r,"shebang",e.SHEBANG()),b(r,"use_strict",f);const w=r.contains.find(j=>j.label==="func.def");return w.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function bD(e){const a=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},l={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:a.concat(/# */,a.either(u,o),/ *#/)},{begin:a.concat(/# */,f,/ *#/)},{begin:a.concat(/# */,d,/ *#/)},{begin:a.concat(/# */,a.either(u,o),/ +/,a.either(d,f),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},b=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),N=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,l,m,p,g,b,N,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[N]}]}}function yD(e){e.regex;const a=e.COMMENT(/\(;/,/;\)/);a.contains.push("self");const r=e.COMMENT(/;;/,/$/),l=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:l},contains:[r,a,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,d,o,e.QUOTE_STRING_MODE,m,p,f]}}function vD(e){const a=e.regex,r=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(u,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),m=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:l,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,m,f,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,d,m,f]}]}]},e.COMMENT(/\x3C!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(r,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:p}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ND(e){const a="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},f=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},w={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},j={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},S=[l,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},N,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},w,j,u,d],k=[...S];return k.pop(),k.push(f),v.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const wD={arduino:sO,bash:aO,c:rO,cpp:iO,csharp:lO,css:xO,diff:gO,go:bO,graphql:yO,ini:vO,java:NO,javascript:kO,json:_O,kotlin:TO,less:IO,lua:UO,makefile:BO,markdown:$O,objectivec:PO,perl:FO,php:HO,"php-template":qO,plaintext:GO,python:KO,"python-repl":YO,r:VO,ruby:XO,rust:ZO,scss:rD,shell:iD,sql:lD,swift:hD,typescript:gD,vbnet:bD,wasm:yD,xml:vD,yaml:ND};var rm,Zy;function ED(){if(Zy)return rm;Zy=1;function e(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(de=>{const Se=X[de],_e=typeof Se;(_e==="object"||_e==="function")&&!Object.isFrozen(Se)&&e(Se)}),X}class a{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function l(X,...de){const Se=Object.create(null);for(const _e in X)Se[_e]=X[_e];return de.forEach(function(_e){for(const Mt in _e)Se[Mt]=_e[Mt]}),Se}const o="</span>",u=X=>!!X.scope,d=(X,{prefix:de})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const Se=X.split(".");return[`${de}${Se.shift()}`,...Se.map((_e,Mt)=>`${_e}${"_".repeat(Mt+1)}`)].join(" ")}return`${de}${X}`};class f{constructor(de,Se){this.buffer="",this.classPrefix=Se.classPrefix,de.walk(this)}addText(de){this.buffer+=r(de)}openNode(de){if(!u(de))return;const Se=d(de.scope,{prefix:this.classPrefix});this.span(Se)}closeNode(de){u(de)&&(this.buffer+=o)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const m=(X={})=>{const de={children:[]};return Object.assign(de,X),de};class p{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(de){this.top.children.push(de)}openNode(de){const Se=m({scope:de});this.add(Se),this.stack.push(Se)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,Se){return typeof Se=="string"?de.addText(Se):Se.children&&(de.openNode(Se),Se.children.forEach(_e=>this._walk(de,_e)),de.closeNode(Se)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(Se=>typeof Se=="string")?de.children=[de.children.join("")]:de.children.forEach(Se=>{p._collapse(Se)}))}}class g extends p{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,Se){const _e=de.root;Se&&(_e.scope=`language:${Se}`),this.add(_e)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(X){return X?typeof X=="string"?X:X.source:null}function N(X){return j("(?=",X,")")}function v(X){return j("(?:",X,")*")}function w(X){return j("(?:",X,")?")}function j(...X){return X.map(Se=>b(Se)).join("")}function S(X){const de=X[X.length-1];return typeof de=="object"&&de.constructor===Object?(X.splice(X.length-1,1),de):{}}function k(...X){return"("+(S(X).capture?"":"?:")+X.map(_e=>b(_e)).join("|")+")"}function _(X){return new RegExp(X.toString()+"|").exec("").length-1}function M(X,de){const Se=X&&X.exec(de);return Se&&Se.index===0}const Z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Y(X,{joinWith:de}){let Se=0;return X.map(_e=>{Se+=1;const Mt=Se;let St=b(_e),De="";for(;St.length>0;){const Ce=Z.exec(St);if(!Ce){De+=St;break}De+=St.substring(0,Ce.index),St=St.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?De+="\\"+String(Number(Ce[1])+Mt):(De+=Ce[0],Ce[0]==="("&&Se++)}return De}).map(_e=>`(${_e})`).join(de)}const C=/\b\B/,I="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",z="\\b(0b[01]+)",P="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",q=(X={})=>{const de=/^#![ ]*\//;return X.binary&&(X.begin=j(de,/.*\b/,X.binary,/\b.*/)),l({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(Se,_e)=>{Se.index!==0&&_e.ignoreMatch()}},X)},$={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$]},Q={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ee=function(X,de,Se={}){const _e=l({scope:"comment",begin:X,end:de,contains:[]},Se);_e.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Mt=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return _e.contains.push({begin:j(/[ ]+/,"(",Mt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),_e},ie=ee("//","$"),T=ee("/\\*","\\*/"),L=ee("#","$"),G={scope:"number",begin:F,relevance:0},O={scope:"number",begin:R,relevance:0},H={scope:"number",begin:z,relevance:0},V={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$,{begin:/\[/,end:/\]/,relevance:0,contains:[$]}]},re={scope:"title",begin:I,relevance:0},xe={scope:"title",begin:D,relevance:0},je={begin:"\\.\\s*"+D,relevance:0};var we=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:$,BINARY_NUMBER_MODE:H,BINARY_NUMBER_RE:z,COMMENT:ee,C_BLOCK_COMMENT_MODE:T,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:O,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(de,Se)=>{Se.data._beginMatch=de[1]},"on:end":(de,Se)=>{Se.data._beginMatch!==de[1]&&Se.ignoreMatch()}})},HASH_COMMENT_MODE:L,IDENT_RE:I,MATCH_NOTHING_RE:C,METHOD_GUARD:je,NUMBER_MODE:G,NUMBER_RE:F,PHRASAL_WORDS_MODE:Q,QUOTE_STRING_MODE:B,REGEXP_MODE:V,RE_STARTERS_RE:P,SHEBANG:q,TITLE_MODE:re,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:xe});function Ye(X,de){X.input[X.index-1]==="."&&de.ignoreMatch()}function jt(X,de){X.className!==void 0&&(X.scope=X.className,delete X.className)}function en(X,de){de&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=Ye,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function oe(X,de){Array.isArray(X.illegal)&&(X.illegal=k(...X.illegal))}function ke(X,de){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function he(X,de){X.relevance===void 0&&(X.relevance=1)}const Xe=(X,de)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const Se=Object.assign({},X);Object.keys(X).forEach(_e=>{delete X[_e]}),X.keywords=Se.keywords,X.begin=j(Se.beforeMatch,N(Se.begin)),X.starts={relevance:0,contains:[Object.assign(Se,{endsParent:!0})]},X.relevance=0,delete Se.beforeMatch},Qe=["of","and","for","in","not","or","if","then","parent","list","value"],lt="keyword";function At(X,de,Se=lt){const _e=Object.create(null);return typeof X=="string"?Mt(Se,X.split(" ")):Array.isArray(X)?Mt(Se,X):Object.keys(X).forEach(function(St){Object.assign(_e,At(X[St],de,St))}),_e;function Mt(St,De){de&&(De=De.map(Ce=>Ce.toLowerCase())),De.forEach(function(Ce){const qe=Ce.split("|");_e[qe[0]]=[St,Yt(qe[0],qe[1])]})}}function Yt(X,de){return de?Number(de):gt(X)?0:1}function gt(X){return Qe.includes(X.toLowerCase())}const Vt={},ct=X=>{console.error(X)},yn=(X,...de)=>{console.log(`WARN: ${X}`,...de)},ue=(X,de)=>{Vt[`${X}/${de}`]||(console.log(`Deprecated as of ${X}. ${de}`),Vt[`${X}/${de}`]=!0)},ve=new Error;function Ae(X,de,{key:Se}){let _e=0;const Mt=X[Se],St={},De={};for(let Ce=1;Ce<=de.length;Ce++)De[Ce+_e]=Mt[Ce],St[Ce+_e]=!0,_e+=_(de[Ce-1]);X[Se]=De,X[Se]._emit=St,X[Se]._multi=!0}function Pe(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ve;if(typeof X.beginScope!="object"||X.beginScope===null)throw ct("beginScope must be object"),ve;Ae(X,X.begin,{key:"beginScope"}),X.begin=Y(X.begin,{joinWith:""})}}function ot(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ve;if(typeof X.endScope!="object"||X.endScope===null)throw ct("endScope must be object"),ve;Ae(X,X.end,{key:"endScope"}),X.end=Y(X.end,{joinWith:""})}}function cn(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function jn(X){cn(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),Pe(X),ot(X)}function un(X){function de(De,Ce){return new RegExp(b(De),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Ce?"g":""))}class Se{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,qe){qe.position=this.position++,this.matchIndexes[this.matchAt]=qe,this.regexes.push([qe,Ce]),this.matchAt+=_(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(qe=>qe[1]);this.matcherRe=de(Y(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const qe=this.matcherRe.exec(Ce);if(!qe)return null;const Xt=qe.findIndex((Ns,ja)=>ja>0&&Ns!==void 0),$t=this.matchIndexes[Xt];return qe.splice(0,Xt),Object.assign(qe,$t)}}class _e{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const qe=new Se;return this.rules.slice(Ce).forEach(([Xt,$t])=>qe.addRule(Xt,$t)),qe.compile(),this.multiRegexes[Ce]=qe,qe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,qe){this.rules.push([Ce,qe]),qe.type==="begin"&&this.count++}exec(Ce){const qe=this.getMatcher(this.regexIndex);qe.lastIndex=this.lastIndex;let Xt=qe.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Xt&&Xt.index===this.lastIndex)){const $t=this.getMatcher(0);$t.lastIndex=this.lastIndex+1,Xt=$t.exec(Ce)}return Xt&&(this.regexIndex+=Xt.position+1,this.regexIndex===this.count&&this.considerAll()),Xt}}function Mt(De){const Ce=new _e;return De.contains.forEach(qe=>Ce.addRule(qe.begin,{rule:qe,type:"begin"})),De.terminatorEnd&&Ce.addRule(De.terminatorEnd,{type:"end"}),De.illegal&&Ce.addRule(De.illegal,{type:"illegal"}),Ce}function St(De,Ce){const qe=De;if(De.isCompiled)return qe;[jt,ke,jn,Xe].forEach($t=>$t(De,Ce)),X.compilerExtensions.forEach($t=>$t(De,Ce)),De.__beforeBegin=null,[en,oe,he].forEach($t=>$t(De,Ce)),De.isCompiled=!0;let Xt=null;return typeof De.keywords=="object"&&De.keywords.$pattern&&(De.keywords=Object.assign({},De.keywords),Xt=De.keywords.$pattern,delete De.keywords.$pattern),Xt=Xt||/\w+/,De.keywords&&(De.keywords=At(De.keywords,X.case_insensitive)),qe.keywordPatternRe=de(Xt,!0),Ce&&(De.begin||(De.begin=/\B|\b/),qe.beginRe=de(qe.begin),!De.end&&!De.endsWithParent&&(De.end=/\B|\b/),De.end&&(qe.endRe=de(qe.end)),qe.terminatorEnd=b(qe.end)||"",De.endsWithParent&&Ce.terminatorEnd&&(qe.terminatorEnd+=(De.end?"|":"")+Ce.terminatorEnd)),De.illegal&&(qe.illegalRe=de(De.illegal)),De.contains||(De.contains=[]),De.contains=[].concat(...De.contains.map(function($t){return qt($t==="self"?De:$t)})),De.contains.forEach(function($t){St($t,qe)}),De.starts&&St(De.starts,Ce),qe.matcher=Mt(qe),qe}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=l(X.classNameAliases||{}),St(X)}function et(X){return X?X.endsWithParent||et(X.starts):!1}function qt(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(de){return l(X,{variants:null},de)})),X.cachedVariants?X.cachedVariants:et(X)?l(X,{starts:X.starts?l(X.starts):null}):Object.isFrozen(X)?l(X):X}var Ve="11.11.1";class vn extends Error{constructor(de,Se){super(de),this.name="HTMLInjectionError",this.html=Se}}const Rt=r,rr=l,Os=Symbol("nomatch"),Zs=7,Qs=function(X){const de=Object.create(null),Se=Object.create(null),_e=[];let Mt=!0;const St="Could not find the language '{}', did you forget to load/include a language module?",De={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function qe(ge){return Ce.noHighlightRe.test(ge)}function Xt(ge){let Ie=ge.className+" ";Ie+=ge.parentNode?ge.parentNode.className:"";const st=Ce.languageDetectRe.exec(Ie);if(st){const te=Sn(st[1]);return te||(yn(St.replace("{}",st[1])),yn("Falling back to no-highlight mode for this block.",ge)),te?st[1]:"no-highlight"}return Ie.split(/\s+/).find(te=>qe(te)||Sn(te))}function $t(ge,Ie,st){let te="",ce="";typeof Ie=="object"?(te=ge,st=Ie.ignoreIllegals,ce=Ie.language):(ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),ue("10.7.0",`Please use highlight(code, options) instead.
611
- https://github.com/highlightjs/highlight.js/issues/2277`),ce=ge,te=Ie),st===void 0&&(st=!0);const ye={code:te,language:ce};Us("before:highlight",ye);const Te=ye.result?ye.result:Ns(ye.language,ye.code,st);return Te.code=ye.code,Us("after:highlight",Te),Te}function Ns(ge,Ie,st,te){const ce=Object.create(null);function ye(Ee,Le){return Ee.keywords[Le]}function Te(){if(!Ke.keywords){dn.addText(_t);return}let Ee=0;Ke.keywordPatternRe.lastIndex=0;let Le=Ke.keywordPatternRe.exec(_t),We="";for(;Le;){We+=_t.substring(Ee,Le.index);const mt=kn.case_insensitive?Le[0].toLowerCase():Le[0],Qt=ye(Ke,mt);if(Qt){const[us,Ii]=Qt;if(dn.addText(We),We="",ce[mt]=(ce[mt]||0)+1,ce[mt]<=Zs&&(Ca+=Ii),us.startsWith("_"))We+=Le[0];else{const uo=kn.classNameAliases[us]||us;it(Le[0],uo)}}else We+=Le[0];Ee=Ke.keywordPatternRe.lastIndex,Le=Ke.keywordPatternRe.exec(_t)}We+=_t.substring(Ee),dn.addText(We)}function Me(){if(_t==="")return;let Ee=null;if(typeof Ke.subLanguage=="string"){if(!de[Ke.subLanguage]){dn.addText(_t);return}Ee=Ns(Ke.subLanguage,_t,!0,co[Ke.subLanguage]),co[Ke.subLanguage]=Ee._top}else Ee=Sa(_t,Ke.subLanguage.length?Ke.subLanguage:null);Ke.relevance>0&&(Ca+=Ee.relevance),dn.__addSublanguage(Ee._emitter,Ee.language)}function Ue(){Ke.subLanguage!=null?Me():Te(),_t=""}function it(Ee,Le){Ee!==""&&(dn.startScope(Le),dn.addText(Ee),dn.endScope())}function kt(Ee,Le){let We=1;const mt=Le.length-1;for(;We<=mt;){if(!Ee._emit[We]){We++;continue}const Qt=kn.classNameAliases[Ee[We]]||Ee[We],us=Le[We];Qt?it(us,Qt):(_t=us,Te(),_t=""),We++}}function Fe(Ee,Le){return Ee.scope&&typeof Ee.scope=="string"&&dn.openNode(kn.classNameAliases[Ee.scope]||Ee.scope),Ee.beginScope&&(Ee.beginScope._wrap?(it(_t,kn.classNameAliases[Ee.beginScope._wrap]||Ee.beginScope._wrap),_t=""):Ee.beginScope._multi&&(kt(Ee.beginScope,Le),_t="")),Ke=Object.create(Ee,{parent:{value:Ke}}),Ke}function _a(Ee,Le,We){let mt=M(Ee.endRe,We);if(mt){if(Ee["on:end"]){const Qt=new a(Ee);Ee["on:end"](Le,Qt),Qt.isMatchIgnored&&(mt=!1)}if(mt){for(;Ee.endsParent&&Ee.parent;)Ee=Ee.parent;return Ee}}if(Ee.endsWithParent)return _a(Ee.parent,Le,We)}function Gt(Ee){return Ke.matcher.regexIndex===0?(_t+=Ee[0],1):(Ta=!0,0)}function $r(Ee){const Le=Ee[0],We=Ee.rule,mt=new a(We),Qt=[We.__beforeBegin,We["on:begin"]];for(const us of Qt)if(us&&(us(Ee,mt),mt.isMatchIgnored))return Gt(Le);return We.skip?_t+=Le:(We.excludeBegin&&(_t+=Le),Ue(),!We.returnBegin&&!We.excludeBegin&&(_t=Le)),Fe(We,Ee),We.returnBegin?0:Le.length}function Mn(Ee){const Le=Ee[0],We=Ie.substring(Ee.index),mt=_a(Ke,Ee,We);if(!mt)return Os;const Qt=Ke;Ke.endScope&&Ke.endScope._wrap?(Ue(),it(Le,Ke.endScope._wrap)):Ke.endScope&&Ke.endScope._multi?(Ue(),kt(Ke.endScope,Ee)):Qt.skip?_t+=Le:(Qt.returnEnd||Qt.excludeEnd||(_t+=Le),Ue(),Qt.excludeEnd&&(_t=Le));do Ke.scope&&dn.closeNode(),!Ke.skip&&!Ke.subLanguage&&(Ca+=Ke.relevance),Ke=Ke.parent;while(Ke!==mt.parent);return mt.starts&&Fe(mt.starts,Ee),Qt.returnEnd?0:Le.length}function Li(){const Ee=[];for(let Le=Ke;Le!==kn;Le=Le.parent)Le.scope&&Ee.unshift(Le.scope);Ee.forEach(Le=>dn.openNode(Le))}let or={};function Pr(Ee,Le){const We=Le&&Le[0];if(_t+=Ee,We==null)return Ue(),0;if(or.type==="begin"&&Le.type==="end"&&or.index===Le.index&&We===""){if(_t+=Ie.slice(Le.index,Le.index+1),!Mt){const mt=new Error(`0 width match regex (${ge})`);throw mt.languageName=ge,mt.badRule=or.rule,mt}return 1}if(or=Le,Le.type==="begin")return $r(Le);if(Le.type==="illegal"&&!st){const mt=new Error('Illegal lexeme "'+We+'" for mode "'+(Ke.scope||"<unnamed>")+'"');throw mt.mode=Ke,mt}else if(Le.type==="end"){const mt=Mn(Le);if(mt!==Os)return mt}if(Le.type==="illegal"&&We==="")return _t+=`
612
- `,1;if(zi>1e5&&zi>Le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _t+=We,We.length}const kn=Sn(ge);if(!kn)throw ct(St.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const oo=un(kn);let Fr="",Ke=te||oo;const co={},dn=new Ce.__emitter(Ce);Li();let _t="",Ca=0,Js=0,zi=0,Ta=!1;try{if(kn.__emitTokens)kn.__emitTokens(Ie,dn);else{for(Ke.matcher.considerAll();;){zi++,Ta?Ta=!1:Ke.matcher.considerAll(),Ke.matcher.lastIndex=Js;const Ee=Ke.matcher.exec(Ie);if(!Ee)break;const Le=Ie.substring(Js,Ee.index),We=Pr(Le,Ee);Js=Ee.index+We}Pr(Ie.substring(Js))}return dn.finalize(),Fr=dn.toHTML(),{language:ge,value:Fr,relevance:Ca,illegal:!1,_emitter:dn,_top:Ke}}catch(Ee){if(Ee.message&&Ee.message.includes("Illegal"))return{language:ge,value:Rt(Ie),illegal:!0,relevance:0,_illegalBy:{message:Ee.message,index:Js,context:Ie.slice(Js-100,Js+100),mode:Ee.mode,resultSoFar:Fr},_emitter:dn};if(Mt)return{language:ge,value:Rt(Ie),illegal:!1,relevance:0,errorRaised:Ee,_emitter:dn,_top:Ke};throw Ee}}function ja(ge){const Ie={value:Rt(ge),illegal:!1,relevance:0,_top:De,_emitter:new Ce.__emitter(Ce)};return Ie._emitter.addText(ge),Ie}function Sa(ge,Ie){Ie=Ie||Ce.languages||Object.keys(de);const st=ja(ge),te=Ie.filter(Sn).filter(zs).map(Ue=>Ns(Ue,ge,!1));te.unshift(st);const ce=te.sort((Ue,it)=>{if(Ue.relevance!==it.relevance)return it.relevance-Ue.relevance;if(Ue.language&&it.language){if(Sn(Ue.language).supersetOf===it.language)return 1;if(Sn(it.language).supersetOf===Ue.language)return-1}return 0}),[ye,Te]=ce,Me=ye;return Me.secondBest=Te,Me}function os(ge,Ie,st){const te=Ie&&Se[Ie]||st;ge.classList.add("hljs"),ge.classList.add(`language-${te}`)}function Zt(ge){let Ie=null;const st=Xt(ge);if(qe(st))return;if(Us("before:highlightElement",{el:ge,language:st}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(Ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ge)),Ce.throwUnescapedHTML))throw new vn("One of your code blocks includes unescaped HTML.",ge.innerHTML);Ie=ge;const te=Ie.textContent,ce=st?$t(te,{language:st,ignoreIllegals:!0}):Sa(te);ge.innerHTML=ce.value,ge.dataset.highlighted="yes",os(ge,st,ce.language),ge.result={language:ce.language,re:ce.relevance,relevance:ce.relevance},ce.secondBest&&(ge.secondBest={language:ce.secondBest.language,relevance:ce.secondBest.relevance}),Us("after:highlightElement",{el:ge,result:ce,text:te})}function Nn(ge){Ce=rr(Ce,ge)}const Ds=()=>{ka(),ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ls(){ka(),ue("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ur=!1;function ka(){function ge(){ka()}if(document.readyState==="loading"){Ur||window.addEventListener("DOMContentLoaded",ge,!1),Ur=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(Zt)}function Br(ge,Ie){let st=null;try{st=Ie(X)}catch(te){if(ct("Language definition for '{}' could not be registered.".replace("{}",ge)),Mt)ct(te);else throw te;st=De}st.name||(st.name=ge),de[ge]=st,st.rawDefinition=Ie.bind(null,X),st.aliases&&ws(st.aliases,{languageName:ge})}function Ws(ge){delete de[ge];for(const Ie of Object.keys(Se))Se[Ie]===ge&&delete Se[Ie]}function ir(){return Object.keys(de)}function Sn(ge){return ge=(ge||"").toLowerCase(),de[ge]||de[Se[ge]]}function ws(ge,{languageName:Ie}){typeof ge=="string"&&(ge=[ge]),ge.forEach(st=>{Se[st.toLowerCase()]=Ie})}function zs(ge){const Ie=Sn(ge);return Ie&&!Ie.disableAutodetect}function Is(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Ie=>{ge["before:highlightBlock"](Object.assign({block:Ie.el},Ie))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Ie=>{ge["after:highlightBlock"](Object.assign({block:Ie.el},Ie))})}function tn(ge){Is(ge),_e.push(ge)}function lr(ge){const Ie=_e.indexOf(ge);Ie!==-1&&_e.splice(Ie,1)}function Us(ge,Ie){const st=ge;_e.forEach(function(te){te[st]&&te[st](Ie)})}function cs(ge){return ue("10.7.0","highlightBlock will be removed entirely in v12.0"),ue("10.7.0","Please use highlightElement now."),Zt(ge)}Object.assign(X,{highlight:$t,highlightAuto:Sa,highlightAll:ka,highlightElement:Zt,highlightBlock:cs,configure:Nn,initHighlighting:Ds,initHighlightingOnLoad:Ls,registerLanguage:Br,unregisterLanguage:Ws,listLanguages:ir,getLanguage:Sn,registerAliases:ws,autoDetection:zs,inherit:rr,addPlugin:tn,removePlugin:lr}),X.debugMode=function(){Mt=!1},X.safeMode=function(){Mt=!0},X.versionString=Ve,X.regex={concat:j,lookahead:N,either:k,optional:w,anyNumberOfTimes:v};for(const ge in we)typeof we[ge]=="object"&&e(we[ge]);return Object.assign(X,we),X},Rn=Qs({});return Rn.newInstance=()=>Qs({}),rm=Rn,Rn.HighlightJS=Rn,Rn.default=Rn,rm}var jD=ED();const SD=nu(jD),Qy={},kD="hljs-";function _D(e){const a=SD.newInstance();return e&&u(e),{highlight:r,highlightAuto:l,listLanguages:o,register:u,registerAlias:d,registered:f};function r(m,p,g){const b=g||Qy,N=typeof b.prefix=="string"?b.prefix:kD;if(!a.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");a.configure({__emitter:CD,classPrefix:N});const v=a.highlight(p,{ignoreIllegals:!0,language:m});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const w=v._emitter.root,j=w.data;return j.language=v.language,j.relevance=v.relevance,w}function l(m,p){const b=(p||Qy).subset||o();let N=-1,v=0,w;for(;++N<b.length;){const j=b[N];if(!a.getLanguage(j))continue;const S=r(j,m,p);S.data&&S.data.relevance!==void 0&&S.data.relevance>v&&(v=S.data.relevance,w=S)}return w||{type:"root",children:[],data:{language:void 0,relevance:v}}}function o(){return a.listLanguages()}function u(m,p){if(typeof m=="string")a.registerLanguage(m,p);else{let g;for(g in m)Object.hasOwn(m,g)&&a.registerLanguage(g,m[g])}}function d(m,p){if(typeof m=="string")a.registerAliases(typeof p=="string"?p:[...p],{languageName:m});else{let g;for(g in m)if(Object.hasOwn(m,g)){const b=m[g];a.registerAliases(typeof b=="string"?b:[...b],{languageName:g})}}}function f(m){return!!a.getLanguage(m)}}class CD{constructor(a){this.options=a,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(a){if(a==="")return;const r=this.stack[this.stack.length-1],l=r.children[r.children.length-1];l&&l.type==="text"?l.value+=a:r.children.push({type:"text",value:a})}startScope(a){this.openNode(String(a))}endScope(){this.closeNode()}__addSublanguage(a,r){const l=this.stack[this.stack.length-1],o=a.root.children;r?l.children.push({type:"element",tagName:"span",properties:{className:[r]},children:o}):l.children.push(...o)}openNode(a){const r=this,l=a.split(".").map(function(d,f){return f?d+"_".repeat(f):r.options.classPrefix+d}),o=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:l},children:[]};o.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const TD={};function AD(e){const a=e||TD,r=a.aliases,l=a.detect||!1,o=a.languages||wD,u=a.plainText,d=a.prefix,f=a.subset;let m="hljs";const p=_D(o);if(r&&p.registerAlias(r),d){const g=d.indexOf("-");m=g===-1?d:d.slice(0,g)}return function(g,b){hu(g,"element",function(N,v,w){if(N.tagName!=="code"||!w||w.type!=="element"||w.tagName!=="pre")return;const j=RD(N);if(j===!1||!j&&!l||j&&u&&u.includes(j))return;Array.isArray(N.properties.className)||(N.properties.className=[]),N.properties.className.includes(m)||N.properties.className.unshift(m);const S=X4(N,{whitespace:"pre"});let k;try{k=j?p.highlight(j,S,{prefix:d}):p.highlightAuto(S,{prefix:d,subset:f})}catch(_){const M=_;if(j&&/Unknown language/.test(M.message)){b.message("Cannot highlight as `"+j+"`, it’s not registered",{ancestors:[w,N],cause:M,place:N.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw M}!j&&k.data&&k.data.language&&N.properties.className.push("language-"+k.data.language),k.children.length>0&&(N.children=k.children)})}}function RD(e){const a=e.properties.className;let r=-1;if(!Array.isArray(a))return;let l;for(;++r<a.length;){const o=String(a[r]);if(o==="no-highlight"||o==="nohighlight")return!1;!l&&o.slice(0,5)==="lang-"&&(l=o.slice(5)),!l&&o.slice(0,9)==="language-"&&(l=o.slice(9))}return l}function Wy(e){return e>=70?{bar:"#34d399",text:"#34d399",bg:"rgba(52,211,153,0.12)",border:"rgba(52,211,153,0.25)"}:e>=40?{bar:"#fbbf24",text:"#fbbf24",bg:"rgba(251,191,36,0.12)",border:"rgba(251,191,36,0.25)"}:{bar:"#f87171",text:"#f87171",bg:"rgba(248,113,113,0.12)",border:"rgba(248,113,113,0.25)"}}function MD(e){return e.includes("haiku")?"Haiku":e.includes("sonnet")?"Sonnet":e.includes("opus")?"Opus":e}function OD({score:e,className:a="",suggestionComments:r=[],onAddSuggestionComment:l,onRemoveSuggestionComment:o,isAiScore:u=!1,aiModel:d,aiScoreLoading:f=!1,onRequestAiScore:m,aiScoringAvailable:p=!1}){const[g,b]=y.useState(!1),N=Wy(e.overall);return n.jsxs("div",{className:`bg-surface-1 border border-border rounded-2xl overflow-hidden ${a}`,children:[n.jsxs("div",{className:"flex items-center justify-between cursor-pointer hover:bg-surface-2 transition-colors px-5 py-4",onClick:()=>b(!g),children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-sm font-bold text-text-primary",children:["Quality Score"," ",f&&!u?n.jsxs("span",{className:"inline-flex items-center gap-1 ml-1",children:[n.jsx("span",{className:"w-3 h-3 border-2 border-surface-3 border-t-accent rounded-full animate-spin inline-block"}),n.jsx("span",{className:"text-[0.6rem] font-medium uppercase tracking-wide text-text-muted",children:"AI scoring..."})]}):u?n.jsxs("span",{className:"inline-flex items-center gap-1 ml-1",children:[n.jsx("span",{className:"text-[0.6rem] font-bold uppercase tracking-wide bg-accent/15 text-accent border border-accent/30 px-1.5 py-0.5 rounded",children:"AI"}),d&&n.jsx("span",{className:"text-[0.6rem] font-medium uppercase tracking-wide bg-surface-3 text-text-muted px-1.5 py-0.5 rounded",children:MD(d)})]}):n.jsx("span",{className:"text-text-muted font-medium text-[0.65rem] uppercase tracking-wide",children:"alpha"})]}),n.jsx("span",{className:"text-sm font-bold rounded-full px-3 py-0.5",style:{color:N.text,backgroundColor:N.bg,border:`1px solid ${N.border}`},children:Math.round(e.overall)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[m&&n.jsx("button",{className:`text-xs font-semibold px-3 py-1.5 rounded-lg transition-all ${f?"bg-accent/20 text-accent border border-accent/30 cursor-wait":p?"bg-accent text-white shadow-sm hover:brightness-110 active:scale-[0.97]":"bg-surface-3 border border-border text-text-muted cursor-not-allowed"}`,onClick:v=>{v.stopPropagation(),!f&&p&&m()},title:f?"AI scoring in progress...":p?"Re-score this plan using AI":"Configure API key in Settings to enable AI scoring",children:f?n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 border-2 border-accent/30 border-t-white rounded-full animate-spin"}),"Scoring..."]}):n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(En,{size:12}),"Score with AI"]})}),n.jsx("span",{className:"text-text-muted text-xs",children:g?n.jsx(Wm,{size:14}):n.jsx(Pn,{size:14})})]})]}),g&&n.jsx("div",{className:"border-t border-border px-5 py-4",children:f&&!u?n.jsxs("div",{className:"py-6",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("div",{className:"w-8 h-8 border-[3px] border-surface-3 border-t-accent rounded-full animate-spin"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-secondary",children:"AI scoring in progress..."}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Analyzing plan quality with Claude. This may take 15-30 seconds."})]})]}),n.jsxs("div",{className:"mt-5 opacity-40 pointer-events-none",children:[n.jsx("h4",{className:"text-xs font-bold text-text-muted uppercase tracking-widest mb-3",children:"Algorithmic Pre-score"}),n.jsx("div",{className:"flex flex-col gap-2",children:e.breakdown.map(v=>n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-text-muted",children:v.name}),n.jsx("span",{className:"text-xs text-text-muted",children:Math.round(v.score)})]},v.name))})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h4",{className:"text-xs font-bold text-text-muted uppercase tracking-widest mb-3",children:"Breakdown"}),n.jsx("div",{className:"flex flex-col gap-3",children:e.breakdown.map(v=>{const w=Wy(v.score);return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("span",{className:"text-sm text-text-secondary",children:v.name}),n.jsx("span",{className:"text-sm font-bold",style:{color:w.text},children:Math.round(v.score)})]}),n.jsx("div",{className:"rounded-full overflow-hidden bg-surface-3 h-1",children:n.jsx("div",{className:"rounded-full",style:{width:`${v.score}%`,height:"100%",backgroundColor:w.bar}})}),v.details&&n.jsx("p",{className:"text-xs text-text-muted mt-1",children:v.details})]},v.name)})})]}),e.suggestions&&e.suggestions.length>0&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-bold text-text-muted uppercase tracking-widest mb-3",children:"Suggestions"}),n.jsx("div",{className:"flex flex-col gap-2",children:e.suggestions.map((v,w)=>{const j=r.find(S=>S.suggestionIndex===w);return n.jsx(DD,{index:w,text:v,comment:j,onAddComment:l,onRemoveComment:o},w)})})]})]})})]})}function DD({index:e,text:a,comment:r,onAddComment:l,onRemoveComment:o}){const[u,d]=y.useState(!1),[f,m]=y.useState(""),p=y.useCallback(()=>{!f.trim()||!l||(l(e,f.trim()),m(""),d(!1))},[e,f,l]),g=y.useCallback(b=>{b.key==="Enter"?(b.preventDefault(),p()):b.key==="Escape"&&(b.preventDefault(),d(!1),m(""))},[p]);return n.jsxs("div",{className:"bg-surface-2 border border-border rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("span",{className:"shrink-0 text-sm leading-5 text-amber-400",children:"*"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("span",{className:"text-sm text-text-secondary",children:a})}),l&&!r&&n.jsx("button",{className:"shrink-0 flex items-center gap-1 text-xs font-medium text-text-muted hover:text-accent transition-colors",onClick:()=>d(!u),children:u?"Cancel":"Reply"}),r&&n.jsx("span",{className:"shrink-0 text-xs font-semibold bg-accent/15 text-accent border border-accent/30 px-1.5 py-0.5 rounded-full",children:"1"})]}),u&&!r&&n.jsxs("div",{className:"mt-2 ml-6 flex items-center gap-2",children:[n.jsx("input",{type:"text",value:f,onChange:b=>m(b.target.value),onKeyDown:g,placeholder:"Add a comment...",className:"flex-1 px-2.5 py-1.5 bg-surface-1 border border-border rounded-md text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent",autoFocus:!0}),n.jsx("button",{className:"text-xs font-medium text-accent hover:brightness-110 transition-colors px-2 py-1.5 disabled:opacity-50",onClick:p,disabled:!f.trim(),children:"Add"})]}),r&&n.jsxs("div",{className:"mt-2 ml-6 flex items-start gap-2 bg-surface-1 border border-border rounded-md px-2.5 py-2",children:[n.jsx("span",{className:"text-sm text-text-primary flex-1",children:r.text}),o&&n.jsx("button",{className:"shrink-0 text-text-muted hover:text-red-400 transition-colors text-sm leading-none",onClick:()=>o(e),title:"Remove comment",children:"×"})]})]})}const LD=[{type:"comment",icon:bk,label:"Comment"},{type:"suggestion",icon:cu,label:"Suggest"},{type:"concern",icon:It,label:"Concern"},{type:"question",icon:cS,label:"Question"},{type:"instruction",icon:fk,label:"Instruct"}];function zD({visible:e,rect:a,onAction:r}){const[l,o]=y.useState({x:0,y:0});return y.useEffect(()=>{if(!e||!a)return;const u=48,d=360,f=8;let m=a.left+(a.width-d)/2,p=a.top-u-f+window.scrollY;m=Math.max(f,Math.min(m,window.innerWidth-d-f)),a.top-u-f<0&&(p=a.bottom+f+window.scrollY),o({x:m,y:p})},[e,a]),!e||!a?null:Ms.createPortal(n.jsx("div",{className:"fixed bg-surface-2 border border-border rounded-xl shadow-xl z-50 p-1.5 flex gap-1",style:{left:`${l.x}px`,top:`${l.y}px`},onMouseDown:u=>u.preventDefault(),children:LD.map(u=>n.jsxs("button",{className:"flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm text-text-secondary hover:bg-surface-3 hover:text-text-primary transition-colors",onClick:()=>r(u.type),title:u.label,children:[n.jsx(u.icon,{size:14}),n.jsx("span",{children:u.label})]},u.type))}),document.body)}const ID=[{tool:"pen",icon:Dk,label:"Pen"},{tool:"arrow",icon:X2,label:"Arrow"},{tool:"circle",icon:pS,label:"Circle"},{tool:"text",icon:u_,label:"Text"}],UD=[{value:"#ef4444",label:"Red"},{value:"#3b82f6",label:"Blue"},{value:"#22c55e",label:"Green"},{value:"#eab308",label:"Yellow"},{value:"#000000",label:"Black"},{value:"#ffffff",label:"White"}],BD=[{value:2,label:"Thin"},{value:4,label:"Medium"},{value:8,label:"Thick"}];function Lc(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function im(e,a){const r=e.getBoundingClientRect(),l=e.width/r.width,o=e.height/r.height;return{x:(a.clientX-r.left)*l,y:(a.clientY-r.top)*o}}function q1(e,a,r,l){if(!(a.length<2)){e.strokeStyle=r,e.lineWidth=l,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(a[0].x,a[0].y);for(let o=1;o<a.length;o++)e.lineTo(a[o].x,a[o].y);e.stroke()}}function G1(e,a,r,l,o){const u=Math.max(o*4,12),d=Math.atan2(r.y-a.y,r.x-a.x);e.strokeStyle=l,e.lineWidth=o,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(r.x,r.y),e.stroke(),e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(r.x-u*Math.cos(d-Math.PI/6),r.y-u*Math.sin(d-Math.PI/6)),e.moveTo(r.x,r.y),e.lineTo(r.x-u*Math.cos(d+Math.PI/6),r.y-u*Math.sin(d+Math.PI/6)),e.stroke()}function K1(e,a,r,l,o){const u=Math.abs(r.x-a.x),d=Math.abs(r.y-a.y);e.strokeStyle=l,e.lineWidth=o,e.lineCap="round",e.beginPath(),e.ellipse(a.x,a.y,u,d,0,0,Math.PI*2),e.stroke()}function $D(e,a,r,l,o){e.fillStyle=l,e.font=`${o}px sans-serif`,e.textBaseline="top";const u=r.split(`
613
- `);for(let d=0;d<u.length;d++)e.fillText(u[d],a.x,a.y+d*(o+2))}function PD(e,a){switch(a.tool){case"pen":q1(e,a.points,a.color,a.lineWidth);break;case"arrow":a.points.length>=2&&G1(e,a.points[0],a.points[1],a.color,a.lineWidth);break;case"circle":a.points.length>=2&&K1(e,a.points[0],a.points[1],a.color,a.lineWidth);break;case"text":a.points.length>=1&&a.text&&$D(e,a.points[0],a.text,a.color,a.lineWidth*4+12);break}}function FD({imageSrc:e,onSave:a,onCancel:r}){const[l,o]=y.useState([]),[u,d]=y.useState("pen"),[f,m]=y.useState("#ef4444"),[p,g]=y.useState(4),[b,N]=y.useState({width:800,height:600}),[v,w]=y.useState(!1),j=y.useRef(null),S=y.useRef(null),k=y.useRef(null),_=y.useRef(null),M=y.useRef({width:0,height:0}),Z=y.useRef([]),Y=y.useRef(null);y.useEffect(()=>{const z=new Image;z.crossOrigin="anonymous",z.onload=()=>{if(_.current=z,M.current={width:z.naturalWidth,height:z.naturalHeight},k.current){const P=k.current.clientWidth;if(P>0){const q=z.naturalWidth/z.naturalHeight,$=P,U=Math.round($/q);N({width:$,height:U})}else N({width:z.naturalWidth,height:z.naturalHeight})}},z.src=e},[e]),y.useEffect(()=>{const z=k.current;if(!z)return;const P=new ResizeObserver(q=>{const{width:$,height:U}=M.current;if(!($===0||U===0))for(const B of q){const Q=B.contentRect.width;if(Q<=0)continue;const ee=$/U,ie=Math.floor(Q),T=Math.round(ie/ee);N(L=>L.width===ie&&L.height===T?L:{width:ie,height:T})}});return P.observe(z),()=>P.disconnect()},[]),y.useEffect(()=>{const z=j.current,P=z==null?void 0:z.getContext("2d"),q=_.current;if(!(!z||!P||!q)){P.clearRect(0,0,z.width,z.height),P.drawImage(q,0,0,z.width,z.height);for(const $ of l)PD(P,$)}},[l,b]),y.useEffect(()=>{if(!v){const z=S.current,P=z==null?void 0:z.getContext("2d");z&&P&&P.clearRect(0,0,z.width,z.height)}},[v,b]),y.useEffect(()=>{const z=P=>{(P.metaKey||P.ctrlKey)&&P.key==="z"&&(P.preventDefault(),o(q=>q.slice(0,-1))),P.key==="Escape"&&r()};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[r]);const C=y.useCallback(z=>{const P=S.current;if(!P)return;z.preventDefault();const q=im(P,z.nativeEvent);if(u==="text"){const $=prompt("Enter text:");$&&o(U=>[...U,{id:Lc(),tool:"text",color:f,lineWidth:p,points:[q],text:$}]);return}w(!0),Y.current=q,Z.current=[q]},[u,f,p]),I=y.useCallback(z=>{if(!v)return;const P=S.current,q=P==null?void 0:P.getContext("2d");if(!P||!q)return;z.preventDefault();const $=im(P,z.nativeEvent);switch(q.clearRect(0,0,P.width,P.height),u){case"pen":Z.current.push($),q1(q,Z.current,f,p);break;case"arrow":Y.current&&G1(q,Y.current,$,f,p);break;case"circle":Y.current&&K1(q,Y.current,$,f,p);break}},[v,u,f,p]),D=y.useCallback(z=>{if(!v)return;z.preventDefault();const P=S.current;if(!P)return;const q=im(P,z.nativeEvent);let $=null;switch(u){case"pen":Z.current.push(q),Z.current.length>=2&&($={id:Lc(),tool:"pen",color:f,lineWidth:p,points:[...Z.current]});break;case"arrow":Y.current&&($={id:Lc(),tool:"arrow",color:f,lineWidth:p,points:[Y.current,q]});break;case"circle":Y.current&&($={id:Lc(),tool:"circle",color:f,lineWidth:p,points:[Y.current,q]});break}w(!1),Z.current=[],Y.current=null,$&&o(U=>[...U,$])},[v,u,f,p]),F=y.useCallback(()=>{const z=j.current;z&&a(z.toDataURL("image/png"))},[a]),R=l.length>0;return Ms.createPortal(n.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-surface-1 border-b border-border flex-wrap shrink-0",children:[n.jsx("div",{className:"flex items-center gap-1",children:ID.map(({tool:z,icon:P,label:q})=>n.jsxs("button",{type:"button",className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded text-xs font-medium transition-colors ${u===z?"bg-accent text-white":"text-text-secondary hover:bg-surface-3 hover:text-text-primary"}`,onClick:()=>d(z),title:q,children:[n.jsx(P,{size:14}),n.jsx("span",{children:q})]},z))}),n.jsx("div",{className:"w-px h-5 bg-border"}),n.jsx("div",{className:"flex items-center gap-1.5",children:UD.map(({value:z,label:P})=>n.jsx("button",{type:"button",className:`w-5 h-5 rounded-full cursor-pointer transition-all ${f===z?"ring-2 ring-accent ring-offset-1 ring-offset-surface-1 scale-110":"hover:scale-110"}`,onClick:()=>m(z),title:P,style:{backgroundColor:z,border:z==="#ffffff"?"1px solid #d1d5db":"none"}},z))}),n.jsx("div",{className:"w-px h-5 bg-border"}),n.jsx("div",{className:"flex items-center gap-1",children:BD.map(({value:z,label:P})=>n.jsxs("button",{type:"button",className:`flex items-center gap-1.5 px-2 py-1.5 rounded text-xs font-medium transition-colors ${p===z?"bg-accent text-white":"text-text-secondary hover:bg-surface-3 hover:text-text-primary"}`,onClick:()=>g(z),title:`${P} line`,children:[n.jsx("span",{className:"w-5 rounded-full",style:{height:`${z}px`,backgroundColor:p===z?"white":f}}),n.jsx("span",{children:P})]},z))}),n.jsx("div",{className:"w-px h-5 bg-border"}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsxs("button",{type:"button",className:`flex items-center gap-1 px-2 py-1.5 rounded text-xs font-medium transition-colors text-text-secondary hover:bg-surface-3 hover:text-text-primary ${R?"":"opacity-40 cursor-not-allowed"}`,onClick:()=>o(z=>z.slice(0,-1)),disabled:!R,title:"Undo (Ctrl+Z)",children:[n.jsx(f_,{size:14}),n.jsx("span",{children:"Undo"})]}),n.jsxs("button",{type:"button",className:`flex items-center gap-1 px-2 py-1.5 rounded text-xs font-medium transition-colors text-red-400 hover:bg-red-500/10 hover:text-red-300 ${R?"":"opacity-40 cursor-not-allowed"}`,onClick:()=>o([]),disabled:!R,title:"Clear all",children:[n.jsx(sr,{size:14}),n.jsx("span",{children:"Clear"})]})]}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",onClick:r,children:[n.jsx(ln,{size:14}),"Cancel"]}),n.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-accent hover:brightness-110 text-white transition-all",onClick:F,children:[n.jsx(np,{size:14}),"Save"]})]})]}),n.jsx("div",{ref:k,className:"flex-1 min-h-0 flex items-center justify-center p-4 overflow-auto",children:n.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:b.width},children:[n.jsx("canvas",{ref:j,width:b.width,height:b.height,style:{display:"block",width:"100%",height:"auto"}}),n.jsx("canvas",{ref:S,width:b.width,height:b.height,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:u==="text"?"text":"crosshair"},onMouseDown:C,onMouseMove:I,onMouseUp:D,onMouseLeave:D})]})})]}),document.body)}function Y1({visible:e,title:a,placeholder:r="Enter your comment...",sessionId:l,onSubmit:o,onCancel:u}){const[d,f]=y.useState(""),[m,p]=y.useState([]),[g,b]=y.useState(null),[N,v]=y.useState(null),w=y.useRef(null),j=y.useRef(null);y.useEffect(()=>{e&&(f(""),p([]),b(null),v(null),setTimeout(()=>{var C;return(C=w.current)==null?void 0:C.focus()},50))},[e]),y.useEffect(()=>{if(!e)return;const C=I=>{I.key==="Escape"&&(g!==null?b(null):u())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[e,u,g]);const S=async C=>{if(l)try{const I=await Rb(C,l);v(null),p(D=>[...D,I.filename])}catch(I){const D=I instanceof Error?I.message:"Upload failed";v(D),setTimeout(()=>v(null),3e3)}},k=async C=>{var D;const I=(D=C.clipboardData)==null?void 0:D.items;if(I){for(const F of Array.from(I))if(F.type.startsWith("image/")){C.preventDefault();const R=F.getAsFile();if(!R)continue;await S(R);break}}},_=async C=>{const I=C.target.files;if(I){for(const D of Array.from(I))await S(D);C.target.value=""}},M=async C=>{if(!(g===null||!l)){try{const D=await(await fetch(C)).blob(),F=await Rb(D,l);p(R=>R.map((z,P)=>P===g?F.filename:z))}catch(I){const D=I instanceof Error?I.message:"Failed to save annotation";v(D),setTimeout(()=>v(null),3e3)}b(null)}},Z=()=>{const C=d.trim();(C||m.length>0)&&(o(C,m.length>0?m:void 0),f(""),p([]))},Y=C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),Z())};return e?g!==null&&m[g]&&l?n.jsx(FD,{imageSrc:Ci(m[g],l),onSave:M,onCancel:()=>b(null)}):Ms.createPortal(n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center",onClick:u,children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl shadow-2xl w-full max-w-md mx-4",onClick:C=>C.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:a}),n.jsx("button",{className:"text-text-muted hover:text-text-primary transition-colors p-1 rounded hover:bg-surface-2",onClick:u,children:n.jsx(ln,{size:16})})]}),n.jsxs("div",{className:"p-5",children:[n.jsx("textarea",{ref:w,value:d,onChange:C=>f(C.target.value),onKeyDown:Y,onPaste:k,placeholder:r,rows:4,className:"w-full bg-surface-2 border border-border rounded-lg px-4 py-3 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent resize-none"}),N&&n.jsx("p",{className:"text-xs text-red-400 mt-2",children:N}),m.length>0&&l&&n.jsx("div",{className:"flex gap-2 flex-wrap mt-3",children:m.map((C,I)=>n.jsxs("div",{className:"relative group",children:[n.jsx("img",{src:Ci(C,l),className:"w-16 h-16 object-cover rounded-lg border border-border",alt:""}),n.jsx("button",{className:"absolute inset-0 flex items-center justify-center bg-black/50 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>b(I),title:"Draw on image",children:n.jsx(cu,{size:16,className:"text-white"})}),n.jsx("button",{className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-surface-4 text-text-primary text-xs flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>p(D=>D.filter((F,R)=>R!==I)),children:n.jsx(ln,{size:10})})]},I))})]}),n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-t border-border",children:[n.jsx("span",{className:"text-xs text-text-muted",children:"Shift+Enter for new line"}),n.jsxs("div",{className:"flex items-center gap-2",children:[l&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",onClick:()=>{var C;return(C=j.current)==null?void 0:C.click()},title:"Attach image",children:n.jsx(Mk,{size:16})}),n.jsx("input",{ref:j,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:_})]}),n.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",onClick:u,children:"Cancel"}),n.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium bg-accent hover:brightness-110 text-white transition-all disabled:opacity-50",onClick:Z,disabled:!d.trim()&&m.length===0,children:"Submit"})]})]})]})}),document.body):null}function HD({src:e,onClose:a}){return Ms.createPortal(n.jsx("div",{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center cursor-pointer",onClick:a,children:n.jsx("img",{src:e,className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl",onClick:r=>r.stopPropagation(),alt:"Preview"})}),document.body)}function qD({visible:e,x:a,y:r,mode:l,onAction:o,onClose:u}){const d=y.useRef(null),[f,m]=y.useState({x:a,y:r}),[p,g]=y.useState(null);if(y.useEffect(()=>{if(!e)return;const S=220,k=400,_=Math.min(a,window.innerWidth-S-10),M=Math.min(r,window.innerHeight-k-10);m({x:Math.max(10,_),y:Math.max(10,M)})},[e,a,r]),y.useEffect(()=>{if(!e)return;const S=M=>{d.current&&!d.current.contains(M.target)&&u()},k=M=>{M.key==="Escape"&&u()},_=()=>u();return document.addEventListener("mousedown",S),document.addEventListener("keydown",k),document.addEventListener("scroll",_,!0),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",k),document.removeEventListener("scroll",_,!0)}},[e,u]),!e)return null;const v=l==="selection"?[{icon:"comment",label:"Add Comment",action:{type:"comment"}},{icon:"suggest",label:"Suggest Change",action:{type:"suggest"}},{icon:"concern",label:"Raise Concern",action:{type:"concern"}},{icon:"question",label:"Ask Question",action:{type:"question"}}]:[{icon:"annotate",label:"Annotate Block",submenu:[{icon:"comment",label:"Comment",action:{type:"comment"}},{icon:"suggest",label:"Suggest",action:{type:"suggest"}},{icon:"concern",label:"Concern",action:{type:"concern"}},{icon:"question",label:"Question",action:{type:"question"}}]},{separator:!0,icon:"",label:""},{icon:"edit",label:"Edit Block",action:{type:"edit"}},{separator:!0,icon:"",label:""},{icon:"instruction",label:"Add Instruction",action:{type:"instruction"}},{icon:"priority",label:"Set Priority",action:{type:"priority"}},{icon:"risk",label:"Flag Risk",action:{type:"risk"}}],w={comment:"💬",suggest:"✏️",concern:"⚠️",question:"❓",annotate:"➕",edit:"✏️",instruction:"📋",priority:"🏷️",risk:"⚠️"},j=S=>{S.submenu?g(p===S.label?null:S.label):S.action&&(o(S.action),u())};return Ms.createPortal(n.jsx("div",{ref:d,className:"fixed bg-surface-2 border border-border rounded-xl shadow-2xl z-50 min-w-48 py-1",style:{left:`${f.x}px`,top:`${f.y}px`},children:v.map((S,k)=>{if(S.separator)return n.jsx("div",{className:"h-px bg-border my-1"},`sep-${k}`);const _=!!S.submenu,M=p===S.label;return n.jsxs("div",{children:[n.jsxs("button",{className:"flex items-center gap-3 w-full px-3 py-2 text-sm text-text-secondary hover:bg-surface-3 hover:text-text-primary cursor-pointer rounded-lg mx-1 transition-colors duration-150",onClick:()=>j(S),children:[n.jsx("span",{className:"w-5 text-center",children:w[S.icon]??"📝"}),n.jsx("span",{className:"flex-1 text-left",children:S.label}),_&&n.jsx("span",{className:"text-text-muted text-xs",children:"▶"})]}),_&&M&&n.jsx("div",{className:"ml-4 border-l border-border",children:S.submenu.map(Z=>n.jsxs("button",{className:"flex items-center gap-3 w-full px-3 py-2 text-sm text-text-secondary hover:bg-surface-3 hover:text-text-primary cursor-pointer rounded-lg mx-1 transition-colors duration-150",onClick:()=>{Z.action&&(o(Z.action),u())},children:[n.jsx("span",{className:"w-5 text-center",children:w[Z.icon]??"📝"}),n.jsx("span",{className:"flex-1 text-left",children:Z.label})]},Z.label))})]},S.label)})}),document.body)}function GD({content:e,isCode:a=!1,onCommit:r,onCancel:l}){const[o,u]=y.useState(e),d=y.useRef(null);return y.useEffect(()=>{u(e)},[e]),y.useEffect(()=>{var f,m;(f=d.current)==null||f.focus(),(m=d.current)==null||m.select()},[]),y.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key==="Enter"?(m.preventDefault(),r(o)):m.key==="Escape"&&(m.preventDefault(),l())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[o,r,l]),n.jsxs("div",{className:"relative border-2 border-violet-500 rounded-md bg-violet-500/5 p-2 my-2",children:[n.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2 bg-violet-500/15 rounded border border-violet-500/30 mb-2",children:[n.jsx("span",{className:"text-sm font-medium text-violet-300",children:"Editing"}),n.jsx("span",{className:"text-xs text-text-muted ml-auto",children:"Cmd+Enter to save, Esc to cancel"})]}),n.jsx("textarea",{ref:d,className:`w-full min-h-24 p-3 text-sm leading-relaxed bg-surface-3 border border-border rounded-md text-text-primary focus:outline-none focus:border-violet-500 resize-y transition-colors ${a?"font-mono":""}`,value:o,onChange:f=>u(f.target.value),spellCheck:!a}),n.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[n.jsx("button",{className:"px-3 py-1.5 text-sm border border-border text-text-secondary rounded-md hover:bg-surface-2 transition-colors",onClick:l,children:"Cancel"}),n.jsx("button",{className:"px-3 py-1.5 text-sm bg-violet-600 text-white rounded-md hover:bg-violet-700 transition-colors",onClick:()=>r(o),children:"Save Changes"})]})]})}const Jy=[{id:"markdown",label:"Markdown",extension:".md",description:"Annotated markdown with review comments, priorities, and risks."},{id:"github",label:"GitHub Issue",extension:".md",description:"Formatted for GitHub Issues with checklist and annotations."},{id:"jira",label:"Jira",extension:".md",description:"Jira-compatible format with ADF-style headers, tables, and {code} blocks."},{id:"json",label:"JSON",extension:".json",description:"Raw JSON export of all review data."}];function KD(e,a,r,l,o,u,d){var m,p,g,b,N,v;const f=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"review";switch(e){case"markdown":{let w=`# Review: ${a}
614
-
615
- `;if(l.length>0){w+=`## Annotations (${l.length})
616
-
617
- `;for(const j of l){const S=j.sectionId&&j.sectionId!=="global"?(m=d.find(k=>k.id===j.sectionId))==null?void 0:m.title:"Global";w+=`- **[${j.type}]** ${S?`(${S}) `:""}${j.text}
618
- `}w+=`
619
- `}if(o.length>0){w+=`## Priorities
620
-
621
- `;for(const j of o){const S=((p=d.find(k=>k.id===j.sectionId))==null?void 0:p.title)??j.sectionId;w+=`- **${j.priority}**: ${S}${j.note?` - ${j.note}`:""}
622
- `}w+=`
623
- `}if(u.length>0){w+=`## Risks
624
-
625
- `;for(const j of u){const S=((g=d.find(k=>k.id===j.sectionId))==null?void 0:g.title)??j.sectionId;w+=`- **${j.level}**: ${S}${j.description?` - ${j.description}`:""}
626
- `}w+=`
627
- `}return w+=`## Plan
628
-
629
- ${r}`,{content:w,filename:`${f}-review.md`}}case"github":{let w=`## Review Summary
630
-
631
- `;if(w+=`- Annotations: ${l.length}
632
- `,w+=`- Priorities: ${o.length}
633
- `,w+=`- Risks: ${u.length}
634
-
635
- `,l.length>0){w+=`### Comments
636
-
637
- `;for(const j of l)w+=`- [ ] **${j.type}**: ${j.text}
638
- `;w+=`
639
- `}return w+=`<details><summary>Full Plan</summary>
640
-
641
- ${r}
642
-
643
- </details>`,{content:`# ${a}
644
-
645
- ${w}`,filename:`${f}-github-issue.md`}}case"jira":{let w=`h1. ${a}
646
-
647
- `;if(l.length>0){w+=`h2. Annotations
648
-
649
- `,w+=`||Type||Section||Comment||
650
- `;for(const S of l){const k=S.sectionId&&S.sectionId!=="global"?(b=d.find(M=>M.id===S.sectionId))==null?void 0:b.title:"Global",_=S.text.replace(/\|/g,"\\|").replace(/\n/g," ");w+=`|${S.type}|${k??"—"}|${_}|
651
- `}w+=`
652
- `}if(o.length>0){w+=`h2. Priorities
653
-
654
- `,w+=`||Section||Priority||Note||
655
- `;for(const S of o){const k=((N=d.find(_=>_.id===S.sectionId))==null?void 0:N.title)??S.sectionId;w+=`|${k}|${S.priority}|${S.note??"—"}|
656
- `}w+=`
657
- `}if(u.length>0){w+=`h2. Risks
658
-
659
- `,w+=`||Section||Level||Description||
660
- `;for(const S of u){const k=((v=d.find(M=>M.id===S.sectionId))==null?void 0:v.title)??S.sectionId,_=(S.description??"—").replace(/\|/g,"\\|").replace(/\n/g," ");w+=`|${k}|${S.level}|${_}|
661
- `}w+=`
662
- `}const j=r.replace(/^### (.+)/gm,"h3. $1").replace(/^## (.+)/gm,"h2. $1").replace(/^# (.+)/gm,"h1. $1").replace(/```(\w*)\n([\s\S]*?)```/g,(S,k,_)=>`{code:language=${k||"none"}}
663
- ${_}{code}`).replace(/\*\*(.+?)\*\*/g,"*$1*").replace(/^- /gm,"* ");return w+=`h2. Plan
664
-
665
- ${j}`,{content:w,filename:`${f}-review-jira.md`}}case"json":{const w={title:a,annotations:l,priorities:o,risks:u,exportedAt:new Date().toISOString()};return{content:JSON.stringify(w,null,2),filename:`${f}-review.json`}}}}function YD(e,a){const r=new Blob([e],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(r),o=document.createElement("a");o.href=l,o.download=a,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)}function VD({visible:e,title:a,markdown:r,annotations:l,priorities:o,risks:u,sections:d,onClose:f,defaultFormat:m}){const[p,g]=y.useState("markdown"),[b,N]=y.useState(!1),v=y.useCallback(_=>{_.key==="Escape"&&f()},[f]);y.useEffect(()=>{if(e)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,v]),y.useEffect(()=>{e&&(g(m??"markdown"),N(!1))},[e]);const w=y.useMemo(()=>e?KD(p,a,r,l,o,u,d):null,[e,p,a,r,l,o,u,d]),j=()=>{w&&YD(w.content,w.filename)},S=async()=>{if(w){try{await navigator.clipboard.writeText(w.content)}catch{const _=document.createElement("textarea");_.value=w.content,_.style.position="fixed",_.style.opacity="0",document.body.appendChild(_),_.select(),document.execCommand("copy"),document.body.removeChild(_)}N(!0),setTimeout(()=>N(!1),2e3)}};if(!e)return null;const k=Jy.find(_=>_.id===p);return Ms.createPortal(n.jsx("div",{className:"fixed inset-0 bg-black/75 backdrop-blur-sm flex items-center justify-center z-50",onClick:_=>{_.target===_.currentTarget&&f()},children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl w-full max-w-lg shadow-2xl",children:[n.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Export Plan"}),n.jsx("button",{className:"text-text-muted hover:text-text-primary transition-colors",onClick:f,children:n.jsx(ln,{size:18})})]}),n.jsxs("div",{className:"p-6 space-y-4",children:[n.jsx("div",{className:"flex gap-2",children:Jy.map(_=>n.jsxs("button",{className:`flex-1 p-3 border rounded-lg text-left transition-colors ${p===_.id?"bg-surface-2 ring-2 ring-accent border-accent/30":"border-border hover:bg-surface-2"}`,onClick:()=>{g(_.id),N(!1)},children:[n.jsx("span",{className:"block text-sm font-medium text-text-primary",children:_.label}),n.jsx("span",{className:"block text-xs text-text-muted",children:_.extension})]},_.id))}),n.jsx("p",{className:"text-sm text-text-secondary",children:k.description}),n.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-3 border-b border-border",children:[n.jsx("span",{className:"text-xs text-text-muted",children:"Preview"}),n.jsx("span",{className:"text-xs text-text-secondary font-mono",children:w==null?void 0:w.filename})]}),n.jsx("pre",{className:"max-h-60 overflow-y-auto p-4 bg-surface-3 text-xs font-mono text-text-secondary whitespace-pre-wrap",children:n.jsx("code",{children:w==null?void 0:w.content})})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{className:"flex-1 py-2.5 bg-surface-2 hover:bg-surface-3 text-text-secondary text-sm font-medium rounded-lg border border-border transition-colors",onClick:S,children:b?"Copied!":"Copy to Clipboard"}),n.jsxs("button",{className:"flex-1 py-2.5 bg-accent hover:brightness-110 text-white text-sm font-medium rounded-lg transition-all",onClick:j,children:["Download ",k.extension]})]})]})]})}),document.body)}const XD=[{key:"j",desc:"Next section"},{key:"k",desc:"Previous section"},{key:"a",desc:"Add global comment"},{key:"c",desc:"Comment on focused section"},{key:"e",desc:"Edit focused block"},{key:"i",desc:"Toggle Instructions panel"},{key:"p",desc:"Set priority on section"},{key:"r",desc:"Flag risk on section"},{key:"?",desc:"Toggle this overlay"},{key:"⌘ Enter",desc:"Approve plan"},{key:"d",desc:"Request changes"},{key:"Esc",desc:"Close modal/overlay"}];function ZD({onClose:e,shortcuts:a}){const r=a??XD;return y.useEffect(()=>{const l=o=>{o.key==="Escape"&&(o.preventDefault(),e())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),Ms.createPortal(n.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50 flex items-center justify-center",onClick:e,children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl shadow-2xl w-full max-w-sm mx-4 p-6",onClick:l=>l.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-semibold text-text-primary flex items-center gap-2",children:[n.jsx(tv,{size:16})," Keyboard Shortcuts"]}),n.jsx("button",{onClick:e,className:"text-text-muted hover:text-text-primary transition-colors",children:n.jsx(ln,{size:16})})]}),n.jsx("div",{className:"space-y-2",children:r.map(l=>n.jsxs("div",{className:"flex items-center justify-between text-xs",children:[n.jsx("span",{className:"text-text-secondary",children:l.desc}),n.jsx("kbd",{className:"bg-surface-3 px-2 py-0.5 rounded text-text-primary font-mono",children:l.key})]},l.key))})]})}),document.body)}function QD({isOpen:e,actionName:a,variant:r,summary:l,onConfirm:o,onCancel:u}){const d=y.useRef(null),f=y.useRef(null),m=y.useCallback(_=>{_.key==="Escape"?(_.preventDefault(),_.stopPropagation(),u()):_.key==="Enter"&&!_.metaKey&&!_.ctrlKey&&(_.preventDefault(),_.stopPropagation(),o())},[o,u]);if(y.useEffect(()=>{var _;if(e)return f.current=document.activeElement,(_=d.current)==null||_.focus(),document.addEventListener("keydown",m,!0),document.body.style.overflow="hidden",()=>{var M;document.removeEventListener("keydown",m,!0),document.body.style.overflow="",(M=f.current)==null||M.focus()}},[e,m]),!e)return null;const p=r==="approve"?"bg-emerald-600 text-white hover:bg-emerald-500 shadow-lg shadow-emerald-600/25":r==="deny"?"bg-red-500 text-white hover:bg-red-400 shadow-lg shadow-red-500/25":"bg-accent text-white hover:brightness-110",{annotationsByType:g,editCount:b,instructionCount:N,priorityCount:v,riskCount:w,globalComment:j}=l,S=g.comments>0||g.questions>0||g.concerns>0||g.suggestions>0||g.approvals>0||g.globalComments>0,k=S||b>0||N>0||v>0||w>0;return Ms.createPortal(n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[90] flex items-center justify-center",onClick:u,children:n.jsxs("div",{ref:d,role:"dialog","aria-modal":"true",tabIndex:-1,className:"w-full max-w-md bg-surface-1 border border-border rounded-2xl shadow-2xl flex flex-col focus:outline-none mx-4",onClick:_=>_.stopPropagation(),children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border",children:[n.jsxs("h2",{className:"text-lg font-semibold text-text-primary",children:["Confirm: ",a]}),n.jsx("p",{className:"text-sm text-text-muted mt-1",children:k?"The following feedback will be included with your decision.":"No feedback attached. The decision will be submitted as-is."})]}),n.jsxs("div",{className:"px-6 py-5 space-y-4 max-h-[50vh] overflow-y-auto",children:[S&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold text-text-tertiary uppercase tracking-widest mb-2",children:"Annotations"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.comments>0&&n.jsx(Hs,{label:"Comments",count:g.comments,color:"text-text-secondary"}),g.questions>0&&n.jsx(Hs,{label:"Questions",count:g.questions,color:"text-accent"}),g.concerns>0&&n.jsx(Hs,{label:"Concerns",count:g.concerns,color:"text-amber-400"}),g.suggestions>0&&n.jsx(Hs,{label:"Suggestions",count:g.suggestions,color:"text-blue-400"}),g.approvals>0&&n.jsx(Hs,{label:"Approvals",count:g.approvals,color:"text-emerald-400"}),g.globalComments>0&&n.jsx(Hs,{label:"Global Comments",count:g.globalComments,color:"text-text-muted"})]})]}),(b>0||N>0||v>0||w>0)&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold text-text-tertiary uppercase tracking-widest mb-2",children:"Metadata"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[b>0&&n.jsx(Hs,{label:"Inline Edits",count:b,color:"text-accent"}),N>0&&n.jsx(Hs,{label:"Instructions",count:N,color:"text-blue-400"}),v>0&&n.jsx(Hs,{label:"Priorities Set",count:v,color:"text-amber-400"}),w>0&&n.jsx(Hs,{label:"Risks Flagged",count:w,color:"text-red-400"})]})]}),j&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold text-text-tertiary uppercase tracking-widest mb-2",children:"Global Comment Preview"}),n.jsx("p",{className:"text-sm text-text-secondary bg-surface-2 border border-border rounded-lg p-3 line-clamp-3",children:j})]})]}),n.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-border",children:[n.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",onClick:u,children:"Cancel"}),n.jsx("button",{className:`px-5 py-2 rounded-lg text-sm font-bold transition-all ${p}`,onClick:o,children:a})]}),n.jsxs("div",{className:"px-6 pb-3 flex items-center justify-center gap-3 text-xs text-text-muted",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"bg-surface-3 border border-border rounded px-1.5 py-0.5 font-mono text-[0.65rem]",children:"Enter"}),n.jsx("span",{children:"to confirm"})]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"bg-surface-3 border border-border rounded px-1.5 py-0.5 font-mono text-[0.65rem]",children:"Esc"}),n.jsx("span",{children:"to cancel"})]})]})]})}),document.body)}function Hs({label:e,count:a,color:r}){return n.jsxs("div",{className:"flex items-center justify-between bg-surface-2 border border-border rounded-lg px-3 py-2",children:[n.jsx("span",{className:"text-sm text-text-secondary",children:e}),n.jsx("span",{className:`text-sm font-bold tabular-nums ${r}`,children:a})]})}const WD=[{value:"must-have",label:"Must Have",color:"bg-red-500/15 text-red-300 border-red-500/30"},{value:"should-have",label:"Should Have",color:"bg-amber-500/15 text-amber-300 border-amber-500/30"},{value:"nice-to-have",label:"Nice to Have",color:"bg-blue-500/15 text-blue-300 border-blue-500/30"},{value:"out-of-scope",label:"Out of Scope",color:"bg-surface-3 text-text-secondary border-border"}];function JD({visible:e,sectionTitle:a,currentLevel:r,currentReason:l,anchorRect:o,onSubmit:u,onRemove:d,onClose:f}){const[m,p]=y.useState(r??"should-have"),[g,b]=y.useState(l??""),N=y.useRef(null);if(y.useEffect(()=>{p(r??"should-have"),b(l??"")},[e,r,l]),y.useEffect(()=>{if(!e)return;const w=S=>{S.key==="Escape"&&f()},j=S=>{N.current&&!N.current.contains(S.target)&&f()};return document.addEventListener("keydown",w),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",w),document.removeEventListener("mousedown",j)}},[e,f]),!e)return null;const v=o?{position:"fixed",top:o.bottom+4,left:Math.min(o.left,window.innerWidth-300),zIndex:50}:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:50};return Ms.createPortal(n.jsxs("div",{ref:N,className:"bg-surface-2 border border-border rounded-xl shadow-2xl w-72 p-4",style:v,children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1",children:"Set Priority"}),n.jsx("p",{className:"text-sm text-text-secondary truncate mb-3",children:a}),n.jsx("div",{className:"flex gap-1.5 mb-3",children:WD.map(w=>n.jsx("button",{className:`flex-1 px-2 py-1.5 rounded-lg text-xs font-medium border transition-colors ${m===w.value?w.color+" ring-1 ring-accent":"border-border text-text-muted hover:bg-surface-3"}`,onClick:()=>p(w.value),children:w.label},w.value))}),n.jsx("input",{type:"text",value:g,onChange:w=>b(w.target.value),placeholder:"Reason (optional)",className:"w-full px-3 py-2 bg-surface-3 border border-border rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent mb-3",onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),u(m,g||void 0))}}),n.jsxs("div",{className:"flex items-center justify-between",children:[r?n.jsx("button",{className:"text-xs text-red-400 hover:text-red-300 transition-colors",onClick:d,children:"Remove"}):n.jsx("span",{}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{className:"px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",onClick:f,children:"Cancel"}),n.jsx("button",{className:"px-3 py-1.5 text-xs bg-accent text-white rounded-lg hover:brightness-110 transition-all",onClick:()=>u(m,g||void 0),children:"Set"})]})]})]}),document.body)}const eL=[{value:"high",label:"High",color:"bg-red-500/15 text-red-300 border-red-500/30"},{value:"medium",label:"Medium",color:"bg-amber-500/15 text-amber-300 border-amber-500/30"},{value:"low",label:"Low",color:"bg-green-500/15 text-green-300 border-green-500/30"}];function tL({visible:e,sectionTitle:a,currentLevel:r,currentDescription:l,anchorRect:o,onSubmit:u,onRemove:d,onClose:f}){const[m,p]=y.useState(r??"medium"),[g,b]=y.useState(l??""),N=y.useRef(null);if(y.useEffect(()=>{p(r??"medium"),b(l??"")},[e,r,l]),y.useEffect(()=>{if(!e)return;const w=S=>{S.key==="Escape"&&f()},j=S=>{N.current&&!N.current.contains(S.target)&&f()};return document.addEventListener("keydown",w),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",w),document.removeEventListener("mousedown",j)}},[e,f]),!e)return null;const v=o?{position:"fixed",top:o.bottom+4,left:Math.min(o.left,window.innerWidth-300),zIndex:50}:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:50};return Ms.createPortal(n.jsxs("div",{ref:N,className:"bg-surface-2 border border-border rounded-xl shadow-2xl w-72 p-4",style:v,children:[n.jsx("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-1",children:"Flag Risk"}),n.jsx("p",{className:"text-sm text-text-secondary truncate mb-3",children:a}),n.jsx("div",{className:"flex gap-1.5 mb-3",children:eL.map(w=>n.jsx("button",{className:`flex-1 px-2 py-1.5 rounded-lg text-xs font-medium border transition-colors ${m===w.value?w.color+" ring-1 ring-accent":"border-border text-text-muted hover:bg-surface-3"}`,onClick:()=>p(w.value),children:w.label},w.value))}),n.jsx("input",{type:"text",value:g,onChange:w=>b(w.target.value),placeholder:"Description (optional)",className:"w-full px-3 py-2 bg-surface-3 border border-border rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent mb-3",onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),u(m,g||void 0))}}),n.jsxs("div",{className:"flex items-center justify-between",children:[r?n.jsx("button",{className:"text-xs text-red-400 hover:text-red-300 transition-colors",onClick:d,children:"Remove"}):n.jsx("span",{}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{className:"px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",onClick:f,children:"Cancel"}),n.jsx("button",{className:"px-3 py-1.5 text-xs bg-accent text-white rounded-lg hover:brightness-110 transition-all",onClick:()=>u(m,g||void 0),children:"Set"})]})]})]}),document.body)}const Um={comment:"border-blue-400 bg-blue-500/10",suggestion:"border-violet-400 bg-violet-500/10",concern:"border-amber-400 bg-amber-500/10",question:"border-cyan-400 bg-cyan-500/10",approval:"border-emerald-400 bg-emerald-500/10",instruction:"border-orange-400 bg-orange-500/10",global_comment:"border-blue-400 bg-blue-500/10"},V1={comment:"bg-blue-500/10 text-blue-300 border-blue-500/20",suggestion:"bg-violet-500/10 text-violet-300 border-violet-500/20",concern:"bg-amber-500/10 text-amber-300 border-amber-500/20",question:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20",approval:"bg-emerald-500/10 text-emerald-300 border-emerald-500/20",instruction:"bg-orange-500/10 text-orange-300 border-orange-500/20",global_comment:"bg-blue-500/10 text-blue-300 border-blue-500/20"};function _p(e){const a=Math.floor((Date.now()-e)/1e3);if(a<60)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function lm(){var lr,Us,cs,ge,Ie,st;const[e]=Zl(),{slug:a}=E0(),r=e.get("session"),l=Rs(),{currentProject:o}=on(),u=o==null?void 0:o.id,[d,f]=y.useState(null),[m,p]=y.useState(""),[g,b]=y.useState(!0),[N,v]=y.useState(null),[w,j]=y.useState([]),[S,k]=y.useState(null),[_,M]=y.useState(!1),[Z,Y]=y.useState(null),[C,I]=y.useState(null),[D,F]=y.useState(new Set),[R,z]=y.useState([]),[P,q]=y.useState([]),[$,U]=y.useState([]),[B,Q]=y.useState([]),[ee,ie]=y.useState(null),[T,L]=y.useState(null),[G,O]=y.useState(!1),[H,V]=y.useState(!1),[re,xe]=y.useState(!1),[je,Be]=y.useState(null),[we,Ye]=y.useState(null),[jt,en]=y.useState(""),[oe,ke]=y.useState(null),[he,Xe]=y.useState(null),[Qe,lt]=y.useState(""),[At,Yt]=y.useState("notes"),[gt,Vt]=y.useState({visible:!1,x:0,y:0,mode:"block",sectionIdx:null}),[ct,yn]=y.useState(null),[ue,ve]=y.useState(!1),[Ae,Pe]=y.useState(!1),[ot,cn]=y.useState(!1),[jn,un]=y.useState(!1),[et,qt]=y.useState(null),[Ve,vn]=y.useState(null),[Rt,rr]=y.useState(null),[Os,Zs]=y.useState([]),[Qs,Rn]=y.useState("markdown"),[,X]=y.useState(0),de=y.useRef(null);y.useEffect(()=>{const te=setInterval(()=>X(ce=>ce+1),3e4);return()=>clearInterval(te)},[]),y.useEffect(()=>{Zm().then(te=>{te.default_export_format&&Rn(te.default_export_format)}).catch(()=>{})},[]),y.useEffect(()=>{async function te(){var ce,ye,Te,Me,Ue;b(!0),v(null),j([]),z([]),q([]),U([]),Q([]),I(null),L(null),k(null),F(new Set),Zs([]),ie(null);try{if(r){let kt=e.get("token")??null;if(!kt)try{kt=await Ar(r)}catch{}ie(kt);const Fe=await U0(r);f(Fe),p(Fe.plan??""),Fe.decision&&I(Fe.decision),j(((ce=Fe.version)==null?void 0:ce.annotations)??[]),z(((ye=Fe.version)==null?void 0:ye.inlineEdits)??[]),q(((Te=Fe.version)==null?void 0:Te.priorities)??[]),U(((Me=Fe.version)==null?void 0:Me.risks)??[]),Q(((Ue=Fe.version)==null?void 0:Ue.instructions)??[])}else if(a){const kt=(await v2(a,u)).versions??[];if(Zs(kt.map(Fe=>({decision:Fe.decision,createdAt:Fe.createdAt,content:Fe.content??Fe.markdown}))),kt.length>0){const Fe=kt[kt.length-1];p((Fe==null?void 0:Fe.content)??(Fe==null?void 0:Fe.markdown)??""),j((Fe==null?void 0:Fe.annotations)??[]),z((Fe==null?void 0:Fe.inlineEdits)??[]),q((Fe==null?void 0:Fe.priorities)??[]),U((Fe==null?void 0:Fe.risks)??[]),Q((Fe==null?void 0:Fe.instructions)??[]),Fe!=null&&Fe.decision&&I(Fe.decision)}}}catch(it){v(it instanceof Error?it.message:"Failed to load plan")}finally{b(!1)}}te()},[r,a,e,u]),y.useEffect(()=>{if(!r||C)return;let te=null;try{te=new EventSource(Wl("/api/review/hub/events")),te.addEventListener("session-decided",ce=>{try{const ye=JSON.parse(ce.data);(ye==null?void 0:ye.id)===r&&(ye!=null&&ye.decision)&&I(ye.decision)}catch{}}),te.onerror=()=>{te==null||te.close(),te=null}}catch{}return()=>{te==null||te.close()}},[r,C]),y.useEffect(()=>{m&&E2(m).then(k).catch(()=>{})},[m]),y.useEffect(()=>{S2().then(V).catch(()=>{})},[]);const Se=y.useCallback(async()=>{if(!(!m||G)){O(!0);try{const te=await j2(m);k(te)}catch{}finally{O(!1)}}},[m,G]),_e=y.useMemo(()=>{if(!m)return[];const te=m.split(`
666
- `),ce=[];let ye=null;const Te=new Set,Me=Ue=>{const it=Ue.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"section";let kt=it,Fe=2;for(;Te.has(kt);)kt=`${it}-${Fe++}`;return Te.add(kt),kt};for(let Ue=0;Ue<te.length;Ue++){const it=te[Ue]??"",kt=it.match(/^(#{1,6})\s+(.+)/);kt?(ye&&ce.push({id:Me(ye.title),title:ye.title,level:ye.level,content:ye.lines.join(`
667
- `),startLine:ye.startLine}),ye={title:kt[2],level:kt[1].length,lines:[it],startLine:Ue}):ye?ye.lines.push(it):it.trim()&&(ye={title:"Overview",level:1,lines:[it],startLine:Ue})}return ye&&ce.push({id:Me(ye.title),title:ye.title,level:ye.level,content:ye.lines.join(`
668
- `),startLine:ye.startLine}),ce},[m]),Mt=y.useMemo(()=>[F4],[]),St=y.useMemo(()=>[AD],[]);y.useEffect(()=>{if(!(!r&&!a||C))return de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{const te={annotations:w,inlineEdits:R,priorities:P,risks:$,instructions:B};r?Ab(r,te,ee??void 0).catch(()=>{}):a&&_f(a,te).catch(()=>{})},3e3),()=>{de.current&&clearTimeout(de.current)}},[r,a,w,R,P,$,B,C,ee]);const De=y.useCallback(()=>{var ye;const te={comments:0,questions:0,concerns:0,suggestions:0,approvals:0,instructions:0,globalComments:0};for(const Te of w)Te.type==="comment"?te.comments++:Te.type==="question"?te.questions++:Te.type==="concern"?te.concerns++:Te.type==="suggestion"?te.suggestions++:Te.type==="approval"?te.approvals++:Te.type==="instruction"?te.instructions++:Te.type==="global_comment"&&te.globalComments++;const ce=w.find(Te=>Te.type==="global_comment");return{annotationCount:w.length,annotationsByType:te,editCount:R.length,instructionCount:B.length,priorityCount:P.length,riskCount:$.length,globalComment:(ye=ce==null?void 0:ce.text)==null?void 0:ye.slice(0,200)}},[w,R,B,P,$]),Ce=y.useCallback((te,ce=!1)=>{L({behavior:te,clearContext:ce})},[]),qe=y.useCallback(async()=>{if(!T||!r&&!a)return;L(null),M(!0),Y(null);const{behavior:te,clearContext:ce}=T,ye=w.length>0?w.map(Me=>{var Ue;return`[${Me.type}${Me.sectionId&&Me.sectionId!=="global"?` - Section: ${((Ue=_e.find(it=>it.id===Me.sectionId))==null?void 0:Ue.title)??Me.sectionId}`:""}] ${Me.text}`}).join(`
669
-
670
- `):void 0,Te={behavior:te,message:te==="allow"?"Approved":"Changes requested",feedback:ye,clearContext:ce};try{const Me={annotations:w,inlineEdits:R,instructions:B,priorities:P,risks:$};r?await N2(r,Te,Me,ee??void 0):a&&await _f(a,{...Me,decision:Te}),I(Te)}catch(Me){Y(Me instanceof Error?Me.message:"Decision submission failed")}finally{M(!1)}},[r,a,T,w,_e,R,B,P,$,ee]),Xt=y.useCallback((te,ce)=>{var Te;if(!oe)return;const ye={id:crypto.randomUUID(),type:oe.type,text:oe.selectedText?`> ${oe.selectedText}
671
-
672
- ${te}`:te,sectionId:oe.sectionIdx!==null?((Te=_e[oe.sectionIdx])==null?void 0:Te.id)??String(oe.sectionIdx):"global",createdAt:Date.now(),imagePaths:ce};j(Me=>[...Me,ye]),ke(null)},[oe,_e]),$t=y.useCallback(()=>{const te=window.getSelection();if(!te||te.isCollapsed||!te.toString().trim()){xe(!1);return}const ce=te.toString().trim(),ye=te.getRangeAt(0),Te=ye.getBoundingClientRect();let Me=ye.startContainer,Ue=null;for(;Me;){if(Me instanceof HTMLElement){const it=Me.getAttribute("data-section-idx");if(it!==null){Ue=Number(it);break}}Me=Me.parentNode}en(ce),Ye(Ue),Be(Te),xe(!0)},[]),Ns=y.useCallback(()=>{xe(!1)},[]),ja=y.useCallback(te=>{var ce;xe(!1),ke({visible:!0,title:`Add ${te}`,sectionIdx:we,type:te,selectedText:jt}),(ce=window.getSelection())==null||ce.removeAllRanges()},[we,jt]),Sa=y.useCallback((te,ce)=>{te.preventDefault();const ye=window.getSelection(),Te=ye&&!ye.isCollapsed&&ye.toString().trim().length>0;Vt({visible:!0,x:te.clientX,y:te.clientY,mode:Te?"selection":"block",sectionIdx:ce}),Te&&(en(ye.toString().trim()),Ye(ce))},[]),os=y.useCallback(te=>{const ce=gt.sectionIdx;switch(te.type){case"comment":case"suggest":case"concern":case"question":{const Te={comment:"comment",suggest:"suggestion",concern:"concern",question:"question"}[te.type]??"comment";ke({visible:!0,title:`Add ${Te}`,sectionIdx:ce,type:Te,selectedText:gt.mode==="selection"?jt:void 0});break}case"instruction":ke({visible:!0,title:"Add Instruction",sectionIdx:ce,type:"instruction"});break;case"edit":yn(ce);break;case"priority":qt(ce);break;case"risk":vn(ce);break}Vt(ye=>({...ye,visible:!1}))},[gt,jt]),Zt=y.useCallback(te=>{if(ct===null)return;const ce=_e[ct];if(!ce)return;const ye=ce.id??String(ct);z(it=>[...it.filter(kt=>kt.blockId!==ye),{blockId:ye,originalContent:ce.content,editedContent:te}]);const Te=m.split(`
673
- `),Me=ce.content.split(`
674
- `),Ue=te.split(`
675
- `);Te.splice(ce.startLine,Me.length,...Ue),p(Te.join(`
676
- `)),yn(null)},[ct,_e,m]),Nn=te=>{F(ce=>{const ye=new Set(ce);return ye.has(te)?ye.delete(te):ye.add(te),ye})},Ds=y.useMemo(()=>{const te=new Map;for(const ce of w)!ce.sectionId||ce.sectionId==="global"||(te.has(ce.sectionId)||te.set(ce.sectionId,[]),te.get(ce.sectionId).push(ce));return te},[w]),Ls=y.useMemo(()=>{if(!Qe.trim())return w;const te=Qe.toLowerCase();return w.filter(ce=>ce.text.toLowerCase().includes(te)||ce.type.toLowerCase().includes(te))},[w,Qe]),Ur=Ls.filter(te=>te.sectionId==="global"),ka=y.useMemo(()=>{const te=new Map;for(const ce of Ls)!ce.sectionId||ce.sectionId==="global"||(te.has(ce.sectionId)||te.set(ce.sectionId,[]),te.get(ce.sectionId).push(ce));return te},[Ls]);y.useEffect(()=>{function te(ce){const ye=ce.target,Te=ye.tagName==="TEXTAREA"||ye.tagName==="INPUT"||ye.tagName==="SELECT"||ye.contentEditable==="true";if(ce.key==="Escape"){if(Ae){Pe(!1);return}if(ue){ve(!1);return}if(gt.visible){Vt(Me=>({...Me,visible:!1}));return}if(et!==null){qt(null);return}if(Ve!==null){vn(null);return}if(ct!==null){yn(null);return}return}if((ce.metaKey||ce.ctrlKey)&&ce.key==="Enter"){if(Te)return;ce.preventDefault(),Ce("allow");return}if(!(Te||oe))switch(ce.key){case"?":ce.preventDefault(),Pe(Me=>!Me);break;case"j":ce.preventDefault(),rr(Me=>{const Ue=(Me??-1)+1;return Ue<_e.length?Ue:Me});break;case"k":ce.preventDefault(),rr(Me=>{const Ue=(Me??1)-1;return Ue>=0?Ue:Me});break;case"a":case"A":ce.preventDefault(),ke({visible:!0,title:"Add Global Comment",sectionIdx:null,type:"global_comment"});break;case"c":Rt!==null&&(ce.preventDefault(),ke({visible:!0,title:"Add Comment",sectionIdx:Rt,type:"comment"}));break;case"d":ce.preventDefault(),Ce("deny");break;case"e":Rt!==null&&(ce.preventDefault(),yn(Rt));break;case"i":ce.preventDefault(),Yt(Me=>Me==="instructions"?"notes":"instructions");break;case"p":Rt!==null&&(ce.preventDefault(),qt(Me=>Me===Rt?null:Rt),vn(null));break;case"r":Rt!==null&&(ce.preventDefault(),vn(Me=>Me===Rt?null:Rt),qt(null));break}}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[Ae,ue,gt.visible,et,Ve,ct,oe,Rt,_e.length,Ce]);const Br=y.useCallback((te,ce)=>{var Te;if(et===null)return;const ye=((Te=_e[et])==null?void 0:Te.id)??String(et);q(Me=>[...Me.filter(Ue=>Ue.sectionId!==ye),{sectionId:ye,priority:te,note:ce}]),qt(null)},[et,_e]),Ws=y.useCallback(()=>{var ce;if(et===null)return;const te=((ce=_e[et])==null?void 0:ce.id)??String(et);q(ye=>ye.filter(Te=>Te.sectionId!==te)),qt(null)},[et,_e]),ir=y.useCallback((te,ce)=>{var Te;if(Ve===null)return;const ye=((Te=_e[Ve])==null?void 0:Te.id)??String(Ve);U(Me=>[...Me.filter(Ue=>Ue.sectionId!==ye),{sectionId:ye,level:te,description:ce}]),vn(null)},[Ve,_e]),Sn=y.useCallback(()=>{var ce;if(Ve===null)return;const te=((ce=_e[Ve])==null?void 0:ce.id)??String(Ve);U(ye=>ye.filter(Te=>Te.sectionId!==te)),vn(null)},[Ve,_e]),ws=y.useCallback((te,ce,ye)=>{Q(Te=>[...Te,{id:crypto.randomUUID(),sectionId:te,instruction:ce,priority:ye,createdAt:Date.now()}])},[]),zs=y.useCallback(te=>{Q(ce=>ce.filter(ye=>ye.id!==te))},[]),Is=y.useCallback(async()=>{try{await navigator.clipboard.writeText(window.location.href)}catch{const te=document.createElement("textarea");te.value=window.location.href,te.style.position="fixed",te.style.opacity="0",document.body.appendChild(te),te.select(),document.execCommand("copy"),document.body.removeChild(te)}cn(!0),setTimeout(()=>cn(!1),2e3)},[]),tn=y.useCallback(async()=>{if(!(!r&&!a))try{const te={annotations:w,inlineEdits:R,priorities:P,risks:$,instructions:B};r?await Ab(r,te,ee??void 0):a&&await _f(a,te),un(!0),setTimeout(()=>un(!1),2e3)}catch{}},[r,a,w,R,P,$,B,ee]);return g?n.jsx("div",{className:"flex justify-center items-center h-full",children:n.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-accent border-t-transparent rounded-full"})}):N?n.jsx("div",{className:"p-8 max-w-3xl mx-auto",children:n.jsx("div",{className:"p-6 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400",children:N})}):n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col",children:[n.jsxs("div",{className:"sticky top-0 z-10 bg-surface-0 border-b border-border-subtle px-6 py-3 flex items-center gap-3",children:[n.jsx("button",{onClick:()=>l(-1),className:"p-1.5 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Back",children:n.jsx(eo,{size:18})}),n.jsx(Fl,{size:20,className:"text-accent flex-shrink-0"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary truncate flex-1",children:(d==null?void 0:d.title)??"Plan Review"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:Is,className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Copy link",children:ot?n.jsx(bn,{size:16,className:"text-emerald-400"}):n.jsx(ck,{size:16})}),(r||a)&&n.jsx("button",{onClick:tn,className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Save snapshot",children:jn?n.jsx(bn,{size:16,className:"text-emerald-400"}):n.jsx(np,{size:16})}),n.jsx("button",{onClick:()=>ve(!0),className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Export",children:n.jsx(to,{size:16})}),n.jsx("button",{onClick:()=>Pe(!0),className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors",title:"Keyboard shortcuts (?)",children:n.jsx("span",{className:"text-xs font-mono",children:"?"})})]})]}),C&&n.jsxs("div",{className:`mx-6 mt-6 rounded-xl border px-5 py-4 flex items-center gap-4 ${C.behavior==="allow"?"bg-emerald-500/10 border-emerald-500/20":"bg-red-500/10 border-red-500/20"}`,children:[C.behavior==="allow"?n.jsx("div",{className:"w-10 h-10 rounded-full bg-emerald-500/20 flex items-center justify-center shrink-0",children:n.jsx(bn,{size:20,className:"text-emerald-400"})}):n.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center shrink-0",children:n.jsx(ln,{size:20,className:"text-red-400"})}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-sm font-semibold text-text-primary",children:C.behavior==="allow"?"Plan Approved":"Changes Requested"}),C.feedback&&n.jsx("p",{className:"text-xs text-text-secondary mt-0.5 line-clamp-2",children:C.feedback}),C.clearContext&&n.jsx("p",{className:"text-[10px] text-accent mt-1",children:"Context will be cleared"})]})]}),S&&n.jsx("div",{className:"px-6 pt-6 w-full",children:n.jsx(OD,{score:S,isAiScore:S.isAiScore,aiModel:S.aiModel,aiScoreLoading:G,onRequestAiScore:Se,aiScoringAvailable:H})}),n.jsx("div",{className:"py-6 px-6 flex-1 w-full",onMouseUp:$t,onMouseDown:Ns,children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-2xl shadow-lg p-8 md:p-10 space-y-1",children:[_e.map((te,ce)=>{const ye=D.has(ce),Te=Ds.get(te.id)??[],Me=Rt===ce,Ue=ct===ce,it=P.find(Gt=>Gt.sectionId===te.id),kt=$.find(Gt=>Gt.sectionId===te.id),Fe=Te.length>0?Te[0].type:null,_a=Fe?Um[Fe]:"";return n.jsxs("div",{"data-section-idx":ce,className:`relative group rounded-lg transition-colors duration-150 ${Me?"bg-accent/5 ring-1 ring-accent/30":""} ${_a?`border-l-[3px] ${_a} pl-3`:""}`,onContextMenu:Gt=>Sa(Gt,ce),children:[n.jsxs("div",{className:"flex items-center gap-2 cursor-pointer py-1 hover:bg-surface-2/50 rounded -mx-2 px-2",onClick:()=>Nn(ce),children:[ye?n.jsx(wa,{size:16,className:"text-text-muted"}):n.jsx(Pn,{size:16,className:"text-text-muted"}),n.jsx("span",{className:`font-semibold text-text-primary ${te.level<=2?"text-lg":"text-base"}`,children:te.title}),Te.length>0&&n.jsx("span",{className:"ml-2 px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-accent/20 text-accent",children:Te.length}),it&&n.jsx("span",{className:`ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium border ${it.priority==="must-have"?"bg-red-500/15 text-red-300 border-red-500/30":it.priority==="should-have"?"bg-amber-500/15 text-amber-300 border-amber-500/30":it.priority==="nice-to-have"?"bg-blue-500/15 text-blue-300 border-blue-500/30":"bg-surface-3 text-text-secondary border-border"}`,children:it.priority}),kt&&n.jsxs("span",{className:`ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium border ${kt.level==="high"?"bg-red-500/15 text-red-300 border-red-500/30":kt.level==="medium"?"bg-amber-500/15 text-amber-300 border-amber-500/30":"bg-green-500/15 text-green-300 border-green-500/30"}`,children:["risk: ",kt.level]}),n.jsx("button",{onClick:Gt=>{Gt.stopPropagation(),ke({visible:!0,title:"Add Comment",sectionIdx:ce,type:"comment"})},className:"ml-auto opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-surface-3",title:"Add annotation",children:n.jsx(Ti,{size:14,className:"text-text-muted"})})]}),!ye&&(Ue?n.jsx("div",{className:"pl-6",children:n.jsx(GD,{content:te.content,isCode:te.content.includes("```"),onCommit:Zt,onCancel:()=>yn(null)})}):n.jsx("div",{className:"md-render pl-6",children:n.jsx(Gl,{remarkPlugins:Mt,rehypePlugins:St,children:te.content.replace(/^#{1,6}\s+.+\n?/,"")})})),!ye&&Te.length>0&&!Ue&&n.jsx("div",{className:"ml-6 mt-2 space-y-2",children:Te.map(Gt=>n.jsxs("div",{className:`border-l-2 ${Um[Gt.type]} rounded-r-lg p-3 text-sm`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded border ${V1[Gt.type]}`,children:Gt.type}),n.jsx("span",{className:"text-[10px] text-text-muted",children:_p(Gt.createdAt)})]}),n.jsx("p",{className:"text-text-secondary whitespace-pre-wrap",children:Gt.text}),Gt.imagePaths&&Gt.imagePaths.length>0&&r&&n.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:Gt.imagePaths.map(($r,Mn)=>n.jsx("img",{src:Ci($r,r),className:"w-16 h-16 object-cover rounded-lg border border-border cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>Xe(Ci($r,r)),alt:""},Mn))})]},Gt.id))})]},ce)}),_e.length===0&&m&&n.jsx("div",{className:"md-render",children:n.jsx(Gl,{remarkPlugins:Mt,rehypePlugins:St,children:m})})]})}),(r||a)&&!C&&n.jsxs("div",{className:"sticky bottom-0 bg-surface-0 border-t border-border-subtle",children:[Z&&n.jsxs("div",{className:"px-6 py-2 bg-red-500/10 border-b border-red-500/20 flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-red-400",children:Z}),n.jsx("button",{onClick:()=>Y(null),className:"text-red-400 hover:text-red-300 transition-colors",children:n.jsx(ln,{size:14})})]}),n.jsxs("div",{className:"px-6 py-4 flex items-center justify-between",children:[n.jsxs("div",{className:"text-sm text-text-muted flex items-center gap-3",children:[w.length>0&&n.jsxs("span",{children:[w.length," annotation(s)"]}),P.length>0&&n.jsxs("span",{children:[P.length," priorities"]}),$.length>0&&n.jsxs("span",{children:[$.length," risks"]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] text-text-muted hidden sm:inline",children:[n.jsxs("kbd",{className:"bg-surface-3 px-1.5 py-0.5 rounded font-mono",children:["⌘"," Enter"]})," approve"]}),n.jsxs("button",{onClick:()=>Ce("deny"),disabled:_,className:"px-4 py-2 rounded-lg border border-red-500/30 text-red-400 hover:bg-red-500/10 text-sm font-medium transition-colors disabled:opacity-50",children:[n.jsx(ln,{size:14,className:"inline mr-1"}),"Request Changes"]}),n.jsxs("button",{onClick:()=>Ce("allow"),disabled:_,className:"px-4 py-2 rounded-lg bg-emerald-600 text-white hover:bg-emerald-500 text-sm font-medium transition-colors disabled:opacity-50",children:[n.jsx(bn,{size:14,className:"inline mr-1"}),"Approve"]}),n.jsxs("button",{onClick:()=>Ce("allow",!0),disabled:_,className:"px-4 py-2 rounded-lg bg-accent text-white hover:brightness-110 text-sm font-medium transition-all disabled:opacity-50",title:"Approve and clear Claude's context window",children:[n.jsx(bn,{size:14,className:"inline mr-1"}),"Approve + Clear"]})]})]})]})]}),n.jsxs("aside",{className:"w-80 border-l border-border-subtle bg-surface-1 overflow-y-auto flex-shrink-0 flex flex-col",children:[n.jsx("div",{className:"flex border-b border-border-subtle",children:["notes","instructions","versions"].map(te=>n.jsx("button",{onClick:()=>Yt(te),className:`flex-1 px-3 py-2.5 text-xs font-semibold uppercase tracking-wider transition-colors ${At===te?"text-accent border-b-2 border-accent":"text-text-muted hover:text-text-primary"}`,children:te==="notes"?`Notes (${w.length})`:te==="instructions"?`Instr (${B.length})`:`Vers (${Os.length})`},te))}),At==="notes"&&n.jsx(nL,{annotations:w,filteredAnnotations:Ls,filteredGlobal:Ur,filteredSectionGroups:ka,annotationFilter:Qe,setAnnotationFilter:lt,sections:_e,sessionId:r,priorities:P,risks:$,onRemoveAnnotation:te=>j(ce=>ce.filter(ye=>ye.id!==te)),onAddGlobalComment:()=>ke({visible:!0,title:"Add Global Comment",sectionIdx:null,type:"global_comment"}),onImageClick:Xe}),At==="instructions"&&n.jsx(sL,{instructions:B,sections:_e,onAdd:ws,onDelete:zs}),At==="versions"&&n.jsx(rL,{versions:Os})]}),n.jsx(zD,{visible:re,rect:je,onAction:ja}),oe&&n.jsx(Y1,{visible:oe.visible,title:oe.title,placeholder:oe.selectedText?`Commenting on: "${oe.selectedText.slice(0,80)}..."`:"Enter your comment...",sessionId:r??void 0,onSubmit:Xt,onCancel:()=>ke(null)}),he&&n.jsx(HD,{src:he,onClose:()=>Xe(null)}),T&&n.jsx(QD,{isOpen:!0,actionName:T.behavior==="allow"?T.clearContext?"Approve + Clear Context":"Approve":"Request Changes",variant:T.behavior==="allow"?"approve":"deny",summary:De(),onConfirm:qe,onCancel:()=>L(null)}),n.jsx(qD,{visible:gt.visible,x:gt.x,y:gt.y,mode:gt.mode,onAction:os,onClose:()=>Vt(te=>({...te,visible:!1}))}),n.jsx(VD,{visible:ue,title:(d==null?void 0:d.title)??"Plan Review",markdown:m,annotations:w,priorities:P,risks:$,sections:_e,onClose:()=>ve(!1),defaultFormat:Qs}),Ae&&n.jsx(ZD,{onClose:()=>Pe(!1)}),n.jsx(JD,{visible:et!==null,sectionTitle:et!==null?((lr=_e[et])==null?void 0:lr.title)??"":"",currentLevel:et!==null?(Us=P.find(te=>{var ce;return te.sectionId===(((ce=_e[et])==null?void 0:ce.id)??String(et))}))==null?void 0:Us.priority:void 0,currentReason:et!==null?(cs=P.find(te=>{var ce;return te.sectionId===(((ce=_e[et])==null?void 0:ce.id)??String(et))}))==null?void 0:cs.note:void 0,onSubmit:Br,onRemove:Ws,onClose:()=>qt(null)}),n.jsx(tL,{visible:Ve!==null,sectionTitle:Ve!==null?((ge=_e[Ve])==null?void 0:ge.title)??"":"",currentLevel:Ve!==null?(Ie=$.find(te=>{var ce;return te.sectionId===(((ce=_e[Ve])==null?void 0:ce.id)??String(Ve))}))==null?void 0:Ie.level:void 0,currentDescription:Ve!==null?(st=$.find(te=>{var ce;return te.sectionId===(((ce=_e[Ve])==null?void 0:ce.id)??String(Ve))}))==null?void 0:st.description:void 0,onSubmit:ir,onRemove:Sn,onClose:()=>vn(null)})]})}function nL({annotations:e,filteredAnnotations:a,filteredGlobal:r,filteredSectionGroups:l,annotationFilter:o,setAnnotationFilter:u,sections:d,sessionId:f,priorities:m,risks:p,onRemoveAnnotation:g,onAddGlobalComment:b,onImageClick:N}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"p-4 border-b border-border-subtle flex items-center justify-between",children:[n.jsx("h2",{className:"text-sm font-semibold text-text-primary",children:"Annotations"}),n.jsxs("button",{onClick:b,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-xs font-medium text-accent hover:bg-accent/10 transition-colors",title:"Add global comment",children:[n.jsx(Cs,{size:12})," Add"]})]}),e.length>0&&n.jsx("div",{className:"px-4 py-2 border-b border-border-subtle",children:n.jsxs("div",{className:"relative",children:[n.jsx(ks,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted"}),n.jsx("input",{type:"text",placeholder:"Filter annotations...",value:o,onChange:v=>u(v.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface-2 border border-border-subtle rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:a.length===0&&m.length===0&&p.length===0?n.jsxs("div",{className:"p-6 text-center",children:[n.jsx(Ti,{size:32,className:"mx-auto text-text-muted mb-2"}),n.jsx("p",{className:"text-sm text-text-muted",children:"No annotations yet"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Select text or right-click on sections to add annotations"})]}):n.jsxs("div",{className:"pb-2",children:[r.length>0&&n.jsxs("div",{className:"px-3 pt-3 pb-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-2",children:"Global Comments"}),n.jsx("div",{className:"space-y-2",children:r.map(v=>n.jsx(e0,{ann:v,sessionId:f,onRemove:g,onImageClick:N},v.id))})]}),Array.from(l.entries()).map(([v,w])=>{var j;return n.jsxs("div",{className:"px-3 pt-3 pb-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-2 truncate",children:((j=d.find(S=>S.id===v))==null?void 0:j.title)??v}),n.jsx("div",{className:"space-y-2",children:w.map(S=>n.jsx(e0,{ann:S,sessionId:f,onRemove:g,onImageClick:N},S.id))})]},v)}),m.length>0&&n.jsxs("div",{className:"px-3 pt-3 pb-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-2",children:"Priorities"}),n.jsx("div",{className:"space-y-2",children:m.map(v=>{var S;const w=((S=d.find(k=>k.id===v.sectionId))==null?void 0:S.title)??v.sectionId,j=v.priority==="must-have"?"bg-red-500/15 text-red-300 border-red-500/30":v.priority==="should-have"?"bg-amber-500/15 text-amber-300 border-amber-500/30":v.priority==="nice-to-have"?"bg-blue-500/15 text-blue-300 border-blue-500/30":"bg-surface-3 text-text-secondary border-border";return n.jsxs("div",{className:"bg-surface-2/50 rounded-xl p-3 border-l-[3px] border-l-amber-400",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-sm text-text-secondary truncate",children:w}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${j}`,children:v.priority})]}),v.note&&n.jsx("p",{className:"text-xs text-text-muted mt-1",children:v.note})]},v.sectionId)})})]}),p.length>0&&n.jsxs("div",{className:"px-3 pt-3 pb-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-2",children:"Risks"}),n.jsx("div",{className:"space-y-2",children:p.map(v=>{var S;const w=((S=d.find(k=>k.id===v.sectionId))==null?void 0:S.title)??v.sectionId,j=v.level==="high"?"bg-red-500/15 text-red-300 border-red-500/30":v.level==="medium"?"bg-amber-500/15 text-amber-300 border-amber-500/30":"bg-green-500/15 text-green-300 border-green-500/30";return n.jsxs("div",{className:"bg-surface-2/50 rounded-xl p-3 border-l-[3px] border-l-red-400",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-sm text-text-secondary truncate",children:w}),n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${j}`,children:v.level})]}),v.description&&n.jsx("p",{className:"text-xs text-text-muted mt-1",children:v.description})]},v.sectionId)})})]})]})})]})}function sL({instructions:e,sections:a,onAdd:r,onDelete:l}){const[o,u]=y.useState(null),d=y.useMemo(()=>{const f=new Map;for(const m of e){const p=f.get(m.sectionId)??[];p.push(m),f.set(m.sectionId,p)}return f},[e]);return n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[a.map((f,m)=>{const p=d.get(f.id)??[];return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h4",{className:"text-xs font-medium text-text-muted uppercase tracking-wider truncate",children:f.title}),n.jsx("button",{className:"w-6 h-6 flex items-center justify-center border border-border rounded text-sm text-text-muted hover:bg-accent hover:border-accent hover:text-white transition-colors",onClick:()=>u(o===m?null:m),title:"Add instruction",children:o===m?"-":"+"})]}),o===m&&n.jsx(aL,{sectionId:f.id,onSubmit:(g,b,N)=>{r(g,b,N),u(null)},onCancel:()=>u(null)}),p.length>0&&n.jsx("div",{className:"space-y-2",children:p.map(g=>n.jsxs("div",{className:"bg-surface-2/50 border border-border rounded-lg p-3",children:[n.jsx("p",{className:"text-sm text-text-secondary leading-relaxed",children:g.instruction}),n.jsxs("div",{className:"flex items-center justify-between mt-2 pt-2 border-t border-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[g.priority&&n.jsx("span",{className:`inline-flex px-2 py-0.5 rounded-full text-xs font-medium border ${g.priority==="must"?"text-red-300 bg-red-500/15 border-red-500/30":g.priority==="should"?"text-amber-300 bg-amber-500/15 border-amber-500/30":"text-text-muted bg-surface-3 border-border"}`,children:g.priority}),n.jsx("span",{className:"text-[10px] text-text-muted",children:_p(g.createdAt)})]}),n.jsx("button",{onClick:()=>l(g.id),className:"text-text-muted hover:text-red-400 transition-colors",title:"Delete",children:n.jsx(sr,{size:12})})]})]},g.id))})]},f.id)}),e.length===0&&n.jsxs("div",{className:"text-center py-8",children:[n.jsx("p",{className:"text-sm text-text-muted",children:"No instructions yet"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Click + on a section to add implementation directives"})]})]})}function aL({sectionId:e,onSubmit:a,onCancel:r}){const[l,o]=y.useState(""),[u,d]=y.useState("");return n.jsxs("div",{className:"bg-surface-2/50 border border-border rounded-lg p-3 space-y-3",children:[n.jsx("textarea",{className:"w-full min-h-16 p-2.5 text-sm bg-surface-3 border border-border rounded-md text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent resize-y transition-colors",value:l,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),l.trim()&&a(e,l.trim(),u||void 0)),f.key==="Escape"&&r()},placeholder:"Enter instruction...",rows:3,autoFocus:!0}),n.jsxs("select",{className:"w-full p-2 text-sm bg-surface-3 border border-border rounded-md text-text-secondary focus:outline-none focus:border-accent",value:u,onChange:f=>d(f.target.value),children:[n.jsx("option",{value:"",children:"No priority"}),n.jsx("option",{value:"must",children:"Must"}),n.jsx("option",{value:"should",children:"Should"}),n.jsx("option",{value:"nice-to-have",children:"Nice to have"})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsx("button",{className:"px-3 py-1.5 text-sm border border-border text-text-secondary rounded-md hover:bg-surface-3 transition-colors",onClick:r,children:"Cancel"}),n.jsx("button",{className:"px-3 py-1.5 text-sm bg-accent text-white rounded-md hover:brightness-110 disabled:opacity-40 transition-all",onClick:()=>{l.trim()&&a(e,l.trim(),u||void 0)},disabled:!l.trim(),children:"Add"})]})]})}function rL({versions:e}){const[a,r]=y.useState(null);if(e.length===0)return n.jsxs("div",{className:"p-6 text-center",children:[n.jsx("p",{className:"text-sm text-text-muted",children:"No versions available"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Versions are saved when decisions are made"})]});const l=(o,u)=>{const d=o.split(`
677
- `),f=u.split(`
678
- `);Math.max(d.length,f.length);const m=[],p=new Set(d),g=new Set(f);for(const b of d)g.has(b)||m.push({type:"remove",text:b});for(const b of f)p.has(b)||m.push({type:"add",text:b});return m.length===0?n.jsx("p",{className:"text-xs text-text-muted italic p-2",children:"No changes between versions"}):n.jsxs("div",{className:"bg-surface-3 rounded-lg p-2 max-h-48 overflow-y-auto text-[11px] font-mono",children:[m.slice(0,50).map((b,N)=>n.jsxs("div",{className:b.type==="add"?"text-green-400":b.type==="remove"?"text-red-400":"text-text-muted",children:[b.type==="add"?"+":"-"," ",b.text]},N)),m.length>50&&n.jsxs("p",{className:"text-text-muted mt-1",children:["... ",m.length-50," more lines"]})]})};return n.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map((o,u)=>{var d,f;return n.jsxs("div",{className:"bg-surface-2/50 border border-border rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-sm font-medium text-text-primary",children:["v",u+1]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u>0&&o.content&&((d=e[u-1])==null?void 0:d.content)&&n.jsx("button",{onClick:()=>r(a&&a[1]===u?null:[u-1,u]),className:`px-1.5 py-0.5 rounded text-[10px] font-medium transition-colors ${a&&a[1]===u?"bg-accent/20 text-accent":"text-text-muted hover:text-text-primary hover:bg-surface-3"}`,title:`Compare v${u} → v${u+1}`,children:"diff"}),o.decision&&n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${o.decision.behavior==="allow"?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:o.decision.behavior==="allow"?"Approved":"Denied"})]})]}),o.createdAt&&n.jsx("p",{className:"text-xs text-text-muted mt-1",children:new Date(o.createdAt).toLocaleString()}),a&&a[1]===u&&((f=e[a[0]])==null?void 0:f.content)&&o.content&&n.jsxs("div",{className:"mt-2 pt-2 border-t border-border-subtle",children:[n.jsxs("p",{className:"text-[10px] text-text-muted mb-1 font-semibold",children:["Changes from v",a[0]+1," → v",a[1]+1]}),l(e[a[0]].content,o.content)]})]},u)})})}function e0({ann:e,sessionId:a,onRemove:r,onImageClick:l}){return n.jsxs("div",{className:`border-l-2 ${Um[e.type]} rounded-r-lg p-3 group`,children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded border ${V1[e.type]}`,children:e.type}),n.jsx("span",{className:"text-[10px] text-text-muted",children:_p(e.createdAt)})]}),n.jsx("button",{onClick:()=>r(e.id),className:"text-text-muted hover:text-red-400 text-xs transition-colors opacity-0 group-hover:opacity-100",children:n.jsx(sr,{size:12})})]}),n.jsx("p",{className:"text-sm text-text-secondary mt-1 whitespace-pre-wrap",children:e.text}),e.imagePaths&&e.imagePaths.length>0&&a&&n.jsx("div",{className:"flex gap-1.5 mt-2 flex-wrap",children:e.imagePaths.map((o,u)=>n.jsx("img",{src:Ci(o,a),className:"w-12 h-12 object-cover rounded border border-border cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>l(Ci(o,a)),alt:""},u))})]})}function iL(e){const a=e.split(`
679
- `),r=[];let l=0,o=0;for(const u of a)if(u.startsWith("diff --git")||u.startsWith("index ")||u.startsWith("---")||u.startsWith("+++"))r.push({type:"header",content:u,oldLineNumber:null,newLineNumber:null});else if(u.startsWith("@@")){const d=u.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);d&&(l=parseInt(d[1]??"0",10),o=parseInt(d[2]??"0",10)),r.push({type:"hunk",content:u,oldLineNumber:null,newLineNumber:null})}else if(u.startsWith("+"))r.push({type:"added",content:u.slice(1),oldLineNumber:null,newLineNumber:o}),o++;else if(u.startsWith("-"))r.push({type:"removed",content:u.slice(1),oldLineNumber:l,newLineNumber:null}),l++;else if(u.startsWith("\\"))r.push({type:"meta",content:u,oldLineNumber:null,newLineNumber:null});else{const d=u.startsWith(" ")?u.slice(1):u;r.push({type:"context",content:d,oldLineNumber:l,newLineNumber:o}),l++,o++}return r}function tu({num:e,onClick:a,hasAnnotation:r}){return n.jsx("td",{onClick:a,className:`select-none text-right pr-2 pl-1 text-xs w-10 align-top
680
- ${e!=null?"cursor-pointer hover:bg-accent/15":""}
681
- ${r?"bg-amber-500/20":"text-text-muted"}`,children:e??""})}function Hc(e){switch(e){case"added":return"bg-green-950/40";case"removed":return"bg-red-950/40";case"hunk":return"bg-blue-950/30";case"header":case"meta":return"bg-surface-2";default:return""}}function qc(e){switch(e){case"added":return"text-green-300";case"removed":return"text-red-300";case"hunk":return"text-blue-400 font-medium";case"header":case"meta":return"text-text-muted italic";default:return""}}function Bm(e){switch(e){case"added":return"+";case"removed":return"-";default:return" "}}function lL({lines:e,annotations:a,onAnnotate:r}){const l=y.useMemo(()=>{const o=new Map;for(const u of a){const d=o.get(u.line)??[];d.push(u),o.set(u.line,d)}return o},[a]);return n.jsx("table",{className:"w-full text-xs font-mono border-collapse",children:n.jsx("tbody",{children:e.map((o,u)=>{const d=o.newLineNumber??o.oldLineNumber,f=d!=null?l.get(d):void 0;return n.jsxs("tr",{className:Hc(o.type),children:[n.jsx(tu,{num:o.oldLineNumber}),n.jsx(tu,{num:o.newLineNumber,onClick:d!=null?()=>r(d):void 0,hasAnnotation:f!=null&&f.length>0}),n.jsx("td",{className:`px-2 whitespace-pre-wrap break-all ${qc(o.type)}`,children:o.type==="hunk"||o.type==="header"||o.type==="meta"?o.content:`${Bm(o.type)}${o.content}`})]},u)})})})}function oL(e){const a=[],r=[],l=[];function o(){const u=Math.max(r.length,l.length);for(let d=0;d<u;d++)a.push({left:r[d]??null,right:l[d]??null});r.length=0,l.length=0}for(const u of e)u.type==="removed"?r.push(u):u.type==="added"?l.push(u):(o(),u.type==="context"?a.push({left:u,right:u}):a.push({left:null,right:null,spanning:u}));return o(),a}function cL({lines:e,annotations:a,onAnnotate:r}){const l=y.useMemo(()=>oL(e),[e]),o=y.useMemo(()=>{const u=new Map;for(const d of a){const f=u.get(d.line)??[];f.push(d),u.set(d.line,f)}return u},[a]);return n.jsx("table",{className:"w-full text-xs font-mono border-collapse",children:n.jsx("tbody",{children:l.map((u,d)=>{var g,b;if(u.spanning)return n.jsx("tr",{className:Hc(u.spanning.type),children:n.jsx("td",{colSpan:4,className:`px-2 py-0.5 ${qc(u.spanning.type)}`,children:u.spanning.content})},d);const f=((g=u.left)==null?void 0:g.oldLineNumber)??null,m=((b=u.right)==null?void 0:b.newLineNumber)??null,p=m!=null?o.get(m):void 0;return n.jsxs("tr",{children:[n.jsx(tu,{num:f}),n.jsx("td",{className:`px-2 whitespace-pre-wrap break-all w-1/2 border-r border-border ${u.left?`${Hc(u.left.type)} ${qc(u.left.type)}`:""}`,children:u.left?`${Bm(u.left.type)}${u.left.content}`:""}),n.jsx(tu,{num:m,onClick:m!=null?()=>r(m):void 0,hasAnnotation:p!=null&&p.length>0}),n.jsx("td",{className:`px-2 whitespace-pre-wrap break-all w-1/2 ${u.right?`${Hc(u.right.type)} ${qc(u.right.type)}`:""}`,children:u.right?`${Bm(u.right.type)}${u.right.content}`:""})]},d)})})})}function uL({diff:e,viewMode:a,annotations:r,onAnnotate:l}){const o=y.useMemo(()=>iL(e),[e]);return e.trim()?n.jsx("div",{className:"overflow-x-auto",children:a==="unified"?n.jsx(lL,{lines:o,annotations:r,onAnnotate:l}):n.jsx(cL,{lines:o,annotations:r,onAnnotate:l})}):n.jsx("div",{className:"flex items-center justify-center h-full text-text-muted text-sm",children:"No diff to display"})}function dL(e){const a=[];if(!e.trim())return a;const r=e.split(/(?=^diff --git)/m);for(const l of r){if(!l.trim())continue;const o=l.match(/^diff --git a\/.+ b\/(.+)/m);if(!o)continue;const u=o[1]??"";let d="modified";l.includes("new file mode")?d="added":l.includes("deleted file mode")?d="deleted":l.includes("rename from")&&(d="renamed");let f=0,m=0;for(const p of l.split(`
682
- `))p.startsWith("+")&&!p.startsWith("+++")?f++:p.startsWith("-")&&!p.startsWith("---")&&m++;a.push({path:u,status:d,additions:f,deletions:m,diff:l})}return a}function fL(e){switch(e){case"added":return"+";case"deleted":return"-";case"renamed":return"R";case"modified":default:return"M"}}function mL(e){switch(e){case"added":return"text-green-400";case"deleted":return"text-red-400";case"renamed":return"text-blue-400";case"modified":default:return"text-yellow-400"}}function t0(e){const a=e.split("/");return a[a.length-1]??e}function pL(e){const a=e.split("/");return a.length<=1?"":a.slice(0,-1).join("/")+"/"}function hL(e){switch(e){case"comment":return"border-l-blue-400";case"suggestion":return"border-l-violet-400";case"concern":return"border-l-amber-400";case"question":return"border-l-cyan-400";case"instruction":return"border-l-orange-400";default:return"border-l-surface-4"}}function X1(e){switch(e){case"comment":return"bg-blue-500/10 text-blue-300";case"suggestion":return"bg-violet-500/10 text-violet-300";case"concern":return"bg-amber-500/10 text-amber-300";case"question":return"bg-cyan-500/10 text-cyan-300";case"instruction":return"bg-orange-500/10 text-orange-300";default:return"bg-surface-3 text-text-secondary"}}function xL(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}const gL=[{key:"j",desc:"Next file"},{key:"k",desc:"Previous file"},{key:"u",desc:"Toggle unified/split"},{key:"a",desc:"Add global comment"},{key:"?",desc:"Toggle this overlay"},{key:"⌘ Enter",desc:"Approve"},{key:"⌘ Shift Enter",desc:"Request changes"},{key:"Esc",desc:"Close modal/overlay"}];function bL({onClose:e}){return n.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50 flex items-center justify-center",onClick:e,children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl shadow-2xl w-full max-w-sm mx-4 p-6",onClick:a=>a.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-semibold text-text-primary flex items-center gap-2",children:[n.jsx(tv,{size:16})," Keyboard Shortcuts"]}),n.jsx("button",{onClick:e,className:"text-text-muted hover:text-text-primary transition-colors",children:n.jsx(ln,{size:16})})]}),n.jsx("div",{className:"space-y-2",children:gL.map(a=>n.jsxs("div",{className:"flex items-center justify-between text-xs",children:[n.jsx("span",{className:"text-text-secondary",children:a.desc}),n.jsx("kbd",{className:"bg-surface-3 px-2 py-0.5 rounded text-text-primary font-mono",children:a.key})]},a.key))})]})})}const yL=[{value:"comment",label:"Comment"},{value:"suggestion",label:"Suggestion"},{value:"concern",label:"Concern"},{value:"question",label:"Question"}];function vL({line:e,type:a,onTypeChange:r,onSubmit:l,onCancel:o}){const[u,d]=y.useState(""),f=y.useRef(null);y.useEffect(()=>{setTimeout(()=>{var p;return(p=f.current)==null?void 0:p.focus()},50)},[]);const m=()=>{const p=u.trim();p&&(l(p),d(""))};return Ms.createPortal(n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center",onClick:o,children:n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl shadow-2xl w-full max-w-md mx-4",onClick:p=>p.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[n.jsxs("h3",{className:"text-sm font-semibold text-text-primary",children:["Add comment at line ",e]}),n.jsx("button",{className:"text-text-muted hover:text-text-primary transition-colors p-1 rounded hover:bg-surface-2",onClick:o,children:n.jsx(ln,{size:16})})]}),n.jsxs("div",{className:"p-5 space-y-3",children:[n.jsx("div",{className:"flex gap-1.5",children:yL.map(p=>n.jsx("button",{onClick:()=>r(p.value),className:`px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-colors ${a===p.value?`${X1(p.value)} ring-1 ring-accent border-transparent`:"border-border text-text-muted hover:bg-surface-3"}`,children:p.label},p.value))}),n.jsx("textarea",{ref:f,value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),m()),p.key==="Escape"&&o()},placeholder:"Describe the issue or suggestion...",rows:4,className:"w-full bg-surface-2 border border-border rounded-lg px-4 py-3 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent resize-none"})]}),n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-t border-border",children:[n.jsx("span",{className:"text-xs text-text-muted",children:"Shift+Enter for new line"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",onClick:o,children:"Cancel"}),n.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium bg-accent hover:brightness-110 text-white transition-all disabled:opacity-50",onClick:m,disabled:!u.trim(),children:"Submit"})]})]})]})}),document.body)}function NL({approved:e,commentCount:a,currentSessionId:r}){const l=Rs(),[o,u]=y.useState(null);return y.useEffect(()=>{Tr().then(d=>{const f=d.find(m=>m.status==="pending"&&m.id!==r);f&&u(f)}).catch(()=>{})},[r]),n.jsx("div",{className:"flex flex-col items-center justify-center h-full bg-surface-0 text-text-primary",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e?n.jsx("div",{className:"w-16 h-16 rounded-full bg-emerald-500/20 flex items-center justify-center",children:n.jsx(bn,{size:32,className:"text-emerald-400"})}):n.jsx("div",{className:"w-16 h-16 rounded-full bg-amber-500/20 flex items-center justify-center",children:n.jsx(rs,{size:32,className:"text-amber-400"})}),n.jsx("h2",{className:"text-xl font-semibold text-text-primary",children:e?"Commit Approved":"Changes Requested"}),n.jsx("p",{className:"text-sm text-text-secondary",children:e?a>0?`Approved with ${a} comment${a!==1?"s":""} as guidance.`:"No issues found. The commit will proceed.":`${a} comment${a!==1?"s":""} sent back to the agent.`}),o?n.jsxs("button",{className:"mt-2 px-4 py-2 rounded-lg bg-accent text-white text-sm font-medium hover:brightness-110 transition-all",onClick:()=>{Ar(o.id).then(d=>{const f=d?`&token=${encodeURIComponent(d)}`:"",m=o.type==="code"?`/review/code?session=${encodeURIComponent(o.id)}${f}`:`/review/plan?session=${encodeURIComponent(o.id)}${f}`;l(m)}).catch(()=>{const d=o.type==="code"?`/review/code?session=${encodeURIComponent(o.id)}`:`/review/plan?session=${encodeURIComponent(o.id)}`;l(d)})},children:["Next Review: ",o.title??"Pending"]}):n.jsx("p",{className:"text-xs text-text-muted mt-2",children:"You can close this tab."})]})})}function wL(e){const a=Math.floor((Date.now()-e)/1e3);if(a<60)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function EL(){const[e]=Zl(),a=Rs(),r=e.get("session"),[l,o]=y.useState(null),[u,d]=y.useState(!0),[f,m]=y.useState(null),[p,g]=y.useState([]),[b,N]=y.useState(!0),[v,w]=y.useState(null),[j,S]=y.useState("unified"),[k,_]=y.useState([]),[M,Z]=y.useState(!1),[Y,C]=y.useState(null),[I,D]=y.useState(null),[F,R]=y.useState(!1),[z,P]=y.useState(null),[q,$]=y.useState(!1),[U,B]=y.useState(!1),[Q,ee]=y.useState(null);y.useEffect(()=>{Tr().then(g).catch(()=>{})},[]),y.useEffect(()=>{let oe=null,ke=null;function he(){try{oe=new EventSource(Wl("/api/review/hub/events"));const Xe=()=>{Tr().then(g).catch(()=>{})};oe.addEventListener("session-added",Xe),oe.addEventListener("session-decided",Qe=>{Xe();try{const lt=JSON.parse(Qe.data);if((lt==null?void 0:lt.id)===r&&!I){const At=lt.decision;At&&D({approved:At.behavior==="allow",commentCount:0})}}catch{}}),oe.addEventListener("session-updated",Xe),oe.onerror=()=>{oe==null||oe.close(),oe=null,ke=setTimeout(he,2e3)}}catch{}}return he(),()=>{oe==null||oe.close(),oe=null,ke&&clearTimeout(ke)}},[r,I]);const ie=p.filter(oe=>oe.type==="code"&&oe.status!=="decided"),T=p.filter(oe=>oe.type==="code"&&oe.status==="decided");y.useEffect(()=>{if(!r){d(!1);return}m(null),D(null),ee(null),_([]),o(null),d(!0),(async()=>{try{const oe=await U0(r);o(oe);let he=e.get("token")??oe.token??null;if(!he&&r)try{he=await Ar(r)}catch{}ee(he),oe.decision&&D({approved:oe.decision.behavior==="allow",commentCount:0})}catch(oe){m(oe instanceof Error?oe.message:"Failed to load")}finally{d(!1)}})()},[r,e]);const L=y.useMemo(()=>dL((l==null?void 0:l.diff)??""),[l==null?void 0:l.diff]);y.useEffect(()=>{w(null),_([])},[r]),y.useEffect(()=>{var oe;L.length>0&&!v&&w(((oe=L[0])==null?void 0:oe.path)??null)},[L,v]);const G=L.find(oe=>oe.path===v),O=y.useMemo(()=>k.filter(oe=>oe.file===v),[k,v]),H=y.useCallback(()=>{var ke;const oe=L.findIndex(he=>he.path===v);oe<L.length-1&&w(((ke=L[oe+1])==null?void 0:ke.path)??null)},[L,v]),V=y.useCallback(()=>{var ke;const oe=L.findIndex(he=>he.path===v);oe>0&&w(((ke=L[oe-1])==null?void 0:ke.path)??null)},[L,v]),re=y.useCallback(()=>{S(oe=>oe==="unified"?"split":"unified")},[]),xe=y.useCallback(oe=>{_(ke=>[...ke,oe])},[]),je=y.useCallback(oe=>{_(ke=>ke.filter(he=>he.id!==oe))},[]),Be=y.useCallback(async oe=>{if(!r)return;Z(!0);const ke=k.map(he=>({file:he.file,line:he.line,type:he.type,text:he.text}));C(null);try{await w2(r,{approved:oe==="approve",comments:ke},Q??void 0),D({approved:oe==="approve",commentCount:k.length})}catch(he){C(he instanceof Error?he.message:"Failed to submit decision")}finally{Z(!1)}},[r,k,Q]);y.useEffect(()=>{function oe(ke){const he=ke.target,Xe=he.tagName==="TEXTAREA"||he.tagName==="INPUT"||he.tagName==="SELECT"||he.contentEditable==="true";if(ke.key==="Escape"){if(z){ke.preventDefault(),P(null);return}if(q){ke.preventDefault(),$(!1);return}if(U){ke.preventDefault(),B(!1);return}if(F){ke.preventDefault(),R(!1);return}return}if((ke.metaKey||ke.ctrlKey)&&ke.key==="Enter"){if(z||q)return;ke.preventDefault(),ke.shiftKey?Be("reject"):Be("approve");return}if(!(Xe||z||q))switch(ke.key){case"?":ke.preventDefault(),B(Qe=>!Qe);break;case"a":case"A":ke.preventDefault(),$(!0);break;case"j":case"J":ke.preventDefault(),H();break;case"k":case"K":ke.preventDefault(),V();break;case"u":case"U":ke.preventDefault(),re();break}}return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[z,q,U,F,Be,H,V,re]);const we=y.useCallback(oe=>{P({line:oe,type:"comment"})},[]),Ye=y.useCallback(oe=>{z&&v&&xe({id:crypto.randomUUID(),file:v,line:z.line,type:z.type,text:oe,createdAt:Date.now()}),P(null)},[z,v,xe]),jt=y.useCallback(oe=>{xe({id:crypto.randomUUID(),file:"global",line:0,type:"comment",text:oe,createdAt:Date.now()}),$(!1)},[xe]),en=y.useMemo(()=>{const oe=new Map;for(const ke of k){const he=oe.get(ke.file)??[];he.push(ke),oe.set(ke.file,he)}return oe},[k]);return u?n.jsx("div",{className:"flex justify-center items-center h-full",children:n.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-accent border-t-transparent rounded-full"})}):f?n.jsx("div",{className:"p-8",children:n.jsx("div",{className:"p-6 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400",children:f})}):I?n.jsx(NL,{approved:I.approved,commentCount:I.commentCount,currentSessionId:r??void 0}):n.jsxs("div",{className:"flex h-full",children:[(ie.length>0||T.length>0)&&n.jsxs("aside",{className:"w-56 border-r border-border-subtle bg-surface-1 overflow-y-auto flex-shrink-0 flex flex-col",children:[n.jsxs("div",{className:"px-3 py-2 border-b border-border-subtle flex items-center gap-1.5",children:[n.jsx(gS,{size:14,className:"text-accent"}),n.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted flex-1",children:"Queue"}),ie.length>0&&n.jsx("span",{className:"bg-accent/20 text-accent text-[10px] font-bold px-1.5 py-0.5 rounded-full",children:ie.length})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[ie.length>0&&n.jsxs("div",{className:"px-2 py-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-1 px-1",children:"Pending"}),ie.map(oe=>n.jsxs("button",{onClick:()=>{Ar(oe.id).then(ke=>{const he=ke?`&token=${encodeURIComponent(ke)}`:"";a(`/review/code?session=${oe.id}${he}`)}).catch(()=>a(`/review/code?session=${oe.id}`))},className:`w-full text-left px-2 py-1.5 rounded-lg text-xs hover:bg-surface-2 transition-colors ${r===oe.id?"bg-accent/10 border-l-2 border-accent":""}`,children:[n.jsx("p",{className:"font-medium text-text-primary truncate",children:oe.title}),n.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 text-text-muted",children:[n.jsx(lu,{size:10}),n.jsx("span",{children:wL(oe.registeredAt)})]})]},oe.id))]}),T.length>0&&n.jsxs("div",{className:"px-2 py-1",children:[n.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-widest text-text-muted mb-1 px-1",children:"Recent"}),T.slice(0,5).map(oe=>{var ke;return n.jsxs("div",{className:"px-2 py-1 text-xs flex items-center gap-1.5",children:[((ke=oe.decision)==null?void 0:ke.behavior)==="allow"?n.jsx(bn,{size:12,className:"text-emerald-400"}):n.jsx(ln,{size:12,className:"text-red-400"}),n.jsx("span",{className:"flex-1 text-text-secondary truncate",children:oe.title})]},oe.id)})]})]})]}),n.jsxs("aside",{className:"w-64 border-r border-border-subtle bg-surface-1 overflow-y-auto flex-shrink-0",children:[n.jsx("div",{className:"px-3 py-2 border-b border-border-subtle",children:n.jsxs("h2",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:["Files (",L.length,")"]})}),L.length===0&&n.jsx("div",{className:"px-3 py-4 text-xs text-text-muted",children:"No files changed"}),n.jsx("ul",{className:"py-1",children:L.map(oe=>{const ke=oe.path===v;return n.jsx("li",{children:n.jsxs("button",{onClick:()=>w(oe.path),className:`w-full text-left px-3 py-1.5 flex items-start gap-2 text-xs hover:bg-surface-2 transition-colors ${ke?"bg-accent/10 border-l-2 border-accent":""}`,children:[n.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded text-[10px] font-bold shrink-0 mt-0.5 ${mL(oe.status)} bg-surface-3`,children:fL(oe.status)}),n.jsxs("span",{className:"flex-1 min-w-0 truncate",children:[n.jsx("span",{className:"text-text-muted",children:pL(oe.path)}),n.jsx("span",{className:"font-medium",children:t0(oe.path)})]}),n.jsxs("span",{className:"flex items-center gap-1 shrink-0",children:[oe.additions>0&&n.jsxs("span",{className:"text-green-400",children:["+",oe.additions]}),oe.deletions>0&&n.jsxs("span",{className:"text-red-400",children:["-",oe.deletions]})]})]})},oe.path)})})]}),n.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs("div",{className:"sticky top-0 z-10 bg-surface-0 border-b border-border-subtle px-6 py-3 flex items-center gap-3",children:[n.jsx(AS,{size:20,className:"text-emerald-400 flex-shrink-0"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary truncate",children:(l==null?void 0:l.title)??"Code Review"}),v&&n.jsx("p",{className:"text-xs text-text-muted truncate",children:v})]}),n.jsxs("div",{className:"flex items-center bg-surface-2 rounded-lg p-0.5 flex-shrink-0",children:[n.jsx("button",{onClick:()=>S("unified"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${j==="unified"?"bg-accent text-white":"text-text-secondary hover:text-text-primary"}`,children:"Unified"}),n.jsx("button",{onClick:()=>S("split"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${j==="split"?"bg-accent text-white":"text-text-secondary hover:text-text-primary"}`,children:"Split"})]})]}),(l==null?void 0:l.commitMessage)&&n.jsxs("div",{className:"border-b border-border-subtle",children:[n.jsxs("button",{onClick:()=>R(oe=>!oe),className:"w-full px-6 py-2 flex items-center gap-2 text-xs text-text-secondary hover:bg-surface-1 transition-colors",children:[F?n.jsx(Pn,{size:14}):n.jsx(wa,{size:14}),n.jsx("span",{className:"font-medium",children:"Commit Message"}),!F&&n.jsx("span",{className:"text-text-muted truncate flex-1 text-left",children:l.commitMessage.split(`
683
- `)[0]})]}),F&&n.jsx("div",{className:"px-6 pb-3",children:n.jsx("pre",{className:"bg-surface-2 border border-border-subtle rounded-lg px-4 py-3 text-xs text-text-secondary whitespace-pre-wrap font-mono",children:l.commitMessage})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:G?n.jsx(uL,{diff:G.diff,viewMode:j,annotations:O.map(oe=>({line:oe.line,type:oe.type,text:oe.text})),onAnnotate:we}):n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx("p",{className:"text-text-muted text-sm",children:"Select a file to view changes"})})}),r&&n.jsxs("div",{className:"sticky bottom-0 bg-surface-0 border-t border-border-subtle",children:[Y&&n.jsxs("div",{className:"px-6 py-2 bg-red-500/10 border-b border-red-500/20 flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-red-400",children:Y}),n.jsx("button",{onClick:()=>C(null),className:"text-red-400 hover:text-red-300 transition-colors",children:n.jsx(ln,{size:14})})]}),n.jsxs("div",{className:"px-6 py-3 flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-text-muted",children:[k.length," comment",k.length!==1?"s":""]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] text-text-muted hidden sm:inline",children:[n.jsxs("kbd",{className:"bg-surface-3 px-1.5 py-0.5 rounded font-mono",children:["⌘"," Enter"]})," to approve"]}),n.jsx("button",{onClick:()=>Be("reject"),disabled:M,className:"px-4 py-2 rounded-lg border border-red-500/30 text-red-400 hover:bg-red-500/10 text-xs font-medium transition-colors disabled:opacity-50",children:"Request Changes"}),n.jsxs("button",{onClick:()=>Be("approve"),disabled:M,className:"px-4 py-2 rounded-lg bg-emerald-600 text-white hover:bg-emerald-500 text-xs font-medium transition-colors disabled:opacity-50",children:[n.jsx(bn,{size:14,className:"inline mr-1"}),"Approve"]})]})]})]})]}),n.jsxs("aside",{className:"w-72 border-l border-border-subtle bg-surface-1 overflow-y-auto flex-shrink-0 flex flex-col",children:[n.jsxs("div",{className:"px-3 py-2 border-b border-border-subtle flex items-center justify-between",children:[n.jsxs("h2",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:["Comments"," ",k.length>0&&n.jsx("span",{className:"ml-1 inline-flex items-center justify-center w-5 h-5 rounded-full bg-accent/20 text-accent text-[10px] font-bold",children:k.length})]}),n.jsxs("button",{onClick:()=>$(!0),className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary transition-colors",title:"Add Global Comment (a)",children:[n.jsx(Cs,{size:12}),"Comment"]})]}),k.length===0?n.jsxs("div",{className:"px-3 py-6 text-center",children:[n.jsx(Ti,{size:28,className:"mx-auto text-text-muted mb-2"}),n.jsx("p",{className:"text-xs text-text-muted",children:"No comments yet"}),n.jsxs("p",{className:"text-[10px] text-text-muted mt-1",children:["Click a line number to comment on code,",n.jsx("br",{}),"or press ",n.jsx("kbd",{className:"bg-surface-3 px-1 rounded font-mono",children:"a"})," for general feedback."]})]}):n.jsx("div",{className:"py-1 flex-1 overflow-y-auto",children:[...en.entries()].map(([oe,ke])=>n.jsxs("div",{className:"mb-2",children:[n.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold text-text-secondary uppercase tracking-wider bg-surface-2",children:oe==="global"?"General":t0(oe)}),ke.map(he=>n.jsxs("div",{className:`px-3 py-2 border-b border-border-subtle border-l-[3px] ${hL(he.type)} hover:bg-surface-2 transition-colors group`,children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${X1(he.type)}`,children:he.type}),he.file!=="global"&&he.line>0&&n.jsxs("span",{className:"text-[10px] text-text-muted",children:["L",he.line]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-[10px] text-text-muted",children:xL(he.createdAt)}),n.jsx("button",{onClick:()=>je(he.id),className:"text-text-muted hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete",children:n.jsx(sr,{size:12})})]})]}),n.jsx("p",{className:"text-xs text-text-primary whitespace-pre-wrap",children:he.text})]},he.id))]},oe))})]}),z&&n.jsx(vL,{line:z.line,type:z.type,onTypeChange:oe=>P({...z,type:oe}),onSubmit:oe=>Ye(oe),onCancel:()=>P(null)}),n.jsx(Y1,{visible:q,title:"Add Global Comment",placeholder:"General feedback about this commit...",sessionId:r??void 0,onSubmit:oe=>jt(oe),onCancel:()=>$(!1)}),U&&n.jsx(bL,{onClose:()=>B(!1)})]})}function n0(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function s0({type:e}){return e==="plan"?n.jsx("span",{className:"bg-violet-500/15 text-violet-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Plan"}):n.jsx("span",{className:"bg-emerald-500/15 text-emerald-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Code"})}function jL({status:e}){switch(e){case"pending":return n.jsx("span",{className:"bg-amber-500/15 text-amber-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Pending"});case"active":case"reviewing":return n.jsx("span",{className:"bg-blue-500/15 text-blue-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Active"});case"decided":return n.jsx("span",{className:"bg-emerald-500/15 text-emerald-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Decided"});default:return n.jsx("span",{className:"bg-surface-3 text-text-muted rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:e})}}function SL({status:e}){switch(e){case"approved":return n.jsx("span",{className:"bg-emerald-500/15 text-emerald-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Approved"});case"denied":return n.jsx("span",{className:"bg-red-500/15 text-red-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Denied"});case"pending":return n.jsx("span",{className:"bg-amber-500/15 text-amber-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Pending"})}}function wi(e){return e.kind==="session"?e.data.registeredAt:new Date(e.data.updatedAt).getTime()}function a0(e){return e.kind==="session"?`session-${e.data.id}`:`plan-${e.data.slug}`}function r0(e){return e.kind==="session"?e.data.title||"Untitled review":e.data.title}function zc(e,a){if(e.kind==="session"){const r=e.data;Ar(r.id).then(l=>{const o=l?`&token=${encodeURIComponent(l)}`:"",u=r.type==="plan"?`/review/plan?session=${encodeURIComponent(r.id)}${o}`:`/review/code?session=${encodeURIComponent(r.id)}${o}`;a(u)}).catch(()=>{const l=r.type==="plan"?`/review/plan?session=${encodeURIComponent(r.id)}`:`/review/code?session=${encodeURIComponent(r.id)}`;a(l)})}else a(`/review/plan/${encodeURIComponent(e.data.slug)}`)}function kL(e){return e.kind==="session"?e.data.type==="plan"?{text:"Plan Review",className:"text-violet-400"}:{text:"Code Review",className:"text-emerald-400"}:{text:"Stored Plan",className:"text-amber-400"}}function _L(e,a){switch(a){case"all":return!0;case"pending":return e.kind==="session"?e.data.status==="pending"||e.data.status==="active":e.data.status==="pending";case"code":return e.kind==="session"?e.data.type==="code":!1;case"decided":return e.kind==="session"?e.data.status==="decided":e.data.status==="approved"||e.data.status==="denied"}}function CL({entry:e}){return n.jsx("div",{className:"flex gap-1 flex-wrap",children:e.kind==="session"?n.jsxs(n.Fragment,{children:[n.jsx(s0,{type:e.data.type}),n.jsx(jL,{status:e.data.status}),e.data.decision&&n.jsx("span",{className:`rounded-full px-1.5 py-0.5 text-[10px] font-medium ${e.data.decision.behavior==="allow"?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.data.decision.behavior==="allow"?"Approved":"Denied"})]}):n.jsxs(n.Fragment,{children:[n.jsx(s0,{type:"plan"}),n.jsx(SL,{status:e.data.status})]})})}function TL(){const e=Rs(),{currentProject:a}=on(),r=a==null?void 0:a.id,[l,o]=y.useState([]),[u,d]=y.useState([]),[f,m]=y.useState([]),[p,g]=y.useState(!0),[b,N]=y.useState(null),[v,w]=y.useState("all"),[,j]=y.useState(0);y.useEffect(()=>{const D=setInterval(()=>j(F=>F+1),3e4);return()=>clearInterval(D)},[]),y.useEffect(()=>{let D=!1;async function F(){try{const[R,z,P]=await Promise.all([Tr().catch(()=>[]),Cb(r).catch(()=>[]),Tb().catch(()=>[])]);if(!D){o(R),d(z),m(P),N(null);const q=R.find($=>$.status==="pending"||$.status==="active");q&&Ar(q.id).then($=>{const U=$?`&token=${encodeURIComponent($)}`:"",B=q.type==="code"?`/review/code?session=${encodeURIComponent(q.id)}${U}`:`/review/plan?session=${encodeURIComponent(q.id)}${U}`;e(B)}).catch(()=>{const $=q.type==="code"?`/review/code?session=${encodeURIComponent(q.id)}`:`/review/plan?session=${encodeURIComponent(q.id)}`;e($)})}}catch(R){D||N(R instanceof Error?R.message:"Failed to load review data")}finally{D||g(!1)}}return F(),()=>{D=!0}},[e,r]),y.useEffect(()=>{let D=null,F=null;function R(){try{D=new EventSource(Wl("/api/review/hub/events"));const z=()=>{Tr().then(o).catch(()=>{}),Cb(r).then(d).catch(()=>{}),Tb().then(m).catch(()=>{})};D.addEventListener("session-added",z),D.addEventListener("session-decided",z),D.addEventListener("session-updated",z),D.onerror=()=>{D==null||D.close(),D=null,F=setTimeout(R,2e3)}}catch{}}return R(),()=>{D==null||D.close(),F&&clearTimeout(F)}},[r]);const S=(a==null?void 0:a.path)??null,k=[...l.map(D=>({kind:"session",data:D})),...u.map(D=>({kind:"plan",data:D}))].sort((D,F)=>wi(F)-wi(D)),_=k.filter(D=>_L(D,v)),M=f.filter(D=>!S||D.projectPath!==S).map(D=>({kind:"plan",data:D})).sort((D,F)=>wi(F)-wi(D)),Z=l.filter(D=>D.status==="pending"||D.status==="active").length,Y=u.length,C=l.filter(D=>D.status==="decided").length,I=M.length;return p?n.jsxs("div",{className:"p-6 lg:p-8 h-full flex items-center justify-center",children:[n.jsx(Je,{size:24,className:"text-accent animate-spin"}),n.jsx("span",{className:"ml-3 text-sm text-text-secondary",children:"Loading review queue..."})]}):n.jsxs("div",{className:"p-6 lg:p-8 h-full flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(ou,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Review Queue"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Pending reviews and recent decisions"})]})]}),b&&n.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-3 flex items-center gap-3 mb-6",children:[n.jsx(Or,{size:16,className:"text-red-400 shrink-0"}),n.jsx("span",{className:"text-sm text-red-300",children:b})]}),n.jsxs("div",{className:"bg-surface-1 border border-border rounded-xl flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:"px-3 py-3 border-b border-border-subtle",children:n.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:Z}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"Pending"})]}),n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:Y}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"Plans"})]}),n.jsxs("div",{className:"bg-surface-2 rounded-lg p-2 text-center",children:[n.jsx("div",{className:"text-sm font-semibold text-text-primary",children:C}),n.jsx("div",{className:"text-[10px] text-text-muted",children:"Decided"})]})]})}),n.jsx("div",{className:"px-3 py-2 border-b border-border-subtle flex flex-wrap gap-1.5",children:[["all","All"],["pending","Pending"],["code","Code"],["decided","Decided"]].map(([D,F])=>n.jsx("button",{type:"button",onClick:()=>w(D),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${v===D?"bg-accent/15 text-accent":"bg-surface-2 text-text-muted hover:text-text-secondary"}`,children:F},D))}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[M.length>0&&n.jsxs("div",{className:"mb-2",children:[n.jsxs("div",{className:"px-2 py-1.5 flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-amber-400",children:"Pending from other projects"}),n.jsx("span",{className:"w-5 h-5 flex items-center justify-center rounded-full bg-amber-500/20 text-amber-400 text-[10px] font-bold",children:I})]}),M.map(D=>{const F=a0(D),R=r0(D),z=wi(D),P=D.kind==="plan"&&D.data.projectPath?D.data.projectPath.split("/").pop()??null:null;return n.jsxs("div",{role:"button",tabIndex:0,onClick:()=>zc(D,e),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),zc(D,e))},className:"w-full text-left px-3 py-2.5 rounded-lg hover:bg-amber-500/10 border border-amber-500/20 bg-amber-500/5 cursor-pointer transition-colors mb-1",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"bg-amber-500/15 text-amber-400 rounded-full px-1.5 py-0.5 text-[10px] font-medium",children:"Pending"}),P&&n.jsx("span",{className:"text-[10px] text-amber-400/80 font-mono bg-amber-500/10 px-1.5 py-0.5 rounded truncate max-w-[140px]",children:P})]}),n.jsx("span",{className:"text-[10px] text-text-muted shrink-0",children:n0(z)})]}),n.jsx("p",{className:"text-sm text-text-primary truncate mt-0.5",children:R})]},F)}),n.jsx("div",{className:"border-b border-border-subtle my-2"})]}),_.map(D=>{const F=a0(D),R=r0(D),z=wi(D),P=kL(D),q=D.kind==="session"?D.data.projectSlug||null:D.data.projectPath?D.data.projectPath.split("/").pop()??null:null;return n.jsxs("div",{role:"button",tabIndex:0,onClick:()=>zc(D,e),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),zc(D,e))},className:"w-full text-left px-3 py-2.5 rounded-lg hover:bg-surface-2 border border-transparent cursor-pointer transition-colors",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:`font-mono text-xs ${P.className}`,children:P.text}),n.jsx("span",{className:"text-[10px] text-text-muted shrink-0",children:n0(z)})]}),n.jsx("p",{className:"text-sm text-text-primary truncate mt-0.5",children:R}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsx(CL,{entry:D}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[D.kind==="plan"&&D.data.versionCount>1&&n.jsxs("span",{className:"text-[10px] text-text-muted",children:["v",D.data.versionCount]}),q&&n.jsx("span",{className:"text-[10px] text-text-muted font-mono bg-surface-2 px-1.5 py-0.5 rounded truncate max-w-[120px]",children:q})]})]})]},F)}),_.length===0&&M.length===0&&n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx("p",{className:"text-text-muted text-sm",children:k.length===0?"No reviews yet. Reviews will appear here when Guardian intercepts a plan exit or git commit.":"No entries match this filter."})})]})]})]})}const AL={available:!1,initialized:!1,mode:"idle",embeddingProvider:"ollama",embeddingModel:"nomic-embed-text",dimensions:768,totalFiles:0,totalChunks:0,staleFiles:0,indexSizeBytes:0},i0=[{action:"init",label:"Init Index",icon:tp},{action:"watch",label:"Start Watch",icon:rs},{action:"reindex",label:"Reindex",icon:ep},{action:"export",label:"Export",icon:to},{action:"import",label:"Import",icon:ap}],RL=[{id:"search",label:"Search",icon:ks},{id:"ranking",label:"Ranking",icon:Vc},{id:"cycles",label:"Cycles",icon:$n},{id:"coupling",label:"Coupling",icon:Ll}];function ML(e){if(e<=0)return"0 B";const a=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),a.length-1),l=1024**r;return`${(e/l).toFixed(r===0?0:1)} ${a[r]}`}function om(e){if(!e)return"Never";const a=Date.parse(e);if(Number.isNaN(a))return e;const r=Date.now()-a;return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function OL(e){return e.mode==="indexing"?{text:"Indexing",className:"bg-amber-500/15 text-amber-300 border-amber-500/30"}:e.mode==="watching"?{text:"Watching",className:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30"}:e.mode==="error"?{text:"Error",className:"bg-red-500/15 text-red-300 border-red-500/30"}:e.initialized?{text:"Ready",className:"bg-blue-500/15 text-blue-300 border-blue-500/30"}:{text:"Not Initialized",className:"bg-surface-3 text-text-secondary border-border"}}function l0(e){return e>=.85?"text-emerald-300":e>=.7?"text-blue-300":"text-amber-300"}function DL(e){return e>.8?"text-red-400":e>.5?"text-amber-300":"text-emerald-300"}function LL({projectId:e}){const[a,r]=y.useState(50),[l,o]=y.useState(null),{data:u,isLoading:d}=Et(["depgraph-ranking",e,a],()=>M2(a,e),{revalidateOnFocus:!1}),{data:f,isLoading:m}=Et(l?["depgraph-search-deps",l,e]:null,()=>L2(l,"dependents",e),{revalidateOnFocus:!1});return n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Vc,{size:17,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"PageRank Ranking"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-xs text-text-muted",children:"Show top"}),n.jsxs("select",{value:a,onChange:p=>r(Number(p.target.value)),className:"rounded-lg border border-border bg-surface-2 px-2 py-1 text-sm text-text-primary focus:outline-none focus:border-accent",children:[n.jsx("option",{value:20,children:"20"}),n.jsx("option",{value:50,children:"50"}),n.jsx("option",{value:100,children:"100"})]})]})]}),d?n.jsx("div",{className:"flex items-center justify-center py-10",children:n.jsx(Je,{size:20,className:"animate-spin text-text-muted"})}):!u||u.rankings.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(Vc,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"No ranking data available"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Make sure the dependency graph index is built."})]}):n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs text-text-muted mb-3",children:[u.totalFiles," files indexed. Showing top ",u.rankings.length," by PageRank score."]}),n.jsx("div",{className:"space-y-1",children:u.rankings.map(p=>{const g=l===p.filePath;return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>o(g?null:p.filePath),className:"w-full flex items-center gap-3 rounded-lg border border-border bg-surface-2 px-3 py-2 text-left hover:bg-surface-3 transition-colors",children:[n.jsxs("span",{className:"text-xs text-text-muted font-mono w-8 shrink-0 text-right",children:["#",p.position]}),n.jsx("span",{className:"text-sm text-text-primary font-mono truncate flex-1",children:p.filePath}),n.jsx("span",{className:"text-xs text-accent font-semibold shrink-0",children:p.rank.toFixed(6)}),g?n.jsx(Pn,{size:14,className:"text-text-muted shrink-0"}):n.jsx(wa,{size:14,className:"text-text-muted shrink-0"})]}),g&&n.jsx("div",{className:"ml-11 mt-1 mb-2 rounded-lg border border-border bg-surface-2 p-3",children:m?n.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[n.jsx(Je,{size:12,className:"animate-spin"})," Loading dependents..."]}):f&&f.results.length>0?n.jsxs("div",{children:[n.jsxs("p",{className:"text-xs text-text-muted mb-2",children:[f.results.length," file(s) depend on this"]}),n.jsx("ul",{className:"space-y-1 max-h-40 overflow-y-auto",children:f.results.map(b=>n.jsxs("li",{className:"text-xs font-mono text-text-secondary flex items-center gap-2",children:[n.jsx(V0,{size:10,className:"text-text-muted shrink-0"}),n.jsx("span",{className:"truncate",children:b.filePath}),b.symbols&&b.symbols.length>0&&n.jsxs("span",{className:"text-text-muted shrink-0",children:["(",b.symbols.join(", "),")"]})]},b.filePath))})]}):n.jsx("p",{className:"text-xs text-text-muted",children:"No dependents found."})})]},p.filePath)})})]})]})})}function zL({projectId:e}){const[a,r]=y.useState(20),{data:l,isLoading:o}=Et(["depgraph-cycles",e,a],()=>O2(a,e),{revalidateOnFocus:!1});return n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx($n,{size:17,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Dependency Cycles"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"text-xs text-text-muted",children:"Show top"}),n.jsxs("select",{value:a,onChange:u=>r(Number(u.target.value)),className:"rounded-lg border border-border bg-surface-2 px-2 py-1 text-sm text-text-primary focus:outline-none focus:border-accent",children:[n.jsx("option",{value:10,children:"10"}),n.jsx("option",{value:20,children:"20"}),n.jsx("option",{value:50,children:"50"})]})]})]}),o?n.jsx("div",{className:"flex items-center justify-center py-10",children:n.jsx(Je,{size:20,className:"animate-spin text-text-muted"})}):!l||l.cycles.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(Mr,{size:32,className:"text-emerald-400/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"No dependency cycles found"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Your codebase has no circular dependencies."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex items-center gap-3 mb-4",children:n.jsxs("span",{className:"inline-flex items-center rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-xs font-medium text-red-300",children:[l.totalCycles," total cycle",l.totalCycles!==1?"s":""]})}),n.jsx("div",{className:"space-y-3",children:l.cycles.map((u,d)=>{const f=u.files.length<=2?"high":"medium";return n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsxs("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${f==="high"?"border-red-500/30 bg-red-500/10 text-red-300":"border-amber-500/30 bg-amber-500/10 text-amber-300"}`,children:[u.files.length," files"]}),n.jsxs("span",{className:"text-xs text-text-muted",children:[u.edgeCount," edge",u.edgeCount!==1?"s":""]})]}),n.jsxs("ul",{className:"space-y-1",children:[u.files.map((m,p)=>n.jsxs("li",{className:"text-xs font-mono text-text-secondary flex items-center gap-2",children:[n.jsxs("span",{className:"text-text-muted shrink-0 w-4 text-right",children:[p+1,"."]}),n.jsx("span",{className:"truncate",children:m}),p<u.files.length-1&&n.jsx(wa,{size:10,className:"text-text-muted shrink-0"})]},m)),u.files.length>0&&n.jsxs("li",{className:"text-xs font-mono text-red-400/70 flex items-center gap-2",children:[n.jsx("span",{className:"text-text-muted shrink-0 w-4 text-right","aria-hidden":"true"}),n.jsxs("span",{className:"truncate",children:["... back to ",u.files[0]]})]})]})]},d)})})]})]})})}function IL({projectId:e}){const[a,r]=y.useState(""),[l,o]=y.useState(null),[u,d]=y.useState("instability"),[f,m]=y.useState(!1),{data:p,isLoading:g}=Et(l!==null?["depgraph-metrics",l,e]:null,()=>D2(l??"",e),{revalidateOnFocus:!1}),b=y.useMemo(()=>{if(!(p!=null&&p.metrics))return[];const j=[...p.metrics];return j.sort((S,k)=>{let _,M;switch(u){case"afferent":_=S.afferentCoupling,M=k.afferentCoupling;break;case"efferent":_=S.efferentCoupling,M=k.efferentCoupling;break;default:_=S.instability,M=k.instability;break}return f?_-M:M-_}),j},[p,u,f]);function N(j){u===j?m(!f):(d(j),m(!1))}function v(j){j.preventDefault(),o(a.trim())}function w(j){return u!==j?"":f?" ^":" v"}return n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Ll,{size:17,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Coupling Metrics"})]}),n.jsxs("form",{onSubmit:v,className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Module Path Prefix"}),n.jsx("input",{value:a,onChange:j=>r(j.target.value),placeholder:"packages/guards-engine/src/",className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),n.jsxs("button",{type:"submit",className:"inline-flex items-center gap-2 rounded-lg bg-accent px-4 py-2.5 text-sm font-medium text-white hover:opacity-90 transition-opacity",children:[n.jsx(Ll,{size:15}),"Analyze"]})]}),g?n.jsx("div",{className:"flex items-center justify-center py-10",children:n.jsx(Je,{size:20,className:"animate-spin text-text-muted"})}):!p||b.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(Ll,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:l===null&&!p?"Enter a module path prefix and click Analyze":"No coupling data found"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:'Leave the prefix empty to analyze all files, or specify a directory like "src/".'})]}):n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs text-text-muted mb-3",children:[p.modulePath?`Module: ${p.modulePath}`:"All files"," — ",b.length," file(s)"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left text-xs text-text-muted uppercase tracking-wide py-2 pr-4",children:"File"}),n.jsxs("th",{className:"text-right text-xs text-text-muted uppercase tracking-wide py-2 px-3 cursor-pointer hover:text-text-primary",onClick:()=>N("afferent"),children:["Ca (In)",w("afferent")]}),n.jsxs("th",{className:"text-right text-xs text-text-muted uppercase tracking-wide py-2 px-3 cursor-pointer hover:text-text-primary",onClick:()=>N("efferent"),children:["Ce (Out)",w("efferent")]}),n.jsxs("th",{className:"text-right text-xs text-text-muted uppercase tracking-wide py-2 pl-3 cursor-pointer hover:text-text-primary",onClick:()=>N("instability"),children:["Instability",w("instability")]})]})}),n.jsx("tbody",{children:b.map(j=>n.jsxs("tr",{className:"border-b border-border/50 hover:bg-surface-2 transition-colors",children:[n.jsx("td",{className:"py-2 pr-4",children:n.jsx("span",{className:"text-xs font-mono text-text-primary truncate block max-w-md",title:j.filePath,children:j.filePath})}),n.jsx("td",{className:"text-right py-2 px-3 text-xs text-text-secondary font-mono",children:j.afferentCoupling}),n.jsx("td",{className:"text-right py-2 px-3 text-xs text-text-secondary font-mono",children:j.efferentCoupling}),n.jsx("td",{className:`text-right py-2 pl-3 text-xs font-mono font-semibold ${DL(j.instability)}`,children:j.instability.toFixed(3)})]},j.filePath))})]})})]})]})})}function UL(){const{currentProject:e}=on(),a=e==null?void 0:e.id,[r,l]=y.useState("search"),[o,u]=y.useState(""),[d,f]=y.useState(10),[m,p]=y.useState(0),[g,b]=y.useState(""),[N,v]=y.useState(!1),[w,j]=y.useState(!1),[S,k]=y.useState([]),[_,M]=y.useState(!1),[Z,Y]=y.useState(null),[C,I]=y.useState(null),[D,F]=y.useState(""),[R,z]=y.useState(15e3),{data:P,error:q,isLoading:$,mutate:U}=Et(a?["codemap-status",a]:"codemap-status",()=>Qm(a),{refreshInterval:C?2e3:R,revalidateOnFocus:!1,onSuccess:H=>{H!=null&&H.pollIntervalMs&&z(H.pollIntervalMs)}}),{data:B}=Et(P!=null&&P.initialized?["depgraph-status",a]:null,()=>R2(a),{revalidateOnFocus:!1,refreshInterval:6e4}),Q=P??AL,ee=!P,ie=$&&!P,T=OL(Q),L=Z!==null;async function G(H){H==null||H.preventDefault();const V=o.trim();if(V){M(!0),F("");try{const re=await k2(V,{limit:d,threshold:m,pathPrefix:g.trim()||void 0,includeTests:N,includeDocs:w},a);k(re.results),Y(re.durationMs)}catch{k([]),Y(0),F("Could not reach CodeMap API. Make sure the index is initialized.")}finally{M(!1)}}}async function O(H){var V;I(H),F("");try{const re=await B0(H,{},a);F(re.message),await U()}catch(re){const xe=re instanceof Error?re.message:String(re),je=xe.match(/API \d+:\s*(.+)/);if(je)try{const Be=JSON.parse(je[1]);F(Be.message??Be.error??xe)}catch{F(xe)}else{const Be=((V=i0.find(we=>we.action===H))==null?void 0:V.label)??H;F(`${Be} failed — ${xe}`)}}finally{I(null)}}return n.jsxs("div",{className:"p-6 lg:p-8 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(Dr,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"CodeMap"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Semantic code discovery for agents and developers"})]})]}),n.jsx(ls,{})]}),(ee||q)&&n.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 flex items-start gap-3",children:[n.jsx(It,{size:16,className:"text-amber-300 mt-0.5 shrink-0"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"text-amber-200 font-medium",children:"Preview mode"}),n.jsx("p",{className:"text-amber-100/90",children:"Could not reach the CodeMap API. Showing fallback data until the server responds."})]})]}),n.jsxs("section",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[ie?n.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-surface-2 px-2.5 py-1 text-xs font-medium text-text-muted",children:[n.jsx(Je,{size:12,className:"animate-spin"})," Loading..."]}):n.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${T.className}`,children:T.text}),$&&!ie&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-text-muted",children:[n.jsx(Je,{size:12,className:"animate-spin"})," Syncing"]})]}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Index Health"}),n.jsxs("p",{className:"text-sm text-text-secondary",children:[Q.branch&&n.jsxs(n.Fragment,{children:["Branch: ",n.jsx("span",{className:"text-text-primary font-medium",children:Q.branch})," · "]}),"Provider: ",n.jsx("span",{className:"text-text-primary font-medium",children:Q.embeddingProvider})," / ",Q.embeddingModel," · ",Q.dimensions,"d embeddings"," · ","Updated ",om(Q.lastUpdated)]}),Q.configMismatch&&n.jsxs("p",{className:"text-xs text-amber-400 mt-0.5",children:["Config changed — reindex to apply (",Q.indexedProvider,"/",Q.indexedModel," ",Q.indexedDimensions,"d indexed)"]})]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:i0.filter(H=>!(H.action==="init"&&Q.initialized||!Q.initialized&&H.action==="reindex")).map(H=>{const V=H.icon,re=C===H.action,xe=Q.mode==="indexing",je=Q.mode==="watching",Be=H.action==="init",we=H.action==="reindex",Ye=H.action==="watch",jt=Be||we,en=jt&&xe&&!re,oe=ie||C!==null||en,ke=Ye&&je,he=ke?"Stop Watch":H.label,Xe=ke?"stop-watch":H.action;return n.jsxs("button",{type:"button",onClick:()=>O(Ye?Xe:H.action),disabled:oe,title:en?"Indexing already in progress":void 0,className:["inline-flex items-center gap-2 rounded-lg border px-3 py-2 text-sm transition-colors",re||jt&&xe?"border-accent text-accent bg-accent/10":ke?"border-emerald-500/50 text-emerald-300 bg-emerald-500/10":"border-border text-text-secondary hover:text-text-primary hover:bg-surface-2",oe?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[re||jt&&xe?n.jsx(Je,{size:15,className:"animate-spin"}):ke?n.jsx(Jk,{size:15}):n.jsx(V,{size:15}),jt&&(xe||re)?"Indexing...":he]},H.action)})})]}),Q.lastError&&Q.mode!=="indexing"&&n.jsxs("div",{className:"mt-4 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 flex items-start gap-3",children:[n.jsx(It,{size:16,className:"text-red-400 mt-0.5 shrink-0"}),n.jsxs("div",{className:"text-sm min-w-0",children:[n.jsx("p",{className:"text-red-300 font-medium",children:"Indexing failed"}),n.jsx("p",{className:"text-red-200/80 break-words",children:Q.lastError})]})]}),Q.progress&&n.jsxs("div",{className:"mt-4 rounded-lg border border-accent/30 bg-accent/5 p-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary capitalize",children:Q.progress.phase}),n.jsx("span",{className:"text-text-primary font-medium",children:Q.progress.total>0?`${Q.progress.current} / ${Q.progress.total}`:Q.progress.message})]}),Q.progress.total>0&&n.jsx("div",{className:"h-2 w-full rounded-full bg-surface-3 overflow-hidden",children:n.jsx("div",{className:"h-full bg-accent/70 transition-all duration-500",style:{width:`${Math.round(Q.progress.current/Q.progress.total*100)}%`}})}),n.jsx("p",{className:"text-xs text-text-muted",children:Q.progress.message})]}),n.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-5 gap-3 mt-5",children:[n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(BL,{}),"Files"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:Q.totalFiles})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(nv,{size:14}),"Chunks"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:Q.totalChunks})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(It,{size:14}),"Stale"]}),n.jsx("p",{className:`text-xl font-semibold mt-2 ${Q.staleFiles>0?"text-amber-300":"text-text-primary"}`,children:Q.staleFiles})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(ep,{size:14}),"Disk"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:ML(Q.indexSizeBytes)})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(Jm,{size:14}),"Queue"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:Q.queueDepth??0})]})]}),(B==null?void 0:B.available)&&n.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-5 gap-3 mt-3",children:[n.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(Ll,{size:14}),"Nodes"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:B.nodeCount})]}),n.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(V0,{size:14}),"Edges"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:B.edgeCount})]}),n.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(Vc,{size:14}),"Defs"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:B.definitionCount})]}),n.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx($n,{size:14}),"Refs"]}),n.jsx("p",{className:"text-xl font-semibold text-text-primary mt-2",children:B.referenceCount})]}),n.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-text-secondary text-xs uppercase tracking-wide",children:[n.jsx(It,{size:14}),"Cycles"]}),n.jsx("p",{className:`text-xl font-semibold mt-2 ${B.cycleCount>0?"text-red-400":"text-text-primary"}`,children:B.cycleCount})]})]}),D&&n.jsxs("div",{className:"mt-4 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 text-sm text-blue-200 flex items-center gap-2",children:[n.jsx(En,{size:14}),D]})]}),n.jsx("div",{className:"flex gap-1 p-1 rounded-lg bg-surface-1 border border-surface-3",children:RL.map(H=>{const V=H.icon,re=H.id==="cycles"&&(B!=null&&B.cycleCount)?B.cycleCount:void 0;return n.jsxs("button",{type:"button",onClick:()=>l(H.id),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors ${r===H.id?"bg-purple-600/20 text-purple-300 border border-purple-500/30":"text-text-secondary hover:text-text-primary hover:bg-surface-2 border border-transparent"}`,children:[n.jsx(V,{size:14}),H.label,re!==void 0&&re>0&&n.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-red-500/20 text-red-400 text-xs font-semibold px-1.5 min-w-[1.25rem] h-5",children:re})]},H.id)})}),r==="search"&&n.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4",children:[n.jsxs("div",{className:"lg:col-span-8 space-y-4",children:[n.jsxs("form",{onSubmit:G,className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{size:17,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Semantic Search"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3",children:[n.jsxs("div",{className:"md:col-span-8",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Query"}),n.jsx("input",{value:o,onChange:H=>u(H.target.value),placeholder:"Where is payment retry logic handled?",className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Limit"}),n.jsx("input",{type:"number",value:d,min:1,max:25,onChange:H=>f(Number(H.target.value)),className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:border-accent"})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Threshold"}),n.jsx("input",{type:"number",value:m,min:0,max:1,step:.05,onChange:H=>p(Number(H.target.value)),className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:border-accent"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end",children:[n.jsxs("div",{className:"md:col-span-9",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(US,{size:12})," Path Prefix"]})}),n.jsx("input",{value:g,onChange:H=>b(H.target.value),placeholder:"apps/cli/src/",className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),n.jsxs("label",{className:"md:col-span-2 inline-flex items-center gap-2 text-sm text-text-secondary pb-2",children:[n.jsx("input",{type:"checkbox",checked:N,onChange:H=>v(H.target.checked),className:"h-4 w-4 rounded border-border bg-surface-3 text-accent focus:ring-accent"}),"Include tests"]}),n.jsxs("label",{className:"md:col-span-2 inline-flex items-center gap-2 text-sm text-text-secondary pb-2",children:[n.jsx("input",{type:"checkbox",checked:w,onChange:H=>j(H.target.checked),className:"h-4 w-4 rounded border-border bg-surface-3 text-accent focus:ring-accent"}),"Include docs"]})]}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsx("p",{className:"text-xs text-text-muted",children:Z?`Last search in ${Z} ms`:"Run a query to inspect ranked code chunks"}),n.jsxs("button",{type:"submit",disabled:_,className:"inline-flex items-center gap-2 rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity disabled:opacity-60",children:[_?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(ks,{size:15}),"Search CodeMap"]})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 mb-4",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary",children:"Ranked Results"}),S.length>0&&n.jsxs("span",{className:"text-xs text-text-muted",children:[S.length," items"]})]}),!L&&S.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(ks,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"No search performed yet"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Enter a query above and hit Search to find relevant code."})]}):S.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(ks,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"No results found"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Try a different query or lower the similarity threshold."})]}):n.jsx("div",{className:"space-y-3",children:S.map(H=>n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsxs("p",{className:"text-xs font-mono text-accent truncate",children:[H.filePath,":",H.startLine,"-",H.endLine]}),n.jsx("p",{className:"text-xs text-text-secondary mt-1",children:H.symbolName?`${H.symbolType??"symbol"} · ${H.symbolName}`:"anonymous chunk"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(KS,{size:14,className:l0(H.score)}),n.jsxs("span",{className:`text-sm font-semibold ${l0(H.score)}`,children:[(H.score*100).toFixed(0),"%"]})]})]}),n.jsx("div",{className:"mt-2 h-1.5 w-full rounded-full bg-surface-3 overflow-hidden",children:n.jsx("div",{className:"h-full bg-accent/70",style:{width:`${Math.round(H.score*100)}%`}})}),n.jsx("pre",{className:"mt-3 text-xs text-text-secondary bg-surface-3 border border-border-subtle rounded-md p-3 overflow-x-auto whitespace-pre-wrap",children:H.snippet})]},`${H.filePath}-${H.startLine}-${H.endLine}`))})]})]}),n.jsxs("div",{className:"lg:col-span-4 space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary mb-3",children:"Live Signals"}),n.jsxs("ul",{className:"space-y-2 text-sm text-text-secondary",children:[n.jsxs("li",{className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-2",children:[n.jsx(Cr,{size:14})," MCP endpoint"]}),n.jsx("span",{className:"text-text-primary",children:Q.available?"online":"pending"})]}),n.jsxs("li",{className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-2",children:[n.jsx(tr,{size:14})," Watch mode"]}),n.jsx("span",{className:Q.mode==="watching"?"text-emerald-300 font-medium":"text-text-primary",children:Q.mode==="watching"?"active":"idle"})]}),n.jsxs("li",{className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-2",children:[n.jsx(Mr,{size:14})," Initialization"]}),n.jsx("span",{className:"text-text-primary",children:Q.initialized?"done":"required"})]})]})]}),Q.watcherStats&&Q.watcherStats.recentEvents.length>0&&n.jsxs("div",{className:"rounded-xl border border-emerald-500/20 bg-surface-1 p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary",children:"Watcher Activity"}),n.jsxs("span",{className:"text-xs text-text-muted",children:[Q.watcherStats.totalProcessed," processed"]})]}),Q.watcherStats.lastFlushAt&&n.jsxs("p",{className:"text-xs text-text-muted mb-2",children:["Last flush: ",om(Q.watcherStats.lastFlushAt)]}),n.jsx("ul",{className:"space-y-1 max-h-48 overflow-y-auto",children:[...Q.watcherStats.recentEvents].reverse().map((H,V)=>n.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[n.jsx("span",{className:H.type==="unlink"?"text-red-400 shrink-0 w-11":H.type==="add"?"text-emerald-400 shrink-0 w-11":"text-blue-400 shrink-0 w-11",children:H.type==="unlink"?"delete":H.type}),n.jsx("span",{className:"text-text-secondary font-mono truncate",title:H.filePath,children:H.filePath}),n.jsx("span",{className:"text-text-muted shrink-0 ml-auto",children:om(H.ts)})]},`${H.filePath}-${V}`))})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary mb-2",children:"About CodeMap"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"Hybrid code search combining vector embeddings with BM25 text matching. Initialize the index, then use natural-language or keyword queries to find relevant code across your project."})]})]})]}),r==="ranking"&&n.jsx(LL,{projectId:a}),r==="cycles"&&n.jsx(zL,{projectId:a}),r==="coupling"&&n.jsx(IL,{projectId:a})]})}function BL(){return n.jsx(Dr,{size:14})}const o0=["DECISION","PATTERN","BUG_ROOT_CAUSE","PREFERENCE","CONSTRAINT","CONTEXT","LESSON","RELATIONSHIP"],c0=["critical","high","medium","low"],Z1={DECISION:"bg-blue-500/20 text-blue-400",PATTERN:"bg-green-500/20 text-green-400",BUG_ROOT_CAUSE:"bg-red-500/20 text-red-400",PREFERENCE:"bg-yellow-500/20 text-yellow-400",CONSTRAINT:"bg-orange-500/20 text-orange-400",CONTEXT:"bg-purple-500/20 text-purple-400",LESSON:"bg-pink-500/20 text-pink-400",RELATIONSHIP:"bg-cyan-500/20 text-cyan-400"},$m={critical:"text-red-400",high:"text-orange-400",medium:"text-yellow-400",low:"text-text-muted"};function Q1(e){const a=new Date(e);if(isNaN(a.getTime()))return e;const r=Date.now()-a.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:r<6048e5?`${Math.floor(r/864e5)}d ago`:a.toLocaleDateString()}function W1(e){return e.replace(/_/g," ")}function J1({type:e}){return n.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${Z1[e]??"bg-surface-3 text-text-secondary"}`,children:W1(e)})}function cm(){return n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-4 space-y-3 animate-pulse",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-4 w-20 rounded-full bg-surface-4"}),n.jsx("div",{className:"h-4 w-12 rounded-full bg-surface-4"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-3.5 w-full rounded bg-surface-4"}),n.jsx("div",{className:"h-3.5 w-3/4 rounded bg-surface-4"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"h-3 w-24 rounded bg-surface-4"}),n.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"}),n.jsx("div",{className:"h-3 w-14 rounded bg-surface-4"})]})]})}function $L({progress:e,onDismiss:a}){const r=e.status==="classifying",l=e.status==="done",o=e.status==="error",u=e.total>0?Math.round(e.completed/e.total*100):0,d=r?"border-accent/40":l?"border-green-500/40":"border-red-500/40",f=r?"bg-accent/5":l?"bg-green-500/5":"bg-red-500/5";return n.jsxs("div",{className:`rounded-lg border ${d} ${f} px-4 py-3 space-y-2`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[r&&n.jsx(Je,{size:14,className:"animate-spin text-accent"}),l&&n.jsx(En,{size:14,className:"text-green-400"}),o&&n.jsx(It,{size:14,className:"text-red-400"}),n.jsx("span",{className:"text-sm font-medium text-text-primary",children:r?`Classifying session ${e.completed+1} of ${e.total}...`:l?e.total===0?"All sessions are up to date — no new memories to discover":`Classification complete — ${e.memoriesFound} ${e.memoriesFound===1?"memory":"memories"} discovered`:`Classification failed — ${e.error??"unknown error"}`})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.memoriesFound>0&&n.jsxs("span",{className:"text-xs text-accent font-medium",children:[e.memoriesFound," found"]}),!r&&n.jsx("button",{type:"button",onClick:a,className:"p-0.5 rounded hover:bg-surface-3 text-text-muted hover:text-text-secondary transition-colors",title:"Dismiss",children:n.jsx(ln,{size:14})})]})]}),e.total>0&&n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"h-1.5 rounded-full bg-surface-3 overflow-hidden",children:n.jsx("div",{className:["h-full rounded-full transition-all duration-500",r?"bg-accent":l?"bg-green-500":"bg-red-500"].join(" "),style:{width:`${r?u:100}%`}})}),n.jsxs("div",{className:"flex items-center justify-between text-[11px] text-text-muted",children:[n.jsxs("span",{children:[e.completed,"/",e.total," sessions",e.failed>0&&` (${e.failed} failed)`]}),e.branch&&n.jsxs("span",{children:["branch: ",e.branch]})]})]})]})}function PL({entry:e,score:a,onForget:r}){var p;const[l,o]=y.useState(!1),u=!!e.detail,d=e.relatedFiles.length>0,f=e.tags.length>4,m=u||d||f;return n.jsxs("div",{className:["rounded-lg border bg-surface-2 p-4 space-y-2 transition-colors",m?"cursor-pointer hover:border-border-hover":"",l?"border-accent/30":"border-border"].join(" "),onClick:()=>m&&o(g=>!g),children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m&&n.jsx(Pn,{size:14,className:`text-text-muted transition-transform ${l?"":"-rotate-90"}`}),n.jsx(J1,{type:e.type}),n.jsx("span",{className:`text-xs font-medium ${$m[e.importance]}`,children:e.importance}),a!==void 0&&n.jsxs("span",{className:"text-xs text-accent font-medium",children:[(a*100).toFixed(0),"% match"]})]}),n.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),r(e.id)},className:"text-[10px] text-text-muted hover:text-red-400 transition-colors px-1.5 py-0.5 rounded hover:bg-red-500/10",title:"Mark as superseded",children:"forget"})]}),n.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:e.summary}),u&&n.jsx("p",{className:`text-xs text-text-secondary leading-relaxed whitespace-pre-wrap ${l?"":"line-clamp-2"}`,children:e.detail}),l&&n.jsxs("div",{className:"space-y-2 pt-1 border-t border-border-subtle mt-2",children:[d&&n.jsxs("div",{className:"space-y-1",children:[n.jsx("p",{className:"text-[10px] text-text-muted uppercase tracking-wide font-semibold",children:"Related Files"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.relatedFiles.map(g=>n.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-surface-3 px-2 py-0.5 text-[11px] text-text-secondary font-mono",children:[n.jsx(Fl,{size:10,className:"shrink-0"}),g.split("/").pop()]},g))})]}),e.tags.length>0&&n.jsxs("div",{className:"space-y-1",children:[n.jsx("p",{className:"text-[10px] text-text-muted uppercase tracking-wide font-semibold",children:"Tags"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.tags.map(g=>n.jsxs("span",{className:"inline-flex items-center rounded-full bg-surface-3 px-2 py-0.5 text-[10px] text-text-secondary",children:["#",g]},g))})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-text-muted pt-1",children:[((p=e.source)==null?void 0:p.sessionId)&&n.jsxs("span",{children:["Session: ",e.source.sessionId.slice(0,12),"..."]}),n.jsxs("span",{children:["Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt!==e.createdAt&&n.jsxs("span",{children:["Updated: ",new Date(e.updatedAt).toLocaleString()]}),n.jsxs("span",{className:"font-mono text-[10px]",children:["ID: ",e.id.slice(0,12)]})]})]}),!l&&n.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-muted",children:[e.tags.length>0&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(ev,{size:11}),e.tags.slice(0,4).join(", "),e.tags.length>4&&` +${e.tags.length-4}`]}),n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Q0,{size:11}),e.accessCount]}),n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Jm,{size:11}),Q1(e.createdAt)]}),d&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Fl,{size:11}),e.relatedFiles.length," files"]})]})]})}function FL(){const{currentProject:e}=on(),a=e==null?void 0:e.id,[r,l]=y.useState(""),[o,u]=y.useState(10),[d,f]=y.useState([]),[m,p]=y.useState([]),[g,b]=y.useState([]),[N,v]=y.useState(!1),[w,j]=y.useState(null),[S,k]=y.useState(!1),[_,M]=y.useState(null),[Z,Y]=y.useState(""),{data:C,error:I,isLoading:D,mutate:F}=Et(a?["memory-status",a]:"memory-status",()=>$0(a),{refreshInterval:5e3,revalidateOnFocus:!1}),R=(C==null?void 0:C.classifyProgress)??null,z=(R==null?void 0:R.status)==="classifying",{data:P,mutate:q}=Et(a?["memory-timeline",a]:"memory-timeline",()=>P0({limit:50},a),{refreshInterval:z?5e3:3e4,revalidateOnFocus:!1}),$=(C==null?void 0:C.initialized)??!1,U=C==null?void 0:C.stats;async function B(H){H==null||H.preventDefault();const V=r.trim();if(V){v(!0);try{const re=await A2(V,{limit:o,types:d.length>0?d:void 0,importance:m.length>0?m:void 0},a);b(re.results),j(re.durationMs),k(!0)}catch{b([]),j(0),k(!0)}finally{v(!1)}}}async function Q(H){try{await F0(H,a),await F(),await q(),b(V=>V.filter(re=>re.entry.id!==H))}catch{}}function ee(H){f(V=>V.includes(H)?V.filter(re=>re!==H):[...V,H])}function ie(H){p(V=>V.includes(H)?V.filter(re=>re!==H):[...V,H])}async function T(){M("classify-all"),Y("");try{await $c("classify-all",{export:!0},a),await F()}catch(H){const V=H instanceof Error?H.message:String(H);Y(`Classification failed — ${V}`)}finally{M(null)}}async function L(){try{await $c("classify-clear",{},a),await F(),await q()}catch{}}async function G(H){M(H),Y("");try{const V=await $c(H,{},a),re=V.message??(H==="export"?`Exported ${V.memoriesExported??0} memories to ${V.branchName??"git branch"}`:`Imported ${V.memoriesImported??0} memories`);Y(re),await F(),await q()}catch(V){const re=V instanceof Error?V.message:String(V),xe=re.match(/API \d+:\s*(.+)/);if(xe)try{const je=JSON.parse(xe[1]);Y(je.message??je.error??re)}catch{Y(re)}else Y(`${H} failed — ${re}`)}finally{M(null)}}const O=S?g.map(H=>({entry:H.entry,score:H.finalScore})):((P==null?void 0:P.entries)??[]).map(H=>({entry:H,score:void 0}));return n.jsxs("div",{className:"p-6 lg:p-8 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(Rr,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Agent Memory"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Persistent knowledge across sessions"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:T,disabled:z||_!==null||!$,title:$?z?"Classification in progress...":"Classify unprocessed sessions to discover new memories":"Memory not initialized",className:["inline-flex items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-colors",z||_==="classify-all"?"border-accent text-accent bg-accent/10":"border-accent/50 text-accent hover:bg-accent/10",z||_!==null||!$?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[z||_==="classify-all"?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(En,{size:15}),z||_==="classify-all"?"Discovering...":"Discover Memories"]}),n.jsx("div",{className:"flex gap-2",children:["export","import"].map(H=>{const V=H==="export"?to:ap,re=H==="export"?"Export":"Import",xe=_===H,je=_!==null||!$;return n.jsxs("button",{type:"button",onClick:()=>G(H),disabled:je,title:$?`${re} memories to/from git branch`:"Memory not initialized",className:["inline-flex items-center gap-1.5 rounded-lg border px-3 py-2 text-sm transition-colors",xe?"border-accent text-accent bg-accent/10":"border-border text-text-secondary hover:text-text-primary hover:bg-surface-2",je?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[xe?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(V,{size:15}),re]},H)})}),n.jsx(ls,{})]})]}),R&&n.jsx($L,{progress:R,onDismiss:L}),Z&&!R&&n.jsx("div",{className:"rounded-lg border border-border bg-surface-2 px-4 py-2.5 text-sm text-text-secondary",children:Z}),(I||!D&&!C)&&n.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 flex items-start gap-3",children:[n.jsx(It,{size:16,className:"text-amber-300 mt-0.5 shrink-0"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"text-amber-200 font-medium",children:"Preview mode"}),n.jsx("p",{className:"text-amber-100/90",children:"Could not reach the Memory API. Showing fallback data until the server responds."})]})]}),n.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4",children:[n.jsxs("div",{className:"lg:col-span-8 space-y-4",children:[n.jsxs("form",{onSubmit:B,className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ks,{size:17,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Search Memories"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3",children:[n.jsxs("div",{className:"md:col-span-9",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Query"}),n.jsx("input",{value:r,onChange:H=>l(H.target.value),placeholder:"Why did we choose this architecture?",className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]}),n.jsxs("div",{className:"md:col-span-3",children:[n.jsx("label",{className:"text-xs text-text-muted uppercase tracking-wide",children:"Limit"}),n.jsx("input",{type:"number",value:o,min:1,max:50,onChange:H=>u(Number(H.target.value)),className:"mt-1 w-full rounded-lg border border-border bg-surface-2 px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:border-accent"})]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wide mb-2",children:"Type filter"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:o0.map(H=>n.jsx("button",{type:"button",onClick:()=>ee(H),className:["inline-flex items-center rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide border transition-colors",d.includes(H)?`${Z1[H]} border-current`:"bg-surface-3 text-text-muted border-transparent hover:text-text-secondary"].join(" "),children:W1(H)},H))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wide mb-2",children:"Importance filter"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:c0.map(H=>n.jsx("button",{type:"button",onClick:()=>ie(H),className:["inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium border transition-colors",m.includes(H)?`${$m[H]} border-current bg-surface-3`:"text-text-muted border-transparent bg-surface-3 hover:text-text-secondary"].join(" "),children:H},H))})]}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsx("p",{className:"text-xs text-text-muted",children:w!==null?`Last search in ${w} ms`:"Run a query to search agent memories"}),n.jsxs("button",{type:"submit",disabled:N,className:"inline-flex items-center gap-2 rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity disabled:opacity-60",children:[N?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(ks,{size:15}),"Search Memory"]})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 mb-4",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary flex items-center gap-2",children:N?n.jsxs(n.Fragment,{children:[n.jsx(Je,{size:15,className:"animate-spin text-accent"}),"Searching..."]}):S?"Search Results":"Recent Memories"}),!N&&O.length>0&&n.jsxs("span",{className:"text-xs text-text-muted",children:[O.length," items"]})]}),N?n.jsxs("div",{className:"space-y-3",children:[n.jsx(cm,{}),n.jsx(cm,{}),n.jsx(cm,{})]}):O.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(Rr,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:S?"No results found":$?"No memories captured yet":"Memory not initialized"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:S?"Try a different query or adjust filters.":$?"Run a session to start building agent memory.":"Go to Memory Settings to initialize."})]}):n.jsx("div",{className:"space-y-3",children:O.map(({entry:H,score:V})=>n.jsx(PL,{entry:H,score:V,onForget:Q},H.id))})]})]}),n.jsxs("div",{className:"lg:col-span-4 space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(J2,{size:16,className:"text-accent"}),n.jsx("h3",{className:"text-base font-semibold text-text-primary",children:"Stats"})]}),U?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary",children:"Total Memories"}),n.jsx("span",{className:"text-text-primary font-semibold",children:U.totalMemories})]}),n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary",children:"Sessions Captured"}),n.jsx("span",{className:"text-text-primary font-semibold",children:U.sessionsCaptured})]}),n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary",children:"Sessions Classified"}),n.jsx("span",{className:"text-text-primary font-semibold",children:U.sessionsClassified})]}),n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary",children:"Total Accesses"}),n.jsx("span",{className:"text-text-primary font-semibold",children:U.totalAccesses})]}),n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-text-secondary",children:"Last Classified"}),n.jsx("span",{className:"text-text-primary font-medium text-xs",children:U.lastClassifiedAt?Q1(U.lastClassifiedAt):"Never"})]}),n.jsxs("div",{className:"pt-2 border-t border-border-subtle",children:[n.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wide mb-2",children:"By Type"}),n.jsx("div",{className:"space-y-1.5",children:o0.map(H=>{const V=U.memoriesByType[H]??0;return V===0?null:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(J1,{type:H}),n.jsx("span",{className:"text-xs text-text-primary font-medium",children:V})]},H)})})]}),n.jsxs("div",{className:"pt-2 border-t border-border-subtle",children:[n.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wide mb-2",children:"By Importance"}),n.jsx("div",{className:"space-y-1.5",children:c0.map(H=>{const V=U.memoriesByImportance[H]??0;return V===0?null:n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:`text-xs font-medium ${$m[H]}`,children:H}),n.jsx("span",{className:"text-xs text-text-primary font-medium",children:V})]},H)})})]})]}):n.jsx("p",{className:"text-sm text-text-muted",children:"Loading..."})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-5",children:[n.jsx("h3",{className:"text-base font-semibold text-text-primary mb-2",children:"About Memory"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"Agent Memory captures decisions, patterns, and lessons learned across coding sessions. Memories are semantically indexed and surfaced to the agent at session start for context continuity."})]})]})]})]})}const HL=["DECISION","PATTERN","BUG_ROOT_CAUSE","PREFERENCE","CONSTRAINT","CONTEXT","LESSON","RELATIONSHIP"],eN={DECISION:"bg-blue-500/20 text-blue-400",PATTERN:"bg-green-500/20 text-green-400",BUG_ROOT_CAUSE:"bg-red-500/20 text-red-400",PREFERENCE:"bg-yellow-500/20 text-yellow-400",CONSTRAINT:"bg-orange-500/20 text-orange-400",CONTEXT:"bg-purple-500/20 text-purple-400",LESSON:"bg-pink-500/20 text-pink-400",RELATIONSHIP:"bg-cyan-500/20 text-cyan-400"},qL={critical:"text-red-400",high:"text-orange-400",medium:"text-yellow-400",low:"text-text-muted"};function GL(e){const a=new Date(e);if(isNaN(a.getTime()))return e;const r=Date.now()-a.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:a.toLocaleDateString()}function KL(e){const a=new Date(e);if(isNaN(a.getTime()))return"Unknown";const l=Math.floor((new Date().getTime()-a.getTime())/864e5);return l===0?"Today":l===1?"Yesterday":l<7?a.toLocaleDateString(void 0,{weekday:"long"}):a.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}function Pm(e){return e.replace(/_/g," ")}function YL(e){const a=new Map;for(const r of e){const l=new Date(r.createdAt).toDateString(),o=a.get(l);o?o.push(r):a.set(l,[r])}return a}function VL({type:e}){return n.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${eN[e]??"bg-surface-3 text-text-secondary"}`,children:Pm(e)})}function XL({entry:e,onForget:a}){return n.jsxs("div",{className:"relative pl-6 pb-4",children:[n.jsx("div",{className:"absolute left-0 top-1.5 w-3 h-3 rounded-full border-2 border-accent bg-surface-0"}),n.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 p-4 space-y-2",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(VL,{type:e.type}),n.jsx("span",{className:`text-xs font-medium ${qL[e.importance]}`,children:e.importance})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-text-muted",children:GL(e.createdAt)}),n.jsx("button",{type:"button",onClick:()=>a(e.id),className:"text-[10px] text-text-muted hover:text-red-400 transition-colors px-1.5 py-0.5 rounded hover:bg-red-500/10",title:"Mark as superseded",children:"forget"})]})]}),n.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:e.summary}),e.detail&&n.jsx("p",{className:"text-xs text-text-secondary leading-relaxed line-clamp-2",children:e.detail}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-muted",children:[e.tags.length>0&&n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(ev,{size:11}),e.tags.slice(0,4).join(", "),e.tags.length>4&&` +${e.tags.length-4}`]}),n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Q0,{size:11}),e.accessCount," accesses"]})]})]})]})}function ZL(){const{currentProject:e}=on(),a=e==null?void 0:e.id,[r,l]=y.useState(null),[o,u]=y.useState(50),[d,f]=y.useState(!1),m=r??void 0,{data:p,error:g,mutate:b}=Et(a?["memory-timeline",a,m,o]:["memory-timeline",m,o],()=>P0({limit:o,type:m},a),{refreshInterval:3e4,revalidateOnFocus:!1}),N=(p==null?void 0:p.entries)??[],v=YL(N);async function w(S){try{await F0(S,a),await b()}catch{}}const j=y.useCallback(async()=>{f(!0),u(S=>S+50),setTimeout(()=>f(!1),500)},[]);return n.jsxs("div",{className:"p-6 lg:p-8 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(Jm,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Memory Timeline"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Chronological view of all captured memories"})]})]}),n.jsx(ls,{})]}),g&&n.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 flex items-start gap-3",children:[n.jsx(It,{size:16,className:"text-amber-300 mt-0.5 shrink-0"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"text-amber-200 font-medium",children:"Could not load timeline"}),n.jsx("p",{className:"text-amber-100/90",children:"Make sure the Memory API is available."})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface-1 p-4",children:[n.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wide mb-2",children:"Filter by type"}),n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n.jsx("button",{type:"button",onClick:()=>l(null),className:["inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium border transition-colors",r===null?"bg-accent/15 text-accent border-accent/30":"bg-surface-3 text-text-muted border-transparent hover:text-text-secondary"].join(" "),children:"All"}),HL.map(S=>n.jsx("button",{type:"button",onClick:()=>l(r===S?null:S),className:["inline-flex items-center rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide border transition-colors",r===S?`${eN[S]} border-current`:"bg-surface-3 text-text-muted border-transparent hover:text-text-secondary"].join(" "),children:Pm(S)},S))]})]}),n.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6",children:N.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx(Rr,{size:32,className:"text-text-muted/40 mb-3"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"No memories found"}),n.jsx("p",{className:"text-xs text-text-muted mt-1",children:r?`No ${Pm(r).toLowerCase()} memories captured yet.`:"Run coding sessions to start building agent memory."})]}):n.jsxs("div",{children:[Array.from(v.entries()).map(([S,k])=>n.jsxs("div",{className:"mb-6 last:mb-0",children:[n.jsx("h3",{className:"text-sm font-semibold text-text-primary mb-3 pl-6",children:KL(k[0].createdAt)}),n.jsx("div",{className:"border-l-2 border-border-subtle ml-1",children:k.map(_=>n.jsx(XL,{entry:_,onForget:w},_.id))})]},S)),N.length>=o&&n.jsx("div",{className:"flex justify-center pt-4",children:n.jsxs("button",{type:"button",onClick:j,disabled:d,className:"inline-flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors disabled:opacity-60",children:[d?n.jsx(Je,{size:14,className:"animate-spin"}):n.jsx(Pn,{size:14}),"Load more"]})})]})})]})}function QL(){const{currentProject:e}=on(),a=e==null?void 0:e.id,{data:r,error:l,mutate:o}=Et(a?["memory-config",a]:"memory-config",()=>H0(a),{revalidateOnFocus:!1}),[u,d]=y.useState(!1),[f,m]=y.useState("continuous"),[p,g]=y.useState(!0),[b,N]=y.useState(5),[v,w]=y.useState(!0),[j,S]=y.useState("claude-sonnet-4-20250514"),[k,_]=y.useState(!1),[M,Z]=y.useState([]),[Y,C]=y.useState(""),[I,D]=y.useState(null),[F,R]=y.useState("");y.useEffect(()=>{r&&(d(r.enabled),m(r.captureMode),g(r.surfaceOnStart),N(r.surfaceLimit),w(r.classifier.enabled),S(r.classifier.model),_(r.autoExport),Z(r.redactPatterns))},[r]);async function z(G){try{await q0(G,a),await o()}catch{R("Failed to save configuration.")}}async function P(){const G=!u;d(G),await z({enabled:G})}async function q(G){m(G),await z({captureMode:G})}async function $(){const G=!p;g(G),await z({surfaceOnStart:G})}async function U(G){const O=Math.min(Math.max(1,G),20);N(O),await z({surfaceLimit:O})}async function B(){const G=!v;w(G),await z({classifier:{...r==null?void 0:r.classifier,enabled:G}})}async function Q(){j!==(r==null?void 0:r.classifier.model)&&await z({classifier:{...r==null?void 0:r.classifier,model:j}})}async function ee(){const G=!k;_(G),await z({autoExport:G})}async function ie(){const G=Y.trim();if(!G||M.includes(G))return;const O=[...M,G];Z(O),C(""),await z({redactPatterns:O})}async function T(G){const O=M.filter((H,V)=>V!==G);Z(O),await z({redactPatterns:O})}async function L(G,O){D(G),R("");try{const H=await $c(G,{},a);R(H.message??`${O} completed.`),await o()}catch{R(`${O} failed.`)}finally{D(null)}}return n.jsxs("div",{className:"p-6 lg:p-8 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"p-2 rounded-lg bg-accent/15",children:n.jsx(sp,{size:22,className:"text-accent"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-display font-semibold text-text-primary",children:"Memory Settings"}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5",children:"Configure agent memory capture and classification"})]})]}),n.jsx(ls,{})]}),l&&n.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 flex items-start gap-3",children:[n.jsx(It,{size:16,className:"text-amber-300 mt-0.5 shrink-0"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"text-amber-200 font-medium",children:"Could not load configuration"}),n.jsx("p",{className:"text-amber-100/90",children:"Make sure the Memory API is available."})]})]}),n.jsxs("section",{className:"rounded-xl border border-border bg-surface-1 p-5",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary mb-4",children:"Actions"}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>L("init","Initialize Memory"),disabled:I!==null,className:["inline-flex items-center gap-2 rounded-lg border px-3 py-2 text-sm transition-colors",I==="init"?"border-accent text-accent bg-accent/10":"border-border text-text-secondary hover:text-text-primary hover:bg-surface-2",I!==null?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[I==="init"?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(tp,{size:15}),"Initialize Memory"]}),n.jsxs("button",{type:"button",onClick:()=>L("export","Export to Git"),disabled:I!==null,className:["inline-flex items-center gap-2 rounded-lg border px-3 py-2 text-sm transition-colors",I==="export"?"border-accent text-accent bg-accent/10":"border-border text-text-secondary hover:text-text-primary hover:bg-surface-2",I!==null?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[I==="export"?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(to,{size:15}),"Export to Git"]}),n.jsxs("button",{type:"button",onClick:()=>L("import","Import from Git"),disabled:I!==null,className:["inline-flex items-center gap-2 rounded-lg border px-3 py-2 text-sm transition-colors",I==="import"?"border-accent text-accent bg-accent/10":"border-border text-text-secondary hover:text-text-primary hover:bg-surface-2",I!==null?"disabled:opacity-60 disabled:cursor-not-allowed":""].join(" "),children:[I==="import"?n.jsx(Je,{size:15,className:"animate-spin"}):n.jsx(ap,{size:15}),"Import from Git"]})]}),F&&n.jsxs("div",{className:"mt-3 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 text-sm text-blue-200 flex items-center gap-2",children:[n.jsx(En,{size:14}),F]})]}),n.jsxs("section",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"General"}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Enable Memory"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Capture and classify memories from sessions"})]}),n.jsx("button",{type:"button",onClick:P,className:["relative inline-flex h-6 w-11 items-center rounded-full transition-colors",u?"bg-accent":"bg-surface-3"].join(" "),children:n.jsx("span",{className:["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",u?"translate-x-6":"translate-x-1"].join(" ")})})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary mb-2",children:"Capture Mode"}),n.jsx("p",{className:"text-xs text-text-secondary mb-3",children:"When to capture events for memory classification"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{type:"button",onClick:()=>q("continuous"),className:["flex-1 rounded-lg border px-4 py-3 text-sm text-left transition-colors",f==="continuous"?"border-accent bg-accent/10 text-accent":"border-border bg-surface-2 text-text-secondary hover:text-text-primary"].join(" "),children:[n.jsx("span",{className:"font-medium block",children:"Continuous"}),n.jsx("span",{className:"text-xs mt-0.5 block opacity-80",children:"Append events via post-tool hook during session"})]}),n.jsxs("button",{type:"button",onClick:()=>q("end_of_session"),className:["flex-1 rounded-lg border px-4 py-3 text-sm text-left transition-colors",f==="end_of_session"?"border-accent bg-accent/10 text-accent":"border-border bg-surface-2 text-text-secondary hover:text-text-primary"].join(" "),children:[n.jsx("span",{className:"font-medium block",children:"End of Session"}),n.jsx("span",{className:"text-xs mt-0.5 block opacity-80",children:"Bulk-capture from session JSONL at session-end"})]})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Surface on Start"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Show top memories when a session starts"})]}),n.jsx("button",{type:"button",onClick:$,className:["relative inline-flex h-6 w-11 items-center rounded-full transition-colors",p?"bg-accent":"bg-surface-3"].join(" "),children:n.jsx("span",{className:["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",p?"translate-x-6":"translate-x-1"].join(" ")})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Surface Limit"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Max memories to show at session start (1-20)"})]}),n.jsx("input",{type:"number",value:b,min:1,max:20,onChange:G=>N(Number(G.target.value)),onBlur:()=>U(b),className:"w-20 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary text-center focus:outline-none focus:border-accent"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Auto-export"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Automatically export memories to git branch"})]}),n.jsx("button",{type:"button",onClick:ee,className:["relative inline-flex h-6 w-11 items-center rounded-full transition-colors",k?"bg-accent":"bg-surface-3"].join(" "),children:n.jsx("span",{className:["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",k?"translate-x-6":"translate-x-1"].join(" ")})})]})]}),n.jsxs("section",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rr,{size:18,className:"text-accent"}),n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Classifier"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary",children:"Enable Classifier"}),n.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:"Use AI to classify session events into memories"})]}),n.jsx("button",{type:"button",onClick:B,className:["relative inline-flex h-6 w-11 items-center rounded-full transition-colors",v?"bg-accent":"bg-surface-3"].join(" "),children:n.jsx("span",{className:["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",v?"translate-x-6":"translate-x-1"].join(" ")})})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Model"}),n.jsx("p",{className:"text-xs text-text-secondary mb-2",children:"AI model for memory classification"}),n.jsx("input",{value:j,onChange:G=>S(G.target.value),onBlur:Q,placeholder:"claude-sonnet-4-20250514",className:"w-full max-w-md rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent"})]})]}),n.jsxs("section",{className:"rounded-xl border border-border bg-surface-1 p-5 lg:p-6 space-y-4",children:[n.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Redact Patterns"}),n.jsx("p",{className:"text-xs text-text-secondary",children:"Regex patterns to redact sensitive content before classification. Matched text is replaced with [REDACTED]."}),n.jsx("div",{className:"space-y-2",children:M.map((G,O)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary font-mono",children:G}),n.jsx("button",{type:"button",onClick:()=>T(O),className:"p-2 rounded-lg text-text-muted hover:text-red-400 hover:bg-red-500/10 transition-colors",children:n.jsx(sr,{size:14})})]},O))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:Y,onChange:G=>C(G.target.value),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),ie())},placeholder:"e.g., sk-[a-zA-Z0-9]{32,}",className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary font-mono placeholder:text-text-muted focus:outline-none focus:border-accent"}),n.jsxs("button",{type:"button",onClick:ie,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors",children:[n.jsx(Cs,{size:14}),"Add"]})]})]})]})}class WL extends au.Component{constructor(a){super(a),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}render(){return this.state.error?n.jsx("div",{className:"flex items-center justify-center h-full bg-surface-0",children:n.jsxs("div",{className:"max-w-md text-center space-y-4 p-8",children:[n.jsx("h1",{className:"text-2xl font-bold text-text-primary",children:"Something went wrong"}),n.jsx("p",{className:"text-sm text-text-secondary",children:this.state.error.message}),n.jsx("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center px-4 py-2 rounded-lg bg-accent text-white text-sm font-medium hover:opacity-90 transition-opacity",children:"Reload"})]})}):this.props.children}}function JL(){return n.jsx("div",{className:"flex items-center justify-center h-full bg-surface-0",children:n.jsxs("div",{className:"max-w-md text-center space-y-4 p-8",children:[n.jsx("h1",{className:"text-2xl font-bold text-text-primary",children:"Page not found"}),n.jsx("p",{className:"text-sm text-text-secondary",children:"The page you are looking for does not exist."}),n.jsx(_s,{to:"/",className:"inline-block text-sm font-medium text-accent hover:underline",children:"Go to Dashboard"})]})})}function ez(){const e=Rs();return y.useEffect(()=>{let a=null,r=null;function l(){try{a=new EventSource(Wl("/api/review/hub/events")),a.addEventListener("session-added",o=>{try{const u=JSON.parse(o.data);u!=null&&u.id&&(u.status==="pending"||u.status==="active")&&Ar(u.id).then(d=>{const f=d?`&token=${encodeURIComponent(d)}`:"",m=u.type==="code"?`/review/code?session=${encodeURIComponent(u.id)}${f}`:`/review/plan?session=${encodeURIComponent(u.id)}${f}`;e(m)}).catch(()=>{const d=u.type==="code"?`/review/code?session=${encodeURIComponent(u.id)}`:`/review/plan?session=${encodeURIComponent(u.id)}`;e(d)})}catch{}}),a.onerror=()=>{a==null||a.close(),a=null,r=setTimeout(l,3e3)}}catch{}}return l(),()=>{a==null||a.close(),r&&clearTimeout(r)}},[e]),null}function tz(){return n.jsx(zj,{children:n.jsx(U2,{children:n.jsxs(B2,{children:[n.jsx(ez,{}),n.jsxs("div",{className:"flex h-screen",children:[n.jsx(j_,{}),n.jsx("main",{className:"flex-1 overflow-y-auto",children:n.jsx(WL,{children:n.jsxs(dj,{children:[n.jsx(Wt,{path:"/",element:n.jsx(dC,{})}),n.jsx(Wt,{path:"/setup",element:n.jsx(bC,{})}),n.jsx(Wt,{path:"/rules",element:n.jsx(vC,{})}),n.jsx(Wt,{path:"/rules/new",element:n.jsx(kC,{})}),n.jsx(Wt,{path:"/pipelines",element:n.jsx(CC,{})}),n.jsx(Wt,{path:"/skills",element:n.jsx(TC,{})}),n.jsx(Wt,{path:"/session",element:n.jsx(UC,{})}),n.jsx(Wt,{path:"/history",element:n.jsx(A3,{})}),n.jsx(Wt,{path:"/history/:sha/transcript",element:n.jsx(O3,{})}),n.jsx(Wt,{path:"/responses",element:n.jsx(HC,{})}),n.jsx(Wt,{path:"/projects",element:n.jsx(XC,{})}),n.jsx(Wt,{path:"/settings",element:n.jsx(tT,{})}),n.jsx(Wt,{path:"/review/queue",element:n.jsx(TL,{})}),n.jsx(Wt,{path:"/review",element:n.jsx(lm,{})}),n.jsx(Wt,{path:"/review/plan",element:n.jsx(lm,{})}),n.jsx(Wt,{path:"/review/plan/:slug",element:n.jsx(lm,{})}),n.jsx(Wt,{path:"/review/code",element:n.jsx(EL,{})}),n.jsx(Wt,{path:"/codemap",element:n.jsx(UL,{})}),n.jsx(Wt,{path:"/memory",element:n.jsx(FL,{})}),n.jsx(Wt,{path:"/memory/timeline",element:n.jsx(ZL,{})}),n.jsx(Wt,{path:"/memory/settings",element:n.jsx(QL,{})}),n.jsx(Wt,{path:"*",element:n.jsx(JL,{})})]})})})]})]})})})}const tN=document.getElementById("root");if(!tN)throw new Error("Root element not found");pE.createRoot(tN).render(n.jsx(tz,{}));</script>
684
- <style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:SF Mono,Cascadia Code,JetBrains Mono,Fira Code,ui-monospace,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-right-1\.5{right:-.375rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1\/2{left:50%}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-72{left:18rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[90\]{z-index:90}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-mb-px{margin-bottom:-1px}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-11{margin-left:2.75rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-4{margin-right:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[50vh\]{max-height:50vh}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0px}.min-h-16{min-height:4rem}.min-h-24{min-height:6rem}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[52px\]{width:52px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-48{min-width:12rem}.min-w-\[1\.25rem\]{min-width:1.25rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[120px\]{max-width:120px}.max-w-\[140px\]{max-width:140px}.max-w-\[200px\]{max-width:200px}.max-w-\[500px\]{max-width:500px}.max-w-\[90vw\]{max-width:90vw}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-2\.5{-moz-column-gap:.625rem;column-gap:.625rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border-subtle>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-divide-opacity, 1))}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[3px\]{border-width:3px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-\[3px\]{border-left-width:3px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.border-accent{--tw-border-opacity: 1;border-color:rgb(var(--accent) / var(--tw-border-opacity, 1))}.border-accent\/30{border-color:rgb(var(--accent) / .3)}.border-accent\/40{border-color:rgb(var(--accent) / .4)}.border-accent\/50{border-color:rgb(var(--accent) / .5)}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-400{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/30{border-color:#3b82f64d}.border-border{--tw-border-opacity: 1;border-color:rgb(var(--border) / var(--tw-border-opacity, 1))}.border-border-subtle{--tw-border-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-border-opacity, 1))}.border-border\/50{border-color:rgb(var(--border) / .5)}.border-current{border-color:currentColor}.border-cyan-400{--tw-border-opacity: 1;border-color:rgb(34 211 238 / var(--tw-border-opacity, 1))}.border-cyan-500\/20{border-color:#06b6d433}.border-cyan-500\/30{border-color:#06b6d44d}.border-danger{--tw-border-opacity: 1;border-color:rgb(var(--danger) / var(--tw-border-opacity, 1))}.border-emerald-400{--tw-border-opacity: 1;border-color:rgb(52 211 153 / var(--tw-border-opacity, 1))}.border-emerald-500\/20{border-color:#10b98133}.border-emerald-500\/30{border-color:#10b9814d}.border-emerald-500\/50{border-color:#10b98180}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/40{border-color:#22c55e66}.border-orange-400{--tw-border-opacity: 1;border-color:rgb(251 146 60 / var(--tw-border-opacity, 1))}.border-orange-500\/20{border-color:#f9731633}.border-orange-500\/30{border-color:#f973164d}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/40{border-color:#ef444466}.border-success\/20{border-color:rgb(var(--success) / .2)}.border-surface-3{--tw-border-opacity: 1;border-color:rgb(var(--surface-3) / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-violet-400{--tw-border-opacity: 1;border-color:rgb(167 139 250 / var(--tw-border-opacity, 1))}.border-violet-500{--tw-border-opacity: 1;border-color:rgb(139 92 246 / var(--tw-border-opacity, 1))}.border-violet-500\/20{border-color:#8b5cf633}.border-violet-500\/30{border-color:#8b5cf64d}.border-l-accent{--tw-border-opacity: 1;border-left-color:rgb(var(--accent) / var(--tw-border-opacity, 1))}.border-l-amber-400{--tw-border-opacity: 1;border-left-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-l-blue-400{--tw-border-opacity: 1;border-left-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-l-cyan-400{--tw-border-opacity: 1;border-left-color:rgb(34 211 238 / var(--tw-border-opacity, 1))}.border-l-orange-400{--tw-border-opacity: 1;border-left-color:rgb(251 146 60 / var(--tw-border-opacity, 1))}.border-l-red-400{--tw-border-opacity: 1;border-left-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.border-l-surface-4{--tw-border-opacity: 1;border-left-color:rgb(var(--surface-4) / var(--tw-border-opacity, 1))}.border-l-violet-400{--tw-border-opacity: 1;border-left-color:rgb(167 139 250 / var(--tw-border-opacity, 1))}.border-l-violet-500{--tw-border-opacity: 1;border-left-color:rgb(139 92 246 / var(--tw-border-opacity, 1))}.border-t-accent{--tw-border-opacity: 1;border-top-color:rgb(var(--accent) / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(var(--accent) / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:rgb(var(--accent) / .1)}.bg-accent\/15{background-color:rgb(var(--accent) / .15)}.bg-accent\/20{background-color:rgb(var(--accent) / .2)}.bg-accent\/5{background-color:rgb(var(--accent) / .05)}.bg-accent\/70{background-color:rgb(var(--accent) / .7)}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-amber-500\/5{background-color:#f59e0b0d}.bg-black\/50{background-color:#00000080}.bg-black\/70{background-color:#000000b3}.bg-black\/75{background-color:#000000bf}.bg-black\/80{background-color:#000c}.bg-black\/90{background-color:#000000e6}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-950\/30{background-color:#1725544d}.bg-border{--tw-bg-opacity: 1;background-color:rgb(var(--border) / var(--tw-bg-opacity, 1))}.bg-current{background-color:currentColor}.bg-cyan-400{--tw-bg-opacity: 1;background-color:rgb(34 211 238 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/10{background-color:#06b6d41a}.bg-cyan-500\/15{background-color:#06b6d426}.bg-cyan-500\/20{background-color:#06b6d433}.bg-cyan-600{--tw-bg-opacity: 1;background-color:rgb(8 145 178 / var(--tw-bg-opacity, 1))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-emerald-500\/20{background-color:#10b98133}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-500\/15{background-color:#6b728026}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-green-950\/40{background-color:#052e1666}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-orange-500\/15{background-color:#f9731626}.bg-orange-500\/20{background-color:#f9731633}.bg-pink-500\/20{background-color:#ec489933}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/15{background-color:#a855f726}.bg-purple-500\/20{background-color:#a855f733}.bg-purple-600\/20{background-color:#9333ea33}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-950\/40{background-color:#450a0a66}.bg-success\/10{background-color:rgb(var(--success) / .1)}.bg-success\/15{background-color:rgb(var(--success) / .15)}.bg-surface-0{--tw-bg-opacity: 1;background-color:rgb(var(--surface-0) / var(--tw-bg-opacity, 1))}.bg-surface-0\/95{background-color:rgb(var(--surface-0) / .95)}.bg-surface-1{--tw-bg-opacity: 1;background-color:rgb(var(--surface-1) / var(--tw-bg-opacity, 1))}.bg-surface-1\/95{background-color:rgb(var(--surface-1) / .95)}.bg-surface-2{--tw-bg-opacity: 1;background-color:rgb(var(--surface-2) / var(--tw-bg-opacity, 1))}.bg-surface-2\/50{background-color:rgb(var(--surface-2) / .5)}.bg-surface-3{--tw-bg-opacity: 1;background-color:rgb(var(--surface-3) / var(--tw-bg-opacity, 1))}.bg-surface-4{--tw-bg-opacity: 1;background-color:rgb(var(--surface-4) / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-400{--tw-bg-opacity: 1;background-color:rgb(167 139 250 / var(--tw-bg-opacity, 1))}.bg-violet-500\/10{background-color:#8b5cf61a}.bg-violet-500\/15{background-color:#8b5cf626}.bg-violet-500\/5{background-color:#8b5cf60d}.bg-violet-600{--tw-bg-opacity: 1;background-color:rgb(124 58 237 / var(--tw-bg-opacity, 1))}.bg-warning\/15{background-color:rgb(var(--warning) / .15)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/20{background-color:#eab30833}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-2\.5{padding-bottom:.625rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.font-display{font-family:SF Pro Display,Segoe UI,Helvetica Neue,system-ui,sans-serif}.font-mono{font-family:SF Mono,Cascadia Code,JetBrains Mono,Fira Code,ui-monospace,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.6rem\]{font-size:.6rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent{--tw-text-opacity: 1;color:rgb(var(--accent) / var(--tw-text-opacity, 1))}.text-accent\/60{color:rgb(var(--accent) / .6)}.text-amber-100\/90{color:#fef3c7e6}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-300\/50{color:#fcd34d80}.text-amber-300\/70{color:#fcd34db3}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-danger{--tw-text-opacity: 1;color:rgb(var(--danger) / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-400\/40{color:#34d39966}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200\/80{color:#fecacacc}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-400\/70{color:#f87171b3}.text-rose-400{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity, 1))}.text-success{--tw-text-opacity: 1;color:rgb(var(--success) / var(--tw-text-opacity, 1))}.text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity, 1))}.text-text-muted{--tw-text-opacity: 1;color:rgb(var(--text-muted) / var(--tw-text-opacity, 1))}.text-text-muted\/40{color:rgb(var(--text-muted) / .4)}.text-text-muted\/60{color:rgb(var(--text-muted) / .6)}.text-text-primary{--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.text-text-secondary{--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.text-text-tertiary{--tw-text-opacity: 1;color:rgb(var(--text-tertiary) / var(--tw-text-opacity, 1))}.text-violet-300{--tw-text-opacity: 1;color:rgb(196 181 253 / var(--tw-text-opacity, 1))}.text-violet-400{--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:rgb(var(--warning) / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_4px_rgba\(52\,211\,153\,0\.5\)\]{--tw-shadow: 0 0 4px rgba(52,211,153,.5);--tw-shadow-colored: 0 0 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(52\,211\,153\,0\.5\)\]{--tw-shadow: 0 0 6px rgba(52,211,153,.5);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(52\,211\,153\,0\.5\)\]{--tw-shadow: 0 0 8px rgba(52,211,153,.5);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-emerald-600\/25{--tw-shadow-color: rgb(5 150 105 / .25);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/25{--tw-shadow-color: rgb(239 68 68 / .25);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-accent{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--accent) / var(--tw-ring-opacity, 1))}.ring-accent\/30{--tw-ring-color: rgb(var(--accent) / .3)}.ring-accent\/40{--tw-ring-color: rgb(var(--accent) / .4)}.ring-current{--tw-ring-color: currentColor}.ring-surface-0{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--surface-0) / var(--tw-ring-opacity, 1))}.ring-offset-1{--tw-ring-offset-width: 1px}.ring-offset-surface-1{--tw-ring-offset-color: rgb(var(--surface-1) / 1)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}:root,.dark{--surface-0: 9 9 11;--surface-1: 20 20 23;--surface-2: 28 28 33;--surface-3: 37 37 41;--surface-4: 47 47 52;--border: 51 51 56;--border-subtle: 36 36 41;--text-primary: 250 250 250;--text-secondary: 161 161 170;--text-tertiary: 113 113 122;--text-muted: 82 82 91;--accent: 139 92 246;--accent-dim: 124 58 237;--success: 52 211 153;--warning: 251 191 36;--danger: 248 113 113}:root:not(.dark){--surface-0: 255 255 255;--surface-1: 249 250 251;--surface-2: 243 244 246;--surface-3: 229 231 235;--surface-4: 209 213 219;--border: 209 213 219;--border-subtle: 229 231 235;--text-primary: 17 24 39;--text-secondary: 75 85 99;--text-tertiary: 107 114 128;--text-muted: 156 163 175;--accent: 124 58 237;--accent-dim: 109 40 217;--success: 5 150 105;--warning: 217 119 6;--danger: 220 38 38}::-moz-selection{background-color:rgb(var(--accent) / .3);color:rgb(var(--text-primary))}::selection{background-color:rgb(var(--accent) / .3);color:rgb(var(--text-primary))}body{--tw-bg-opacity: 1;background-color:rgb(var(--surface-0) / var(--tw-bg-opacity, 1));font-family:SF Pro Text,Segoe UI,Helvetica Neue,system-ui,sans-serif;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:rgb(var(--surface-4));border-radius:3px}::-webkit-scrollbar-thumb:hover{background:rgb(var(--text-muted))}.md-render h1{margin-top:1.5rem;margin-bottom:.75rem;font-family:SF Pro Display,Segoe UI,Helvetica Neue,system-ui,sans-serif;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.md-render h2{margin-top:1.25rem;margin-bottom:.5rem;font-family:SF Pro Display,Segoe UI,Helvetica Neue,system-ui,sans-serif;font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.md-render h3{margin-top:1rem;margin-bottom:.375rem;font-family:SF Pro Display,Segoe UI,Helvetica Neue,system-ui,sans-serif;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.md-render h4{margin-top:.75rem;margin-bottom:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render h5,.md-render h6{margin-top:.625rem;margin-bottom:.25rem;font-size:.75rem;line-height:1rem;font-weight:600;text-transform:uppercase;letter-spacing:.025em;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render>:first-child{margin-top:0}.md-render p{margin-bottom:.75rem;font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render p:last-child{margin-bottom:0}.md-render strong{font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.md-render em{font-style:italic}.md-render del{text-decoration-line:line-through;opacity:.6}.md-render a{--tw-text-opacity: 1;color:rgb(var(--accent) / var(--tw-text-opacity, 1));text-decoration-line:underline;text-underline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.md-render a:hover{color:rgb(var(--accent) / .8)}.md-render code{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(var(--surface-3) / var(--tw-bg-opacity, 1));padding:.125rem .375rem;font-family:SF Mono,Cascadia Code,JetBrains Mono,Fira Code,ui-monospace,monospace;font-size:.75rem;line-height:1rem;--tw-text-opacity: 1;color:rgb(var(--accent) / var(--tw-text-opacity, 1))}.md-render pre{margin-bottom:.75rem;overflow-x:auto;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--surface-2) / var(--tw-bg-opacity, 1));padding:1rem}.md-render pre code{background-color:transparent;padding:0;font-size:13px;line-height:1.625;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render ul,.md-render ol{margin-bottom:.75rem;padding-left:1.25rem}.md-render ul{list-style-type:disc}.md-render ol{list-style-type:decimal}.md-render li{margin-bottom:.25rem;font-size:.875rem;line-height:1.25rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render ul ul{margin-top:.25rem;margin-bottom:0;list-style-type:circle}.md-render ul ul ul{list-style-type:square}.md-render li>ol,.md-render li>ul{margin-top:.25rem;margin-bottom:0}.md-render li>input[type=checkbox]{margin-right:.375rem;accent-color:rgb(var(--accent) / 1)}.md-render blockquote{margin-bottom:.75rem;border-top-right-radius:.5rem;border-bottom-right-radius:.5rem;border-left-width:2px;border-color:rgb(var(--accent) / .4);background-color:rgb(var(--accent) / .05);padding-top:.25rem;padding-bottom:.25rem;padding-left:1rem}.md-render blockquote p{font-style:italic;--tw-text-opacity: 1;color:rgb(var(--text-muted) / var(--tw-text-opacity, 1))}.md-render hr{margin-top:1.5rem;margin-bottom:1.5rem;border-width:0px;border-top-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-border-opacity, 1))}.md-render img{margin-top:.75rem;margin-bottom:.75rem;max-width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-border-opacity, 1))}.md-render table{margin-bottom:.75rem;width:100%;border-collapse:collapse;font-size:.875rem;line-height:1.25rem}.md-render th{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--border) / var(--tw-border-opacity, 1));background-color:rgb(var(--surface-2) / .7);padding:.5rem .75rem;text-align:left;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.md-render td{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--border-subtle) / var(--tw-border-opacity, 1));padding:.375rem .75rem;--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.md-render tr:nth-child(2n) td{background-color:rgb(var(--surface-2) / .5)}.md-render tr:hover td{--tw-bg-opacity: 1;background-color:rgb(var(--surface-2) / var(--tw-bg-opacity, 1))}.placeholder\:text-text-muted::-moz-placeholder{--tw-text-opacity: 1;color:rgb(var(--text-muted) / var(--tw-text-opacity, 1))}.placeholder\:text-text-muted::placeholder{--tw-text-opacity: 1;color:rgb(var(--text-muted) / var(--tw-text-opacity, 1))}.placeholder\:text-text-tertiary::-moz-placeholder{--tw-text-opacity: 1;color:rgb(var(--text-tertiary) / var(--tw-text-opacity, 1))}.placeholder\:text-text-tertiary::placeholder{--tw-text-opacity: 1;color:rgb(var(--text-tertiary) / var(--tw-text-opacity, 1))}.first\:border-t-0:first-child{border-top-width:0px}.first\:pt-0:first-child{padding-top:0}.last\:mb-0:last-child{margin-bottom:0}.focus-within\:border-accent\/50:focus-within{border-color:rgb(var(--accent) / .5)}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(var(--accent) / var(--tw-border-opacity, 1))}.hover\:border-accent\/30:hover{border-color:rgb(var(--accent) / .3)}.hover\:border-accent\/50:hover{border-color:rgb(var(--accent) / .5)}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:rgb(var(--accent) / var(--tw-bg-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:rgb(var(--accent) / .1)}.hover\:bg-accent\/15:hover{background-color:rgb(var(--accent) / .15)}.hover\:bg-accent\/90:hover{background-color:rgb(var(--accent) / .9)}.hover\:bg-amber-500\/10:hover{background-color:#f59e0b1a}.hover\:bg-cyan-500\/15:hover{background-color:#06b6d426}.hover\:bg-cyan-700:hover{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-500:hover{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-500\/10:hover{background-color:#10b9811a}.hover\:bg-emerald-500\/15:hover{background-color:#10b98126}.hover\:bg-emerald-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 120 87 / var(--tw-bg-opacity, 1))}.hover\:bg-red-400:hover{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-surface-1:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-1) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-2:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-2) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-2\/50:hover{background-color:rgb(var(--surface-2) / .5)}.hover\:bg-surface-3:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-3) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-3\/50:hover{background-color:rgb(var(--surface-3) / .5)}.hover\:bg-violet-700:hover{--tw-bg-opacity: 1;background-color:rgb(109 40 217 / var(--tw-bg-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(var(--accent) / var(--tw-text-opacity, 1))}.hover\:text-accent\/80:hover{color:rgb(var(--accent) / .8)}.hover\:text-amber-300:hover{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-emerald-300:hover{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-text-primary:hover{--tw-text-opacity: 1;color:rgb(var(--text-primary) / var(--tw-text-opacity, 1))}.hover\:text-text-secondary:hover{--tw-text-opacity: 1;color:rgb(var(--text-secondary) / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(var(--accent) / var(--tw-border-opacity, 1))}.focus\:border-violet-500:focus{--tw-border-opacity: 1;border-color:rgb(139 92 246 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-inset:focus{--tw-ring-inset: inset}.focus\:ring-accent:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--accent) / var(--tw-ring-opacity, 1))}.focus\:ring-accent\/50:focus{--tw-ring-color: rgb(var(--accent) / .5)}.focus\:ring-offset-0:focus{--tw-ring-offset-width: 0px}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-surface-1:focus{--tw-ring-offset-color: rgb(var(--surface-1) / 1)}.active\:scale-\[0\.97\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:hover\:bg-surface-2:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(var(--surface-2) / var(--tw-bg-opacity, 1))}.group:hover .group-hover\:text-accent{--tw-text-opacity: 1;color:rgb(var(--accent) / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:hidden{display:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:col-span-3{grid-column:span 3 / span 3}.md\:col-span-8{grid-column:span 8 / span 8}.md\:col-span-9{grid-column:span 9 / span 9}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:p-10{padding:2.5rem}}@media(min-width:1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:col-span-3{grid-column:span 3 / span 3}.lg\:col-span-4{grid-column:span 4 / span 4}.lg\:col-span-8{grid-column:span 8 / span 8}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-80{width:20rem}.lg\:shrink-0{flex-shrink:0}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:flex-col{flex-direction:column}.lg\:p-6{padding:1.5rem}.lg\:p-8{padding:2rem}}@media(min-width:1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
685
- Theme: GitHub Dark
686
- Description: Dark theme as seen on github.com
687
- Author: github.com
688
- Maintainer: @Hirse
689
- Updated: 2021-05-15
690
-
691
- Outdated base version: https://github.com/primer/github-syntax-dark
692
- Current colors taken from GitHub's CSS
693
- */.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}</style>
694
- </head>
695
- <body>
696
- <div id="root"></div>
697
- </body>
698
- </html>