@dylanpiercey/work 0.0.27 → 0.0.28
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.
- package/dist/index.mjs +193 -190
- package/dist/public/assets/{_k8h5DW7b.js → _599s_mPO.js} +2 -2
- package/dist/public/assets/{_k8h5DW7b.js.map → _599s_mPO.js.map} +1 -1
- package/dist/public/assets/{_BUXTK4lJ.js → _7EfSt1VP.js} +2 -2
- package/dist/public/assets/{_BUXTK4lJ.js.map → _7EfSt1VP.js.map} +1 -1
- package/dist/public/assets/{_CyzHhkSz.js → _8z_taKm3.js} +2 -2
- package/dist/public/assets/{_CyzHhkSz.js.map → _8z_taKm3.js.map} +1 -1
- package/dist/public/assets/{_CZpWy771.js → _B1jQI_MS.js} +2 -2
- package/dist/public/assets/{_CZpWy771.js.map → _B1jQI_MS.js.map} +1 -1
- package/dist/public/assets/{_BhHBCWCj.js → _B1j_sdSo.js} +2 -2
- package/dist/public/assets/{_BhHBCWCj.js.map → _B1j_sdSo.js.map} +1 -1
- package/dist/public/assets/{_6Fcx5D9i.js → _BEA0rtsf.js} +2 -2
- package/dist/public/assets/{_6Fcx5D9i.js.map → _BEA0rtsf.js.map} +1 -1
- package/dist/public/assets/{_BNp5XLge2.js → _BF0cJ2cO2.js} +2 -2
- package/dist/public/assets/{_BNp5XLge2.js.map → _BF0cJ2cO2.js.map} +1 -1
- package/dist/public/assets/{_Bxc-rPnR.js → _BG98a-Bd.js} +2 -2
- package/dist/public/assets/{_Bxc-rPnR.js.map → _BG98a-Bd.js.map} +1 -1
- package/dist/public/assets/{_B8nux85Y2.js → _BHXWNTj72.js} +2 -2
- package/dist/public/assets/{_B8nux85Y2.js.map → _BHXWNTj72.js.map} +1 -1
- package/dist/public/assets/{_B2t7eRJv2.js → _BIZVez4e2.js} +2 -2
- package/dist/public/assets/{_B2t7eRJv2.js.map → _BIZVez4e2.js.map} +1 -1
- package/dist/public/assets/{_SbEDD5sS2.js → _BTLEtyOE2.js} +2 -2
- package/dist/public/assets/{_SbEDD5sS2.js.map → _BTLEtyOE2.js.map} +1 -1
- package/dist/public/assets/{_Bw8AbEkz.js → _BX-1MhYY.js} +2 -2
- package/dist/public/assets/{_Bw8AbEkz.js.map → _BX-1MhYY.js.map} +1 -1
- package/dist/public/assets/{_jNIFnvkH.js → _Bg_ZrvlF.js} +2 -2
- package/dist/public/assets/{_jNIFnvkH.js.map → _Bg_ZrvlF.js.map} +1 -1
- package/dist/public/assets/{_xH8kCfq2.js → _BkCe1Qp0.js} +2 -2
- package/dist/public/assets/{_xH8kCfq2.js.map → _BkCe1Qp0.js.map} +1 -1
- package/dist/public/assets/{_IKBWE1IQ.js → _BkYaxto4.js} +2 -2
- package/dist/public/assets/{_IKBWE1IQ.js.map → _BkYaxto4.js.map} +1 -1
- package/dist/public/assets/{_cJF5JKj1.js → _Br-vX1Tu.js} +2 -2
- package/dist/public/assets/{_cJF5JKj1.js.map → _Br-vX1Tu.js.map} +1 -1
- package/dist/public/assets/{_ipAOmiqc.js → _ByJ8bIho.js} +2 -2
- package/dist/public/assets/{_ipAOmiqc.js.map → _ByJ8bIho.js.map} +1 -1
- package/dist/public/assets/{_CQQsLoJf2.js → _ByVz1pEI2.js} +2 -2
- package/dist/public/assets/{_CQQsLoJf2.js.map → _ByVz1pEI2.js.map} +1 -1
- package/dist/public/assets/{_Bm2CKqh32.js → _C1uLH64z2.js} +2 -2
- package/dist/public/assets/{_Bm2CKqh32.js.map → _C1uLH64z2.js.map} +1 -1
- package/dist/public/assets/{_BjM37MRx.js → _C1v_RN4j.js} +2 -2
- package/dist/public/assets/{_BjM37MRx.js.map → _C1v_RN4j.js.map} +1 -1
- package/dist/public/assets/{_CsORzCSG.js → _C2awCEWl.js} +2 -2
- package/dist/public/assets/{_CsORzCSG.js.map → _C2awCEWl.js.map} +1 -1
- package/dist/public/assets/{_D2fmkodJ2.js → _CCxovD8F2.js} +2 -2
- package/dist/public/assets/{_D2fmkodJ2.js.map → _CCxovD8F2.js.map} +1 -1
- package/dist/public/assets/{_CgF-PZ5_.js → _CE1QtCTP.js} +2 -2
- package/dist/public/assets/{_CgF-PZ5_.js.map → _CE1QtCTP.js.map} +1 -1
- package/dist/public/assets/{_XoS-gv2A.js → _CHLq34up.js} +2 -2
- package/dist/public/assets/{_XoS-gv2A.js.map → _CHLq34up.js.map} +1 -1
- package/dist/public/assets/{_DC2Xj-J82.js → _CK7dNIXj2.js} +2 -2
- package/dist/public/assets/{_DC2Xj-J82.js.map → _CK7dNIXj2.js.map} +1 -1
- package/dist/public/assets/{_CtmneVE32.js → _CMGOcqMA2.js} +2 -2
- package/dist/public/assets/{_CtmneVE32.js.map → _CMGOcqMA2.js.map} +1 -1
- package/dist/public/assets/{_B-UOuIXW2.js → _CNdGjx_J2.js} +2 -2
- package/dist/public/assets/{_B-UOuIXW2.js.map → _CNdGjx_J2.js.map} +1 -1
- package/dist/public/assets/{_C4ksDlX4.js → _CQW9g4EM.js} +2 -2
- package/dist/public/assets/{_C4ksDlX4.js.map → _CQW9g4EM.js.map} +1 -1
- package/dist/public/assets/{_BpxKj3fb.js → _CYIktEVH.js} +2 -2
- package/dist/public/assets/{_BpxKj3fb.js.map → _CYIktEVH.js.map} +1 -1
- package/dist/public/assets/{_DsvFQlDq.js → _CYvarg9W.js} +2 -2
- package/dist/public/assets/{_DsvFQlDq.js.map → _CYvarg9W.js.map} +1 -1
- package/dist/public/assets/{_CaCXvqxm.js → _Ccm3rKVf.js} +2 -2
- package/dist/public/assets/{_CaCXvqxm.js.map → _Ccm3rKVf.js.map} +1 -1
- package/dist/public/assets/{_BsOS4GJz2.js → _CiA4dPfT2.js} +2 -2
- package/dist/public/assets/{_BsOS4GJz2.js.map → _CiA4dPfT2.js.map} +1 -1
- package/dist/public/assets/{_DAX0iAZb2.js → _Cp-Aarc52.js} +2 -2
- package/dist/public/assets/{_DAX0iAZb2.js.map → _Cp-Aarc52.js.map} +1 -1
- package/dist/public/assets/{_wB7-64Qk.js → _CpUOMlac.js} +2 -2
- package/dist/public/assets/{_wB7-64Qk.js.map → _CpUOMlac.js.map} +1 -1
- package/dist/public/assets/{_BDHG3pN8.js → _CqfjUWNC.js} +2 -2
- package/dist/public/assets/{_BDHG3pN8.js.map → _CqfjUWNC.js.map} +1 -1
- package/dist/public/assets/{_HmZ46EU-.js → _CwjXbHzo.js} +2 -2
- package/dist/public/assets/{_HmZ46EU-.js.map → _CwjXbHzo.js.map} +1 -1
- package/dist/public/assets/{_CILSW09C.js → _CwmqjsDb.js} +2 -2
- package/dist/public/assets/{_CILSW09C.js.map → _CwmqjsDb.js.map} +1 -1
- package/dist/public/assets/{_C32Tdcjq.js → _Cz_1vtBu.js} +2 -2
- package/dist/public/assets/{_C32Tdcjq.js.map → _Cz_1vtBu.js.map} +1 -1
- package/dist/public/assets/{_CbOW3Qss.js → _D2PHPuf-.js} +2 -2
- package/dist/public/assets/{_CbOW3Qss.js.map → _D2PHPuf-.js.map} +1 -1
- package/dist/public/assets/{_rbd-OpBS.js → _D6mnVZvL.js} +2 -2
- package/dist/public/assets/{_rbd-OpBS.js.map → _D6mnVZvL.js.map} +1 -1
- package/dist/public/assets/{_O6zku0Kn.js → _DA2HAsmL.js} +2 -2
- package/dist/public/assets/{_O6zku0Kn.js.map → _DA2HAsmL.js.map} +1 -1
- package/dist/public/assets/{_DktWaxA8.js → _DB4u0VFp.js} +2 -2
- package/dist/public/assets/{_DktWaxA8.js.map → _DB4u0VFp.js.map} +1 -1
- package/dist/public/assets/{_DGsXFfnh2.js → _DDFWuRVz2.js} +2 -2
- package/dist/public/assets/{_DGsXFfnh2.js.map → _DDFWuRVz2.js.map} +1 -1
- package/dist/public/assets/{_lTS8Eg0V2.js → _DHNkWyG72.js} +2 -2
- package/dist/public/assets/{_lTS8Eg0V2.js.map → _DHNkWyG72.js.map} +1 -1
- package/dist/public/assets/{_CRjIS-nr.js → _DI0WPTfJ.js} +2 -2
- package/dist/public/assets/{_CRjIS-nr.js.map → _DI0WPTfJ.js.map} +1 -1
- package/dist/public/assets/{_Cc-O1azs.js → _DJ1rqVCG.js} +2 -2
- package/dist/public/assets/{_Cc-O1azs.js.map → _DJ1rqVCG.js.map} +1 -1
- package/dist/public/assets/{_CJhxWkis2.js → _DNYpQ8c_2.js} +2 -2
- package/dist/public/assets/{_CJhxWkis2.js.map → _DNYpQ8c_2.js.map} +1 -1
- package/dist/public/assets/{_CTz_hU3k2.js → _DNtDpT7J2.js} +2 -2
- package/dist/public/assets/{_CTz_hU3k2.js.map → _DNtDpT7J2.js.map} +1 -1
- package/dist/public/assets/{_CIDwMDlU.js → _DPSelcsm.js} +2 -2
- package/dist/public/assets/{_CIDwMDlU.js.map → _DPSelcsm.js.map} +1 -1
- package/dist/public/assets/{_DpyJdHLB2.js → _DPt_dOB32.js} +2 -2
- package/dist/public/assets/{_DpyJdHLB2.js.map → _DPt_dOB32.js.map} +1 -1
- package/dist/public/assets/{_Blx-QhC42.js → _DTfT-sFF2.js} +2 -2
- package/dist/public/assets/{_Blx-QhC42.js.map → _DTfT-sFF2.js.map} +1 -1
- package/dist/public/assets/{_r_JHGP4r.js → _DVlxgdsm.js} +2 -2
- package/dist/public/assets/{_r_JHGP4r.js.map → _DVlxgdsm.js.map} +1 -1
- package/dist/public/assets/{_jSREeQIf.js → _DVszDPmx.js} +2 -2
- package/dist/public/assets/{_jSREeQIf.js.map → _DVszDPmx.js.map} +1 -1
- package/dist/public/assets/{_DSgRvNDs.js → _DWHvByuS.js} +2 -2
- package/dist/public/assets/{_DSgRvNDs.js.map → _DWHvByuS.js.map} +1 -1
- package/dist/public/assets/{_DjvE6GSd.js → _DWKZhwbB.js} +2 -2
- package/dist/public/assets/{_DjvE6GSd.js.map → _DWKZhwbB.js.map} +1 -1
- package/dist/public/assets/{_gaXUm7Ph.js → _DZxfPQXv.js} +2 -2
- package/dist/public/assets/{_gaXUm7Ph.js.map → _DZxfPQXv.js.map} +1 -1
- package/dist/public/assets/{_DngrSHmN.js → _DcATy5r-.js} +2 -2
- package/dist/public/assets/{_DngrSHmN.js.map → _DcATy5r-.js.map} +1 -1
- package/dist/public/assets/{_CLZUfNOi.js → _DdqCKkdW.js} +2 -2
- package/dist/public/assets/{_CLZUfNOi.js.map → _DdqCKkdW.js.map} +1 -1
- package/dist/public/assets/{_Qm4Ud6cR.js → _Djl1TRVn.js} +2 -2
- package/dist/public/assets/{_Qm4Ud6cR.js.map → _Djl1TRVn.js.map} +1 -1
- package/dist/public/assets/{_DT4PVQNh.js → _DmYu9jHv.js} +2 -2
- package/dist/public/assets/{_DT4PVQNh.js.map → _DmYu9jHv.js.map} +1 -1
- package/dist/public/assets/{_CRQMg1X9.js → _DwJU6EeU.js} +2 -2
- package/dist/public/assets/{_CRQMg1X9.js.map → _DwJU6EeU.js.map} +1 -1
- package/dist/public/assets/{_goN0hfB3.js → _JVRw7xKf.js} +2 -2
- package/dist/public/assets/{_goN0hfB3.js.map → _JVRw7xKf.js.map} +1 -1
- package/dist/public/assets/{_rH6un46m2.js → _Km9UGEJN2.js} +2 -2
- package/dist/public/assets/{_rH6un46m2.js.map → _Km9UGEJN2.js.map} +1 -1
- package/dist/public/assets/{_hEOkUobY.js → _NVM5qbq7.js} +2 -2
- package/dist/public/assets/{_hEOkUobY.js.map → _NVM5qbq7.js.map} +1 -1
- package/dist/public/assets/{_DNKb4wZ8.js → _Q4XgVPG6.js} +2 -2
- package/dist/public/assets/{_DNKb4wZ8.js.map → _Q4XgVPG6.js.map} +1 -1
- package/dist/public/assets/{_PIyxaGSC.js → _WrsJ1SVx.js} +2 -2
- package/dist/public/assets/{_PIyxaGSC.js.map → _WrsJ1SVx.js.map} +1 -1
- package/dist/public/assets/{_DPGFJ6Li2.js → _Zlv_lPYo2.js} +2 -2
- package/dist/public/assets/{_DPGFJ6Li2.js.map → _Zlv_lPYo2.js.map} +1 -1
- package/dist/public/assets/{_D_W0W1cX.js → _afjtTIwy.js} +2 -2
- package/dist/public/assets/{_D_W0W1cX.js.map → _afjtTIwy.js.map} +1 -1
- package/dist/public/assets/{_DRHywp9A2.js → _doUtVqO32.js} +2 -2
- package/dist/public/assets/{_DRHywp9A2.js.map → _doUtVqO32.js.map} +1 -1
- package/dist/public/assets/{_AaWDncwx2.js → _iFGGC9pM2.js} +2 -2
- package/dist/public/assets/{_AaWDncwx2.js.map → _iFGGC9pM2.js.map} +1 -1
- package/dist/public/assets/{_Dp6nvOUq2.js → _txg_BrbE2.js} +2 -2
- package/dist/public/assets/{_Dp6nvOUq2.js.map → _txg_BrbE2.js.map} +1 -1
- package/dist/public/assets/{_ySYn5emK2.js → _xYLJb0_42.js} +2 -2
- package/dist/public/assets/{_ySYn5emK2.js.map → _xYLJb0_42.js.map} +1 -1
- package/dist/public/assets/{_B0alns9R.js → _yvxe882E.js} +2 -2
- package/dist/public/assets/{_B0alns9R.js.map → _yvxe882E.js.map} +1 -1
- package/dist/public/assets/{_4fQaDKgf.js → _zSSacvcn.js} +2 -2
- package/dist/public/assets/{_4fQaDKgf.js.map → _zSSacvcn.js.map} +1 -1
- package/dist/public/assets/index-BWFFuQvr.css +1 -0
- package/dist/public/assets/{index-BevHvc5w.js → index-DZa_eHPR.js} +9 -9
- package/dist/public/assets/{index-BevHvc5w.js.map → index-DZa_eHPR.js.map} +1 -1
- package/package.json +1 -1
- package/dist/public/assets/index-C8Tlu8lR.css +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/
|
|
2
|
-
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(nee)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Le());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Ie(r.$,r.F)),i===48&&(r[a(c++)]=Le());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,E={},D=/[\p{L}\p{N}]/gu,ce=``,le={},ue={},O=xe((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(lt(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&$t(t,e,r[t[n]=i],st)}}),de=xe((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||Ve(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),iee(l))}}),fe=xe((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=be(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if($t(a,e,l||(t?t(a):void 0),en),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);$t(a[i],`a`,e,st),e.f&&Je(e.e,e.f,a[i].Aa)}}else l?.f&&Je(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?gt:_t)(e,`a`,(r?n[0]:n)||{},ue[e.a.tagName]),(e.Ia||e.Ea)&&Te(e,Qt);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),pe=xe(e=>{e=a(e);let t=`A`+e,n=`D`+e;return(r,i)=>{if(r[n]!==(r[n]=i?.a||i)&&($t(r,e,i,st),i?.f&&Je(i.e,i.f,r[t])),i)for(let e in i.g)i.g[e](r[t],i.h[e])}}),k=xe(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=lt(``,n,r,i)();return(n,r)=>{let i=n[t],a=Me(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=st(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Be:ze),_||(f.textContent=``));for(let e of u)Ve(e,f,v);return}if(p)p.forEach(Be);else for(let e=g;e<d;e++)Be(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)Ve(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:Ve(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=tn,typeof t==`string`?Se(e,(e,r)=>n(e[t],[e,r])):Se(e,(e,r)=>n(t(e,r),[e,r]))});function me(e,t){return t?e:``}function he(e,t){return t||t===0?ge(e)+`:`+ge(t+``):``}function ge(e){return n.test(e)?e.replace(n,r):e}function _e(e){return/^on[A-Z-]/.test(e)}function ve(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ye(e){return e!=null&&e!==!1}function be(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function xe(e){return o=1,e}function Se(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Ce(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);we(a)}function we(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Te(e,t){d.push(t,e)}function Ee(){let e=d;try{s=1,eee()}finally{c++,s=0,f=[],d=[]}p(e)}function De(e,t){h=1,xe(),p=e(p),m=t(m)}function eee(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function Oe(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Te(n,je):je(n))}function ke(e,t){return Ae(e),((e.A||={})[t]||=new AbortController).signal}function Ae(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function je(e){e.abort()}function Me(e){return e?Array.isArray(e)?e:[e]:[]}function Ne(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function tee(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function A(e,t,n){e[1+t]===void 0&&g(t,Pe),e[1+t]=n||null}function Pe(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Fe(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Ie(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Le(){return v++}function Re(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function ze(e){e.N?.D?.delete(e),b(e)}function nee(e){e.Z?.forEach(ree,e);for(let t in e.A)Oe(e,t)}function ree(e){e.delete(this)}function Be(e){ze(e),Et(e.S,e.K)}function Ve(e,t,n){Dt(t,n,e.S,e.K)}function iee(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,Dt(t,null,e.S,e.K)}function aee(){x||(x=1,queueMicrotask(oee))}function oee(){requestAnimationFrame(He),Ee()}function He(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,Ee()}),S.port2.postMessage(0)}function j(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(aee(),Ce(r,t,e)),i)}function Ue(e,t){let n=a(e),r=a(e+1),i=j(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function M(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function N(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Ce(i,t,e,0,i[r])}}function We(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Me(e[n]);r.length&&Ce(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Ge(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Me(e[i]);if(e.H<c&&a.length){let c=e[t];Ce(e,()=>{let t=Ke(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&(qe(e,r),qe(n,r))}else for(let t of Me(e[i]))qe(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Ke(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Me(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function qe(e,t){e&&e.H>0&&e.H<c&&t(e)}function P(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Ce(a,n,-1)};return o._=n,o}function Je(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&Ae(n,r)}function F(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Ce(i,e[i[r]||0],-1)}}function I(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),Je(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&R(r,i),i}function Ye(e,t,n){e[a(t)].T=t=>n(e,t)}function Xe({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function L(e,t){return R(e,t),e=>{Te(e,t)}}function*Ze(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*Ze(r,t,n);else{let r=e[t[n]];n?yield*Ze(r,t,n-1):yield typeof r==`function`?r():r}}}function Qe(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>Ze(t,e).next().value;return n[Symbol.iterator]=()=>Ze(t,e),n}}function $e(e,...t){return R(e,Qe(...t))}function et(e,t,n){C=e,ne(0,t,n)}function tt(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ot(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=tee(a,c),u&&(b[u]=a,Ne(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ot(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),nt(r)},r})})};if(t){r(t);for(let e in t)nt(ae(e))}else n({configurable:!0,set:r})}function nt(e){try{T=1,p(e.m([]),1)}finally{T=0}}function R(e,t){return ie[e]=t}function rt(e,t){return R(e,e=>n=>t(e,n)),t}function it(e,t){return t=a(t),R(e,e=>()=>e[t])}function at(e,t,n,r){let i=Ie(e);return i._=t.e||n,ot(i,n?.F),t.b?.(i,r.namespaceURI),i}function ot(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function st(e,t,n,r){return ct(t,at(e,t,n,r))}function ct(e,t){return e.c&&Ce(t,e.c,-1),t}function lt(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((E[r]||={})[1+t]||=see(t,r))(e,n)}:e=>{et(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function ut(e,t,n,r,i,a){return R(e,lt(e,t,n,r,i,a))}function see(e,t){let{firstChild:n,lastChild:r}=Fe(e,t),i=document.createElementNS(t,`t`);return Dt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{et(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);et(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function dt(e){return e||e===0?e+``:``}function z(e,t,n){ft(e,t,wt(n))}function ft(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function B(e,t){ft(e,`class`,i(t,` `,me)||void 0)}function pt(e,t){for(let n in t)mt(e,n,t[n])}function mt(e,t,n){e.classList.toggle(t,!!n)}function ht(e,t){ft(e,`style`,i(t,`;`,he)||void 0)}function V(e,t){let n=dt(t);e.data!==n&&(e.data=n)}function gt(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||vt(i,t,n))||i.removeAttribute(t)}bt(e,t,n,r)}function _t(e,t,n,r){gt(e,t,n,r),xt(e,t,n?.content)}function vt(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function yt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||vt(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=_e(e)?`on-${ve(e)}`:e;r[t]||(o[t]=n[e])}bt(e,t,o,i)}function bt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:B(i,s);break;case`style`:ht(i,s);break;default:_e(r)?(a||=e[`I`+t]={})[ve(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||z(i,r,s)}}}function xt(e,t,n){let r=Ct(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&($t(e,t,r,st),r?.f&&Je(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function St(e,t){let n=e[t],r=e[`I`+t];le[e[`F`+t]]?.(e,t);for(let e in r)A(n,e,r[e])}function Ct(e){let t=be(e);if(t&&t.a)return t}function wt(e){if(ye(e))return e===!0?``:e+``}function Tt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),ke(e,r).onabort=()=>t.onDestroy?.())}function Et(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function Dt(e,t,n,r){if(e.isConnected)e.insertBefore(Ot(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Ot(e,t){return e===t?e:Dt(new DocumentFragment,null,e,t)}function kt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(D)?.length;for(;a&&D.test(r);)a--;return a?r.length:D.lastIndex}return-1}function At(e,t,n){let r=e[t],i=ye(n);if(r.defaultChecked!==i){let t=e.H<c?r.checked:i;r.defaultChecked=i,t!==i&&(r.checked=t)}}function jt(e,t,n,r){let i=e[t],a=ye(n);e[`E`+t]=r,e[`F`+t]=r?0:5,r&&e.H<c?i.checked=a:At(e,t,a)}function Mt(e,t){let n=e[t];Ht(n,Kt,()=>{let r=e[`E`+t];if(r){let e=n.checked;n.checked=!e,r(e),Ee()}})}function cee(e,t,n){let r=e[t],i=wt(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Ft(r,t)}}function Nt(e,t,n,r,i=cee){let a=e[t],o=wt(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Ft(a,o):i(e,t,o)}function Pt(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Ht(n,Gt,r=>{let i=e[`E`+t];i&&(ce=r?.inputType,i(n.value),Ee(),Ft(n,e[`G`+t]),ce=``)})}function Ft(e,t){if(e.value!==t){let n=kt(ce,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function lee(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Yt):Yt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=zt(i,o)),e.defaultSelected=t)}r!==void 0&&Rt(i,r,o)},e)}function It(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Yt):Yt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Rt(i,s,o),e):lee(e,t,s)}function Lt(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=zt(n,a);Rt(n,i,a),r(o),Ee()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Ht(n,qt,r),Vt(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Rt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function zt(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function Bt(e,t,n){e.H===c&&(e[t].open=ye(n))}function uee(e,t,n,r){let i=e[`G`+t]=ye(n);e[`E`+t]=r,e[`F`+t]=r?4:5,r&&e.H<c?e[t].open=i:Bt(e,t,i)}function dee(e,t){let n=e[t];Vt(e,t,{attributes:!0,attributeFilter:[`open`]},()=>{let r=e[`E`+t];if(r&&n.open===!e[`G`+t]){let e=n.open;n.open=!e,r(e),Ee()}})}function Vt(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Ht(e,t,n){e._=n,g(`input`,Ut),e.form&&g(`reset`,Wt),T&&t(e)&&queueMicrotask(n)}function Ut(e){e.target._?.(e)}function Wt(e){let t=[];for(let n of e.target.elements)n._&&Jt(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Gt(e){return e.value!==e.defaultValue}function Kt(e){return e.checked!==e.defaultChecked}function qt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function Jt(e){return e.options?qt(e):Gt(e)||Kt(e)}function Yt(e){return wt(e)||``}function Xt(e,t,n){if(`open`in n||`openChange`in n)return uee(e,t,n.open,n.openChange),/^open(?:Change)?$/}function Zt(e,t){let n=Re(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,ze(n)),l.add(d),$t(e,n.C,n.E,st),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function Qt(e){St(e,`a`)}function $t(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(ze(a),i.textContent=``),s&&Ve(s,o,null)):a?(s?Ve(s,o,a.S):o.insertBefore(i,a.S),Be(a)):s&&(Ve(s,o,i),i.remove())}function en(e,t,n,r){let i=at(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):ct(t,i),i}function tn(e,t){return t}var nn=[],rn=Symbol();function an(e){return e[Symbol.iterator]=on,e[rn]=nn,e}function*on(){yield this,yield*this[rn]}var sn={boot:`_a`};async function cn(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function ln(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var un=[`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`],dn=1e4,fn=4e4,pn=8e3,mn=5e3,hn=6e4,gn,_n,vn=null,yn,bn,xn,Sn,Cn=0;function wn(e){_n&&e!==_n&&location.reload(),_n=e}async function Tn(){try{wn((await cn(`/api/boot`)).boot)}catch{}}function En(){clearTimeout(bn),clearTimeout(xn),xn=setTimeout(Dn,fn),Cn&&(Cn=0,clearInterval(Sn),Sn=void 0)}function Dn(){On(),!Cn&&(Cn=Date.now(),Sn=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-Cn>hn&&(Cn=Date.now(),An()),kn(),Tn(),cn(`/api/status`).then(e=>{gn.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},mn))}function On(){clearTimeout(bn),clearTimeout(xn),vn?.close(),vn=null}function kn(){for(let e of[`workspaces.changed`,`sessions.changed`])gn.dispatchEvent(new MessageEvent(e,{data:null}))}function An(){if(vn)return;let e=vn=new EventSource(`/api/events`);clearTimeout(bn),bn=setTimeout(Dn,pn),e.addEventListener(`hello`,e=>{En(),wn(JSON.parse(e.data||`{}`).boot)}),e.addEventListener(`ping`,En);for(let t of un)e.addEventListener(t,e=>{En(),gn.dispatchEvent(new MessageEvent(t,{data:JSON.parse(e.data||`null`)}))})}function jn(){return gn||(gn=new EventTarget,An(),Tn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(yn),An(),Tn(),kn()):(clearTimeout(yn),yn=setTimeout(()=>{Cn||On()},dn))})),gn}var Mn=null,Nn=null,Pn=new EventTarget;function fee(e,t){Pn.addEventListener(`intent`,e,{signal:t})}function Fn(e,t){Mn={workspaceId:e,pr:t},Pn.dispatchEvent(new Event(`intent`))}function In(e){if(Mn?.workspaceId!==e)return!1;let t=Mn.pr;return Mn=null,{pr:t}}function Ln(e,t){Nn=[e,t],Pn.dispatchEvent(new Event(`intent`))}function Rn(e){if(Nn?.[0]!==e)return null;let t=Nn[1];return Nn=null,t}function zn(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Bn=new Map,Vn=new Set,Hn;function Un(e){for(let[t,n]of Object.entries(e))Vn.has(t)||Bn.set(t,n);typeof window<`u`&&(Hn??=Promise.resolve())}function Wn(e){return Bn.get(e)??null}function Gn(e,t){Vn.add(e),t===null?Bn.delete(e):Bn.set(e,t),Kn(e,t)}function Kn(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function qn(e){Gn(`last-workspace`,e)}function Jn(){return Wn(`side-nav`)!==`0`}function Yn(e){Gn(`side-nav`,e?`1`:`0`)}function Xn(e){return Wn(`tab:${e}`)}function Zn(e,t){Gn(`tab:${e}`,t)}function Qn(){return Wn(`diff-tree`)!==`0`}function $n(e){Gn(`diff-tree`,e?`1`:`0`)}function er(){return Wn(`diff-uncommitted`)===`1`}function tr(e){Gn(`diff-uncommitted`,e?`1`:`0`)}function nr(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function rr(){return nr()?(await sr()).pushManager.getSubscription():null}async function ir(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await sr(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await cn(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:cr(n)})}return await cn(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function ar(){let e=await rr();e&&(await cn(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function or(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function sr(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function cr(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function lr(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function ur(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function dr(){return typeof navigator<`u`&&navigator.standalone===!0}function fr(e){if(!dr()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var pr={toast:`_i`,toastFloat:`_j`,toastInline:`_k`,toastError:`_l`,toastTitle:`_m`,toastWarn:`_n`,toastInfo:`_o`,toastBody:`_p`,toastContent:`_q`,toastActions:`_r`,toastDismiss:`_s _cP`},mr=`<div><div><!><!></div><!></div>`,hr=` D D%b%l%l`,gr=L(`v0`,e=>A(e.a,`click`,function(){e._._.o?.()})),_r=e=>{B(e.a,pr.toastDismiss),gr(e)},vr=fe(0),yr=I(26,e=>vr(e,e._._.n),e=>e._._),br=O(1,`<!><!><!>`,`b%`,yr),xr=P(4,0,e=>br(e,+!e._.m)),Sr=e=>{xr._(e),wr._(e),B(e.a,pr.toastActions)},Cr=O(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,_r),wr=P(4,0,e=>Cr(e,+!e._.o)),Tr=fe(1),Er=P(3,0,e=>Tr(e,e._.l)),Dr=e=>{Er._(e),B(e.a,pr.toastContent)},Or=P(2,0,e=>V(e.b,e._.j)),kr=e=>{Or._(e),B(e.a,pr.toastTitle)},Ar=N(22,e=>B(e.a,[pr.toast,e.u,e.v,e.k]),2),jr=M(20,Ar),Mr=(e,t)=>{z(e.a,`role`,t===`error`?`alert`:`status`),jr(e,{error:pr.toastError,warn:pr.toastWarn,info:pr.toastInfo}[t])},Nr=(e,t)=>Mr(e,t||`error`),Pr=M(21,Ar),Fr=N(19,L(`v1`,e=>Tt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`.palette:not(.inline)`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Ir=M(18,e=>{Pr(e,{float:pr.toastFloat,inline:pr.toastInline}[e.s]),Fr(e)}),Lr=(e,t)=>Ir(e,t||`float`),Rr=M(10,Ar),zr=L(`v2`,e=>St(e,`a`)),Br=M(16,e=>{yt(e,`a`,e.q,{class:1,role:1}),zr(e)});function Vr(e){B(e.b,pr.toastBody)}var Hr=O(2,`<strong> </strong>`,` D `,kr),Ur=M(9,e=>{Hr(e,+!e.j),Or(e)}),Wr=O(3,`<div><!></div>`,` D%`,Dr),Gr=M(11,e=>{Wr(e,+!e.l),Er(e)}),Kr=O(4,`<div><!><!></div>`,` D%b%`,Sr),qr=N(15,e=>Kr(e,e.m||e.o?0:1)),Jr=M(12,e=>{Xr(e,e.m?.content),qr(e),xr(e)}),Yr=M(14,e=>{qr(e),Fr(e),wr(e)}),Xr=M(13,F(yr));function Zr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:$r(n,a)?400+o:r.includes(n)?300:$r(n,r)?100:-1}function Qr(e,t,n){return e?t.map(t=>({repo:t,score:Zr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function $r(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function ei(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function ti(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var ni={paletteBackdrop:`_O`,inline:`_P`,rows:`_Q`,rowWrap:`_R`,row:`_S`,rowMore:`_T`,hi:`_U`,archived:`_V`,cmdRow:`_W`,onboard:`_X`,rowName:`_Y`,rowNameText:`_Z`,rowStats:`_0`,open:`_1`,stat:`_2`,rowRepos:`_3`,paletteFoot:`_4`,hint:`_5`,archivedLink:`_6`},ri=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,ii=` D l`,pee=(e,t)=>{z(e.a,`width`,t),z(e.a,`height`,t)},ai=(e,t)=>pee(e,t??15),oi=(e,t)=>B(e.a,[`icon`,t]),si=(e,t)=>z(e.b,`d`,t),ci=ri,li=(e=>`/${e}&`)(ii);function ui(e){si(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var di=(e,t)=>ai(e.a,t),fi=(e,t)=>oi(e.a,t),pi=ri,mi=(e=>`/${e}&`)(ii);function hi(e){si(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var gi=(e,t)=>ai(e.a,t),_i=(e,t)=>oi(e.a,t),vi=ri,yi=(e=>`/${e}&`)(ii);function bi(e){si(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var xi=(e,t)=>ai(e.a,t),Si=(e,t)=>oi(e.a,t),Ci=`<!><!><!>`,wi={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},Ti=P(0,1,e=>ai(e.a,e._.d)),Ei=e=>{Ti._(e),Di._(e),si(e.a,`M5 7L10 12L5 17 M13 17H20`)},Di=P(0,1,e=>oi(e.a,e._.f)),Oi=P(0,0,e=>B(e.a,[`icon`,e._.f])),ki=e=>{Oi._(e),Ai._(e),ji._(e)},Ai=P(0,0,e=>{z(e.a,`width`,e._.g),z(e.a,`height`,e._.g)}),ji=P(0,0,e=>z(e.b,`d`,e._.h)),Mi=M(6,Ai),Ni=M(3,e=>{Mi(e,e.d??15),Ti(e)}),Pi=O(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,ki,ri,(e=>`/${e}&`)(ii),Ei),Fi=M(7,e=>{Pi(e,+!e.h),ji(e)}),Ii=(e,t)=>Fi(e,wi[t]),Li=M(5,e=>{Oi(e),Di(e)}),Ri=`<!><!><div role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,zi=`b%b D%b b b%b Db b%m`,Bi=(e,t)=>{z(e.a,`value`,t),V(e.b,t)},Vi=(e,t)=>Bi(e,t[0]),Hi=(e,t)=>V(e.a,t),Ui=(e,t)=>Hi(e,t[0]?.worktree),Wi=e=>B(e.a,[`chip`,ni.open]),Gi=P(8,0,e=>{z(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),V(e.b,e._.u),V(e.c,e._.u===1?``:`s`)}),Ki=e=>{Gi._(e),B(e.a,[`chip`,ni.stat])},qi=P(9,0,e=>z(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
|
|
3
|
-
`))),Ji=e=>{qi._(e),Yi._(e),B(e.a,[`chip`,ni.stat])},Yi=P(9,0,e=>V(e.b,e._.s)),Xi=N(2,e=>z(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),Zi=P(7,0,e=>{V(e.b,e._.o),Xi(e)}),Qi=e=>{Zi._(e),$i._(e),ea._(e),B(e.a,[`chip`,ni.stat])},$i=P(7,0,Xi),ea=P(7,0,Xi),ta=e=>B(e.a,ni.rowName),na=P(1,1,e=>V(e.b,e._.h)),ra=e=>{na._(e),B(e.a,[ni.rowName,ni.cmdRow])},ia=e=>B(e.a,ni.onboard),aa=N(2,e=>V(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),oa=P(5,0,aa),sa=L(`o8`,e=>A(e.a,`click`,function(){Bo(e._,!e._.af)})),ca=e=>{oa._(e),la._(e),B(e.a,ni.archivedLink),sa(e)},la=P(5,0,aa),ua=P(8,0,e=>It(e,`a`,e._.aa?.preferredAgent,ps(e))),da=L(`o9`,e=>Lt(e,`a`)),fa=e=>{ua._(e),ma._(e),da(e)},pa=k(0,`<option> </option>`,` D `,0,Vi),ma=P(8,0,e=>pa(e,[e._.ad,e=>e])),ha=L(`o4`,e=>A(e.a,`click`,function(){po(e._,!1)})),ga=e=>{B(e.a,ni.paletteBackdrop),ha(e)},_a=L(`o5`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),va=e=>{e.b,Ni(e.b,14),Li(e.b),_a(e)},ya=M(4,e=>{Ii(e.b,e.e),V(e.c,e.e)}),ba=k(6,(e=>`<button>${e}<!></button>`)(Ci),(e=>` D/${e}&%l`)(`b%c`),va,(e,t)=>ya(e,t[0])),xa=I(59,e=>ba(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),Sa=(e,t)=>{z(e.e,`popovertarget`,t),z(e.g,`id`,t)},Ca=L(`o6`,e=>{A(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),A(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),A(e.e,`click`,function(e){e.stopPropagation()}),A(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),wa=e=>{xa(e),B(e.a,ni.rowMore),ui(e.b),di(e.b,13),fi(e.b),B(e.c,ni.rowMore),hi(e.d),gi(e.d,13),_i(e.d),B(e.e,ni.rowMore),bi(e.f),xi(e.f,13),Si(e.f),Sa(e,Xe(e)),Ca(e)},Ta=O(4,`<span>open</span>`,` `,Wi),Ea=N(21,e=>Ta(e,e._.j===e._._.v?0:1)),Da=I(57,Ea,e=>e._._),Oa=e=>{Da(e),ja(e),Na._(e),Pa._(e),Fa._(e),Ra._(e),B(e.a,ni.rowName),B(e.c,ni.rowNameText),B(e.g,ni.rowStats),B(e.k,ni.rowRepos)},ka=(e,t)=>{B(e.b,[`dot`,ei(t)]),Ba(e,t?.repos),Ha(e,t?.agents),Ua(e,t?.working),Wa(e,t?.waiting),Ka(e,t?.ports)},Aa=N(22,e=>ka(e,e._._.a6[e._.j])),ja=I(58,Aa,e=>e._._),Ma=O(5,`<span class=chip>archived</span>`),Na=P(1,2,e=>Ma(e,+!e._.g)),Pa=P(1,2,e=>{Aa(e),Ea(e)}),Fa=P(1,2,e=>V(e.d,e._.k)),Ia=k(10,`<span class=mono> </span>`,`D `,0,Ui),La=N(13,e=>Ia(e,[e.m||e._.l,`full_name`])),Ra=P(1,2,La),za=(e,t)=>Ya(e,t?.length),Ba=M(12,e=>{za(e,(e.m||[]).flatMap(e=>e.prs||[])),La(e)}),Va=O(7,`<span> </span>`,` D `,Qi),Ha=M(14,e=>{Va(e,+!e.o),Zi(e)}),Ua=M(15,$i),Wa=M(16,ea),Ga=O(9,`<span>:<!></span>`,` Db%`,Ji),Ka=M(17,e=>{qa(e,e.r?.length),Ga(e,+!(e.r||[]).length),qi(e)}),qa=M(18,Yi),Ja=O(8,`<span><!> PR<!></span>`,` D%c%`,Ki),Ya=M(20,e=>{Ja(e,+!e.u),Gi(e)}),Xa=N(13,e=>B(e.b,[ni.row,{[ni.hi]:e.m===e._.as,[ni.archived]:e.f===`ws`&&e.g}]),3),Za=We(4,Xa),Qa=L(`o7`,e=>{A(e.b,`click`,function(){e._.au(e.e)}),A(e.b,`mouseenter`,function(){zo(e._,e.m)})}),$a=e=>{Za._(e),B(e.a,ni.rowWrap),Qa(e)},eo=O(1,`<span>+ New workspace</span>`,` `,ta,`<span>▸ <!></span>`,` Db%`,ra,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,Oa),to=O(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto class=new-session-pop></div>`)(ci,pi,vi),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(li,mi,yi),wa),no=M(5,e=>{eo(e,e.f===`new`?0:e.f===`cmd`?1:2),to(e,e.f===`ws`?0:1),Xa(e)}),ro=M(6,e=>{Xa(e),Na(e)}),io=M(12,Xa),ao=(e,t)=>{oo(e,t[0]),io(e,t[1])},oo=M(4,e=>{no(e,e.e?.kind),ro(e,e.e?.archived),so(e,e.e?.label),co(e,e.e?.ws)}),so=M(7,na),co=M(8,e=>{lo(e,e.i?.id),uo(e,e.i?.name),fo(e,e.i?.repos)}),lo=M(9,Pa),uo=M(10,Fa),fo=M(11,Ra),po=Ue(19),mo=N(13,e=>po(e,e.l,e.m)),ho=M(11,mo),go=M(12,mo),_o=k(4,`<li><div><button></button><!></div></li>`,`D D b%`,$a,ao),vo=N(55,L(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&zo(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),yo=M(51,e=>{es(e,e.ap.length),_o(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),vo(e)}),bo=N(50,e=>yo(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),xo=M(46,bo),So=M(49,bo),Co=N(48,e=>So(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&$r(e.a8||``,t.label))),5),wo=O(5,`<button> </button>`,` D `,ca),To=N(45,e=>wo(e,e.ai&&!e.a8?0:1)),Eo=Ue(34,e=>{Nt(e,`d`,e.a8||``,hs(e)),xo(e,ms(e)),Co(e),bo(e),To(e)}),Do=N(16,e=>Eo(e,e.o,e.p)),Oo=M(14,Do),ko=M(15,Do),Ao=O(8,`<label class=dim><select aria-label="Preferred agent"></select></label>`,`D `,fa),jo=Ue(36,e=>{Mo(e,e.aa?.preferredAgent),No(e,e.aa?.agents),Ao(e,+!e.aa),ua(e)}),Mo=M(38,Co),No=M(39,ma),Po=N(19,e=>jo(e,e.r,e.s)),Fo=M(17,e=>{ds(e,e.r?.agents),Po(e)}),Io=M(18,Po),Lo=M(54,e=>{vo(e),Za(e)}),Ro=N(53,e=>Lo(e,Math.min(e.ae,e.aq-1))),zo=j(40,Ro),Bo=j(41,e=>{bo(e),oa(e)}),Vo=L(`o10`,e=>{Pt(e,`d`),A(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),zo(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),zo(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function Ho(e){B(e.e,ni.rows),B(e.g,ni.paletteFoot),B(e.h,ni.hint),zo(e,0),Bo(e,!1),Vo(e)}var Uo=M(42,bo),Wo=M(43,e=>{Jo(e,e.ah?.length),bo(e)}),Go=M(47,Co),Ko=N(22,e=>Go(e,e.u.find(t=>t.id===e.v))),qo=M(20,e=>{us(e,e.u?.length),Uo(e,e.u.filter(e=>e.status===`active`)),Wo(e,e.u.filter(e=>e.status===`archived`)),Ko(e)}),Jo=M(44,e=>{To(e),la(e)}),Yo=F(Da),Xo=M(21,e=>{Ko(e),vo(e),Yo(e)}),Zo=M(23,Co),Qo=M(24,Co),$o=M(25,Co),es=M(52,Ro),ts=M(56),ns=N(28,e=>ts(e,gs(e))),rs=M(26,ns),is=M(27,ns),as=O(0,`<div></div>`,` `,ga),os=O(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ia),ss=N(31,e=>os(e,e.a3&&!e.a4?0:1)),cs=L(`o11`,e=>A(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),po(e,!1)))}))),ls=M(29,e=>{B(e.b,[`palette`,{[ni.inline]:e.a3}]),as(e,+!!e.a3),ss(e),cs(e)}),us=M(30,ss),ds=M(33,F(xa)),fs=M(32,F(ja));function ps(e){return function(t){jo(e._,{...e._.aa,preferredAgent:t}),cn(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function ms(e){return t=>t.filter(t=>$r(e.a8||``,t.name))}function hs(e){return function(t){Eo(e,t),zo(e,0)}}function gs(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}R(`o1`,ps),R(`o2`,ms),R(`o0`,hs),R(`o3`,gs);var _s={iconBtn:`_t _cP`,spinning:`_u _cQ`,actStep:`_v`,prRepo:`_w`,prRepoName:`_x`,prList:`_y`,prSpacer:`_z`,prDismiss:`_A`,prState:`_B`,prLink:`_C`,procs:`_D`,procCmd:`_E`,procKill:`_F`,portLink:`_G`},vs=`<button><!></button>`,ys=` D%l`,bs=pe(1),xs=L(`c0`,e=>St(e,`a`)),Ss=M(5,e=>{gt(e,`a`,{type:`submit`,...e.f}),xs(e)}),Cs=ri,ws=(e=>`/${e}&`)(ii);function Ts(e){si(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var Es=(e,t)=>ai(e.a,t),Ds=(e,t)=>oi(e.a,t),Os={addRepo:`_cD`,repoResults:`_cE`,resultWrap:`_cF`,hi:`_cG`,resultRow:`_cH`,resultBranch:`_cI`,on:`_cJ`,branchPick:`_cK`,branchList:`_cL`,resultPlus:`_cM`,repoName:`_cN`,emptyNote:`_cO`},ks=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,As=` D b%b%l`,js=null,mee=e=>B(e.a,Os.emptyNote),hee=e=>B(e.a,Os.emptyNote),gee=e=>B(e.a,Os.emptyNote),_ee=L(`q7`,e=>A(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),vee=e=>{B(e.a,Os.resultRow),B(e.b,[Os.repoName,`mono`]),_ee(e)},yee=M(4,e=>V(e.c,e.e)),bee=(e,t)=>yee(e,t[0]),Ms=I(35,e=>Nt(e,`a`,e._._._._._.a0,Nc(e)),e=>e._._._._._),xee=L(`q6`,e=>Pt(e,`a`)),See=e=>{Ms(e),xee(e)},Cee=k(2,`<li><button><span> </span></button></li>`,`D D D `,vee,bee),wee=(e,t)=>{Rs(e,t?.length),Cee(e,[t,e=>e])},Ns=N(6,e=>wee(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),Ps=I(33,Ns,e=>e._._._._),Tee=e=>{Ps(e),Fs(e),Is(e),B(e.b,Os.branchList)},Eee=O(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,See),Fs=I(34,e=>Eee(e,e._._._._.z>8?0:1),e=>e._._._._),Is=I(35,Ns,e=>e._._._._),Ls=O(3,`<li><p>No branches match.</p></li>`,`D `,mee),Rs=(e,t)=>Ls(e,+!!t),zs=O(0,`<p><span class=spin></span> Loading branches…</p>`,` `,hee,`<!><!><ul><!><!></ul>`,`b%b D%b%`,Tee),Bs=I(33,e=>zs(e,+!!e._._._.y),e=>e._._._),Vs=e=>{Bs(e),B(e.a,Os.branchPick)},Hs=N(12,e=>B(e.a,[Os.resultWrap,{[Os.hi]:e.l===e._._.r}])),Us=I(30,Hs,e=>e._._),Ws=L(`q8`,e=>{A(e.a,`mouseenter`,function(){mc(e._._,e.l)}),A(e.b,`click`,function(){e._._.a1(e.j)}),A(e.f,`click`,function(){e._._.a2(e.j)})}),Gs=e=>{Us(e),Js(e),B(e.b,Os.resultRow),bi(e.c),xi(e.c,12),Si(e.c,Os.resultPlus),B(e.d,Os.repoName),Ws(e)},Ks=O(6,`<div></div>`,` `,Vs),qs=N(10,e=>{B(e.f,[Os.resultBranch,{[Os.on]:e._._.w===e.j}]),Ks(e,e._._.w===e.j?0:1)}),Js=I(32,qs,e=>e._._),Ys=M(11,Hs),Xs=M(9,e=>{V(e.e,e.j),z(e.f,`title`,`Pick a base branch for ${e.j}`),z(e.f,`aria-label`,`Pick a base branch for ${e.j}`),qs(e)}),Zs=k(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(vi),(e=>`D D D/${e}& D m l%l`)(yi),Gs,(e,t)=>{Xs(e,t[0]?.nameWithOwner),Ys(e,t[1])}),Qs=P(3,0,e=>Zs(e,[e._.t,`nameWithOwner`])),$s=e=>{Qs._(e),B(e.a,Os.repoResults)},ec=P(3,1,e=>V(e.b,e._.o)),tc=e=>{ec._(e),B(e.a,Os.emptyNote)},nc=Ue(8),rc=N(8,e=>nc(e,e.g,e.h)),ic=M(6,rc),ac=M(7,rc),oc=M(19,e=>{Dc(e,e.t?.length),Qs(e)}),sc=N(16,e=>oc(e,e.n&&e.o?Qr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),cc=O(2,`<p>Loading repos…</p>`,` `,gee),lc=N(15,e=>cc(e,e.o&&!e.n?0:1)),uc=O(3,`<ul></ul>`,` `,$s,`<p>No repos match "<!>".</p>`,` Db%`,tc),dc=N(21,e=>uc(e,e.u?0:e.o&&e.n?1:2),2),fc=j(13,e=>{sc(e),lc(e),dc(e)}),pc=j(14,e=>{Nt(e,`b`,e.o,Pc(e)),sc(e),lc(e),dc(e),ec(e)}),mc=j(17,F(Us)),hc=M(28),gc=N(23,e=>hc(e,Fc(e))),_c=F(Js),vc=j(22,e=>{gc(e),_c(e)}),yc=F(Bs,Ps),bc=j(24,e=>{kc(e,e.y?.length),yc(e)}),xc=j(26,F(Is,Ms)),Sc=L(`q9`,e=>{Pt(e,`b`),A(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),mc(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),mc(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),pc(e,``))})});function Cc(e){B(e.a,Os.addRepo),fc(e,null),pc(e,``),mc(e,0),vc(e,null),bc(e,null),xc(e,``),Sc(e)}var wc=L(`q10`,e=>Tt(e,{onMount:function(){js&&fc(e,js),e.s(!1)}})),Tc=M(18,e=>{ee(e,Ic(e)),wc(e)}),Ec=M(9,e=>{Tc(e,Lc(e)),gc(e)}),Dc=M(20,dc),Oc=M(10,sc),kc=M(25,F(Fs)),Ac=M(27),jc=M(11,e=>Ac(e,Rc(e))),Mc=(e,t)=>z(e.b,`disabled`,t);function Nc(e){return t=>{xc(e._._._._._,t)}}function Pc(e){return function(t){pc(e,t),mc(e,0)}}function Fc(e){return async t=>{if(e.w===t){vc(e,null);return}vc(e,t),bc(e,null),xc(e,``);try{let n=await cn(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&bc(e,n.branches)}catch(t){vc(e,null),e.j?.(String(t.message||t))}}}function Ic(e){return()=>e.s(!0)}function Lc(e){return async t=>{t&&nc(e,!0);try{let n=await cn(`/api/repos${t?`?refresh`:``}`);js=n,fc(e,n)}catch(t){e.j?.(String(t.message||t))}t&&nc(e,!1)}}function Rc(e){return(t,n)=>{pc(e,``),vc(e,null),e.l(t,n)}}R(`q1`,Nc),R(`q0`,Pc),R(`q5`,Fc),R(`q2`,Ic),R(`q3`,Lc),R(`q4`,Rc);var zc={manageView:`_7`,manage:`_8`,manageBar:`_9`};le[4]=dee;var Bc=`<dialog><div><!></div><!></dialog>`,Vc=` D D%l%l`,Hc=pe(2),Uc=lt(`l0`,`Done`),Wc=e=>{B(e.a,zc.manageBar),e.b,bs(e.b,Uc(e)),Ss(e.b,{class:`btn primary`})},Gc=fe(1),Kc=P(3,0,e=>Gc(e,e._.p)),qc=e=>{Kc._(e),B(e.a,zc.manageBar)},Jc=M(20,e=>z(e.a,`closedby`,e.u?`any`:`none`)),Yc=(e,t)=>Jc(e,t!==!1),Xc=Ue(21,L(`l3`,e=>{{let t=e.a;e.v?t.open||t.showModal():t.open&&t.close()}})),Zc=N(9,e=>Xc(e,e.h,e.i)),Qc=M(7,Zc),$c=O(3,`<form method=dialog><!></form>`,` D%`,qc,(e=>`<form method=dialog>${e}</form>`)(vs),(e=>` D/${e}&l`)(ys),Wc),el=N(14,e=>$c(e,e.n?0:e.i?1:2)),tl=M(8,e=>{Zc(e),el(e)}),nl=(e,t)=>B(e.a,[zc.manageView,t]),rl=N(18,e=>z(e.a,`aria-label`,e.r?e.q:e.q||e.k),2),il=M(17,e=>{z(e.a,`aria-labelledby`,e.r),rl(e)}),al=M(10,rl),ol=M(16,rl),sl=L(`l2`,e=>{A(e.a,`cancel`,function(t){t.preventDefault(),e.u&&Xc(e,!1)}),A(e.a,`close`,function(){e.v&&Xc(e,!1)})});function cl(e){B(e.b,zc.manage),sl(e)}var ll=L(`l1`,e=>St(e,`a`)),ul=M(19,e=>{yt(e,`a`,{...e.t,open:null},{class:1,"aria-labelledby":1,"aria-label":1,closedby:1,"on-cancel":1,"on-close":1},Xt),ll(e)}),dl=M(13,e=>{fl(e,e.n?.content),el(e)}),fl=M(15,Kc),pl=Bc,ml=(e=>`/${e}&`)(Vc),hl=new Map,gl=L(`k24`,e=>A(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),_l=e=>{B(e.a,[`chip`,_s.portLink]),gl(e)},vl=M(3,e=>{z(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),V(e.b,e.d)}),yl=(e,t)=>vl(e,t[0]),bl=(e,t)=>V(e.a,t),xl=(e,t)=>bl(e,t[0]),Sl=P(2,0,e=>V(e.a,e._.j)),Cl=Sl,wl=e=>B(e.a,[_s.prState,`closed`]),Tl=e=>B(e.a,[_s.prState,`open`]),El=P(1,0,e=>V(e.b,e._.f)),Dl=e=>{El._(e),B(e.a,[_s.prRepoName,`mono`])},Ol=lt(`k14`,`Done`),kl=L(`k25`,e=>A(e.d,`click`,function(){e._._._.aj(e.j)})),Al=e=>{B(e.a,[`mono`,_s.procCmd]),B(e.d,_s.procKill),kl(e)},jl=(e,t)=>z(e.a,`title`,t),Ml=(e,t)=>V(e.b,t),Nl=k(2,`<button>:<!></button>`,` Db%`,_l,yl),Pl=(e,t)=>Nl(e,[t,e=>String(e)]),Fl=M(9,e=>{z(e.d,`title`,`Kill ${e.j}`),z(e.d,`aria-label`,`Kill process ${e.j}`)}),Il=(e,t)=>{jl(e,t[0]?.args),Ml(e,t[0]?.cmd),Pl(e,t[0]?.ports),Fl(e,t[0]?.pid)},Ll=P(7,0,e=>z(e.a,`title`,`Confirm #${e._.q} is done — remove from this list`)),Rl=L(`k20`,e=>A(e.a,`click`,function(){e._._._._._.ab(e._._.h,e._.q)})),zl=O(7,`<button>✓</button>`,` `,e=>{Ll._(e),B(e.a,_s.prDismiss),Rl(e)}),Bl=N(12,e=>V(e.b,e.k===`OPEN`&&e.l?`draft`:e.k.toLowerCase())),Vl=O(2,`<span title=Approved>✓</span>`,` `,Tl,`<span title="Changes requested">✗</span>`,` `,wl),Hl=N(14,e=>Vl(e,e.k===`OPEN`&&e.n===`APPROVED`?0:e.k===`OPEN`&&e.n===`CHANGES_REQUESTED`?1:2)),Ul=M(10,e=>{B(e.a,[_s.prState,e.k.toLowerCase()]),zl(e,+(e.k===`OPEN`)),Bl(e),Hl(e)}),Wl=M(11,Bl),Gl=M(13,Hl),Kl=e=>{B(e.d,_s.prLink),B(e.g,_s.prSpacer)},ql=(e,t)=>z(e.d,`href`,t),Jl=M(16,e=>{V(e.e,e.q),Ll(e)}),Yl=(e,t)=>V(e.f,t),Xl=(e,t)=>{Ul(e,t[0]?.state),Wl(e,t[0]?.isDraft),Gl(e,t[0]?.reviewDecision),ql(e,t[0]?.url),Jl(e,t[0]?.number),Yl(e,t[0]?.title)},Zl=P(0,0,e=>V(e.b,e._.e)),Ql=L(`k19`,e=>A(e.a,`click`,function(){e._._._.aa()})),$l=e=>{Zl._(e),Ql(e)},eu=I(58,e=>V(e.b,e._._.v),e=>e._._),tu=e=>{eu(e),B(e.a,_s.actStep)},nu=N(2,e=>{mt(e.a,`armed`,e._._._.u===e._.h),V(e.b,e._._._.u===e._.h?`remove?`:`×`)}),ru=N(3,e=>z(e.a,`title`,e._._._.u===e._.h?`Really remove ${e._.g}/? Uncommitted changes are lost.`:`Remove ${e._.g}/`),2),iu=I(57,e=>{nu(e),ru(e)},e=>e._._._),au=L(`k22`,e=>A(e.a,`click`,function(){e._._._.u===e._.f?.full_name?(qd(e._._._,null),e._._._.ah(e._.f)):(qd(e._._._,e._.f?.full_name),setTimeout(()=>{qd(e._._._,null)},4e3))})),ou=e=>{iu(e),su._(e),cu._(e),au(e)},su=P(3,1,ru),cu=P(3,1,e=>{nu(e),ru(e)}),lu=I(55,e=>z(e.a,`disabled`,!!e._._.s),e=>e._._),uu=L(`k16`,e=>A(e.a,`click`,function(){e._._.ai(`restore`)})),du=e=>{lu(e),uu(e)},fu=I(55,e=>{z(e.a,`disabled`,!!e._._.s),V(e.b,e._._.s===`archive`?`Archiving…`:`Archive`)},e=>e._._),pu=L(`k15`,e=>A(e.a,`click`,function(){e._._.ai(`archive`)})),mu=e=>{fu(e),pu(e)},hu=O(1,`<span><span class=spin></span> </span>`,` Db `,tu),gu=N(6,e=>hu(e,e._.s&&e._.v?0:1)),_u=N(5,e=>V(e.e,e._.s===`delete`?`Deleting…`:e._.t?`Really delete?`:`Delete`)),vu=I(55,e=>{Ss(e.a,{disabled:!!e._.s,class:`btn primary`}),z(e.d,`disabled`,!!e._.s),gu(e),_u(e)}),yu=L(`k17`,e=>A(e.d,`click`,function(){e._.t?(Kd(e._,!1),e._.ai(`delete`)):(Kd(e._,!0),setTimeout(()=>{Kd(e._,!1)},4e3))})),bu=e=>{vu(e),xu(e),Su(e),wu(e),e.a,bs(e.a,Ol(e)),yu(e)},xu=I(56,e=>{mt(e.d,`armed`,e._.t),_u(e)}),Su=I(58,gu),Cu=O(2,`<button type=button class=btn> </button>`,` D `,mu,`<button type=button class=btn>Restore</button>`,` `,du),wu=I(61,e=>Cu(e,e._.a1===`active`?0:1)),Tu=ut(`k27`,(e=>`${e}<!><div class=spacer></div><!><button type=button class="btn danger"> </button>`)(vs),(e=>`/${e}&%c%b D l`)(ys),bu),Eu=I(54,e=>V(e.a,e._._._.r),e=>e._._._),Du=ut(`k18`,` `,` `,Eu),Ou=e=>{Vr(e.a),Gr(e.a,Du(e)),Lr(e.a,`inline`),Yr(e.a,Mf(e)),Jr(e.a),Rr(e.a),Nr(e.a),Ur(e.a),Br(e.a,{})},ku=O(3,`<span class=spin></span>`,0,0,`<button class=cur-remove> </button>`,` D `,ou),Au=N(8,e=>ku(e,+!e._._.p.has(e.h))),ju=I(52,Au,e=>e._._),Mu=ju,Nu=M(6,e=>{V(e.a,e.g),su(e)}),Pu=M(7,e=>{V(e.b,e.h),Au(e),cu(e)}),Fu=O(2,`<span class="cur-base mono" title="Base branch">⎇ <!></span>`,`Db%`,Cl),Iu=N(11,e=>Fu(e,+(e.j===e.k))),Lu=M(9,e=>{Iu(e),Sl(e)}),Ru=M(10,Iu),zu=(e,t)=>Bu(e,t[0]),Bu=M(5,e=>{Nu(e,e.f?.worktree),Pu(e,e.f?.full_name),Lu(e,e.f?.base_branch),Ru(e,e.f?.default_branch)}),Vu=O(1,`<div> </div>`,` D `,Dl),Hu=I(50,e=>Vu(e,e._._._.n>1?0:1),e=>e._._._),Uu=e=>{Hu(e),B(e.a,_s.prRepo),B(e.c,_s.prList)},Wu=k(2,`<li><span> </span><!><a target=_blank rel=noopener><span class="dim mono">#<!></span> </a><span></span><!></li>`,`D D l%b Eb%l l b%`,Kl,Xl),Gu=(e,t)=>Wu(e,[t,`number`]),Ku=(e,t)=>{qu(e,t[0]?.worktree),Gu(e,t[0]?.prs),Ju(e,t[0]?.full_name)},qu=M(5,El),Ju=M(7),Yu=O(0,`<button class=btn title="Confirm every merged/closed PR is done — remove them from this list">Clear <!> finished</button>`,` Db%`,$l),Xu=M(4,e=>{Yu(e,+!e.e),Zl(e)}),Zu=k(3,`<div><!><ul></ul></div>`,` D%b `,Uu,Ku),Qu=I(49,e=>{Xu(e,(e._._.m||[]).reduce((e,t)=>e+t.prs.filter(e=>e.state!==`OPEN`).length,0)),Zu(e,[e._._.m.filter(e=>e.prs.length),`full_name`])},e=>e._._),$u=L(`k21`,e=>A(e.b,`click`,function(){e._._.a9()})),ed=e=>{Qu(e),td(e),Ts(e.c),Es(e.c,13),Ds(e.c),$u(e)},td=I(51,e=>{B(e.b,[_s.iconBtn,{[_s.spinning]:e._._.o}]),z(e.b,`disabled`,e._._.o)},e=>e._._),nd=k(0,`<li><span><!><!></span><button type=button>×</button></li>`,`D D%b%l `,Al,Il),rd=I(48,e=>nd(e,[e._._.l,`pid`]),e=>e._._),id=e=>{rd(e),B(e.a,_s.procs)},ad=Qe(13),od=I(47,e=>{B(e.f,[_s.iconBtn,{[_s.spinning]:e._.k}]),z(e.f,`disabled`,e._.k)}),sd=L(`k26`,e=>A(e.f,`click`,function(){ad(e)()})),cd=e=>{od(e),ud(e),fd(e),hd(e),vd(e),bd(e),Sd(e),Cd(e),Td(e),Ed(e),Dd(e),Od(e),kd(e),Ad(e),Ts(e.g),Es(e.g,13),Ds(e.g),Ye(e,10,jd),Cc(e.k),Ec(e.k,Pf(e)),ac(e.k,Nf(e)),ic(e.k),Mc(e.k),sd(e)},ld=O(12,`<section><h3>Processes</h3><ul></ul></section>`,`Db `,id),ud=I(48,e=>ld(e,e._.l&&e._.l?.length?0:1)),dd=O(4,(e=>`<section><div class=repos-head><h3>Pull requests</h3><!><button title="Refresh PRs" aria-label="Refresh PRs">${e}</button></div><!></section>`)(Cs),(e=>`Eb%b D/${e}&m%l`)(ws),ed),fd=I(49,e=>dd(e,e._.m&&e._.m.some(e=>e.prs.length)?0:1)),pd=k(8,`<li class="cur-repo pending"><span class=spin></span><span class="dim cur-full"> </span></li>`,`DbD `,0,xl),md=N(14,e=>pd(e,[[...e._.p].filter(t=>!e._.ac.has(t)),e=>e])),hd=I(52,md),gd=O(9,`<li class=empty-note>No repos yet — search below to add one.</li>`),_d=N(15,e=>gd(e,!e._.a4&&!e._.q?0:1)),vd=I(53,_d),yd=O(3,mr,(e=>`/${e}&`)(hr),Ou),bd=I(54,e=>yd(e,+!e._.r)),xd=k(7,`<li class=cur-repo><span class="mono cur-worktree"><!>/</span><span class="dim cur-full"> </span><!><!></li>`,`E%lD l%b%`,Mu,zu),Sd=I(59,e=>xd(e,[e._.z,`full_name`])),Cd=I(60,e=>V(e.b,e._.a0)),wd=N(16,e=>V(e.c,e._.a2||e._.a3)),Td=I(62,wd),Ed=I(63,wd),Dd=I(64,_d),Od=I(65,e=>{Oc(e.k,e._.ac),md(e)}),kd=I(66,e=>jc(e.k,Ff(e))),Ad=I(67,e=>z(e.a,`id`,e._.ak)),jd=rt(`k23`,M(13)),Md=lt(`k28`,((e,t)=>`<header class=manage-head><div><h2> </h2><p class="dim mono"> </p></div></header><!><!><section><div class=repos-head><h3>Repos</h3><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul class=cur-repos><!><!><!></ul>${t}</section><!><!>`)(Cs,ks),((e,t)=>`E D lD n%b%bEb D/${e}&mD%b%b%l0${t}&l%c`)(ws,As),cd,0,`B1`),Nd=j(10,F(od)),Pd=j(14,F(td)),Fd=M(42,F(kd)),Id=N(41,e=>Fd(e,If(e)),2),Ld=M(43),Rd=N(40,e=>Ld(e,Lf(e)),2),zd=M(39,e=>{Id(e),Rd(e)}),Bd=F(hd,ju),Vd=j(15,e=>{of(e,e.p?.size),zd(e,Rf(e)),Id(e),Rd(e),Bd(e)}),Hd=j(17,F(bd,Eu)),Ud=N(34,L(`k29`,e=>Tt(e,{busyCount:e.q,pendingAction:e.s,onMount:function(){let t=new AbortController,n=t.signal;return jn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.y&&Jd(e,t.data.message)},{signal:n}),e.a5(n),e.a6(n,!1).then(()=>e.a6(n,!0)),{abort:t}},onDestroy:function(){this.abort.abort()}})),4),Wd=F(vu,fu,lu),Gd=j(18,e=>{Yc(e.a,!e.s),Ud(e),Wd(e)}),Kd=j(19,F(xu)),qd=j(20,F(iu)),Jd=j(21,F(Su,eu)),Yd=M(46,e=>il(e.a,e.ak));function Xd(e){cl(e.a),dl(e.a,an({content:Tu(e)})),Hc(e.a,Md(e)),ol(e.a),nl(e.a),ul(e.a,{}),Nd(e,!1),Pd(e,!1),Vd(e,new Set),Hd(e,null),Gd(e,null),Kd(e,!1),qd(e,null),Jd(e,null),Yd(e,Xe(e))}var Zd=j(11,F(ud,rd)),Qd=M(36),$d=N(33,e=>Qd(e,zf(e)),2),ef=F(fd,Qu),tf=j(12,e=>{rf(e,e.m?.length),$d(e),ef(e)}),nf=(e,t)=>{Zd(e,hl.get(`procs:${t}`)||null),tf(e,hl.get(`prs:${t}`)||null)},rf=M(13,F(Hu)),af=F(vd),of=M(16,e=>{Ud(e),af(e)}),sf=Ue(20),cf=N(7,e=>sf(e,e.f,e.g)),lf=M(5,e=>{Qc(e.a,e.f),cf(e)}),uf=M(6,e=>{tl(e.a,e.g),cf(e)}),df=Ue(22,e=>{ff(e,e.w),Rd(e)}),ff=e=>{yf(e,e.w?.id),Sf(e,e.w?.repos),Tf(e,e.w?.name),Ef(e,e.w?.status),Df(e,e.w?.display_path),Of(e,e.w?.path)},pf=M(45),mf=M(31,e=>{pf(e,Bf(e)),Ud(e)}),hf=M(35),gf=M(32,e=>{hf(e,Hf(e)),Ud(e),$d(e)}),_f=M(37),vf=M(44),yf=M(24,e=>{mf(e,Vf(e)),gf(e,Uf(e)),_f(e,Wf(e)),vf(e,Gf(e)),Ud(e),$d(e),Id(e)}),bf=M(38,F(Od)),xf=F(Sd),Sf=M(25,e=>{Cf(e,e.z?.length),bf(e,new Set(e.z.map(e=>e.full_name))),xf(e)}),Cf=M(30,F(Dd)),wf=F(Cd),Tf=M(26,e=>{al(e.a,`Manage ${e.a0}`),wf(e)}),Ef=M(27,F(wu)),Df=M(28,F(Td)),Of=M(29,F(Ed)),kf=N(9,e=>df(e,e.d,e.i)),Af=M(3,e=>{nf(e,e.d?.id),kf(e)}),jf=M(8,kf);function Mf(e){return function(){Hd(e._._,null)}}function Nf(e){return function(t){Nd(e._,t)}}function Pf(e){return function(t){Hd(e._,t)}}function Ff(e){return function(t,n){e._.ag(t,n)}}function If(e){return async(t,n)=>{if(!(!t||e.p.has(t))){Hd(e,null),e.ad(t,!0);try{df(e,await cn(`/api/workspaces/${e.y}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){Hd(e,String(t.message||t))}e.ad(t,!1)}}}function Lf(e){return async t=>{if(!e.p.has(t.full_name)){Hd(e,null),e.ad(t.full_name,!0);try{await cn(`/api/workspaces/${e.w?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),df(e,{...e.w,repos:(e.w?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){Hd(e,String(t.message||t))}e.ad(t.full_name,!1)}}}function Rf(e){return(t,n)=>{let r=new Set(e.p);n?r.add(t):r.delete(t),Vd(e,r)}}function zf(e){return async()=>{for(let t of e.m||[])for(let n of t.prs)n.state!==`OPEN`&&await cn(`/api/workspaces/${e.y}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t.full_name,number:n.number})}).catch(()=>{});await e.a6(void 0,!1)}}function Bf(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.a5(void 0),500)}}function Vf(e){return async t=>{try{let n=await cn(`/api/workspaces/${e.y}/procs`,{signal:t});Zd(e,n),hl.set(`procs:${e.y}`,n)}catch{}}}function Hf(e){return async()=>{Pd(e,!0),await e.a6(void 0,!0),Pd(e,!1)}}function Uf(e){return async(t,n)=>{try{let r=await cn(`/api/workspaces/${e.y}/prs${n?`?refresh`:``}`,{signal:t});tf(e,r),hl.set(`prs:${e.y}`,r)}catch{}}}function Wf(e){return async(t,n)=>{Hd(e,null);try{let r=await cn(`/api/workspaces/${e.y}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})});tf(e,r),hl.set(`prs:${e.y}`,r)}catch(t){Hd(e,String(t.message||t))}}}function Gf(e){return async t=>{Hd(e,null),Gd(e,t),Jd(e,null);try{await cn(`/api/workspaces/${e.y}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`delete`&&sf(e,!1)}catch(t){Hd(e,String(t.message||t))}finally{Gd(e,null),Jd(e,null)}}}R(`k10`,Mf),R(`k13`,Nf),R(`k12`,Pf),R(`k11`,Ff),R(`k6`,If),R(`k7`,Lf),R(`k5`,Rf),R(`k3`,zf),R(`k9`,Bf),R(`k0`,Vf),R(`k2`,Hf),R(`k1`,Uf),R(`k4`,Wf),R(`k8`,Gf);var Kf={iconBtn:`_H _cP`,spinning:`_I _cQ`,newWs:`_J`,field:`_K`,steps:`_L`,active:`_M`,stepDone:`_N`},qf=Bc,Jf=(e=>`/${e}&`)(Vc),Yf=e=>B(e.a,Kf.stepDone),Xf=P(1,0,e=>V(e.a,e._.g)),Zf=Xf,Qf=lt(`m9`,`Cancel`),$f=O(1,`<span class=spin></span>`,0,0,`<span>✓</span>`,` `,Yf),ep=I(32,e=>{B(e.a,{[Kf.active]:e.M===e._._._.n-1}),$f(e,e.M===e._._._.n-1?0:1)},e=>e._._._),tp=ep,np=(e,t)=>V(e.c,t),rp=k(0,`<li><!><!></li>`,` D%b%`,tp,(e,t)=>np(e,t[0])),ip=I(31,e=>rp(e,[e._._.m]),e=>e._._),ap=e=>{ip(e),B(e.a,Kf.steps)},op=I(30,e=>V(e.a,e._._._.l),e=>e._._._),sp=ut(`m11`,` `,` `,op),cp=e=>{Vr(e.a),Gr(e.a,sp(e)),Lr(e.a,`inline`),Yr(e.a,mm(e)),Jr(e.a),Rr(e.a),Nr(e.a),Ur(e.a),Br(e.a,{})},lp=I(29,e=>z(e.c,`disabled`,e._._.k),e=>e._._),up=L(`m12`,e=>A(e.c,`click`,function(){e._._.w(e.f)})),dp=e=>{lp(e),up(e)},fp=M(5,e=>{V(e.a,e.f),z(e.c,`title`,`Remove ${e.f}`)}),pp=O(1,`<span class="cur-base mono" title="Base branch">⎇ <!></span>`,`Db%`,Zf),mp=M(6,e=>{pp(e,+!e.g),Xf(e)}),hp=(e,t)=>{fp(e,t[0]?.fullName),mp(e,t[0]?.baseBranch)},gp=Qe(11),_p=I(25,e=>Nt(e,`d`,e._.g,hm(e))),vp=L(`m14`,e=>{Pt(e,`d`),A(e.e,`click`,function(){gp(e)()})}),yp=e=>{_p(e),bp(e),Sp(e),wp(e),Dp(e),kp(e),Ap(e),jp(e),Mp(e),B(e.c,Kf.field),Ts(e.f),Es(e.f,13),Ds(e.f),Ye(e,8,Np),Cc(e.i),Ec(e.i,_m(e)),ac(e.i,gm(e)),ic(e.i),vp(e)},bp=I(26,e=>{B(e.e,[Kf.iconBtn,{[Kf.spinning]:e._.h}]),z(e.e,`disabled`,e._.h)}),xp=k(6,`<li class=cur-repo><span class=cur-full> </span><!><button class=cur-remove>×</button></li>`,`E l%b `,dp,hp),Sp=I(27,e=>{Oc(e.i,new Set(e._.i.map(e=>e.fullName))),xp(e,[e._.i,`fullName`])}),Cp=O(7,`<li class=empty-note>No repos yet — search below to add one (or create empty).</li>`),wp=I(28,e=>Cp(e,+!!e._.j)),Tp=O(10,`<ul></ul>`,` `,ap),Ep=N(12,e=>Tp(e,e._.k&&e._.n?0:1)),Dp=I(29,e=>{z(e.d,`disabled`,e._.k),Mc(e.i,e._.k),Ep(e)}),Op=O(1,mr,(e=>`/${e}&`)(hr),cp),kp=I(30,e=>Op(e,+!e._.l)),Ap=I(32,Ep),jp=I(33,e=>jc(e.i,vm(e))),Mp=I(34,e=>z(e.a,`id`,e._.y)),Np=rt(`m13`,M(11)),Pp=lt(`m16`,((e,t)=>`<header class=manage-head><div><h2>New workspace</h2></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div class=repos-head><h3>Repos</h3><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul class=cur-repos><!><!></ul>${t}</section><!><!>`)(Cs,ks),((e,t)=>`E m%b Db lEb D/${e}&mD%b%l0${t}&l%c`)(ws,As),yp,0,`B2`),Fp=N(3,e=>z(e.a,`disabled`,e._.k||!e._.g.trim())),Ip=I(25,Fp),Lp=L(`m10`,e=>A(e.a,`click`,function(){e._.x()})),Rp=e=>{Ip(e),zp(e),e.c,bs(e.c,Qf(e)),Lp(e)},zp=I(29,e=>{V(e.b,e._.k?`Creating…`:`Create workspace`),Ss(e.c,{disabled:e._.k,class:`btn`}),Fp(e)}),Bp=ut(`m15`,(e=>`<button type=button class="btn primary"> </button><div class=spacer></div>${e}`)(vs),(e=>` D lb/${e}&`)(ys),Rp),Vp=M(23),Hp=N(20,e=>Vp(e,ym(e)),5),Up=F(Ip,_p),Wp=j(6,e=>{Hp(e),Up(e)}),Gp=j(7,F(bp)),Kp=M(21,F(jp)),qp=M(22),Jp=F(Sp),Yp=j(8,e=>{sm(e,e.i?.length),Kp(e,bm(e)),qp(e,xm(e)),Hp(e),Jp(e)}),Xp=N(19,L(`m17`,e=>Tt(e,{busy:e.k,onMount:function(){let t=new AbortController;return jn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.s([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),Zp=F(zp,Dp,lp),Qp=j(10,e=>{Yc(e.a,!e.k),Xp(e),Zp(e)}),$p=j(11,F(kp,op)),em=M(18,e=>{Xp(e),Hp(e)}),tm=N(17,e=>em(e,Sm(e)),2),nm=F(ip),rm=j(12,e=>{cm(e,e.m?.length),tm(e),nm(e)}),im=(e,t)=>{lm(e,t.op),um(e,t.last)},am=M(24,e=>il(e.a,e.y));function om(e){cl(e.a),dl(e.a,an({content:Bp(e)})),Hc(e.a,Pp(e)),al(e.a,`New workspace`),nl(e.a,Kf.newWs),ol(e.a),ul(e.a,{}),Wp(e,``),Gp(e,!1),Yp(e,[]),Qp(e,!1),$p(e,null),rm(e,[]),im(e,{last:0,op:``}),am(e,Xe(e))}var sm=M(9,F(wp)),cm=M(13,F(Ap,ep)),lm=M(15,e=>{tm(e),Hp(e)}),um=M(16,e=>{tm(e),Hp(e)}),dm=M(3,Hp),fm=(e,t)=>Qc(e.a,t),pm=(e,t)=>tl(e.a,t);function mm(e){return function(){$p(e._._,null)}}function hm(e){return t=>{Wp(e._,t)}}function gm(e){return function(t){Gp(e._,t)}}function _m(e){return function(t){$p(e._,t)}}function vm(e){return function(t,n){e._.v(t,n)}}function ym(e){return async()=>{Qp(e,!0),$p(e,null),rm(e,[]),e.p=Math.random().toString(36).slice(2,10);try{e.q=(await cn(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await cn(`/api/progress?since=${e.q}&op=${e.p}`);e.s(t.messages)}catch{}},800);try{let t=await cn(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.g,repos:e.i,opId:e.p})});Qp(e,!1),e.d?.(t)}catch(t){Qp(e,!1),$p(e,String(t.message||t))}finally{clearInterval(t)}}}function bm(e){return(t,n)=>{!t||e.i.some(e=>e.fullName===t)||Yp(e,e.i.concat({fullName:t,baseBranch:n}))}}function xm(e){return t=>{Yp(e,e.i.filter(e=>e.fullName!==t))}}function Sm(e){return t=>{for(let n of t)n.op===e.p&&(n.seq&&n.seq<=e.q||(n.seq&&(e.q=n.seq),rm(e,e.m.concat(n.message))))}}R(`m5`,mm),R(`m0`,hm),R(`m8`,gm),R(`m7`,_m),R(`m6`,vm),R(`m4`,ym),R(`m2`,bm),R(`m3`,xm),R(`m1`,Sm);var Cm={workView:`_c`,mainCol:`_d`,termArea:`_e`,asBar:`_f`,padInline:`_g`,emptySess:`_h`},wm={iconBtn:`__ _cP`,spinning:`_ba _cQ`,navToggle:`_bb _cP`,notifyBtn:`_bc _cP`,sideNav:`_bd`,open:`_be`,sideList:`_bf`,sideRail:`_bg`,sideFoot:`_bh`,on:`_bi`,drawerBackdrop:`_bj`,closed:`_bk`,railPop:`_bl`},Tm={railBtn:`_cS _cP`},Em=ri,Dm=(e=>`/${e}&`)(ii);function Om(e){si(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var km=(e,t)=>ai(e.a,t),Am=(e,t)=>oi(e.a,t),jm={sideChips:`_dl`,chip:`_dm`,pr:`_dn`,rejected:`_do`,portChip:`_dp`,portOpen:`_dq`,portKill:`_dr`,armed:`_ds`},Dee=`<!><!><!>`,Mm=N(9,e=>B(e.d,[jm.portKill,{[jm.armed]:e._._.h===e.i}])),Nm=N(10,e=>z(e.d,`title`,e._._.h===e.i?`Really kill ${e.g}?`:`Kill ${e.g} (pid ${e.i})`),2),Pm=I(15,e=>{Mm(e),Nm(e)},e=>e._._),Oee=L(`r3`,e=>{A(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.h}`,`_blank`,`noopener`)}),A(e.d,`click`,function(){e._._.h===e.i?(Um(e._._,null),fetch(`/api/procs/${e.i}`,{method:`DELETE`}).catch(()=>{})):e._._.k(e.i)})}),kee=e=>{Pm(e),B(e.a,[`chip`,jm.portChip]),B(e.b,jm.portOpen),Oee(e)},Aee=M(6,e=>{z(e.a,`title`,e.g),Nm(e)}),jee=M(7,e=>{z(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.h}`),V(e.c,e.h)}),Mee=M(8,e=>{Mm(e),Nm(e)}),Nee=(e,t)=>{Aee(e,t[0]?.cmd),jee(e,t[0]?.port),Mee(e,t[0]?.pid)},Fm=N(12,e=>V(e.b,e._._.d(e._.c))),Im=I(4,Fm,e=>e._._),Pee=L(`r2`,e=>A(e.a,`click`,function(){e._._._.g?.(e._.e,e.l)})),Fee=e=>{Im(e),Lm._(e),zm._(e),Pee(e)},Lm=We(0,Fm),Rm=N(10,e=>z(e.a,`title`,`${e._.e} — ${e.j}${e.h===`APPROVED`?` (approved)`:e.h===`CHANGES_REQUESTED`?` (changes requested)`:``}`),2),zm=We(0,Rm),Bm=N(8,e=>pt(e.a,{draft:e.g,rejected:e.h===`CHANGES_REQUESTED`})),Iee=M(6,Bm),Lee=M(7,e=>{V(e.d,e.h===`APPROVED`?` ✓`:e.h===`CHANGES_REQUESTED`?` ✗`:``),Bm(e),Rm(e)}),Ree=M(9,Rm),zee=M(11,e=>V(e.c,e.l)),Bee=k(0,`<button type=button class="chip pr"><!>#<!><!></button>`,` D%c%b%`,Fee,(e,t)=>{Iee(e,t[0]?.isDraft),Lee(e,t[0]?.reviewDecision),Ree(e,t[0]?.title),zee(e,t[0]?.number)}),Vee=(e,t)=>Bee(e,[t||[],`number`]),Hee=(e,t)=>Uee(e,t[0]),Uee=M(2,e=>{Vee(e,e.c?.prs),Wee(e,e.c?.worktree),Lm(e)}),Wee=M(4,zm),Gee=M(3,F(Im)),Kee=k(1,`<!><!><!>`,`b%`,0,Hee),Vm=P(0,0,e=>{Gee(e,Gm(e)),Kee(e,[e._.l,`full_name`])}),qee=e=>{Vm._(e),Hm._(e),B(e.a,jm.sideChips)},Jee=k(2,`<span><button type=button>:<!></button><button type=button>×</button></span>`,` D Db%l `,kee,Nee),Hm=P(0,0,e=>Jee(e,[e._.m,`port`])),Um=j(7,F(Pm)),Yee=(e,t)=>Qee(e,t.timer);function Xee(e){Um(e,null),Yee(e,{timer:0})}var Zee=M(10),Qee=M(9,e=>Zee(e,Km(e))),$ee=O(0,`<div><!><!></div>`,` D%b%`,qee),Wm=N(14,e=>$ee(e,e.l.some(e=>(e.prs||[]).length)||e.n?0:1)),ete=M(11,e=>{Wm(e),Vm(e)}),tte=(e,t)=>ete(e,t||[]),nte=M(12,e=>{rte(e,e.m.length),Hm(e)}),rte=M(13,Wm),ite=(e,t)=>nte(e,t||[]),ate=(e,t)=>{tte(e,t?.repos),ite(e,t?.ports)},ote=M(6);function Gm(e){return t=>{if(e._.l.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.l.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function Km(e){return t=>{clearTimeout(e.j),Um(e,t),e.j=setTimeout(()=>{Um(e,null)},3500)}}R(`r1`,Gm),R(`r0`,Km);var qm=`<!><!><!>`,Jm=N(11,e=>mt(e.a,`current`,e.k===e._._._.q)),Ym=I(36,Jm,e=>e._._._),ste=L(`s5`,e=>{A(e.b,`click`,function(){e._._._.r?.(e.k)}),A(e.f,`click`,function(){e._._._.s?.(e.j)}),A(e.h,`click`,function(){e._._._.v===e.k?(Sh(e._._._,null),e._._._.t?.(e.k)):e._._._.y(e.k)})}),cte=e=>{Ym(e),Zm(e),e.d,Ni(e.d,13),Li(e.d,`sess-icon`),Om(e.g),km(e.g,12),Am(e.g),ste(e)},Xm=N(12,e=>{mt(e.h,`armed`,e._._._.v===e.k),z(e.h,`title`,e._._._.v===e.k?`Really kill this session?`:`Kill session`)}),Zm=I(38,Xm,e=>e._._._),lte=M(10,e=>{Jm(e),Xm(e)}),ute=(e,t)=>B(e.c,[`dot`,ti(t)]),Qm=N(16,e=>V(e.e,e.p||e.o)),dte=M(14,e=>{Ii(e.d,e.o),Qm(e)}),fte=M(15,Qm),pte=(e,t)=>mte(e,t[0]),mte=M(9,e=>{lte(e,e.j?.id),ute(e,e.j?.state),dte(e,e.j?.agent),fte(e,e.j?.title)}),hte=L(`s3`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._.n?.(e.e)})),gte=e=>{e.b,Ni(e.b,14),Li(e.b),hte(e)},_te=M(4,e=>{Ii(e.b,e.e),V(e.c,e.e)}),vte=k(2,(e=>`<button>${e}<!></button>`)(Ci),(e=>` D/${e}&%l`)(`b%c`),gte,(e,t)=>_te(e,t[0])),$m=I(34,e=>vte(e,[[...e._._._.o||[],`shell`],e=>e]),e=>e._._._),yte=(e,t)=>{z(e.a,`popovertarget`,t),z(e.c,`id`,t)},bte=L(`s4`,e=>A(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),xte=e=>{$m(e),e.b,Ii(e.b,`shell`),Ni(e.b,12),Li(e.b),yte(e,Xe(e)),bte(e)},Ste=L(`s2`,e=>A(e.a,`click`,function(){e._._._.l?.()})),Cte=e=>{ui(e.b),di(e.b,12),fi(e.b),Ste(e)},eh=I(30,e=>mt(e.a,`current`,e._._.i),e=>e._._),wte=L(`s6`,e=>{A(e.b,`click`,function(){e._._.j()}),A(e.f,`click`,function(){e._._.m?.()})}),Tte=e=>{eh(e),th(e),nh(e),rh(e),ih(e),ah(e),oh._(e),sh._(e),hi(e.g),gi(e.g,12),_i(e.g),Xee(e.j),wte(e)},Ete=O(4,(e=>`<button class="row-icon new-sess" title="Review changes">${e}</button>`)(ci),(e=>` D/${e}&l`)(li),Cte),th=I(32,e=>Ete(e,+!e._._.l),e=>e._._),Dte=O(7,(e=>`<button class="row-icon new-sess" title="New session">${e}</button><div popover=auto class=new-session-pop></div>`)(Ci),(e=>` D/${e}&l b`)(`b%c`),xte),nh=I(33,e=>Dte(e,+!e._._.n),e=>e._._),Ote=k(8,((e,t)=>`<div class=side-sess><button class=side-sess-btn><span></span>${e}<!></button><button class=row-icon title="Rename session">${t}</button><button class=close>×</button></div>`)(Ci,Em),((e,t)=>` D D b/${e}&%l D/${t}&l l`)(`b%c`,Dm),cte,pte),kte=(e,t)=>Ote(e,[t.length>1?t:[],`id`]),rh=I(35,e=>kte(e,e._._.p||[]),e=>e._._),ih=I(37,e=>ote(e.j,e._._.u),e=>e._._),ah=I(39,e=>V(e.d,e._._.a0),e=>e._._),oh=P(0,1,e=>ate(e.j,e._.b)),sh=P(0,1,e=>B(e.c,[`dot`,e._.c])),ch=I(30,e=>B(e.a,[Tm.railBtn,`rail-btn`,{current:e._._.i}]),e=>e._._),lh=L(`s1`,e=>A(e.a,`click`,function(){e._._.j()})),uh=e=>{ch(e),dh(e),fh(e),ph._(e),lh(e)},dh=I(31,e=>V(e.b,(e._._.k??0)+1),e=>e._._),fh=I(39,e=>z(e.a,`title`,e._._.a0),e=>e._._),ph=P(0,0,e=>B(e.c,[`dot`,e._.c])),mh=M(2,e=>{ph(e),sh(e)}),hh=M(1,e=>{mh(e,ei(e.b)),oh(e)}),gh=N(3,e=>hh(e,e._.g[e._.e])),_h=P(0,0,gh),vh=e=>{_h._(e),yh._(e),xh._(e)},yh=P(0,0,gh),bh=O(0,`<button> <span></span></button>`,` D b `,uh,((e,t)=>`<section class=side-ws><div class=side-ws-row><button class=side-ws-btn><span></span><span class=side-ws-name> </span></button><!><button class=row-icon title="Manage workspace">${e}</button><!></div><div class=side-sessions><!>${t}</div></section>`)(pi,Dee),((e,t)=>` E D bD m%b D/${e}&l%lD%b/${t}&m`)(mi,`b%c`),Tte),xh=P(0,0,e=>bh(e,+!e._.h)),Sh=j(21,F(Zm)),Ch=(e,t)=>Eh(e,t.timer);function wh(e){Sh(e,null),Ch(e,{timer:0})}var Th=M(24),Eh=M(23,e=>Th(e,Jh(e))),Dh=O(0,`<!><!><!>`,`b%`,vh),Oh=(e,t)=>{kh(e,t?.name),Dh(e,+!t)},kh=M(26,F(fh,ah)),Ah=N(5,e=>Oh(e,e.d.find(t=>t.id===e.e))),jh=M(3,Ah),Mh=M(4,e=>{Ah(e),_h(e)}),Nh=M(6,yh),Ph=M(7,xh),Fh=M(8,F(ch,eh)),Ih=M(9),Lh=M(10,F(dh)),Rh=M(11,F(th)),zh=M(12),Bh=M(13,F(nh)),Vh=M(14,F($m)),Hh=M(15,F(rh)),Uh=M(16,F(Ym)),Wh=M(17),Gh=M(18),Kh=M(19),qh=M(20,F(ih));function Jh(e){return t=>{clearTimeout(e.x),Sh(e,t),e.x=setTimeout(()=>{Sh(e,null)},3500)}}R(`s0`,Jh);var Yh=ri,Xh=(e=>`/${e}&`)(ii);function Zh(e){si(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Qh=(e,t)=>ai(e.a,t),$h=(e,t)=>oi(e.a,t),eg=ri,tg=(e=>`/${e}&`)(ii);function ng(e){si(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var rg=(e,t)=>ai(e.a,t),ig=(e,t)=>oi(e.a,t),ag=ri,og=(e=>`/${e}&`)(ii);function sg(e){si(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var cg=(e,t)=>ai(e.a,t),lg=(e,t)=>oi(e.a,t),ug=ri,dg=(e=>`/${e}&`)(ii);function fg(e){si(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var pg=(e,t)=>ai(e.a,t),mg=(e,t)=>oi(e.a,t),hg=ri,gg=(e=>`/${e}&`)(ii);function _g(e){si(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var vg=(e,t)=>ai(e.a,t),yg=(e,t)=>oi(e.a,t),bg=((e,t)=>`<!><!><aside><div></div><!><div><button></button><div class=spacer></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button></div></aside>`)(ug,hg),xg=((e,t)=>`b%b D b%b D c%b D/${e}&l D/${t}&n`)(dg,gg),Sg=e=>{ng(e.a),rg(e.a,15),ig(e.a)},Cg=e=>{Zh(e.a),Qh(e.a,15),$h(e.a)},wg=P(6,0,e=>{B(e.a,[wm.notifyBtn,{[wm.on]:e._.ao}]),z(e.a,`title`,e._.ao?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)}),Tg=L(`t19`,e=>A(e.a,`click`,function(){e._.aq()})),Eg=e=>{wg._(e),sg(e.b),cg(e.b,15),lg(e.b),Tg(e)},Dg=L(`t16`,e=>A(e.a,`click`,function(){sv(e._,!1)})),Og=e=>{B(e.a,wm.drawerBackdrop),Dg(e)},kg=N(7,e=>Rh(e.b,Wv(e)),4),Ag=I(57,kg,e=>e._._),jg=L(`t18`,e=>{A(e.a,`mouseenter`,function(){e._.i()}),A(e.a,`mouseleave`,function(){e._.j()})}),Mg=e=>{Ag(e),Ng(e),Fg(e),Ig(e),Rg(e),zg(e),Bg(e),Ug(e),Wg(e),Gg(e),Kg(e),qg(e),Yg._(e),Zg._(e),Qg._(e),B(e.a,wm.railPop),wh(e.b),zh(e.b,Gv(e)),Ph(e.b),Lh(e.b),jg(e)},Ng=I(58,e=>Vh(e.b,e._._.a3),e=>e._._),Pg=N(3,e=>Bh(e.b,Kv(e))),Fg=I(59,Pg,e=>e._._),Ig=I(60,kg,e=>e._._),Lg=N(5,e=>Hh(e.b,e.c===e._._.ae&&e._._.a6?e._._.a6:e._._.at[e.c]?.sessions||[]),3),Rg=I(61,Lg,e=>e._._),zg=I(62,e=>Gh(e.b,e._._.a8),e=>e._._),Bg=I(63,e=>Kh(e.b,e._._.a9),e=>e._._),Vg=N(4,e=>Fh(e.b,e.c===e._._.ae)),Hg=N(6,e=>Uh(e.b,e.c===e._._.ae&&e._._.ai===`term`?e._._.ag:null),3),Ug=I(64,e=>{Ih(e.b,Yv(e)),qh(e.b,Jv(e)),Wh(e.b,qv(e)),Vg(e),kg(e),Lg(e),Hg(e)},e=>e._._),Wg=I(65,Hg,e=>e._._),Gg=I(66,e=>{kg(e),Hg(e)},e=>e._._),Kg=I(69,e=>jh(e.b,e._._.as),e=>e._._),qg=I(70,e=>{Nh(e.b,e._._.at),Lg(e)},e=>e._._),Jg=M(2,e=>{Mh(e.b,e.c),Vg(e),Pg(e),kg(e),Lg(e),Hg(e)}),Yg=P(1,0,e=>Jg(e,e._.d)),Xg=N(8,e=>ht(e.a,`top:${e._.e}px;left:${e._.f}px`)),Zg=P(1,0,Xg),Qg=P(1,0,Xg),$g=N(4,e=>Fh(e.b,e.d===e._._.ae)),e_=I(64,e=>{Ih(e.b,Xv(e)),$g(e)},e=>e._._),t_=L(`t17`,e=>{A(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();u_(e._,{id:e.d,top:r.top,left:r.right+8})}),A(e.a,`mouseleave`,function(){e._.j()})}),n_=e=>{e_(e),r_(e),i_(e),wh(e.b),Ph(e.b,!0),Rh(e.b),zh(e.b),Bh(e.b),Vh(e.b),Hh(e.b),Uh(e.b),Wh(e.b),Gh(e.b),Kh(e.b),qh(e.b),t_(e)},r_=I(69,e=>jh(e.b,e._._.as),e=>e._._),i_=I(70,e=>Nh(e.b,e._._.at),e=>e._._),a_=(e,t)=>Lh(e.b,t),o_=M(3,e=>{Mh(e.b,e.d),$g(e)}),s_=k(0,(e=>`<span>${e}</span>`)(qm),(e=>` D/${e}&l`)(`b%c`),n_,(e,t)=>{o_(e,t[0]),a_(e,t[1])}),c_=P(3,0,e=>s_(e,[e._.ar,e=>e])),l_=O(1,(e=>`<div>${e}</div>`)(qm),(e=>` D/${e}&l`)(`b%c`),Mg),u_=j(2,e=>{p_(e,e.c?.id),m_(e,e.c?.top),h_(e,e.c?.left),l_(e,+!e.c)}),d_=(e,t)=>v_(e,t.timer),f_=e=>{c_._(e),B(e.a,wm.sideRail),u_(e,null),d_(e,{timer:0})},p_=M(3,Yg),m_=M(4,Zg),h_=M(5,Qg),g_=M(8),__=M(9),v_=M(7,e=>{g_(e,Zv(e)),__(e,Qv(e))}),y_=N(7,e=>Rh(e.a,$v(e)),4),b_=We(2,y_),x_=e=>{b_._(e),S_._(e),w_._(e),T_._(e),D_._(e),O_._(e),k_._(e),j_._(e),M_._(e),N_._(e),P_._(e),F_._(e),wh(e.a),zh(e.a,ey(e)),Ph(e.a),Lh(e.a)},S_=We(2,e=>Vh(e.a,e._.a3)),C_=N(3,e=>Bh(e.a,ty(e))),w_=We(2,C_),T_=We(2,y_),E_=N(5,e=>Hh(e.a,e.c===e._.ae&&e._.a6?e._.a6:e._.at[e.c]?.sessions||[]),3),D_=We(2,E_),O_=We(2,e=>Gh(e.a,e._.a8)),k_=We(2,e=>Kh(e.a,e._.a9)),A_=N(6,e=>Uh(e.a,e.c===e._.ae&&e._.ai===`term`?e._.ag:null),3),j_=Ge(2,40,2,e=>{Fh(e.a,e.c===e._.ae),Ih(e.a,iy(e)),qh(e.a,ry(e)),Wh(e.a,ny(e)),y_(e),E_(e),A_(e)}),M_=We(2,A_),N_=We(2,e=>{y_(e),A_(e)}),P_=We(2,e=>jh(e.a,e._.as)),F_=We(2,e=>{Nh(e.a,e._.at),E_(e)}),I_=M(2,e=>{Mh(e.a,e.c),C_(e),y_(e),E_(e),A_(e)}),L_=(e,t)=>I_(e,t[0]),R_=F(r_,Kg),z_=M(54,e=>{P_(e),R_(e)}),B_=N(39,e=>z_(e,e.z||[e.ac])),V_=M(38,e=>{q_(e,e.ac?.id),B_(e)}),H_=k(2,(e=>`<!>${e}<!>`)(qm),(e=>`b/${e}&b`)(`b%c`),x_,L_),U_=M(53,e=>{H_(e,[e.ar,e=>e]),c_(e)}),W_=N(41,e=>U_(e,e.z?.length?e.z.filter(e=>e.status===`active`).map(e=>e.id):[e.ae])),G_=N(56,e=>e.at[e.ae]),K_=F(e_,Ug),q_=M(40,e=>{W_(e),G_(e),j_(e),K_(e)}),J_=V_,Y_=F(Wg),X_=Ue(42,e=>{M_(e),Y_(e)}),Z_=N(16,e=>X_(e,e.o,e.p)),Q_=M(14,Z_),$_=M(15,Z_),ev=F(Gg),tv=Ue(44,e=>{z(e.b,`hidden`,e.ai===`diff`),N_(e),ev(e)}),nv=N(19,e=>tv(e,e.r,e.s)),rv=M(17,nv),iv=M(18,nv),av=O(0,`<div></div>`,` `,Og),ov=N(49,e=>B(e.b,[wm.sideNav,{[wm.closed]:!e.am,[wm.open]:e.ak}])),sv=Ue(46,e=>{av(e,+!e.ak),ov(e)}),cv=N(22,e=>sv(e,e.u,e.v)),lv=M(20,cv),uv=M(21,cv),dv=O(3,`<div></div><!><!>`,` b%`,f_),fv=O(5,Yh,(e=>`/${e}&`)(Xh),Cg,eg,(e=>`/${e}&`)(tg),Sg),pv=j(48,e=>{z(e.f,`title`,e.am?`Collapse sidebar`:`Expand sidebar`),dv(e,+!!e.am),fv(e,+!e.am),ov(e)}),mv=M(52),hv=N(51,e=>mv(e,ay(e))),gv=j(50,e=>{hv(e),wg(e)}),_v=O(6,(e=>`<button>${e}</button>`)(ag),(e=>` D/${e}&l`)(og),Eg),vv=L(`t21`,e=>{Tt(e,{onMount:function(){nr()&&rr().then(t=>{gv(e,!!t)})}}),A(e.f,`click`,function(){pv(e,!e.am),Yn(e.am)}),A(e.h,`click`,function(){sv(e,!1),e.aa?.()}),A(e.j,`click`,function(){sv(e,!1),e.ab?.()})});function yv(e){B(e.c,wm.sideList),B(e.e,wm.sideFoot),B(e.f,wm.navToggle),B(e.h,wm.iconBtn),fg(e.i),pg(e.i,15),mg(e.i),B(e.j,wm.iconBtn),_g(e.k),vg(e.k,16),yg(e.k),pv(e,Jn()),gv(e,!1),_v(e,+!nr()),vv(e)}var bv=M(23,hv),xv=M(24,L(`t20`,e=>{e.y&&pv(e,Jn())})),Sv=M(25,e=>{W_(e),B_(e)}),Cv=F(i_,qg),wv=M(55,e=>{G_(e),F_(e),Cv(e)}),Tv=(e,t)=>wv(e,t||{}),Ev=F(Ag),Dv=M(27,e=>{b_(e),Ev(e)}),Ov=M(28),kv=F(Ng),Av=M(29,e=>{S_(e),kv(e)}),jv=F(Fg),Mv=M(30,e=>{w_(e),jv(e)}),Nv=F(Ig),Pv=M(31,e=>{T_(e),Nv(e)}),Fv=F(Rg),Iv=M(32,e=>{D_(e),Fv(e)}),Lv=M(33),Rv=F(zg),zv=M(34,e=>{O_(e),Rv(e)}),Bv=F(Bg),Vv=M(35,e=>{k_(e),Bv(e)}),Hv=M(36),Uv=M(37);function Wv(e){return function(){u_(e._,null),e.c===e._._.ae?e._._.ai===`diff`?tv(e._._,`term`):e._._.a5?.():(Fn(e.c),e._._.a1?.(e.c))}}function Gv(e){return function(){u_(e._,null),e._._.a2?.(e.c)}}function Kv(e){return function(t){u_(e._,null),e._._.a4(e.c,t)}}function qv(e){return function(t){u_(e._,null),e.c===e._._.ae?(X_(e._._,t),tv(e._._,`term`)):e._._.a7?.(e.c,t)}}function Jv(e){return function(t,n){u_(e._,null);let r=`${t}/${n}`;e.c===e._._.ae?e._._.a5?.(r):(Fn(e.c,r),e._._.a1?.(e.c))}}function Yv(e){return function(){u_(e._,null),e.c!==e._._.ae&&e._._.a1?.(e.c)}}function Xv(e){return function(){e.d!==e._._.ae&&e._._.a1?.(e.d)}}function Zv(e){return()=>clearTimeout(e.h)}function Qv(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{u_(e,null)},150)}}function $v(e){return function(){sv(e._,!1),e.c===e._.ae?e._.ai===`diff`?tv(e._,`term`):e._.a5?.():(Fn(e.c),e._.a1?.(e.c))}}function ey(e){return function(){sv(e._,!1),e._.a2?.(e.c)}}function ty(e){return function(t){sv(e._,!1),e._.a4(e.c,t)}}function ny(e){return function(t){sv(e._,!1),e.c===e._.ae?(X_(e._,t),tv(e._,`term`)):e._.a7?.(e.c,t)}}function ry(e){return function(t,n){sv(e._,!1);let r=`${t}/${n}`;e.c===e._.ae?e._.a5?.(r):(Fn(e.c,r),e._.a1?.(e.c))}}function iy(e){return function(){e.c!==e._.ae&&(sv(e._,!1),e._.a1?.(e.c))}}function ay(e){return async()=>{try{e.ao?(await ar(),gv(e,!1)):(gv(e,await ir()),e.ao||e.x?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){gv(e,!1),e.x?.(`Notifications failed: ${String(t.message||t)}`)}}}R(`t13`,Wv),R(`t11`,Gv),R(`t12`,Kv),R(`t15`,qv),R(`t14`,Jv),R(`t10`,Yv),R(`t9`,Xv),R(`t7`,Zv),R(`t8`,Qv),R(`t4`,$v),R(`t2`,ey),R(`t3`,ty),R(`t6`,ny),R(`t5`,ry),R(`t1`,iy),R(`t0`,ay);async function oy(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function sy(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function cy(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var ly=null;function uy(){return ly}function dy(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(fy(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function fy(e){if(!/[*?]/.test(e))return t=>$r(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>$r(e,t)}}var py=3;function my(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(hy(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=_y(a,e.line_start,e.line_end,e.side),n=vy(t);r.push(``),r.push(yy(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(yy(e.text))}}return r.join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_8z_taKm3.js","assets/_Bg_ZrvlF.js","assets/_DVszDPmx.js","assets/_CqfjUWNC.js","assets/_ByJ8bIho.js","assets/_DPSelcsm.js","assets/_CpUOMlac.js","assets/_CYvarg9W.js","assets/_DWHvByuS.js","assets/_CwjXbHzo.js","assets/_yvxe882E.js","assets/_Ccm3rKVf.js","assets/_BXeXVLqQ.js","assets/_Q4XgVPG6.js","assets/_iFGGC9pM2.js","assets/_DHNkWyG72.js","assets/_CiA4dPfT2.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_BHXWNTj72.js","assets/_CCxovD8F2.js","assets/_DTfT-sFF2.js","assets/_CMGOcqMA2.js","assets/_JVRw7xKf.js","assets/_Cz_1vtBu.js","assets/_DJ1rqVCG.js","assets/_afjtTIwy.js","assets/_DwJU6EeU.js","assets/_DB4u0VFp.js","assets/_CYIktEVH.js","assets/_DVlxgdsm.js","assets/_7EfSt1VP.js","assets/_NVM5qbq7.js","assets/_DmYu9jHv.js","assets/_CHLq34up.js","assets/_DcATy5r-.js","assets/_599s_mPO.js","assets/_WrsJ1SVx.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_ByVz1pEI2.js","assets/_Cp-Aarc52.js","assets/_doUtVqO32.js","assets/_Km9UGEJN2.js","assets/_xYLJb0_42.js","assets/_DNtDpT7J2.js","assets/_txg_BrbE2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_BkCe1Qp0.js","assets/_DI0WPTfJ.js","assets/_DZxfPQXv.js","assets/_CQW9g4EM.js","assets/_DWKZhwbB.js","assets/_BEA0rtsf.js","assets/_BG98a-Bd.js","assets/_DdqCKkdW.js","assets/_D6mnVZvL.js","assets/_D2PHPuf-.js","assets/_DVTAwKKz.js","assets/_C2awCEWl.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_B1jQI_MS.js","assets/_BIZVez4e2.js","assets/_DNYpQ8c_2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_CK7dNIXj2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_DDFWuRVz2.js","assets/_CwmqjsDb.js","assets/_BX-1MhYY.js","assets/_Br-vX1Tu.js","assets/_C1v_RN4j.js","assets/_Bj61d0ZC2.js","assets/_B1j_sdSo.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_BkYaxto4.js","assets/_DA2HAsmL.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_CE1QtCTP.js","assets/_Djl1TRVn.js","assets/_zSSacvcn.js","assets/_CNdGjx_J2.js","assets/_DPt_dOB32.js","assets/_C1uLH64z2.js","assets/_BF0cJ2cO2.js","assets/_BTLEtyOE2.js","assets/_Zlv_lPYo2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(nee)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Le());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Ie(r.$,r.F)),i===48&&(r[a(c++)]=Le());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,E={},D=/[\p{L}\p{N}]/gu,ce=``,le={},ue={},O=xe((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(lt(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&$t(t,e,r[t[n]=i],st)}}),de=xe((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||Ve(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),iee(l))}}),fe=xe((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=be(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if($t(a,e,l||(t?t(a):void 0),en),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);$t(a[i],`a`,e,st),e.f&&Je(e.e,e.f,a[i].Aa)}}else l?.f&&Je(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?gt:_t)(e,`a`,(r?n[0]:n)||{},ue[e.a.tagName]),(e.Ia||e.Ea)&&Te(e,Qt);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),pe=xe(e=>{e=a(e);let t=`A`+e,n=`D`+e;return(r,i)=>{if(r[n]!==(r[n]=i?.a||i)&&($t(r,e,i,st),i?.f&&Je(i.e,i.f,r[t])),i)for(let e in i.g)i.g[e](r[t],i.h[e])}}),k=xe(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=lt(``,n,r,i)();return(n,r)=>{let i=n[t],a=Me(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=st(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Be:ze),_||(f.textContent=``));for(let e of u)Ve(e,f,v);return}if(p)p.forEach(Be);else for(let e=g;e<d;e++)Be(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)Ve(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:Ve(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=tn,typeof t==`string`?Se(e,(e,r)=>n(e[t],[e,r])):Se(e,(e,r)=>n(t(e,r),[e,r]))});function me(e,t){return t?e:``}function he(e,t){return t||t===0?ge(e)+`:`+ge(t+``):``}function ge(e){return n.test(e)?e.replace(n,r):e}function _e(e){return/^on[A-Z-]/.test(e)}function ve(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ye(e){return e!=null&&e!==!1}function be(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function xe(e){return o=1,e}function Se(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Ce(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);we(a)}function we(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Te(e,t){d.push(t,e)}function Ee(){let e=d;try{s=1,eee()}finally{c++,s=0,f=[],d=[]}p(e)}function De(e,t){h=1,xe(),p=e(p),m=t(m)}function eee(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function Oe(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Te(n,je):je(n))}function ke(e,t){return Ae(e),((e.A||={})[t]||=new AbortController).signal}function Ae(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function je(e){e.abort()}function Me(e){return e?Array.isArray(e)?e:[e]:[]}function Ne(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function tee(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function A(e,t,n){e[1+t]===void 0&&g(t,Pe),e[1+t]=n||null}function Pe(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Fe(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Ie(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Le(){return v++}function Re(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function ze(e){e.N?.D?.delete(e),b(e)}function nee(e){e.Z?.forEach(ree,e);for(let t in e.A)Oe(e,t)}function ree(e){e.delete(this)}function Be(e){ze(e),Et(e.S,e.K)}function Ve(e,t,n){Dt(t,n,e.S,e.K)}function iee(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,Dt(t,null,e.S,e.K)}function aee(){x||(x=1,queueMicrotask(oee))}function oee(){requestAnimationFrame(He),Ee()}function He(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,Ee()}),S.port2.postMessage(0)}function j(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(aee(),Ce(r,t,e)),i)}function Ue(e,t){let n=a(e),r=a(e+1),i=j(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function M(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function N(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Ce(i,t,e,0,i[r])}}function We(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Me(e[n]);r.length&&Ce(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Ge(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Me(e[i]);if(e.H<c&&a.length){let c=e[t];Ce(e,()=>{let t=Ke(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&(qe(e,r),qe(n,r))}else for(let t of Me(e[i]))qe(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Ke(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Me(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function qe(e,t){e&&e.H>0&&e.H<c&&t(e)}function P(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Ce(a,n,-1)};return o._=n,o}function Je(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&Ae(n,r)}function F(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Ce(i,e[i[r]||0],-1)}}function I(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),Je(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&R(r,i),i}function Ye(e,t,n){e[a(t)].T=t=>n(e,t)}function Xe({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function L(e,t){return R(e,t),e=>{Te(e,t)}}function*Ze(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*Ze(r,t,n);else{let r=e[t[n]];n?yield*Ze(r,t,n-1):yield typeof r==`function`?r():r}}}function Qe(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>Ze(t,e).next().value;return n[Symbol.iterator]=()=>Ze(t,e),n}}function $e(e,...t){return R(e,Qe(...t))}function et(e,t,n){C=e,ne(0,t,n)}function tt(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ot(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=tee(a,c),u&&(b[u]=a,Ne(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ot(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),nt(r)},r})})};if(t){r(t);for(let e in t)nt(ae(e))}else n({configurable:!0,set:r})}function nt(e){try{T=1,p(e.m([]),1)}finally{T=0}}function R(e,t){return ie[e]=t}function rt(e,t){return R(e,e=>n=>t(e,n)),t}function it(e,t){return t=a(t),R(e,e=>()=>e[t])}function at(e,t,n,r){let i=Ie(e);return i._=t.e||n,ot(i,n?.F),t.b?.(i,r.namespaceURI),i}function ot(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function st(e,t,n,r){return ct(t,at(e,t,n,r))}function ct(e,t){return e.c&&Ce(t,e.c,-1),t}function lt(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((E[r]||={})[1+t]||=see(t,r))(e,n)}:e=>{et(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function ut(e,t,n,r,i,a){return R(e,lt(e,t,n,r,i,a))}function see(e,t){let{firstChild:n,lastChild:r}=Fe(e,t),i=document.createElementNS(t,`t`);return Dt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{et(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);et(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function dt(e){return e||e===0?e+``:``}function z(e,t,n){ft(e,t,wt(n))}function ft(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function B(e,t){ft(e,`class`,i(t,` `,me)||void 0)}function pt(e,t){for(let n in t)mt(e,n,t[n])}function mt(e,t,n){e.classList.toggle(t,!!n)}function ht(e,t){ft(e,`style`,i(t,`;`,he)||void 0)}function V(e,t){let n=dt(t);e.data!==n&&(e.data=n)}function gt(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||vt(i,t,n))||i.removeAttribute(t)}bt(e,t,n,r)}function _t(e,t,n,r){gt(e,t,n,r),xt(e,t,n?.content)}function vt(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function yt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||vt(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=_e(e)?`on-${ve(e)}`:e;r[t]||(o[t]=n[e])}bt(e,t,o,i)}function bt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:B(i,s);break;case`style`:ht(i,s);break;default:_e(r)?(a||=e[`I`+t]={})[ve(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||z(i,r,s)}}}function xt(e,t,n){let r=Ct(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&($t(e,t,r,st),r?.f&&Je(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function St(e,t){let n=e[t],r=e[`I`+t];le[e[`F`+t]]?.(e,t);for(let e in r)A(n,e,r[e])}function Ct(e){let t=be(e);if(t&&t.a)return t}function wt(e){if(ye(e))return e===!0?``:e+``}function Tt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),ke(e,r).onabort=()=>t.onDestroy?.())}function Et(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function Dt(e,t,n,r){if(e.isConnected)e.insertBefore(Ot(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Ot(e,t){return e===t?e:Dt(new DocumentFragment,null,e,t)}function kt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(D)?.length;for(;a&&D.test(r);)a--;return a?r.length:D.lastIndex}return-1}function At(e,t,n){let r=e[t],i=ye(n);if(r.defaultChecked!==i){let t=e.H<c?r.checked:i;r.defaultChecked=i,t!==i&&(r.checked=t)}}function jt(e,t,n,r){let i=e[t],a=ye(n);e[`E`+t]=r,e[`F`+t]=r?0:5,r&&e.H<c?i.checked=a:At(e,t,a)}function Mt(e,t){let n=e[t];Ht(n,Kt,()=>{let r=e[`E`+t];if(r){let e=n.checked;n.checked=!e,r(e),Ee()}})}function cee(e,t,n){let r=e[t],i=wt(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Ft(r,t)}}function Nt(e,t,n,r,i=cee){let a=e[t],o=wt(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Ft(a,o):i(e,t,o)}function Pt(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Ht(n,Gt,r=>{let i=e[`E`+t];i&&(ce=r?.inputType,i(n.value),Ee(),Ft(n,e[`G`+t]),ce=``)})}function Ft(e,t){if(e.value!==t){let n=kt(ce,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function lee(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Yt):Yt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=zt(i,o)),e.defaultSelected=t)}r!==void 0&&Rt(i,r,o)},e)}function It(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Yt):Yt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Rt(i,s,o),e):lee(e,t,s)}function Lt(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=zt(n,a);Rt(n,i,a),r(o),Ee()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Ht(n,qt,r),Vt(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Rt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function zt(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function Bt(e,t,n){e.H===c&&(e[t].open=ye(n))}function uee(e,t,n,r){let i=e[`G`+t]=ye(n);e[`E`+t]=r,e[`F`+t]=r?4:5,r&&e.H<c?e[t].open=i:Bt(e,t,i)}function dee(e,t){let n=e[t];Vt(e,t,{attributes:!0,attributeFilter:[`open`]},()=>{let r=e[`E`+t];if(r&&n.open===!e[`G`+t]){let e=n.open;n.open=!e,r(e),Ee()}})}function Vt(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Ht(e,t,n){e._=n,g(`input`,Ut),e.form&&g(`reset`,Wt),T&&t(e)&&queueMicrotask(n)}function Ut(e){e.target._?.(e)}function Wt(e){let t=[];for(let n of e.target.elements)n._&&Jt(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Gt(e){return e.value!==e.defaultValue}function Kt(e){return e.checked!==e.defaultChecked}function qt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function Jt(e){return e.options?qt(e):Gt(e)||Kt(e)}function Yt(e){return wt(e)||``}function Xt(e,t,n){if(`open`in n||`openChange`in n)return uee(e,t,n.open,n.openChange),/^open(?:Change)?$/}function Zt(e,t){let n=Re(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,ze(n)),l.add(d),$t(e,n.C,n.E,st),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function Qt(e){St(e,`a`)}function $t(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(ze(a),i.textContent=``),s&&Ve(s,o,null)):a?(s?Ve(s,o,a.S):o.insertBefore(i,a.S),Be(a)):s&&(Ve(s,o,i),i.remove())}function en(e,t,n,r){let i=at(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):ct(t,i),i}function tn(e,t){return t}var nn=[],rn=Symbol();function an(e){return e[Symbol.iterator]=on,e[rn]=nn,e}function*on(){yield this,yield*this[rn]}var sn={boot:`_a`};async function cn(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function ln(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var un=[`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`],dn=1e4,fn=4e4,pn=8e3,mn=5e3,hn=6e4,gn,_n,vn=null,yn,bn,xn,Sn,Cn=0;function wn(e){_n&&e!==_n&&location.reload(),_n=e}async function Tn(){try{wn((await cn(`/api/boot`)).boot)}catch{}}function En(){clearTimeout(bn),clearTimeout(xn),xn=setTimeout(Dn,fn),Cn&&(Cn=0,clearInterval(Sn),Sn=void 0)}function Dn(){On(),!Cn&&(Cn=Date.now(),Sn=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-Cn>hn&&(Cn=Date.now(),An()),kn(),Tn(),cn(`/api/status`).then(e=>{gn.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},mn))}function On(){clearTimeout(bn),clearTimeout(xn),vn?.close(),vn=null}function kn(){for(let e of[`workspaces.changed`,`sessions.changed`])gn.dispatchEvent(new MessageEvent(e,{data:null}))}function An(){if(vn)return;let e=vn=new EventSource(`/api/events`);clearTimeout(bn),bn=setTimeout(Dn,pn),e.addEventListener(`hello`,e=>{En(),wn(JSON.parse(e.data||`{}`).boot)}),e.addEventListener(`ping`,En);for(let t of un)e.addEventListener(t,e=>{En(),gn.dispatchEvent(new MessageEvent(t,{data:JSON.parse(e.data||`null`)}))})}function jn(){return gn||(gn=new EventTarget,An(),Tn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(yn),An(),Tn(),kn()):(clearTimeout(yn),yn=setTimeout(()=>{Cn||On()},dn))})),gn}var Mn=null,Nn=null,Pn=new EventTarget;function fee(e,t){Pn.addEventListener(`intent`,e,{signal:t})}function Fn(e,t){Mn={workspaceId:e,pr:t},Pn.dispatchEvent(new Event(`intent`))}function In(e){if(Mn?.workspaceId!==e)return!1;let t=Mn.pr;return Mn=null,{pr:t}}function Ln(e,t){Nn=[e,t],Pn.dispatchEvent(new Event(`intent`))}function Rn(e){if(Nn?.[0]!==e)return null;let t=Nn[1];return Nn=null,t}function zn(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Bn=new Map,Vn=new Set,Hn;function Un(e){for(let[t,n]of Object.entries(e))Vn.has(t)||Bn.set(t,n);typeof window<`u`&&(Hn??=Promise.resolve())}function Wn(e){return Bn.get(e)??null}function Gn(e,t){Vn.add(e),t===null?Bn.delete(e):Bn.set(e,t),Kn(e,t)}function Kn(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function qn(e){Gn(`last-workspace`,e)}function Jn(){return Wn(`side-nav`)!==`0`}function Yn(e){Gn(`side-nav`,e?`1`:`0`)}function Xn(e){return Wn(`tab:${e}`)}function Zn(e,t){Gn(`tab:${e}`,t)}function Qn(){return Wn(`diff-tree`)!==`0`}function $n(e){Gn(`diff-tree`,e?`1`:`0`)}function er(){return Wn(`diff-uncommitted`)===`1`}function tr(e){Gn(`diff-uncommitted`,e?`1`:`0`)}function nr(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function rr(){return nr()?(await sr()).pushManager.getSubscription():null}async function ir(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await sr(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await cn(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:cr(n)})}return await cn(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function ar(){let e=await rr();e&&(await cn(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function or(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function sr(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function cr(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function lr(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function ur(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function dr(){return typeof navigator<`u`&&navigator.standalone===!0}function fr(e){if(!dr()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var pr={toast:`_c`,toastFloat:`_d`,toastInline:`_e`,toastError:`_f`,toastTitle:`_g`,toastWarn:`_h`,toastInfo:`_i`,toastBody:`_j`,toastContent:`_k`,toastActions:`_l`,toastDismiss:`_m _7`},mr=`<div><div><!><!></div><!></div>`,hr=` D D%b%l%l`,gr=L(`v0`,e=>A(e.a,`click`,function(){e._._.o?.()})),_r=e=>{B(e.a,pr.toastDismiss),gr(e)},vr=fe(0),yr=I(26,e=>vr(e,e._._.n),e=>e._._),br=O(1,`<!><!><!>`,`b%`,yr),xr=P(4,0,e=>br(e,+!e._.m)),Sr=e=>{xr._(e),wr._(e),B(e.a,pr.toastActions)},Cr=O(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,_r),wr=P(4,0,e=>Cr(e,+!e._.o)),Tr=fe(1),Er=P(3,0,e=>Tr(e,e._.l)),Dr=e=>{Er._(e),B(e.a,pr.toastContent)},Or=P(2,0,e=>V(e.b,e._.j)),kr=e=>{Or._(e),B(e.a,pr.toastTitle)},Ar=N(22,e=>B(e.a,[pr.toast,e.u,e.v,e.k]),2),jr=M(20,Ar),Mr=(e,t)=>{z(e.a,`role`,t===`error`?`alert`:`status`),jr(e,{error:pr.toastError,warn:pr.toastWarn,info:pr.toastInfo}[t])},Nr=(e,t)=>Mr(e,t||`error`),Pr=M(21,Ar),Fr=N(19,L(`v1`,e=>Tt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`.palette:not(.inline)`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Ir=M(18,e=>{Pr(e,{float:pr.toastFloat,inline:pr.toastInline}[e.s]),Fr(e)}),Lr=(e,t)=>Ir(e,t||`float`),Rr=M(10,Ar),zr=L(`v2`,e=>St(e,`a`)),Br=M(16,e=>{yt(e,`a`,e.q,{class:1,role:1}),zr(e)});function Vr(e){B(e.b,pr.toastBody)}var Hr=O(2,`<strong> </strong>`,` D `,kr),Ur=M(9,e=>{Hr(e,+!e.j),Or(e)}),Wr=O(3,`<div><!></div>`,` D%`,Dr),Gr=M(11,e=>{Wr(e,+!e.l),Er(e)}),Kr=O(4,`<div><!><!></div>`,` D%b%`,Sr),qr=N(15,e=>Kr(e,e.m||e.o?0:1)),Jr=M(12,e=>{Xr(e,e.m?.content),qr(e),xr(e)}),Yr=M(14,e=>{qr(e),Fr(e),wr(e)}),Xr=M(13,F(yr));function Zr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:$r(n,a)?400+o:r.includes(n)?300:$r(n,r)?100:-1}function Qr(e,t,n){return e?t.map(t=>({repo:t,score:Zr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function $r(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function ei(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function ti(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var ni={paletteBackdrop:`_H`,inline:`_I`,rows:`_J`,rowWrap:`_K`,row:`_L`,rowMore:`_M`,hi:`_N`,archived:`_O`,cmdRow:`_P`,onboard:`_Q`,rowName:`_R`,rowNameText:`_S`,rowStats:`_T`,open:`_U`,stat:`_V`,rowRepos:`_W`,paletteFoot:`_X`,hint:`_Y`,archivedLink:`_Z`},ri=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,ii=` D l`,pee=(e,t)=>{z(e.a,`width`,t),z(e.a,`height`,t)},ai=(e,t)=>pee(e,t??15),oi=(e,t)=>B(e.a,[`icon`,t]),si=(e,t)=>z(e.b,`d`,t),ci=ri,li=(e=>`/${e}&`)(ii);function ui(e){si(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var di=(e,t)=>ai(e.a,t),fi=(e,t)=>oi(e.a,t),pi=ri,mi=(e=>`/${e}&`)(ii);function hi(e){si(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var gi=(e,t)=>ai(e.a,t),_i=(e,t)=>oi(e.a,t),vi=ri,yi=(e=>`/${e}&`)(ii);function bi(e){si(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var xi=(e,t)=>ai(e.a,t),Si=(e,t)=>oi(e.a,t),Ci=`<!><!><!>`,wi={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},Ti=P(0,1,e=>ai(e.a,e._.d)),Ei=e=>{Ti._(e),Di._(e),si(e.a,`M5 7L10 12L5 17 M13 17H20`)},Di=P(0,1,e=>oi(e.a,e._.f)),Oi=P(0,0,e=>B(e.a,[`icon`,e._.f])),ki=e=>{Oi._(e),Ai._(e),ji._(e)},Ai=P(0,0,e=>{z(e.a,`width`,e._.g),z(e.a,`height`,e._.g)}),ji=P(0,0,e=>z(e.b,`d`,e._.h)),Mi=M(6,Ai),Ni=M(3,e=>{Mi(e,e.d??15),Ti(e)}),Pi=O(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,ki,ri,(e=>`/${e}&`)(ii),Ei),Fi=M(7,e=>{Pi(e,+!e.h),ji(e)}),Ii=(e,t)=>Fi(e,wi[t]),Li=M(5,e=>{Oi(e),Di(e)}),Ri=`<!><!><div role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,zi=`b%b D%b b b%b Db b%m`,Bi=(e,t)=>{z(e.a,`value`,t),V(e.b,t)},Vi=(e,t)=>Bi(e,t[0]),Hi=(e,t)=>V(e.a,t),Ui=(e,t)=>Hi(e,t[0]?.worktree),Wi=e=>B(e.a,[`chip`,ni.open]),Gi=P(8,0,e=>{z(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),V(e.b,e._.u),V(e.c,e._.u===1?``:`s`)}),Ki=e=>{Gi._(e),B(e.a,[`chip`,ni.stat])},qi=P(9,0,e=>z(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
|
|
3
|
+
`))),Ji=e=>{qi._(e),Yi._(e),B(e.a,[`chip`,ni.stat])},Yi=P(9,0,e=>V(e.b,e._.s)),Xi=N(2,e=>z(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),Zi=P(7,0,e=>{V(e.b,e._.o),Xi(e)}),Qi=e=>{Zi._(e),$i._(e),ea._(e),B(e.a,[`chip`,ni.stat])},$i=P(7,0,Xi),ea=P(7,0,Xi),ta=e=>B(e.a,ni.rowName),na=P(1,1,e=>V(e.b,e._.h)),ra=e=>{na._(e),B(e.a,[ni.rowName,ni.cmdRow])},ia=e=>B(e.a,ni.onboard),aa=N(2,e=>V(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),oa=P(5,0,aa),sa=L(`o8`,e=>A(e.a,`click`,function(){Bo(e._,!e._.af)})),ca=e=>{oa._(e),la._(e),B(e.a,ni.archivedLink),sa(e)},la=P(5,0,aa),ua=P(8,0,e=>It(e,`a`,e._.aa?.preferredAgent,ps(e))),da=L(`o9`,e=>Lt(e,`a`)),fa=e=>{ua._(e),ma._(e),da(e)},pa=k(0,`<option> </option>`,` D `,0,Vi),ma=P(8,0,e=>pa(e,[e._.ad,e=>e])),ha=L(`o4`,e=>A(e.a,`click`,function(){po(e._,!1)})),ga=e=>{B(e.a,ni.paletteBackdrop),ha(e)},_a=L(`o5`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),va=e=>{e.b,Ni(e.b,14),Li(e.b),_a(e)},ya=M(4,e=>{Ii(e.b,e.e),V(e.c,e.e)}),ba=k(6,(e=>`<button>${e}<!></button>`)(Ci),(e=>` D/${e}&%l`)(`b%c`),va,(e,t)=>ya(e,t[0])),xa=I(59,e=>ba(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),Sa=(e,t)=>{z(e.e,`popovertarget`,t),z(e.g,`id`,t)},Ca=L(`o6`,e=>{A(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),A(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),A(e.e,`click`,function(e){e.stopPropagation()}),A(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),wa=e=>{xa(e),B(e.a,ni.rowMore),ui(e.b),di(e.b,13),fi(e.b),B(e.c,ni.rowMore),hi(e.d),gi(e.d,13),_i(e.d),B(e.e,ni.rowMore),bi(e.f),xi(e.f,13),Si(e.f),Sa(e,Xe(e)),Ca(e)},Ta=O(4,`<span>open</span>`,` `,Wi),Ea=N(21,e=>Ta(e,e._.j===e._._.v?0:1)),Da=I(57,Ea,e=>e._._),Oa=e=>{Da(e),ja(e),Na._(e),Pa._(e),Fa._(e),Ra._(e),B(e.a,ni.rowName),B(e.c,ni.rowNameText),B(e.g,ni.rowStats),B(e.k,ni.rowRepos)},ka=(e,t)=>{B(e.b,[`dot`,ei(t)]),Ba(e,t?.repos),Ha(e,t?.agents),Ua(e,t?.working),Wa(e,t?.waiting),Ka(e,t?.ports)},Aa=N(22,e=>ka(e,e._._.a6[e._.j])),ja=I(58,Aa,e=>e._._),Ma=O(5,`<span class=chip>archived</span>`),Na=P(1,2,e=>Ma(e,+!e._.g)),Pa=P(1,2,e=>{Aa(e),Ea(e)}),Fa=P(1,2,e=>V(e.d,e._.k)),Ia=k(10,`<span class=mono> </span>`,`D `,0,Ui),La=N(13,e=>Ia(e,[e.m||e._.l,`full_name`])),Ra=P(1,2,La),za=(e,t)=>Ya(e,t?.length),Ba=M(12,e=>{za(e,(e.m||[]).flatMap(e=>e.prs||[])),La(e)}),Va=O(7,`<span> </span>`,` D `,Qi),Ha=M(14,e=>{Va(e,+!e.o),Zi(e)}),Ua=M(15,$i),Wa=M(16,ea),Ga=O(9,`<span>:<!></span>`,` Db%`,Ji),Ka=M(17,e=>{qa(e,e.r?.length),Ga(e,+!(e.r||[]).length),qi(e)}),qa=M(18,Yi),Ja=O(8,`<span><!> PR<!></span>`,` D%c%`,Ki),Ya=M(20,e=>{Ja(e,+!e.u),Gi(e)}),Xa=N(13,e=>B(e.b,[ni.row,{[ni.hi]:e.m===e._.as,[ni.archived]:e.f===`ws`&&e.g}]),3),Za=We(4,Xa),Qa=L(`o7`,e=>{A(e.b,`click`,function(){e._.au(e.e)}),A(e.b,`mouseenter`,function(){zo(e._,e.m)})}),$a=e=>{Za._(e),B(e.a,ni.rowWrap),Qa(e)},eo=O(1,`<span>+ New workspace</span>`,` `,ta,`<span>▸ <!></span>`,` Db%`,ra,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,Oa),to=O(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto class=new-session-pop></div>`)(ci,pi,vi),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(li,mi,yi),wa),no=M(5,e=>{eo(e,e.f===`new`?0:e.f===`cmd`?1:2),to(e,e.f===`ws`?0:1),Xa(e)}),ro=M(6,e=>{Xa(e),Na(e)}),io=M(12,Xa),ao=(e,t)=>{oo(e,t[0]),io(e,t[1])},oo=M(4,e=>{no(e,e.e?.kind),ro(e,e.e?.archived),so(e,e.e?.label),co(e,e.e?.ws)}),so=M(7,na),co=M(8,e=>{lo(e,e.i?.id),uo(e,e.i?.name),fo(e,e.i?.repos)}),lo=M(9,Pa),uo=M(10,Fa),fo=M(11,Ra),po=Ue(19),mo=N(13,e=>po(e,e.l,e.m)),ho=M(11,mo),go=M(12,mo),_o=k(4,`<li><div><button></button><!></div></li>`,`D D b%`,$a,ao),vo=N(55,L(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&zo(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),yo=M(51,e=>{es(e,e.ap.length),_o(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),vo(e)}),bo=N(50,e=>yo(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),xo=M(46,bo),So=M(49,bo),Co=N(48,e=>So(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&$r(e.a8||``,t.label))),5),wo=O(5,`<button> </button>`,` D `,ca),To=N(45,e=>wo(e,e.ai&&!e.a8?0:1)),Eo=Ue(34,e=>{Nt(e,`d`,e.a8||``,hs(e)),xo(e,ms(e)),Co(e),bo(e),To(e)}),Do=N(16,e=>Eo(e,e.o,e.p)),Oo=M(14,Do),ko=M(15,Do),Ao=O(8,`<label class=dim><select aria-label="Preferred agent"></select></label>`,`D `,fa),jo=Ue(36,e=>{Mo(e,e.aa?.preferredAgent),No(e,e.aa?.agents),Ao(e,+!e.aa),ua(e)}),Mo=M(38,Co),No=M(39,ma),Po=N(19,e=>jo(e,e.r,e.s)),Fo=M(17,e=>{ds(e,e.r?.agents),Po(e)}),Io=M(18,Po),Lo=M(54,e=>{vo(e),Za(e)}),Ro=N(53,e=>Lo(e,Math.min(e.ae,e.aq-1))),zo=j(40,Ro),Bo=j(41,e=>{bo(e),oa(e)}),Vo=L(`o10`,e=>{Pt(e,`d`),A(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),zo(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),zo(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function Ho(e){B(e.e,ni.rows),B(e.g,ni.paletteFoot),B(e.h,ni.hint),zo(e,0),Bo(e,!1),Vo(e)}var Uo=M(42,bo),Wo=M(43,e=>{Jo(e,e.ah?.length),bo(e)}),Go=M(47,Co),Ko=N(22,e=>Go(e,e.u.find(t=>t.id===e.v))),qo=M(20,e=>{us(e,e.u?.length),Uo(e,e.u.filter(e=>e.status===`active`)),Wo(e,e.u.filter(e=>e.status===`archived`)),Ko(e)}),Jo=M(44,e=>{To(e),la(e)}),Yo=F(Da),Xo=M(21,e=>{Ko(e),vo(e),Yo(e)}),Zo=M(23,Co),Qo=M(24,Co),$o=M(25,Co),es=M(52,Ro),ts=M(56),ns=N(28,e=>ts(e,gs(e))),rs=M(26,ns),is=M(27,ns),as=O(0,`<div></div>`,` `,ga),os=O(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ia),ss=N(31,e=>os(e,e.a3&&!e.a4?0:1)),cs=L(`o11`,e=>A(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),po(e,!1)))}))),ls=M(29,e=>{B(e.b,[`palette`,{[ni.inline]:e.a3}]),as(e,+!!e.a3),ss(e),cs(e)}),us=M(30,ss),ds=M(33,F(xa)),fs=M(32,F(ja));function ps(e){return function(t){jo(e._,{...e._.aa,preferredAgent:t}),cn(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function ms(e){return t=>t.filter(t=>$r(e.a8||``,t.name))}function hs(e){return function(t){Eo(e,t),zo(e,0)}}function gs(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}R(`o1`,ps),R(`o2`,ms),R(`o0`,hs),R(`o3`,gs);var _s={iconBtn:`_t _7`,spinning:`_u _8`,actStep:`_v`,prRepo:`_w`,prRepoName:`_x`,prList:`_y`,prSpacer:`_z`,prDismiss:`_A`,prState:`_B`,prLink:`_C`,procs:`_D`,procCmd:`_E`,procKill:`_F`,portLink:`_G`},vs=`<button><!></button>`,ys=` D%l`,bs=pe(1),xs=L(`c0`,e=>St(e,`a`)),Ss=M(5,e=>{gt(e,`a`,{type:`submit`,...e.f}),xs(e)}),Cs=ri,ws=(e=>`/${e}&`)(ii);function Ts(e){si(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var Es=(e,t)=>ai(e.a,t),Ds=(e,t)=>oi(e.a,t),Os={addRepo:`_cG`,repoResults:`_cH`,resultWrap:`_cI`,hi:`_cJ`,resultRow:`_cK`,resultBranch:`_cL`,on:`_cM`,branchPick:`_cN`,branchList:`_cO`,resultPlus:`_cP`,repoName:`_cQ`,emptyNote:`_cR`},ks=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,As=` D b%b%l`,js=null,mee=e=>B(e.a,Os.emptyNote),hee=e=>B(e.a,Os.emptyNote),gee=e=>B(e.a,Os.emptyNote),_ee=L(`q7`,e=>A(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),vee=e=>{B(e.a,Os.resultRow),B(e.b,[Os.repoName,`mono`]),_ee(e)},yee=M(4,e=>V(e.c,e.e)),bee=(e,t)=>yee(e,t[0]),Ms=I(35,e=>Nt(e,`a`,e._._._._._.a0,Nc(e)),e=>e._._._._._),xee=L(`q6`,e=>Pt(e,`a`)),See=e=>{Ms(e),xee(e)},Cee=k(2,`<li><button><span> </span></button></li>`,`D D D `,vee,bee),wee=(e,t)=>{Rs(e,t?.length),Cee(e,[t,e=>e])},Ns=N(6,e=>wee(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),Ps=I(33,Ns,e=>e._._._._),Tee=e=>{Ps(e),Fs(e),Is(e),B(e.b,Os.branchList)},Eee=O(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,See),Fs=I(34,e=>Eee(e,e._._._._.z>8?0:1),e=>e._._._._),Is=I(35,Ns,e=>e._._._._),Ls=O(3,`<li><p>No branches match.</p></li>`,`D `,mee),Rs=(e,t)=>Ls(e,+!!t),zs=O(0,`<p><span class=spin></span> Loading branches…</p>`,` `,hee,`<!><!><ul><!><!></ul>`,`b%b D%b%`,Tee),Bs=I(33,e=>zs(e,+!!e._._._.y),e=>e._._._),Vs=e=>{Bs(e),B(e.a,Os.branchPick)},Hs=N(12,e=>B(e.a,[Os.resultWrap,{[Os.hi]:e.l===e._._.r}])),Us=I(30,Hs,e=>e._._),Ws=L(`q8`,e=>{A(e.a,`mouseenter`,function(){mc(e._._,e.l)}),A(e.b,`click`,function(){e._._.a1(e.j)}),A(e.f,`click`,function(){e._._.a2(e.j)})}),Gs=e=>{Us(e),Js(e),B(e.b,Os.resultRow),bi(e.c),xi(e.c,12),Si(e.c,Os.resultPlus),B(e.d,Os.repoName),Ws(e)},Ks=O(6,`<div></div>`,` `,Vs),qs=N(10,e=>{B(e.f,[Os.resultBranch,{[Os.on]:e._._.w===e.j}]),Ks(e,e._._.w===e.j?0:1)}),Js=I(32,qs,e=>e._._),Ys=M(11,Hs),Xs=M(9,e=>{V(e.e,e.j),z(e.f,`title`,`Pick a base branch for ${e.j}`),z(e.f,`aria-label`,`Pick a base branch for ${e.j}`),qs(e)}),Zs=k(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(vi),(e=>`D D D/${e}& D m l%l`)(yi),Gs,(e,t)=>{Xs(e,t[0]?.nameWithOwner),Ys(e,t[1])}),Qs=P(3,0,e=>Zs(e,[e._.t,`nameWithOwner`])),$s=e=>{Qs._(e),B(e.a,Os.repoResults)},ec=P(3,1,e=>V(e.b,e._.o)),tc=e=>{ec._(e),B(e.a,Os.emptyNote)},nc=Ue(8),rc=N(8,e=>nc(e,e.g,e.h)),ic=M(6,rc),ac=M(7,rc),oc=M(19,e=>{Dc(e,e.t?.length),Qs(e)}),sc=N(16,e=>oc(e,e.n&&e.o?Qr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),cc=O(2,`<p>Loading repos…</p>`,` `,gee),lc=N(15,e=>cc(e,e.o&&!e.n?0:1)),uc=O(3,`<ul></ul>`,` `,$s,`<p>No repos match "<!>".</p>`,` Db%`,tc),dc=N(21,e=>uc(e,e.u?0:e.o&&e.n?1:2),2),fc=j(13,e=>{sc(e),lc(e),dc(e)}),pc=j(14,e=>{Nt(e,`b`,e.o,Pc(e)),sc(e),lc(e),dc(e),ec(e)}),mc=j(17,F(Us)),hc=M(28),gc=N(23,e=>hc(e,Fc(e))),_c=F(Js),vc=j(22,e=>{gc(e),_c(e)}),yc=F(Bs,Ps),bc=j(24,e=>{kc(e,e.y?.length),yc(e)}),xc=j(26,F(Is,Ms)),Sc=L(`q9`,e=>{Pt(e,`b`),A(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),mc(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),mc(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),pc(e,``))})});function Cc(e){B(e.a,Os.addRepo),fc(e,null),pc(e,``),mc(e,0),vc(e,null),bc(e,null),xc(e,``),Sc(e)}var wc=L(`q10`,e=>Tt(e,{onMount:function(){js&&fc(e,js),e.s(!1)}})),Tc=M(18,e=>{ee(e,Ic(e)),wc(e)}),Ec=M(9,e=>{Tc(e,Lc(e)),gc(e)}),Dc=M(20,dc),Oc=M(10,sc),kc=M(25,F(Fs)),Ac=M(27),jc=M(11,e=>Ac(e,Rc(e))),Mc=(e,t)=>z(e.b,`disabled`,t);function Nc(e){return t=>{xc(e._._._._._,t)}}function Pc(e){return function(t){pc(e,t),mc(e,0)}}function Fc(e){return async t=>{if(e.w===t){vc(e,null);return}vc(e,t),bc(e,null),xc(e,``);try{let n=await cn(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&bc(e,n.branches)}catch(t){vc(e,null),e.j?.(String(t.message||t))}}}function Ic(e){return()=>e.s(!0)}function Lc(e){return async t=>{t&&nc(e,!0);try{let n=await cn(`/api/repos${t?`?refresh`:``}`);js=n,fc(e,n)}catch(t){e.j?.(String(t.message||t))}t&&nc(e,!1)}}function Rc(e){return(t,n)=>{pc(e,``),vc(e,null),e.l(t,n)}}R(`q1`,Nc),R(`q0`,Pc),R(`q5`,Fc),R(`q2`,Ic),R(`q3`,Lc),R(`q4`,Rc);var zc={manageView:`_bA`,manage:`_bB`,manageBar:`_bC`};le[4]=dee;var Bc=`<dialog><div><!></div><!></dialog>`,Vc=` D D%l%l`,Hc=pe(2),Uc=lt(`l0`,`Done`),Wc=e=>{B(e.a,zc.manageBar),e.b,bs(e.b,Uc(e)),Ss(e.b,{class:`btn primary`})},Gc=fe(1),Kc=P(3,0,e=>Gc(e,e._.p)),qc=e=>{Kc._(e),B(e.a,zc.manageBar)},Jc=M(20,e=>z(e.a,`closedby`,e.u?`any`:`none`)),Yc=(e,t)=>Jc(e,t!==!1),Xc=Ue(21,L(`l3`,e=>{{let t=e.a;e.v?t.open||t.showModal():t.open&&t.close()}})),Zc=N(9,e=>Xc(e,e.h,e.i)),Qc=M(7,Zc),$c=O(3,`<form method=dialog><!></form>`,` D%`,qc,(e=>`<form method=dialog>${e}</form>`)(vs),(e=>` D/${e}&l`)(ys),Wc),el=N(14,e=>$c(e,e.n?0:e.i?1:2)),tl=M(8,e=>{Zc(e),el(e)}),nl=(e,t)=>B(e.a,[zc.manageView,t]),rl=N(18,e=>z(e.a,`aria-label`,e.r?e.q:e.q||e.k),2),il=M(17,e=>{z(e.a,`aria-labelledby`,e.r),rl(e)}),al=M(10,rl),ol=M(16,rl),sl=L(`l2`,e=>{A(e.a,`cancel`,function(t){t.preventDefault(),e.u&&Xc(e,!1)}),A(e.a,`close`,function(){e.v&&Xc(e,!1)})});function cl(e){B(e.b,zc.manage),sl(e)}var ll=L(`l1`,e=>St(e,`a`)),ul=M(19,e=>{yt(e,`a`,{...e.t,open:null},{class:1,"aria-labelledby":1,"aria-label":1,closedby:1,"on-cancel":1,"on-close":1},Xt),ll(e)}),dl=M(13,e=>{fl(e,e.n?.content),el(e)}),fl=M(15,Kc),pl=Bc,ml=(e=>`/${e}&`)(Vc),hl=new Map,gl=L(`k24`,e=>A(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),_l=e=>{B(e.a,[`chip`,_s.portLink]),gl(e)},vl=M(3,e=>{z(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),V(e.b,e.d)}),yl=(e,t)=>vl(e,t[0]),bl=(e,t)=>V(e.a,t),xl=(e,t)=>bl(e,t[0]),Sl=P(2,0,e=>V(e.a,e._.j)),Cl=Sl,wl=e=>B(e.a,[_s.prState,`closed`]),Tl=e=>B(e.a,[_s.prState,`open`]),El=P(1,0,e=>V(e.b,e._.f)),Dl=e=>{El._(e),B(e.a,[_s.prRepoName,`mono`])},Ol=lt(`k14`,`Done`),kl=L(`k25`,e=>A(e.d,`click`,function(){e._._._.aj(e.j)})),Al=e=>{B(e.a,[`mono`,_s.procCmd]),B(e.d,_s.procKill),kl(e)},jl=(e,t)=>z(e.a,`title`,t),Ml=(e,t)=>V(e.b,t),Nl=k(2,`<button>:<!></button>`,` Db%`,_l,yl),Pl=(e,t)=>Nl(e,[t,e=>String(e)]),Fl=M(9,e=>{z(e.d,`title`,`Kill ${e.j}`),z(e.d,`aria-label`,`Kill process ${e.j}`)}),Il=(e,t)=>{jl(e,t[0]?.args),Ml(e,t[0]?.cmd),Pl(e,t[0]?.ports),Fl(e,t[0]?.pid)},Ll=P(7,0,e=>z(e.a,`title`,`Confirm #${e._.q} is done — remove from this list`)),Rl=L(`k20`,e=>A(e.a,`click`,function(){e._._._._._.ab(e._._.h,e._.q)})),zl=O(7,`<button>✓</button>`,` `,e=>{Ll._(e),B(e.a,_s.prDismiss),Rl(e)}),Bl=N(12,e=>V(e.b,e.k===`OPEN`&&e.l?`draft`:e.k.toLowerCase())),Vl=O(2,`<span title=Approved>✓</span>`,` `,Tl,`<span title="Changes requested">✗</span>`,` `,wl),Hl=N(14,e=>Vl(e,e.k===`OPEN`&&e.n===`APPROVED`?0:e.k===`OPEN`&&e.n===`CHANGES_REQUESTED`?1:2)),Ul=M(10,e=>{B(e.a,[_s.prState,e.k.toLowerCase()]),zl(e,+(e.k===`OPEN`)),Bl(e),Hl(e)}),Wl=M(11,Bl),Gl=M(13,Hl),Kl=e=>{B(e.d,_s.prLink),B(e.g,_s.prSpacer)},ql=(e,t)=>z(e.d,`href`,t),Jl=M(16,e=>{V(e.e,e.q),Ll(e)}),Yl=(e,t)=>V(e.f,t),Xl=(e,t)=>{Ul(e,t[0]?.state),Wl(e,t[0]?.isDraft),Gl(e,t[0]?.reviewDecision),ql(e,t[0]?.url),Jl(e,t[0]?.number),Yl(e,t[0]?.title)},Zl=P(0,0,e=>V(e.b,e._.e)),Ql=L(`k19`,e=>A(e.a,`click`,function(){e._._._.aa()})),$l=e=>{Zl._(e),Ql(e)},eu=I(58,e=>V(e.b,e._._.v),e=>e._._),tu=e=>{eu(e),B(e.a,_s.actStep)},nu=N(2,e=>{mt(e.a,`armed`,e._._._.u===e._.h),V(e.b,e._._._.u===e._.h?`remove?`:`×`)}),ru=N(3,e=>z(e.a,`title`,e._._._.u===e._.h?`Really remove ${e._.g}/? Uncommitted changes are lost.`:`Remove ${e._.g}/`),2),iu=I(57,e=>{nu(e),ru(e)},e=>e._._._),au=L(`k22`,e=>A(e.a,`click`,function(){e._._._.u===e._.f?.full_name?(qd(e._._._,null),e._._._.ah(e._.f)):(qd(e._._._,e._.f?.full_name),setTimeout(()=>{qd(e._._._,null)},4e3))})),ou=e=>{iu(e),su._(e),cu._(e),au(e)},su=P(3,1,ru),cu=P(3,1,e=>{nu(e),ru(e)}),lu=I(55,e=>z(e.a,`disabled`,!!e._._.s),e=>e._._),uu=L(`k16`,e=>A(e.a,`click`,function(){e._._.ai(`restore`)})),du=e=>{lu(e),uu(e)},fu=I(55,e=>{z(e.a,`disabled`,!!e._._.s),V(e.b,e._._.s===`archive`?`Archiving…`:`Archive`)},e=>e._._),pu=L(`k15`,e=>A(e.a,`click`,function(){e._._.ai(`archive`)})),mu=e=>{fu(e),pu(e)},hu=O(1,`<span><span class=spin></span> </span>`,` Db `,tu),gu=N(6,e=>hu(e,e._.s&&e._.v?0:1)),_u=N(5,e=>V(e.e,e._.s===`delete`?`Deleting…`:e._.t?`Really delete?`:`Delete`)),vu=I(55,e=>{Ss(e.a,{disabled:!!e._.s,class:`btn primary`}),z(e.d,`disabled`,!!e._.s),gu(e),_u(e)}),yu=L(`k17`,e=>A(e.d,`click`,function(){e._.t?(Kd(e._,!1),e._.ai(`delete`)):(Kd(e._,!0),setTimeout(()=>{Kd(e._,!1)},4e3))})),bu=e=>{vu(e),xu(e),Su(e),wu(e),e.a,bs(e.a,Ol(e)),yu(e)},xu=I(56,e=>{mt(e.d,`armed`,e._.t),_u(e)}),Su=I(58,gu),Cu=O(2,`<button type=button class=btn> </button>`,` D `,mu,`<button type=button class=btn>Restore</button>`,` `,du),wu=I(61,e=>Cu(e,e._.a1===`active`?0:1)),Tu=ut(`k27`,(e=>`${e}<!><div class=spacer></div><!><button type=button class="btn danger"> </button>`)(vs),(e=>`/${e}&%c%b D l`)(ys),bu),Eu=I(54,e=>V(e.a,e._._._.r),e=>e._._._),Du=ut(`k18`,` `,` `,Eu),Ou=e=>{Vr(e.a),Gr(e.a,Du(e)),Lr(e.a,`inline`),Yr(e.a,Mf(e)),Jr(e.a),Rr(e.a),Nr(e.a),Ur(e.a),Br(e.a,{})},ku=O(3,`<span class=spin></span>`,0,0,`<button class=cur-remove> </button>`,` D `,ou),Au=N(8,e=>ku(e,+!e._._.p.has(e.h))),ju=I(52,Au,e=>e._._),Mu=ju,Nu=M(6,e=>{V(e.a,e.g),su(e)}),Pu=M(7,e=>{V(e.b,e.h),Au(e),cu(e)}),Fu=O(2,`<span class="cur-base mono" title="Base branch">⎇ <!></span>`,`Db%`,Cl),Iu=N(11,e=>Fu(e,+(e.j===e.k))),Lu=M(9,e=>{Iu(e),Sl(e)}),Ru=M(10,Iu),zu=(e,t)=>Bu(e,t[0]),Bu=M(5,e=>{Nu(e,e.f?.worktree),Pu(e,e.f?.full_name),Lu(e,e.f?.base_branch),Ru(e,e.f?.default_branch)}),Vu=O(1,`<div> </div>`,` D `,Dl),Hu=I(50,e=>Vu(e,e._._._.n>1?0:1),e=>e._._._),Uu=e=>{Hu(e),B(e.a,_s.prRepo),B(e.c,_s.prList)},Wu=k(2,`<li><span> </span><!><a target=_blank rel=noopener><span class="dim mono">#<!></span> </a><span></span><!></li>`,`D D l%b Eb%l l b%`,Kl,Xl),Gu=(e,t)=>Wu(e,[t,`number`]),Ku=(e,t)=>{qu(e,t[0]?.worktree),Gu(e,t[0]?.prs),Ju(e,t[0]?.full_name)},qu=M(5,El),Ju=M(7),Yu=O(0,`<button class=btn title="Confirm every merged/closed PR is done — remove them from this list">Clear <!> finished</button>`,` Db%`,$l),Xu=M(4,e=>{Yu(e,+!e.e),Zl(e)}),Zu=k(3,`<div><!><ul></ul></div>`,` D%b `,Uu,Ku),Qu=I(49,e=>{Xu(e,(e._._.m||[]).reduce((e,t)=>e+t.prs.filter(e=>e.state!==`OPEN`).length,0)),Zu(e,[e._._.m.filter(e=>e.prs.length),`full_name`])},e=>e._._),$u=L(`k21`,e=>A(e.b,`click`,function(){e._._.a9()})),ed=e=>{Qu(e),td(e),Ts(e.c),Es(e.c,13),Ds(e.c),$u(e)},td=I(51,e=>{B(e.b,[_s.iconBtn,{[_s.spinning]:e._._.o}]),z(e.b,`disabled`,e._._.o)},e=>e._._),nd=k(0,`<li><span><!><!></span><button type=button>×</button></li>`,`D D%b%l `,Al,Il),rd=I(48,e=>nd(e,[e._._.l,`pid`]),e=>e._._),id=e=>{rd(e),B(e.a,_s.procs)},ad=Qe(13),od=I(47,e=>{B(e.f,[_s.iconBtn,{[_s.spinning]:e._.k}]),z(e.f,`disabled`,e._.k)}),sd=L(`k26`,e=>A(e.f,`click`,function(){ad(e)()})),cd=e=>{od(e),ud(e),fd(e),hd(e),vd(e),bd(e),Sd(e),Cd(e),Td(e),Ed(e),Dd(e),Od(e),kd(e),Ad(e),Ts(e.g),Es(e.g,13),Ds(e.g),Ye(e,10,jd),Cc(e.k),Ec(e.k,Pf(e)),ac(e.k,Nf(e)),ic(e.k),Mc(e.k),sd(e)},ld=O(12,`<section><h3>Processes</h3><ul></ul></section>`,`Db `,id),ud=I(48,e=>ld(e,e._.l&&e._.l?.length?0:1)),dd=O(4,(e=>`<section><div class=repos-head><h3>Pull requests</h3><!><button title="Refresh PRs" aria-label="Refresh PRs">${e}</button></div><!></section>`)(Cs),(e=>`Eb%b D/${e}&m%l`)(ws),ed),fd=I(49,e=>dd(e,e._.m&&e._.m.some(e=>e.prs.length)?0:1)),pd=k(8,`<li class="cur-repo pending"><span class=spin></span><span class="dim cur-full"> </span></li>`,`DbD `,0,xl),md=N(14,e=>pd(e,[[...e._.p].filter(t=>!e._.ac.has(t)),e=>e])),hd=I(52,md),gd=O(9,`<li class=empty-note>No repos yet — search below to add one.</li>`),_d=N(15,e=>gd(e,!e._.a4&&!e._.q?0:1)),vd=I(53,_d),yd=O(3,mr,(e=>`/${e}&`)(hr),Ou),bd=I(54,e=>yd(e,+!e._.r)),xd=k(7,`<li class=cur-repo><span class="mono cur-worktree"><!>/</span><span class="dim cur-full"> </span><!><!></li>`,`E%lD l%b%`,Mu,zu),Sd=I(59,e=>xd(e,[e._.z,`full_name`])),Cd=I(60,e=>V(e.b,e._.a0)),wd=N(16,e=>V(e.c,e._.a2||e._.a3)),Td=I(62,wd),Ed=I(63,wd),Dd=I(64,_d),Od=I(65,e=>{Oc(e.k,e._.ac),md(e)}),kd=I(66,e=>jc(e.k,Ff(e))),Ad=I(67,e=>z(e.a,`id`,e._.ak)),jd=rt(`k23`,M(13)),Md=lt(`k28`,((e,t)=>`<header class=manage-head><div><h2> </h2><p class="dim mono"> </p></div></header><!><!><section><div class=repos-head><h3>Repos</h3><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul class=cur-repos><!><!><!></ul>${t}</section><!><!>`)(Cs,ks),((e,t)=>`E D lD n%b%bEb D/${e}&mD%b%b%l0${t}&l%c`)(ws,As),cd,0,`B1`),Nd=j(10,F(od)),Pd=j(14,F(td)),Fd=M(42,F(kd)),Id=N(41,e=>Fd(e,If(e)),2),Ld=M(43),Rd=N(40,e=>Ld(e,Lf(e)),2),zd=M(39,e=>{Id(e),Rd(e)}),Bd=F(hd,ju),Vd=j(15,e=>{of(e,e.p?.size),zd(e,Rf(e)),Id(e),Rd(e),Bd(e)}),Hd=j(17,F(bd,Eu)),Ud=N(34,L(`k29`,e=>Tt(e,{busyCount:e.q,pendingAction:e.s,onMount:function(){let t=new AbortController,n=t.signal;return jn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.y&&Jd(e,t.data.message)},{signal:n}),e.a5(n),e.a6(n,!1).then(()=>e.a6(n,!0)),{abort:t}},onDestroy:function(){this.abort.abort()}})),4),Wd=F(vu,fu,lu),Gd=j(18,e=>{Yc(e.a,!e.s),Ud(e),Wd(e)}),Kd=j(19,F(xu)),qd=j(20,F(iu)),Jd=j(21,F(Su,eu)),Yd=M(46,e=>il(e.a,e.ak));function Xd(e){cl(e.a),dl(e.a,an({content:Tu(e)})),Hc(e.a,Md(e)),ol(e.a),nl(e.a),ul(e.a,{}),Nd(e,!1),Pd(e,!1),Vd(e,new Set),Hd(e,null),Gd(e,null),Kd(e,!1),qd(e,null),Jd(e,null),Yd(e,Xe(e))}var Zd=j(11,F(ud,rd)),Qd=M(36),$d=N(33,e=>Qd(e,zf(e)),2),ef=F(fd,Qu),tf=j(12,e=>{rf(e,e.m?.length),$d(e),ef(e)}),nf=(e,t)=>{Zd(e,hl.get(`procs:${t}`)||null),tf(e,hl.get(`prs:${t}`)||null)},rf=M(13,F(Hu)),af=F(vd),of=M(16,e=>{Ud(e),af(e)}),sf=Ue(20),cf=N(7,e=>sf(e,e.f,e.g)),lf=M(5,e=>{Qc(e.a,e.f),cf(e)}),uf=M(6,e=>{tl(e.a,e.g),cf(e)}),df=Ue(22,e=>{ff(e,e.w),Rd(e)}),ff=e=>{yf(e,e.w?.id),Sf(e,e.w?.repos),Tf(e,e.w?.name),Ef(e,e.w?.status),Df(e,e.w?.display_path),Of(e,e.w?.path)},pf=M(45),mf=M(31,e=>{pf(e,Bf(e)),Ud(e)}),hf=M(35),gf=M(32,e=>{hf(e,Hf(e)),Ud(e),$d(e)}),_f=M(37),vf=M(44),yf=M(24,e=>{mf(e,Vf(e)),gf(e,Uf(e)),_f(e,Wf(e)),vf(e,Gf(e)),Ud(e),$d(e),Id(e)}),bf=M(38,F(Od)),xf=F(Sd),Sf=M(25,e=>{Cf(e,e.z?.length),bf(e,new Set(e.z.map(e=>e.full_name))),xf(e)}),Cf=M(30,F(Dd)),wf=F(Cd),Tf=M(26,e=>{al(e.a,`Manage ${e.a0}`),wf(e)}),Ef=M(27,F(wu)),Df=M(28,F(Td)),Of=M(29,F(Ed)),kf=N(9,e=>df(e,e.d,e.i)),Af=M(3,e=>{nf(e,e.d?.id),kf(e)}),jf=M(8,kf);function Mf(e){return function(){Hd(e._._,null)}}function Nf(e){return function(t){Nd(e._,t)}}function Pf(e){return function(t){Hd(e._,t)}}function Ff(e){return function(t,n){e._.ag(t,n)}}function If(e){return async(t,n)=>{if(!(!t||e.p.has(t))){Hd(e,null),e.ad(t,!0);try{df(e,await cn(`/api/workspaces/${e.y}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){Hd(e,String(t.message||t))}e.ad(t,!1)}}}function Lf(e){return async t=>{if(!e.p.has(t.full_name)){Hd(e,null),e.ad(t.full_name,!0);try{await cn(`/api/workspaces/${e.w?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),df(e,{...e.w,repos:(e.w?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){Hd(e,String(t.message||t))}e.ad(t.full_name,!1)}}}function Rf(e){return(t,n)=>{let r=new Set(e.p);n?r.add(t):r.delete(t),Vd(e,r)}}function zf(e){return async()=>{for(let t of e.m||[])for(let n of t.prs)n.state!==`OPEN`&&await cn(`/api/workspaces/${e.y}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t.full_name,number:n.number})}).catch(()=>{});await e.a6(void 0,!1)}}function Bf(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.a5(void 0),500)}}function Vf(e){return async t=>{try{let n=await cn(`/api/workspaces/${e.y}/procs`,{signal:t});Zd(e,n),hl.set(`procs:${e.y}`,n)}catch{}}}function Hf(e){return async()=>{Pd(e,!0),await e.a6(void 0,!0),Pd(e,!1)}}function Uf(e){return async(t,n)=>{try{let r=await cn(`/api/workspaces/${e.y}/prs${n?`?refresh`:``}`,{signal:t});tf(e,r),hl.set(`prs:${e.y}`,r)}catch{}}}function Wf(e){return async(t,n)=>{Hd(e,null);try{let r=await cn(`/api/workspaces/${e.y}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})});tf(e,r),hl.set(`prs:${e.y}`,r)}catch(t){Hd(e,String(t.message||t))}}}function Gf(e){return async t=>{Hd(e,null),Gd(e,t),Jd(e,null);try{await cn(`/api/workspaces/${e.y}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`delete`&&sf(e,!1)}catch(t){Hd(e,String(t.message||t))}finally{Gd(e,null),Jd(e,null)}}}R(`k10`,Mf),R(`k13`,Nf),R(`k12`,Pf),R(`k11`,Ff),R(`k6`,If),R(`k7`,Lf),R(`k5`,Rf),R(`k3`,zf),R(`k9`,Bf),R(`k0`,Vf),R(`k2`,Hf),R(`k1`,Uf),R(`k4`,Wf),R(`k8`,Gf);var Kf={iconBtn:`_0 _7`,spinning:`_1 _8`,newWs:`_2`,field:`_3`,steps:`_4`,active:`_5`,stepDone:`_6`},qf=Bc,Jf=(e=>`/${e}&`)(Vc),Yf=e=>B(e.a,Kf.stepDone),Xf=P(1,0,e=>V(e.a,e._.g)),Zf=Xf,Qf=lt(`m9`,`Cancel`),$f=O(1,`<span class=spin></span>`,0,0,`<span>✓</span>`,` `,Yf),ep=I(32,e=>{B(e.a,{[Kf.active]:e.M===e._._._.n-1}),$f(e,e.M===e._._._.n-1?0:1)},e=>e._._._),tp=ep,np=(e,t)=>V(e.c,t),rp=k(0,`<li><!><!></li>`,` D%b%`,tp,(e,t)=>np(e,t[0])),ip=I(31,e=>rp(e,[e._._.m]),e=>e._._),ap=e=>{ip(e),B(e.a,Kf.steps)},op=I(30,e=>V(e.a,e._._._.l),e=>e._._._),sp=ut(`m11`,` `,` `,op),cp=e=>{Vr(e.a),Gr(e.a,sp(e)),Lr(e.a,`inline`),Yr(e.a,mm(e)),Jr(e.a),Rr(e.a),Nr(e.a),Ur(e.a),Br(e.a,{})},lp=I(29,e=>z(e.c,`disabled`,e._._.k),e=>e._._),up=L(`m12`,e=>A(e.c,`click`,function(){e._._.w(e.f)})),dp=e=>{lp(e),up(e)},fp=M(5,e=>{V(e.a,e.f),z(e.c,`title`,`Remove ${e.f}`)}),pp=O(1,`<span class="cur-base mono" title="Base branch">⎇ <!></span>`,`Db%`,Zf),mp=M(6,e=>{pp(e,+!e.g),Xf(e)}),hp=(e,t)=>{fp(e,t[0]?.fullName),mp(e,t[0]?.baseBranch)},gp=Qe(11),_p=I(25,e=>Nt(e,`d`,e._.g,hm(e))),vp=L(`m14`,e=>{Pt(e,`d`),A(e.e,`click`,function(){gp(e)()})}),yp=e=>{_p(e),bp(e),Sp(e),wp(e),Dp(e),kp(e),Ap(e),jp(e),Mp(e),B(e.c,Kf.field),Ts(e.f),Es(e.f,13),Ds(e.f),Ye(e,8,Np),Cc(e.i),Ec(e.i,_m(e)),ac(e.i,gm(e)),ic(e.i),vp(e)},bp=I(26,e=>{B(e.e,[Kf.iconBtn,{[Kf.spinning]:e._.h}]),z(e.e,`disabled`,e._.h)}),xp=k(6,`<li class=cur-repo><span class=cur-full> </span><!><button class=cur-remove>×</button></li>`,`E l%b `,dp,hp),Sp=I(27,e=>{Oc(e.i,new Set(e._.i.map(e=>e.fullName))),xp(e,[e._.i,`fullName`])}),Cp=O(7,`<li class=empty-note>No repos yet — search below to add one (or create empty).</li>`),wp=I(28,e=>Cp(e,+!!e._.j)),Tp=O(10,`<ul></ul>`,` `,ap),Ep=N(12,e=>Tp(e,e._.k&&e._.n?0:1)),Dp=I(29,e=>{z(e.d,`disabled`,e._.k),Mc(e.i,e._.k),Ep(e)}),Op=O(1,mr,(e=>`/${e}&`)(hr),cp),kp=I(30,e=>Op(e,+!e._.l)),Ap=I(32,Ep),jp=I(33,e=>jc(e.i,vm(e))),Mp=I(34,e=>z(e.a,`id`,e._.y)),Np=rt(`m13`,M(11)),Pp=lt(`m16`,((e,t)=>`<header class=manage-head><div><h2>New workspace</h2></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div class=repos-head><h3>Repos</h3><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul class=cur-repos><!><!></ul>${t}</section><!><!>`)(Cs,ks),((e,t)=>`E m%b Db lEb D/${e}&mD%b%l0${t}&l%c`)(ws,As),yp,0,`B2`),Fp=N(3,e=>z(e.a,`disabled`,e._.k||!e._.g.trim())),Ip=I(25,Fp),Lp=L(`m10`,e=>A(e.a,`click`,function(){e._.x()})),Rp=e=>{Ip(e),zp(e),e.c,bs(e.c,Qf(e)),Lp(e)},zp=I(29,e=>{V(e.b,e._.k?`Creating…`:`Create workspace`),Ss(e.c,{disabled:e._.k,class:`btn`}),Fp(e)}),Bp=ut(`m15`,(e=>`<button type=button class="btn primary"> </button><div class=spacer></div>${e}`)(vs),(e=>` D lb/${e}&`)(ys),Rp),Vp=M(23),Hp=N(20,e=>Vp(e,ym(e)),5),Up=F(Ip,_p),Wp=j(6,e=>{Hp(e),Up(e)}),Gp=j(7,F(bp)),Kp=M(21,F(jp)),qp=M(22),Jp=F(Sp),Yp=j(8,e=>{sm(e,e.i?.length),Kp(e,bm(e)),qp(e,xm(e)),Hp(e),Jp(e)}),Xp=N(19,L(`m17`,e=>Tt(e,{busy:e.k,onMount:function(){let t=new AbortController;return jn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.s([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),Zp=F(zp,Dp,lp),Qp=j(10,e=>{Yc(e.a,!e.k),Xp(e),Zp(e)}),$p=j(11,F(kp,op)),em=M(18,e=>{Xp(e),Hp(e)}),tm=N(17,e=>em(e,Sm(e)),2),nm=F(ip),rm=j(12,e=>{cm(e,e.m?.length),tm(e),nm(e)}),im=(e,t)=>{lm(e,t.op),um(e,t.last)},am=M(24,e=>il(e.a,e.y));function om(e){cl(e.a),dl(e.a,an({content:Bp(e)})),Hc(e.a,Pp(e)),al(e.a,`New workspace`),nl(e.a,Kf.newWs),ol(e.a),ul(e.a,{}),Wp(e,``),Gp(e,!1),Yp(e,[]),Qp(e,!1),$p(e,null),rm(e,[]),im(e,{last:0,op:``}),am(e,Xe(e))}var sm=M(9,F(wp)),cm=M(13,F(Ap,ep)),lm=M(15,e=>{tm(e),Hp(e)}),um=M(16,e=>{tm(e),Hp(e)}),dm=M(3,Hp),fm=(e,t)=>Qc(e.a,t),pm=(e,t)=>tl(e.a,t);function mm(e){return function(){$p(e._._,null)}}function hm(e){return t=>{Wp(e._,t)}}function gm(e){return function(t){Gp(e._,t)}}function _m(e){return function(t){$p(e._,t)}}function vm(e){return function(t,n){e._.v(t,n)}}function ym(e){return async()=>{Qp(e,!0),$p(e,null),rm(e,[]),e.p=Math.random().toString(36).slice(2,10);try{e.q=(await cn(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await cn(`/api/progress?since=${e.q}&op=${e.p}`);e.s(t.messages)}catch{}},800);try{let t=await cn(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.g,repos:e.i,opId:e.p})});Qp(e,!1),e.d?.(t)}catch(t){Qp(e,!1),$p(e,String(t.message||t))}finally{clearInterval(t)}}}function bm(e){return(t,n)=>{!t||e.i.some(e=>e.fullName===t)||Yp(e,e.i.concat({fullName:t,baseBranch:n}))}}function xm(e){return t=>{Yp(e,e.i.filter(e=>e.fullName!==t))}}function Sm(e){return t=>{for(let n of t)n.op===e.p&&(n.seq&&n.seq<=e.q||(n.seq&&(e.q=n.seq),rm(e,e.m.concat(n.message))))}}R(`m5`,mm),R(`m0`,hm),R(`m8`,gm),R(`m7`,_m),R(`m6`,vm),R(`m4`,ym),R(`m2`,bm),R(`m3`,xm),R(`m1`,Sm);var Cm={workView:`_n`,mainCol:`_o`,termArea:`_p`,asBar:`_q`,padInline:`_r`,emptySess:`_s`},wm={iconBtn:`_ct _7`,spinning:`_cu _8`,navToggle:`_cv _7`,notifyBtn:`_cw _7`,sideNav:`_cx`,open:`_cy`,sideList:`_cz`,sideRail:`_cA`,sideFoot:`_cB`,on:`_cC`,drawerBackdrop:`_cD`,closed:`_cE`,railPop:`_cF`},Tm={railBtn:`_dk _7`},Em=ri,Dm=(e=>`/${e}&`)(ii);function Om(e){si(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var km=(e,t)=>ai(e.a,t),Am=(e,t)=>oi(e.a,t),jm={sideChips:`_dl`,chip:`_dm`,pr:`_dn`,rejected:`_do`,portChip:`_dp`,portOpen:`_dq`,portKill:`_dr`,armed:`_ds`},Dee=`<!><!><!>`,Mm=N(9,e=>B(e.d,[jm.portKill,{[jm.armed]:e._._.h===e.i}])),Nm=N(10,e=>z(e.d,`title`,e._._.h===e.i?`Really kill ${e.g}?`:`Kill ${e.g} (pid ${e.i})`),2),Pm=I(15,e=>{Mm(e),Nm(e)},e=>e._._),Oee=L(`r3`,e=>{A(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.h}`,`_blank`,`noopener`)}),A(e.d,`click`,function(){e._._.h===e.i?(Um(e._._,null),fetch(`/api/procs/${e.i}`,{method:`DELETE`}).catch(()=>{})):e._._.k(e.i)})}),kee=e=>{Pm(e),B(e.a,[`chip`,jm.portChip]),B(e.b,jm.portOpen),Oee(e)},Aee=M(6,e=>{z(e.a,`title`,e.g),Nm(e)}),jee=M(7,e=>{z(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.h}`),V(e.c,e.h)}),Mee=M(8,e=>{Mm(e),Nm(e)}),Nee=(e,t)=>{Aee(e,t[0]?.cmd),jee(e,t[0]?.port),Mee(e,t[0]?.pid)},Fm=N(12,e=>V(e.b,e._._.d(e._.c))),Im=I(4,Fm,e=>e._._),Pee=L(`r2`,e=>A(e.a,`click`,function(){e._._._.g?.(e._.e,e.l)})),Fee=e=>{Im(e),Lm._(e),zm._(e),Pee(e)},Lm=We(0,Fm),Rm=N(10,e=>z(e.a,`title`,`${e._.e} — ${e.j}${e.h===`APPROVED`?` (approved)`:e.h===`CHANGES_REQUESTED`?` (changes requested)`:``}`),2),zm=We(0,Rm),Bm=N(8,e=>pt(e.a,{draft:e.g,rejected:e.h===`CHANGES_REQUESTED`})),Iee=M(6,Bm),Lee=M(7,e=>{V(e.d,e.h===`APPROVED`?` ✓`:e.h===`CHANGES_REQUESTED`?` ✗`:``),Bm(e),Rm(e)}),Ree=M(9,Rm),zee=M(11,e=>V(e.c,e.l)),Bee=k(0,`<button type=button class="chip pr"><!>#<!><!></button>`,` D%c%b%`,Fee,(e,t)=>{Iee(e,t[0]?.isDraft),Lee(e,t[0]?.reviewDecision),Ree(e,t[0]?.title),zee(e,t[0]?.number)}),Vee=(e,t)=>Bee(e,[t||[],`number`]),Hee=(e,t)=>Uee(e,t[0]),Uee=M(2,e=>{Vee(e,e.c?.prs),Wee(e,e.c?.worktree),Lm(e)}),Wee=M(4,zm),Gee=M(3,F(Im)),Kee=k(1,`<!><!><!>`,`b%`,0,Hee),Vm=P(0,0,e=>{Gee(e,Gm(e)),Kee(e,[e._.l,`full_name`])}),qee=e=>{Vm._(e),Hm._(e),B(e.a,jm.sideChips)},Jee=k(2,`<span><button type=button>:<!></button><button type=button>×</button></span>`,` D Db%l `,kee,Nee),Hm=P(0,0,e=>Jee(e,[e._.m,`port`])),Um=j(7,F(Pm)),Yee=(e,t)=>Qee(e,t.timer);function Xee(e){Um(e,null),Yee(e,{timer:0})}var Zee=M(10),Qee=M(9,e=>Zee(e,Km(e))),$ee=O(0,`<div><!><!></div>`,` D%b%`,qee),Wm=N(14,e=>$ee(e,e.l.some(e=>(e.prs||[]).length)||e.n?0:1)),ete=M(11,e=>{Wm(e),Vm(e)}),tte=(e,t)=>ete(e,t||[]),nte=M(12,e=>{rte(e,e.m.length),Hm(e)}),rte=M(13,Wm),ite=(e,t)=>nte(e,t||[]),ate=(e,t)=>{tte(e,t?.repos),ite(e,t?.ports)},ote=M(6);function Gm(e){return t=>{if(e._.l.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.l.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function Km(e){return t=>{clearTimeout(e.j),Um(e,t),e.j=setTimeout(()=>{Um(e,null)},3500)}}R(`r1`,Gm),R(`r0`,Km);var qm=`<!><!><!>`,Jm=N(11,e=>mt(e.a,`current`,e.k===e._._._.q)),Ym=I(36,Jm,e=>e._._._),ste=L(`s5`,e=>{A(e.b,`click`,function(){e._._._.r?.(e.k)}),A(e.f,`click`,function(){e._._._.s?.(e.j)}),A(e.h,`click`,function(){e._._._.v===e.k?(Sh(e._._._,null),e._._._.t?.(e.k)):e._._._.y(e.k)})}),cte=e=>{Ym(e),Zm(e),e.d,Ni(e.d,13),Li(e.d,`sess-icon`),Om(e.g),km(e.g,12),Am(e.g),ste(e)},Xm=N(12,e=>{mt(e.h,`armed`,e._._._.v===e.k),z(e.h,`title`,e._._._.v===e.k?`Really kill this session?`:`Kill session`)}),Zm=I(38,Xm,e=>e._._._),lte=M(10,e=>{Jm(e),Xm(e)}),ute=(e,t)=>B(e.c,[`dot`,ti(t)]),Qm=N(16,e=>V(e.e,e.p||e.o)),dte=M(14,e=>{Ii(e.d,e.o),Qm(e)}),fte=M(15,Qm),pte=(e,t)=>mte(e,t[0]),mte=M(9,e=>{lte(e,e.j?.id),ute(e,e.j?.state),dte(e,e.j?.agent),fte(e,e.j?.title)}),hte=L(`s3`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._.n?.(e.e)})),gte=e=>{e.b,Ni(e.b,14),Li(e.b),hte(e)},_te=M(4,e=>{Ii(e.b,e.e),V(e.c,e.e)}),vte=k(2,(e=>`<button>${e}<!></button>`)(Ci),(e=>` D/${e}&%l`)(`b%c`),gte,(e,t)=>_te(e,t[0])),$m=I(34,e=>vte(e,[[...e._._._.o||[],`shell`],e=>e]),e=>e._._._),yte=(e,t)=>{z(e.a,`popovertarget`,t),z(e.c,`id`,t)},bte=L(`s4`,e=>A(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),xte=e=>{$m(e),e.b,Ii(e.b,`shell`),Ni(e.b,12),Li(e.b),yte(e,Xe(e)),bte(e)},Ste=L(`s2`,e=>A(e.a,`click`,function(){e._._._.l?.()})),Cte=e=>{ui(e.b),di(e.b,12),fi(e.b),Ste(e)},eh=I(30,e=>mt(e.a,`current`,e._._.i),e=>e._._),wte=L(`s6`,e=>{A(e.b,`click`,function(){e._._.j()}),A(e.f,`click`,function(){e._._.m?.()})}),Tte=e=>{eh(e),th(e),nh(e),rh(e),ih(e),ah(e),oh._(e),sh._(e),hi(e.g),gi(e.g,12),_i(e.g),Xee(e.j),wte(e)},Ete=O(4,(e=>`<button class="row-icon new-sess" title="Review changes">${e}</button>`)(ci),(e=>` D/${e}&l`)(li),Cte),th=I(32,e=>Ete(e,+!e._._.l),e=>e._._),Dte=O(7,(e=>`<button class="row-icon new-sess" title="New session">${e}</button><div popover=auto class=new-session-pop></div>`)(Ci),(e=>` D/${e}&l b`)(`b%c`),xte),nh=I(33,e=>Dte(e,+!e._._.n),e=>e._._),Ote=k(8,((e,t)=>`<div class=side-sess><button class=side-sess-btn><span></span>${e}<!></button><button class=row-icon title="Rename session">${t}</button><button class=close>×</button></div>`)(Ci,Em),((e,t)=>` D D b/${e}&%l D/${t}&l l`)(`b%c`,Dm),cte,pte),kte=(e,t)=>Ote(e,[t.length>1?t:[],`id`]),rh=I(35,e=>kte(e,e._._.p||[]),e=>e._._),ih=I(37,e=>ote(e.j,e._._.u),e=>e._._),ah=I(39,e=>V(e.d,e._._.a0),e=>e._._),oh=P(0,1,e=>ate(e.j,e._.b)),sh=P(0,1,e=>B(e.c,[`dot`,e._.c])),ch=I(30,e=>B(e.a,[Tm.railBtn,`rail-btn`,{current:e._._.i}]),e=>e._._),lh=L(`s1`,e=>A(e.a,`click`,function(){e._._.j()})),uh=e=>{ch(e),dh(e),fh(e),ph._(e),lh(e)},dh=I(31,e=>V(e.b,(e._._.k??0)+1),e=>e._._),fh=I(39,e=>z(e.a,`title`,e._._.a0),e=>e._._),ph=P(0,0,e=>B(e.c,[`dot`,e._.c])),mh=M(2,e=>{ph(e),sh(e)}),hh=M(1,e=>{mh(e,ei(e.b)),oh(e)}),gh=N(3,e=>hh(e,e._.g[e._.e])),_h=P(0,0,gh),vh=e=>{_h._(e),yh._(e),xh._(e)},yh=P(0,0,gh),bh=O(0,`<button> <span></span></button>`,` D b `,uh,((e,t)=>`<section class=side-ws><div class=side-ws-row><button class=side-ws-btn><span></span><span class=side-ws-name> </span></button><!><button class=row-icon title="Manage workspace">${e}</button><!></div><div class=side-sessions><!>${t}</div></section>`)(pi,Dee),((e,t)=>` E D bD m%b D/${e}&l%lD%b/${t}&m`)(mi,`b%c`),Tte),xh=P(0,0,e=>bh(e,+!e._.h)),Sh=j(21,F(Zm)),Ch=(e,t)=>Eh(e,t.timer);function wh(e){Sh(e,null),Ch(e,{timer:0})}var Th=M(24),Eh=M(23,e=>Th(e,Jh(e))),Dh=O(0,`<!><!><!>`,`b%`,vh),Oh=(e,t)=>{kh(e,t?.name),Dh(e,+!t)},kh=M(26,F(fh,ah)),Ah=N(5,e=>Oh(e,e.d.find(t=>t.id===e.e))),jh=M(3,Ah),Mh=M(4,e=>{Ah(e),_h(e)}),Nh=M(6,yh),Ph=M(7,xh),Fh=M(8,F(ch,eh)),Ih=M(9),Lh=M(10,F(dh)),Rh=M(11,F(th)),zh=M(12),Bh=M(13,F(nh)),Vh=M(14,F($m)),Hh=M(15,F(rh)),Uh=M(16,F(Ym)),Wh=M(17),Gh=M(18),Kh=M(19),qh=M(20,F(ih));function Jh(e){return t=>{clearTimeout(e.x),Sh(e,t),e.x=setTimeout(()=>{Sh(e,null)},3500)}}R(`s0`,Jh);var Yh=ri,Xh=(e=>`/${e}&`)(ii);function Zh(e){si(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Qh=(e,t)=>ai(e.a,t),$h=(e,t)=>oi(e.a,t),eg=ri,tg=(e=>`/${e}&`)(ii);function ng(e){si(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var rg=(e,t)=>ai(e.a,t),ig=(e,t)=>oi(e.a,t),ag=ri,og=(e=>`/${e}&`)(ii);function sg(e){si(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var cg=(e,t)=>ai(e.a,t),lg=(e,t)=>oi(e.a,t),ug=ri,dg=(e=>`/${e}&`)(ii);function fg(e){si(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var pg=(e,t)=>ai(e.a,t),mg=(e,t)=>oi(e.a,t),hg=ri,gg=(e=>`/${e}&`)(ii);function _g(e){si(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var vg=(e,t)=>ai(e.a,t),yg=(e,t)=>oi(e.a,t),bg=((e,t)=>`<!><!><aside><div></div><!><div><button></button><div class=spacer></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button></div></aside>`)(ug,hg),xg=((e,t)=>`b%b D b%b D c%b D/${e}&l D/${t}&n`)(dg,gg),Sg=e=>{ng(e.a),rg(e.a,15),ig(e.a)},Cg=e=>{Zh(e.a),Qh(e.a,15),$h(e.a)},wg=P(6,0,e=>{B(e.a,[wm.notifyBtn,{[wm.on]:e._.ao}]),z(e.a,`title`,e._.ao?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)}),Tg=L(`t19`,e=>A(e.a,`click`,function(){e._.aq()})),Eg=e=>{wg._(e),sg(e.b),cg(e.b,15),lg(e.b),Tg(e)},Dg=L(`t16`,e=>A(e.a,`click`,function(){sv(e._,!1)})),Og=e=>{B(e.a,wm.drawerBackdrop),Dg(e)},kg=N(7,e=>Rh(e.b,Wv(e)),4),Ag=I(57,kg,e=>e._._),jg=L(`t18`,e=>{A(e.a,`mouseenter`,function(){e._.i()}),A(e.a,`mouseleave`,function(){e._.j()})}),Mg=e=>{Ag(e),Ng(e),Fg(e),Ig(e),Rg(e),zg(e),Bg(e),Ug(e),Wg(e),Gg(e),Kg(e),qg(e),Yg._(e),Zg._(e),Qg._(e),B(e.a,wm.railPop),wh(e.b),zh(e.b,Gv(e)),Ph(e.b),Lh(e.b),jg(e)},Ng=I(58,e=>Vh(e.b,e._._.a3),e=>e._._),Pg=N(3,e=>Bh(e.b,Kv(e))),Fg=I(59,Pg,e=>e._._),Ig=I(60,kg,e=>e._._),Lg=N(5,e=>Hh(e.b,e.c===e._._.ae&&e._._.a6?e._._.a6:e._._.at[e.c]?.sessions||[]),3),Rg=I(61,Lg,e=>e._._),zg=I(62,e=>Gh(e.b,e._._.a8),e=>e._._),Bg=I(63,e=>Kh(e.b,e._._.a9),e=>e._._),Vg=N(4,e=>Fh(e.b,e.c===e._._.ae)),Hg=N(6,e=>Uh(e.b,e.c===e._._.ae&&e._._.ai===`term`?e._._.ag:null),3),Ug=I(64,e=>{Ih(e.b,Yv(e)),qh(e.b,Jv(e)),Wh(e.b,qv(e)),Vg(e),kg(e),Lg(e),Hg(e)},e=>e._._),Wg=I(65,Hg,e=>e._._),Gg=I(66,e=>{kg(e),Hg(e)},e=>e._._),Kg=I(69,e=>jh(e.b,e._._.as),e=>e._._),qg=I(70,e=>{Nh(e.b,e._._.at),Lg(e)},e=>e._._),Jg=M(2,e=>{Mh(e.b,e.c),Vg(e),Pg(e),kg(e),Lg(e),Hg(e)}),Yg=P(1,0,e=>Jg(e,e._.d)),Xg=N(8,e=>ht(e.a,`top:${e._.e}px;left:${e._.f}px`)),Zg=P(1,0,Xg),Qg=P(1,0,Xg),$g=N(4,e=>Fh(e.b,e.d===e._._.ae)),e_=I(64,e=>{Ih(e.b,Xv(e)),$g(e)},e=>e._._),t_=L(`t17`,e=>{A(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();u_(e._,{id:e.d,top:r.top,left:r.right+8})}),A(e.a,`mouseleave`,function(){e._.j()})}),n_=e=>{e_(e),r_(e),i_(e),wh(e.b),Ph(e.b,!0),Rh(e.b),zh(e.b),Bh(e.b),Vh(e.b),Hh(e.b),Uh(e.b),Wh(e.b),Gh(e.b),Kh(e.b),qh(e.b),t_(e)},r_=I(69,e=>jh(e.b,e._._.as),e=>e._._),i_=I(70,e=>Nh(e.b,e._._.at),e=>e._._),a_=(e,t)=>Lh(e.b,t),o_=M(3,e=>{Mh(e.b,e.d),$g(e)}),s_=k(0,(e=>`<span>${e}</span>`)(qm),(e=>` D/${e}&l`)(`b%c`),n_,(e,t)=>{o_(e,t[0]),a_(e,t[1])}),c_=P(3,0,e=>s_(e,[e._.ar,e=>e])),l_=O(1,(e=>`<div>${e}</div>`)(qm),(e=>` D/${e}&l`)(`b%c`),Mg),u_=j(2,e=>{p_(e,e.c?.id),m_(e,e.c?.top),h_(e,e.c?.left),l_(e,+!e.c)}),d_=(e,t)=>v_(e,t.timer),f_=e=>{c_._(e),B(e.a,wm.sideRail),u_(e,null),d_(e,{timer:0})},p_=M(3,Yg),m_=M(4,Zg),h_=M(5,Qg),g_=M(8),__=M(9),v_=M(7,e=>{g_(e,Zv(e)),__(e,Qv(e))}),y_=N(7,e=>Rh(e.a,$v(e)),4),b_=We(2,y_),x_=e=>{b_._(e),S_._(e),w_._(e),T_._(e),D_._(e),O_._(e),k_._(e),j_._(e),M_._(e),N_._(e),P_._(e),F_._(e),wh(e.a),zh(e.a,ey(e)),Ph(e.a),Lh(e.a)},S_=We(2,e=>Vh(e.a,e._.a3)),C_=N(3,e=>Bh(e.a,ty(e))),w_=We(2,C_),T_=We(2,y_),E_=N(5,e=>Hh(e.a,e.c===e._.ae&&e._.a6?e._.a6:e._.at[e.c]?.sessions||[]),3),D_=We(2,E_),O_=We(2,e=>Gh(e.a,e._.a8)),k_=We(2,e=>Kh(e.a,e._.a9)),A_=N(6,e=>Uh(e.a,e.c===e._.ae&&e._.ai===`term`?e._.ag:null),3),j_=Ge(2,40,2,e=>{Fh(e.a,e.c===e._.ae),Ih(e.a,iy(e)),qh(e.a,ry(e)),Wh(e.a,ny(e)),y_(e),E_(e),A_(e)}),M_=We(2,A_),N_=We(2,e=>{y_(e),A_(e)}),P_=We(2,e=>jh(e.a,e._.as)),F_=We(2,e=>{Nh(e.a,e._.at),E_(e)}),I_=M(2,e=>{Mh(e.a,e.c),C_(e),y_(e),E_(e),A_(e)}),L_=(e,t)=>I_(e,t[0]),R_=F(r_,Kg),z_=M(54,e=>{P_(e),R_(e)}),B_=N(39,e=>z_(e,e.z||[e.ac])),V_=M(38,e=>{q_(e,e.ac?.id),B_(e)}),H_=k(2,(e=>`<!>${e}<!>`)(qm),(e=>`b/${e}&b`)(`b%c`),x_,L_),U_=M(53,e=>{H_(e,[e.ar,e=>e]),c_(e)}),W_=N(41,e=>U_(e,e.z?.length?e.z.filter(e=>e.status===`active`).map(e=>e.id):[e.ae])),G_=N(56,e=>e.at[e.ae]),K_=F(e_,Ug),q_=M(40,e=>{W_(e),G_(e),j_(e),K_(e)}),J_=V_,Y_=F(Wg),X_=Ue(42,e=>{M_(e),Y_(e)}),Z_=N(16,e=>X_(e,e.o,e.p)),Q_=M(14,Z_),$_=M(15,Z_),ev=F(Gg),tv=Ue(44,e=>{z(e.b,`hidden`,e.ai===`diff`),N_(e),ev(e)}),nv=N(19,e=>tv(e,e.r,e.s)),rv=M(17,nv),iv=M(18,nv),av=O(0,`<div></div>`,` `,Og),ov=N(49,e=>B(e.b,[wm.sideNav,{[wm.closed]:!e.am,[wm.open]:e.ak}])),sv=Ue(46,e=>{av(e,+!e.ak),ov(e)}),cv=N(22,e=>sv(e,e.u,e.v)),lv=M(20,cv),uv=M(21,cv),dv=O(3,`<div></div><!><!>`,` b%`,f_),fv=O(5,Yh,(e=>`/${e}&`)(Xh),Cg,eg,(e=>`/${e}&`)(tg),Sg),pv=j(48,e=>{z(e.f,`title`,e.am?`Collapse sidebar`:`Expand sidebar`),dv(e,+!!e.am),fv(e,+!e.am),ov(e)}),mv=M(52),hv=N(51,e=>mv(e,ay(e))),gv=j(50,e=>{hv(e),wg(e)}),_v=O(6,(e=>`<button>${e}</button>`)(ag),(e=>` D/${e}&l`)(og),Eg),vv=L(`t21`,e=>{Tt(e,{onMount:function(){nr()&&rr().then(t=>{gv(e,!!t)})}}),A(e.f,`click`,function(){pv(e,!e.am),Yn(e.am)}),A(e.h,`click`,function(){sv(e,!1),e.aa?.()}),A(e.j,`click`,function(){sv(e,!1),e.ab?.()})});function yv(e){B(e.c,wm.sideList),B(e.e,wm.sideFoot),B(e.f,wm.navToggle),B(e.h,wm.iconBtn),fg(e.i),pg(e.i,15),mg(e.i),B(e.j,wm.iconBtn),_g(e.k),vg(e.k,16),yg(e.k),pv(e,Jn()),gv(e,!1),_v(e,+!nr()),vv(e)}var bv=M(23,hv),xv=M(24,L(`t20`,e=>{e.y&&pv(e,Jn())})),Sv=M(25,e=>{W_(e),B_(e)}),Cv=F(i_,qg),wv=M(55,e=>{G_(e),F_(e),Cv(e)}),Tv=(e,t)=>wv(e,t||{}),Ev=F(Ag),Dv=M(27,e=>{b_(e),Ev(e)}),Ov=M(28),kv=F(Ng),Av=M(29,e=>{S_(e),kv(e)}),jv=F(Fg),Mv=M(30,e=>{w_(e),jv(e)}),Nv=F(Ig),Pv=M(31,e=>{T_(e),Nv(e)}),Fv=F(Rg),Iv=M(32,e=>{D_(e),Fv(e)}),Lv=M(33),Rv=F(zg),zv=M(34,e=>{O_(e),Rv(e)}),Bv=F(Bg),Vv=M(35,e=>{k_(e),Bv(e)}),Hv=M(36),Uv=M(37);function Wv(e){return function(){u_(e._,null),e.c===e._._.ae?e._._.ai===`diff`?tv(e._._,`term`):e._._.a5?.():(Fn(e.c),e._._.a1?.(e.c))}}function Gv(e){return function(){u_(e._,null),e._._.a2?.(e.c)}}function Kv(e){return function(t){u_(e._,null),e._._.a4(e.c,t)}}function qv(e){return function(t){u_(e._,null),e.c===e._._.ae?(X_(e._._,t),tv(e._._,`term`)):e._._.a7?.(e.c,t)}}function Jv(e){return function(t,n){u_(e._,null);let r=`${t}/${n}`;e.c===e._._.ae?e._._.a5?.(r):(Fn(e.c,r),e._._.a1?.(e.c))}}function Yv(e){return function(){u_(e._,null),e.c!==e._._.ae&&e._._.a1?.(e.c)}}function Xv(e){return function(){e.d!==e._._.ae&&e._._.a1?.(e.d)}}function Zv(e){return()=>clearTimeout(e.h)}function Qv(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{u_(e,null)},150)}}function $v(e){return function(){sv(e._,!1),e.c===e._.ae?e._.ai===`diff`?tv(e._,`term`):e._.a5?.():(Fn(e.c),e._.a1?.(e.c))}}function ey(e){return function(){sv(e._,!1),e._.a2?.(e.c)}}function ty(e){return function(t){sv(e._,!1),e._.a4(e.c,t)}}function ny(e){return function(t){sv(e._,!1),e.c===e._.ae?(X_(e._,t),tv(e._,`term`)):e._.a7?.(e.c,t)}}function ry(e){return function(t,n){sv(e._,!1);let r=`${t}/${n}`;e.c===e._.ae?e._.a5?.(r):(Fn(e.c,r),e._.a1?.(e.c))}}function iy(e){return function(){e.c!==e._.ae&&(sv(e._,!1),e._.a1?.(e.c))}}function ay(e){return async()=>{try{e.ao?(await ar(),gv(e,!1)):(gv(e,await ir()),e.ao||e.x?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){gv(e,!1),e.x?.(`Notifications failed: ${String(t.message||t)}`)}}}R(`t13`,Wv),R(`t11`,Gv),R(`t12`,Kv),R(`t15`,qv),R(`t14`,Jv),R(`t10`,Yv),R(`t9`,Xv),R(`t7`,Zv),R(`t8`,Qv),R(`t4`,$v),R(`t2`,ey),R(`t3`,ty),R(`t6`,ny),R(`t5`,ry),R(`t1`,iy),R(`t0`,ay);async function oy(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function sy(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function cy(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var ly=null;function uy(){return ly}function dy(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(fy(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function fy(e){if(!/[*?]/.test(e))return t=>$r(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>$r(e,t)}}var py=3;function my(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(hy(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=_y(a,e.line_start,e.line_end,e.side),n=vy(t);r.push(``),r.push(yy(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(yy(e.text))}}return r.join(`
|
|
4
4
|
`)}function hy(e,t){if(!t?.head)return`${e}/`;let n=gy(t.head),r=gy(t.baseSha),i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``} — \`${i}\` ${n} vs \`${t.base}\` ${r}`}function gy(e,t=12){return e.slice(0,t)}function _y(e,t,n,r){let i=e.split(`
|
|
5
5
|
`),a=Math.max(1,t-py),o=Math.min(i.length,n+py),s=r===`deletions`?`-`:`+`,c=[];for(let e=a;e<=o;e++){let r=e>=t&&e<=n?s:` `;c.push(`${r}${String(e).padStart(4)} | ${i[e-1]??``}`)}return c.join(`
|
|
6
6
|
`)}function vy(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function yy(e){return e.split(`
|
|
7
7
|
`).map(e=>e&&` ${e}`).join(`
|
|
8
|
-
`)}function by(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var xy={iconBtn:`
|
|
9
|
-
`);for(let t=0;t<c.length;t++){if(o.length>=eS||s>=tS)return;let l=c[t],u=(i?l:l.toLowerCase()).indexOf(r);u<0||n===`deletions`&&a.has(l)||(n===`additions`&&a.add(l),s++,o.push({key:e.key,path:e.path,repo:e.repo,line:t+1,side:n,preview:iS(l,u,r.length)}))}}function iS(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var aS=`search-mark`,oS=`mark.${aS}`,sS=`mark.${aS}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${aS} *,mark.${aS} *::before,mark.${aS} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${aS}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,cS={query:``,hit:null},lS=new Map;function uS(e,t){cS.query=e,cS.hit=t;for(let[e,t]of lS)xS(e,cS.query,cS.hit?.key===t?cS.hit:null);t&&requestAnimationFrame(()=>{for(let[e,n]of lS)n===t.key&&dS(e,t)})}function dS(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return;let r=n.querySelector(`mark.search-mark.active`);if(r){r.scrollIntoView({block:`center`});return}if(t.line<1)return;let i=[...n.querySelectorAll(`[data-line="${t.line}"]`)],a=t.side||`additions`;(i.find(e=>gS(e)===a)??i[0])?.scrollIntoView({block:`center`})}function fS(e,t){let n=t&&cS.hit?.key===t?cS.hit:null;xS(e,cS.query,n),n&&requestAnimationFrame(()=>dS(e,n))}function pS(e,t){return lS.set(e,t),fS(e,t),()=>{lS.delete(e)}}function mS(e){fS(e,lS.get(e))}function hS(e){for(let t of[...e.querySelectorAll(oS)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function gS(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function _S(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(oS)||n.push(e);return n}function vS(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function yS(e,t,n,r,i){let a=vS(e,t,n),o=vS(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function bS(e,t,n,r){let i=_S(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=gS(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${aS} active`:aS;for(let e=c.length-1;e>=0;e--)yS(i,a,c[e][0],c[e][1],d)}function xS(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(hS(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))bS(t,s,o,n)}var SS={findBar:`_dg`,findInput:`_dh`,count:`_di`,findIconBtn:`_dj _cP`},CS=`<div><input type=search placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button title="Previous match">↑</button><button title="Next match">↓</button><button title="Close find">×</button></div>`,wS=` D b D l b b l`,TS=Ue(10),ES=N(11,e=>TS(e,e.j,e.k)),DS=M(9,ES),OS=M(10,ES),kS=(e,t)=>eC(e,t?.length),AS=N(22,e=>kS(e,nS(e.s,e.u||``))),jS=N(39,L(`f5`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),TS(e,!1);return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))},{signal:t.signal}),e.a6=e.t,setTimeout(()=>e.b?.focus(),0),{abort:t}},onUpdate:function(){if(e.t!==e.a6){e.a6=e.t;let t=e.b;t?.focus(),t?.select()}},onDestroy:function(){e.a5&&clearTimeout(e.a5),this.abort.abort(),uS(``,null),BS(e,{query:``,hit:null,keys:[]})}})),3),MS=M(38,jS),NS=N(35,e=>MS(e,aC(e)),3),PS=N(37,e=>Nt(e,`b`,e.u||``,oC(e))),FS=N(29,e=>V(e.d,(e.u||``).trim()?e.a0?`${e.a2+1}/${e.a0}`:`0/0`:``),2),IS=Ue(20,e=>{AS(e),NS(e),PS(e),FS(e)}),LS=N(14,e=>IS(e,e.m,e.n)),RS=M(12,LS),zS=M(13,LS),BS=Ue(12),VS=N(17,e=>BS(e,e.p,e.q)),HS=M(15,VS),US=M(16,VS),WS=M(28,e=>{NS(e),FS(e)}),GS=N(27,e=>WS(e,e.a0?Math.min(e.x,e.a0-1):-1)),KS=M(36,PS),qS=N(34,e=>KS(e,sC(e)),2),JS=M(33,e=>{qS(e),NS(e)}),YS=N(24,e=>JS(e,cC(e))),XS=j(23,e=>{GS(e),YS(e)}),ZS=(e,t)=>{nC(e,t.timer),rC(e,t.tick)},QS=L(`f4`,e=>{Pt(e,`b`),A(e.b,`keydown`,function(t){t.key===`Enter`&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))}),A(e.e,`click`,function(){e.ac(-1)}),A(e.f,`click`,function(){e.ac(1)}),A(e.g,`click`,function(){TS(e,!1)})});function $S(e){B(e.a,SS.findBar),B(e.b,SS.findInput),B(e.c,SS.count),B(e.e,SS.findIconBtn),B(e.f,SS.findIconBtn),B(e.g,SS.findIconBtn),XS(e,0),ZS(e,{timer:0,tick:0}),QS(e)}var eC=M(26,e=>{z(e.e,`disabled`,!e.a0),z(e.f,`disabled`,!e.a0),GS(e),FS(e)}),tC=M(18,e=>{AS(e),YS(e),qS(e)}),nC=M(31,e=>{qS(e),NS(e),jS(e)}),rC=M(32,jS),iC=M(19,jS);function aC(e){return t=>{e.a5&&=(clearTimeout(e.a5),0),e.a7(e.u||``,(e.a2<0?0:e.a2)+t)}}function oC(e){return function(t){e.aa(t)}}function sC(e){return t=>{IS(e,t),XS(e,0),uS(t,nS(e.s,t)[0]??null),e.a5&&clearTimeout(e.a5),e.a5=setTimeout(()=>{e.a5=0,e.a7(t,0)},80)}}function cC(e){return(t,n)=>{let r=nS(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){XS(e,0),uS(t,null),BS(e,{query:t,hit:null,keys:i});return}XS(e,(n%r.length+r.length)%r.length);let a=r[e.x];uS(t,a),BS(e,{query:t,hit:a,keys:i})}}R(`f3`,aC),R(`f0`,oC),R(`f2`,sC),R(`f1`,cC);var lC=`diffs-container`,uC=/(?=^diff --git)/gm,dC=/(?<=\n)/,fC=/^(---|\+\+\+)\s+([^\t\r\n]+)/,pC=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,mC=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,hC=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,gC=`header-prefix`,_C=`header-filename-suffix`,vC=`header-metadata`,yC=`header-custom`,bC={dark:`pierre-dark`,light:`pierre-light`},xC=`data-theme-css`,SC=`data-unsafe-css`,CC=`data-diffs-scrollbar-measure`,wC=`--diffs-scrollbar-gutter-measured`,TC=1e5,EC=Object.freeze({fromStart:0,fromEnd:0}),DC={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},OC={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},kC=new Set,AC=null;function jC(e){kC.add(e),AC??=requestAnimationFrame(NC)}function MC(e){kC.delete(e)&&kC.size===0&&AC!=null&&(cancelAnimationFrame(AC),AC=null)}function NC(e){let t=new Set(kC);kC.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}AC=kC.size>0?requestAnimationFrame(NC):null}function PC(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function FC(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function IC(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var LC=new TextEncoder,RC=new TextDecoder(`utf-8`,{ignoreBOM:!0}),zC=/[\uD800-\uDFFF]/,BC=1024,VC=new Uint8Array(BC);function HC(){VC.length!==BC&&(VC=new Uint8Array(BC))}function UC(e){if(e.length===0)return e;if(zC.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;VC.length<t&&(VC=new Uint8Array(t));let{written:n}=LC.encodeInto(e,VC);return RC.decode(VC.subarray(0,n))}function WC(e,t){return e-(t===0?0:1)}function GC(e,t){return WC(e,t)+t}var KC=4096,qC=.5;function JC(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=XC(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}YC(t,e)}}function YC(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function XC(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>KC)return null;let c=[];for(let t=0;t<n;t++)c.push(QC(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(QC(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=$C(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*qC:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var ZC=/\s+/g;function QC(e){return e.replace(ZC,``)}function $C(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function ew(e,t){try{return tw(e,t)}finally{HC()}}function tw(e,{cacheKey:t,isGitDiff:n=uC.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=lw(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=rw(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=ow(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?nw(i.contents):[],deletionLines:!l&&r!=null&&i!=null?nw(r.contents):[],cacheKey:dw(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(mC),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=UC(r.trim()),n!==r&&(c.prevName=UC(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?pC:fC):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=UC(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=UC(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=UC(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=UC(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=UC(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=UC(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(hC)??[];t!=null&&(c.prevObjectId=UC(t)),n!=null&&(c.newObjectId=UC(n)),r!=null&&(c.mode=UC(r))}e.startsWith(`rename from `)&&(c.prevName=UC(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=UC(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
8
|
+
`)}function by(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var xy={iconBtn:`_bb _7`,spinning:`_bc _8`,treeToggle:`_bd _7`,diffTools:`_be`,on:`_bf`,diffCol:`_bg`,diffHead:`_bh`,findBtn:`_bi`,toastMeta:`_bj`,diffStats:`_bk`,twoDot:`_bl`,repoSection:`_bm`,repoSep:`_bn`,repoMeta:`_bo`,files:`_bp`,file:`_bq`,diffWait:`_br`,treeChev:`_bs`,status:`_bt`,path:`_bu`,viewed:`_bv`,centerPad:`_bw`,filesBtn:`_bx`,findLabel:`_by`,diffPad:`_bz`},Sy={tree:`_c2`,closed:`_c3`,treeRepo:`_c4`,treeRepoName:`_c5`,treeDir:`_c6`,treeFile:`_c7`,seen:`_c8`,treeFileName:`_c9`,treeNote:`_c_`,treeChev:`_da`,status:`_db`},Cy=`<aside></aside>`,wy=e=>B(e.a,Sy.treeNote),Ty=N(4,e=>{B(e.a,[Sy.treeDir,{[Sy.closed]:e._._._._.n.has(e._._.c(e._.e))}]),V(e.c,e._._._._.n.has(e._._.c(e._.e))?`▸`:`▾`)},2),Ey=I(17,Ty,e=>e._._._._),Dy=L(`h3`,e=>A(e.a,`click`,function(){let t=new Set(e._._._._.n);t.delete(e._._.c(e._.e))||t.add(e._._.c(e._.e)),Db(e._._._._,t)})),Oy=e=>{Ey(e),ky(e),Ay._(e),jy._(e),My._(e),B(e.b,Sy.treeChev),Dy(e)},ky=I(6,Ty,e=>e._._),Ay=P(0,0,e=>{z(e.a,`title`,e._.e),Ty(e)}),jy=P(0,0,e=>ht(e.a,`padding-left:${.35+e._.f*.75}rem`)),My=P(0,0,e=>V(e.d,e._.g)),Ny=N(6,e=>B(e.a,[Sy.treeFile,{[Sy.seen]:e._._._._.o.has(e._.i)}])),Py=I(18,Ny,e=>e._._._._),Fy=L(`h4`,e=>A(e.a,`click`,function(){e._._._._.k(e._.i)})),Iy=e=>{Py(e),zy(e),By._(e),Vy._(e),Hy._(e),Uy._(e),Wy._(e),B(e.d,Sy.treeFileName),Fy(e)},Ly=O(5,`<span>💬</span>`,` `,wy),Ry=N(7,e=>Ly(e,+!e._._._._.p.has(e._.i))),zy=I(19,Ry,e=>e._._._._),By=P(0,1,e=>ht(e.a,`padding-left:${.5+e._.f*.75}rem`)),Vy=P(0,1,e=>{Ny(e),Ry(e)}),Hy=P(0,1,e=>z(e.a,`title`,e._.j)),Uy=P(0,1,e=>{B(e.b,[Sy.status,e._.k]),V(e.c,e._.k)}),Wy=P(0,1,e=>V(e.e,e._.l)),Gy=O(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,Oy,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,Iy),Ky=N(3,e=>Gy(e,!e._.f(e.c)&&e.c?.kind===`dir`?0:!e._.f(e.c)&&e.c?.kind!==`dir`?1:2)),qy=We(0,Ky),Jy=qy,Yy=M(2,e=>{Zy(e,e.c?.path),Qy(e,e.c?.depth),$y(e,e.c?.label),eb(e,e.c?.file?.key),tb(e,e.c?.file?.path),nb(e,e.c?.file?.status),rb(e,e.c?.name),Ky(e)}),Xy=(e,t)=>Yy(e,t[0]),Zy=M(4,Ay),Qy=M(5,e=>{By(e),jy(e)}),$y=M(6,My),eb=M(8,Vy),tb=M(9,Hy),nb=M(10,Uy),rb=M(11,Wy),ib=M(5,qy),ab=N(4,e=>ib(e,Lb(e)),2),ob=I(17,ab,e=>e._._),sb=M(3,ab),cb=e=>{ob(e),ub._(e),pb._(e),sb(e,Rb)},lb=M(2,F(ky)),ub=P(5,0,e=>{lb(e,zb(e)),ab(e)}),db=k(0,`<!><!><!>`,`b%`,Jy,Xy),fb=(e,t)=>db(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),pb=P(5,0,e=>fb(e,by(e._.l))),mb=O(5,`<!><!><!>`,`b%`,cb),hb=N(9,e=>{B(e.b,[Sy.treeRepoName,{[Sy.closed]:e._.l.has(e.i)}]),V(e.d,e._.l.has(e.i)?`▸`:`▾`),mb(e,+!!e._.l.has(e.i))}),gb=We(0,hb),_b=L(`h5`,e=>A(e.b,`click`,function(){let t=new Set(e._.l);t.delete(e.i)||t.add(e.i),Cb(e._,t)})),vb=e=>{gb._(e),B(e.a,Sy.treeRepo),B(e.c,Sy.treeChev),_b(e)},yb=M(8,e=>{hb(e),ub(e)}),bb=(e,t)=>V(e.e,t),xb=(e,t)=>{yb(e,t[0]?.id),bb(e,t[0]?.label),Sb(e,t[0]?.files)},Sb=M(11,pb),Cb=Ue(11,gb),wb=N(5,e=>Cb(e,e.d,e.e)),Tb=M(3,wb),Eb=M(4,wb),Db=j(13,F(ob,Ey));function Ob(e){Db(e,new Set)}var kb=M(14,F(Py)),Ab=(e,t)=>kb(e,t||new Set),jb=M(15,F(zy)),Mb=(e,t)=>jb(e,t||new Set),Nb=(e,t)=>B(e.a,[Sy.tree,{[Sy.closed]:t===!1}]),Pb=k(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,vb,xb),Fb=(e,t)=>Pb(e,[t,`id`]),Ib=M(10);function Lb(e){return t=>{let n=e.d(t);for(let r of e._._.n){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function Rb(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function zb(e){return t=>`${e._.i}/${t}`}R(`h2`,Lb),R(`h1`,Rb),R(`h0`,zb);var Bb=ri,Vb=(e=>`/${e}&`)(ii);function Hb(e){si(e.a,`M15 6L9 12L15 18`)}var Ub=(e,t)=>ai(e.a,t),Wb=(e,t)=>oi(e.a,t),Gb={headActions:`_dc`},Kb=`<span><button type=button class=btn title="Copy comments as markdown"> </button><!></span>`,qb=` D D l%l`,Jb=(e,t)=>z(e.a,`value`,t),Yb=N(7,e=>V(e.b,e.f||e.g)),Xb=M(5,Yb),Zb=M(6,Yb),Qb=(e,t)=>{Jb(e,t[0]?.id),Xb(e,t[0]?.title),Zb(e,t[0]?.agent)},$b=P(3,1,e=>{z(e.a,`disabled`,e._.k),V(e.b,e._.k?`Sending…`:`Send to`),z(e.c,`disabled`,e._.k)}),ex=L(`g2`,e=>{A(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){fx(e._,!0);try{await e._.i(e._.s)}finally{fx(e._,!1)}}})()}),Lt(e,`c`)}),tx=e=>{$b._(e),nx._(e),ix._(e),ex(e)},nx=P(3,1,e=>It(e,`c`,e._.l,Ex(e))),rx=k(2,`<option> </option>`,` D `,0,Qb),ix=P(3,1,e=>rx(e,[e._.m,`id`])),ax=N(2,e=>V(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),ox=P(3,0,e=>{z(e.a,`disabled`,e._.k),ax(e)}),sx=L(`g1`,e=>A(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){fx(e._,!0);try{await e._.i(e._.s)}finally{fx(e._,!1)}}})()})),cx=e=>{ox._(e),lx._(e),ux._(e),sx(e)},lx=P(3,0,ax),ux=P(3,0,ax),dx=j(9,e=>V(e.c,e.j?`Copied ✓`:`Copy`)),fx=j(10,e=>{ox(e),$b(e)}),px=M(18),mx=N(13,e=>px(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),hx=j(11,e=>{mx(e),nx(e)}),gx=L(`g3`,e=>A(e.b,`click`,function(){(async()=>{await e.h()&&(dx(e,!0),setTimeout(()=>{dx(e,!1)},1500))})()}));function _x(e){B(e.a,Gb.headActions),dx(e,!1),fx(e,!1),hx(e,null),gx(e)}var vx=M(12,e=>{yx(e,e.m[0]?.title),bx(e,e.m[0]?.agent),Sx(e,e.m.length),mx(e),ix(e)}),yx=M(16,lx),bx=M(17,ux),xx=O(3,`<button type=button class="btn primary"> </button>`,` D `,cx,`<span class="split-btn primary"><button type=button> </button><select aria-label="Send comments to session"></select></span>`,`D D l `,tx),Sx=(e,t)=>xx(e,t===1?0:t?1:2),Cx=(e,t)=>vx(e,t||[]),wx=M(7),Tx=M(8);function Ex(e){return t=>{hx(e._,t)}}R(`g0`,Ex);var Dx=ri,Ox=(e=>`/${e}&`)(ii);function kx(e){si(e.a,`M17 17L21 21 M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z`)}var Ax=(e,t)=>ai(e.a,t),jx=(e,t)=>oi(e.a,t),Mx={wrap:`_di`,fileFilter:`_dj`},Nx=`<div><input type=search placeholder="Filter files… (globs, !excludes)" aria-label="Filter files"></div>`,Px=` D l`,Fx=N(18,e=>Nt(e,`b`,e.l,Zx(e))),Ix=M(11,Fx),Lx=N(10,e=>Ix(e,(e.j??e.h)||``)),Rx=M(17,Fx),zx=N(16,e=>Rx(e,Qx(e))),Bx=M(15,zx),Vx=N(14,e=>Bx(e,$x(e)),2),Hx=Ue(7,e=>{Lx(e),Vx(e)}),Ux=N(6,e=>Hx(e,e.e,e.f)),Wx=M(4,Ux),Gx=M(5,Ux),Kx=j(9,e=>{Lx(e),Vx(e)}),qx=(e,t)=>Xx(e,t.timer),Jx=L(`j3`,e=>{Pt(e,`b`),A(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function Yx(e){B(e.a,Mx.wrap),B(e.b,Mx.fileFilter),Kx(e,null),qx(e,{timer:0}),Jx(e)}var Xx=M(13,e=>{Vx(e),zx(e)});function Zx(e){return function(t){e.r(t)}}function Qx(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,Kx(e,null),Hx(e,``);return}Kx(e,t),e.n=setTimeout(e.p,150)}}function $x(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;Kx(e,null),Hx(e,t)}}R(`j0`,Zx),R(`j2`,Qx),R(`j1`,$x);var eS=200,tS=40;function nS(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=eS)break;(r?t.path:t.path.toLowerCase()).includes(i)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path});let e=new Set;rS(t,t.new,`additions`,i,r,e,a),rS(t,t.old,`deletions`,i,r,e,a)}return a}function rS(e,t,n,r,i,a,o){if(!t||o.length>=eS)return;let s=0,c=t.split(`
|
|
9
|
+
`);for(let t=0;t<c.length;t++){if(o.length>=eS||s>=tS)return;let l=c[t],u=(i?l:l.toLowerCase()).indexOf(r);u<0||n===`deletions`&&a.has(l)||(n===`additions`&&a.add(l),s++,o.push({key:e.key,path:e.path,repo:e.repo,line:t+1,side:n,preview:iS(l,u,r.length)}))}}function iS(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var aS=`search-mark`,oS=`mark.${aS}`,sS=`mark.${aS}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${aS} *,mark.${aS} *::before,mark.${aS} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${aS}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,cS={query:``,hit:null},lS=new Map;function uS(e,t){cS.query=e,cS.hit=t;for(let[e,t]of lS)xS(e,cS.query,cS.hit?.key===t?cS.hit:null);t&&requestAnimationFrame(()=>{for(let[e,n]of lS)n===t.key&&dS(e,t)})}function dS(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return;let r=n.querySelector(`mark.search-mark.active`);if(r){r.scrollIntoView({block:`center`});return}if(t.line<1)return;let i=[...n.querySelectorAll(`[data-line="${t.line}"]`)],a=t.side||`additions`;(i.find(e=>gS(e)===a)??i[0])?.scrollIntoView({block:`center`})}function fS(e,t){let n=t&&cS.hit?.key===t?cS.hit:null;xS(e,cS.query,n),n&&requestAnimationFrame(()=>dS(e,n))}function pS(e,t){return lS.set(e,t),fS(e,t),()=>{lS.delete(e)}}function mS(e){fS(e,lS.get(e))}function hS(e){for(let t of[...e.querySelectorAll(oS)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function gS(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function _S(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(oS)||n.push(e);return n}function vS(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function yS(e,t,n,r,i){let a=vS(e,t,n),o=vS(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function bS(e,t,n,r){let i=_S(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=gS(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${aS} active`:aS;for(let e=c.length-1;e>=0;e--)yS(i,a,c[e][0],c[e][1],d)}function xS(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(hS(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))bS(t,s,o,n)}var SS={findBar:`_dd`,findInput:`_de`,count:`_df`,findIconBtn:`_dg _7`},CS=`<div><input type=search placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button title="Previous match">↑</button><button title="Next match">↓</button><button title="Close find">×</button></div>`,wS=` D b D l b b l`,TS=Ue(10),ES=N(11,e=>TS(e,e.j,e.k)),DS=M(9,ES),OS=M(10,ES),kS=(e,t)=>eC(e,t?.length),AS=N(22,e=>kS(e,nS(e.s,e.u||``))),jS=N(39,L(`f5`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),TS(e,!1);return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))},{signal:t.signal}),e.a6=e.t,setTimeout(()=>e.b?.focus(),0),{abort:t}},onUpdate:function(){if(e.t!==e.a6){e.a6=e.t;let t=e.b;t?.focus(),t?.select()}},onDestroy:function(){e.a5&&clearTimeout(e.a5),this.abort.abort(),uS(``,null),BS(e,{query:``,hit:null,keys:[]})}})),3),MS=M(38,jS),NS=N(35,e=>MS(e,aC(e)),3),PS=N(37,e=>Nt(e,`b`,e.u||``,oC(e))),FS=N(29,e=>V(e.d,(e.u||``).trim()?e.a0?`${e.a2+1}/${e.a0}`:`0/0`:``),2),IS=Ue(20,e=>{AS(e),NS(e),PS(e),FS(e)}),LS=N(14,e=>IS(e,e.m,e.n)),RS=M(12,LS),zS=M(13,LS),BS=Ue(12),VS=N(17,e=>BS(e,e.p,e.q)),HS=M(15,VS),US=M(16,VS),WS=M(28,e=>{NS(e),FS(e)}),GS=N(27,e=>WS(e,e.a0?Math.min(e.x,e.a0-1):-1)),KS=M(36,PS),qS=N(34,e=>KS(e,sC(e)),2),JS=M(33,e=>{qS(e),NS(e)}),YS=N(24,e=>JS(e,cC(e))),XS=j(23,e=>{GS(e),YS(e)}),ZS=(e,t)=>{nC(e,t.timer),rC(e,t.tick)},QS=L(`f4`,e=>{Pt(e,`b`),A(e.b,`keydown`,function(t){t.key===`Enter`&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))}),A(e.e,`click`,function(){e.ac(-1)}),A(e.f,`click`,function(){e.ac(1)}),A(e.g,`click`,function(){TS(e,!1)})});function $S(e){B(e.a,SS.findBar),B(e.b,SS.findInput),B(e.c,SS.count),B(e.e,SS.findIconBtn),B(e.f,SS.findIconBtn),B(e.g,SS.findIconBtn),XS(e,0),ZS(e,{timer:0,tick:0}),QS(e)}var eC=M(26,e=>{z(e.e,`disabled`,!e.a0),z(e.f,`disabled`,!e.a0),GS(e),FS(e)}),tC=M(18,e=>{AS(e),YS(e),qS(e)}),nC=M(31,e=>{qS(e),NS(e),jS(e)}),rC=M(32,jS),iC=M(19,jS);function aC(e){return t=>{e.a5&&=(clearTimeout(e.a5),0),e.a7(e.u||``,(e.a2<0?0:e.a2)+t)}}function oC(e){return function(t){e.aa(t)}}function sC(e){return t=>{IS(e,t),XS(e,0),uS(t,nS(e.s,t)[0]??null),e.a5&&clearTimeout(e.a5),e.a5=setTimeout(()=>{e.a5=0,e.a7(t,0)},80)}}function cC(e){return(t,n)=>{let r=nS(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){XS(e,0),uS(t,null),BS(e,{query:t,hit:null,keys:i});return}XS(e,(n%r.length+r.length)%r.length);let a=r[e.x];uS(t,a),BS(e,{query:t,hit:a,keys:i})}}R(`f3`,aC),R(`f0`,oC),R(`f2`,sC),R(`f1`,cC);var lC=`diffs-container`,uC=/(?=^diff --git)/gm,dC=/(?<=\n)/,fC=/^(---|\+\+\+)\s+([^\t\r\n]+)/,pC=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,mC=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,hC=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,gC=`header-prefix`,_C=`header-filename-suffix`,vC=`header-metadata`,yC=`header-custom`,bC={dark:`pierre-dark`,light:`pierre-light`},xC=`data-theme-css`,SC=`data-unsafe-css`,CC=`data-diffs-scrollbar-measure`,wC=`--diffs-scrollbar-gutter-measured`,TC=1e5,EC=Object.freeze({fromStart:0,fromEnd:0}),DC={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},OC={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},kC=new Set,AC=null;function jC(e){kC.add(e),AC??=requestAnimationFrame(NC)}function MC(e){kC.delete(e)&&kC.size===0&&AC!=null&&(cancelAnimationFrame(AC),AC=null)}function NC(e){let t=new Set(kC);kC.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}AC=kC.size>0?requestAnimationFrame(NC):null}function PC(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function FC(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function IC(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var LC=new TextEncoder,RC=new TextDecoder(`utf-8`,{ignoreBOM:!0}),zC=/[\uD800-\uDFFF]/,BC=1024,VC=new Uint8Array(BC);function HC(){VC.length!==BC&&(VC=new Uint8Array(BC))}function UC(e){if(e.length===0)return e;if(zC.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;VC.length<t&&(VC=new Uint8Array(t));let{written:n}=LC.encodeInto(e,VC);return RC.decode(VC.subarray(0,n))}function WC(e,t){return e-(t===0?0:1)}function GC(e,t){return WC(e,t)+t}var KC=4096,qC=.5;function JC(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=XC(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}YC(t,e)}}function YC(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function XC(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>KC)return null;let c=[];for(let t=0;t<n;t++)c.push(QC(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(QC(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=$C(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*qC:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var ZC=/\s+/g;function QC(e){return e.replace(ZC,``)}function $C(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function ew(e,t){try{return tw(e,t)}finally{HC()}}function tw(e,{cacheKey:t,isGitDiff:n=uC.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=lw(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=rw(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=ow(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?nw(i.contents):[],deletionLines:!l&&r!=null&&i!=null?nw(r.contents):[],cacheKey:dw(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(mC),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=UC(r.trim()),n!==r&&(c.prevName=UC(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?pC:fC):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=UC(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=UC(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=UC(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=UC(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=UC(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=UC(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(hC)??[];t!=null&&(c.prevObjectId=UC(t)),n!=null&&(c.newObjectId=UC(n)),r!=null&&(c.mode=UC(r))}e.startsWith(`rename from `)&&(c.prevName=UC(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=UC(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
10
10
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
11
11
|
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:dw(p.hunkContext),hunkSpecs:UC(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&iw(t)&&!aw(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=fw(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=pw(t);(g==null||g.type!==`change`)&&(g=mw(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=pw(t);(g==null||g.type!==`change`)&&(g=mw(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=pw(t);(g==null||g.type!==`context`)&&(g=mw(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=IC(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=IC(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(WC(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=GC(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=GC(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),JC(c),c}}function nw(e){let t=rw(e);for(let e=0;e<t.length;e++)t[e]=UC(t[e]);return t}function rw(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
12
12
|
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function iw(e){let t=e[0];return t===`+`||t===`-`||t===` `}function aw(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
@@ -33,7 +33,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
33
33
|
\f\r &>`.split(``),`\0
|
|
34
34
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
35
35
|
\f\r "&'<=>\``.split(``),`\0
|
|
36
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function qE(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=IT);let l=JE(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!BE(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!wE(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function JE(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=YE(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function YE(e,t,n){let r=MT(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=oE(r.attribute,Object.assign({},e.settings.characterReferences,{subset:KE.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?pE:mE)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=oE(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:KE.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&fE(n,o)>fE(n,e.alternative)&&(o=e.alternative),s=o+oE(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?KE.single:KE.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var XE=[`<`,`&`];function ZE(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:oE(e.value,Object.assign({},r.settings.characterReferences,{subset:XE}))}function QE(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ZE(e,t,n,r)}function $E(e,t,n,r){return r.all(e)}var eD=RT(`type`,{invalid:tD,unknown:nD,handlers:{comment:uE,doctype:dE,element:qE,raw:QE,root:$E,text:ZE}});function tD(e){throw Error("Expected node, not `"+e+"`")}function nD(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var rD={},iD={},aD=[];function oD(e,t){let n=t||rD,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:sD,all:cD,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||iT,characterReferences:n.characterReferences||iD,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?IT:FT,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function sD(e,t,n){return eD(e,t,n,this)}function cD(e){let t=[],n=e&&e.children||aD,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var lD=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),MC(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||FC(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&rT(e.composedPath())||(OD(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(OD(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(OD(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){OD(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();OD(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);OD(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=mD(i)&&this.hoveredLine?.lineElement===i.lineElement;pD(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),pD(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),mD(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(gD(i)&&p!=null){p(i);break}if(hD(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!mD(i))break;pD(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,OD(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),OD(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),OD(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();rT(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(nT(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=oD(tT());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);fD(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(yD(t));if(fD(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(fD(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(fD(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&rT(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=yD(e);if(t&&rT(n))return;let r=bD(e);return r==null?this.pathFromAnnotationSlot(e):yD(r)}pathFromAnnotationSlot(e){let t=SD(xD(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:yD(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=CD(t)?t:CD(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}FC(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,jC(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{MC(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!TD(this.renderedSelectedLinesState,n),i=!TD(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);_D(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=DD(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=DD(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:vD(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:vD(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ED(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ED(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function uD({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:dD({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function dD({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function fD(e){return e!=null&&`kind`in e&&e.kind===`line`}function pD(e){return e!=null&&`kind`in e&&e.kind===`token`}function mD(e){return fD(e)||pD(e)}function hD(e){return`type`in e&&e.type===`line-info`}function gD(e){return`kind`in e&&e.kind===`merge-conflict-action`}function _D(e){return e===`current`||e===`incoming`||e===`both`}function vD(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function yD(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function bD(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function xD(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function SD(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function CD(e){return e!=null&&typeof e.elementFromPoint==`function`}function wD(e,t){return e===t||FC(e??void 0,t??void 0)}function TD(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&wD(e?.range??null,t.range)}function ED(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function DD(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function OD(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var kD=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),MD(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?FD(t):ID(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:AD(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:jD(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&ND(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function AD(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function jD(e){return Math.max(Math.ceil(e),0)}function MD(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ND(e,{codeWidthChanged:!0,numberWidthChanged:!0}):PD(e))}function ND(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function PD(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function FD(e){e.codeElement.isConnected&&PD(e)}function ID(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var LD=new Map,RD=new Map,zD=new Map,BD=new Set;function VD(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!BD.has(t))return!1;return!0}function HD(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(BD.has(n.name))continue;let e=LD.get(n.name);e??(e=n,LD.set(n.name,e)),BD.add(e.name),t.loadLanguageSync(e.data)}}function UD(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var WD=Object.defineProperty,GD=Object.getOwnPropertyDescriptor,KD=Object.getOwnPropertyNames,qD=Object.prototype.hasOwnProperty,JD=(e,t)=>{let n={};for(var r in e)WD(n,r,{get:e[r],enumerable:!0});return t||WD(n,Symbol.toStringTag,{value:`Module`}),n},YD=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=KD(t),a=0,o=i.length,s;a<o;a++)s=i[a],!qD.call(e,s)&&s!==n&&WD(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=GD(t,s))||r.enumerable});return e},XD=(e,t,n)=>(YD(e,t,`default`),n&&YD(n,t,`default`)),ZD=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),QD=function(e){return`/`+e},$D={},G=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=QD(t,n),t=s(t),t in $D)return;$D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ZD,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},eO=[{id:`abap`,name:`ABAP`,import:(()=>G(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>G(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>G(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>G(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>G(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>G(()=>import(`./_CyzHhkSz.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>G(()=>import(`./_ipAOmiqc.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>G(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>G(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>G(()=>import(`./_wB7-64Qk.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>G(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>G(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>G(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>G(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>G(()=>import(`./_B0alns9R.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>G(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>G(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>G(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>G(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>G(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>G(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>G(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>G(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>G(()=>import(`./_AaWDncwx2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>G(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>G(()=>import(`./_D2fmkodJ2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>G(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>G(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>G(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>G(()=>import(`./_B8nux85Y2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>G(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>G(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>G(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>G(()=>import(`./_Blx-QhC42.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>G(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>G(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>G(()=>import(`./_CtmneVE32.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>G(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>G(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>G(()=>import(`./_goN0hfB3.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>G(()=>import(`./_D_W0W1cX.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>G(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>G(()=>import(`./_BDHG3pN8.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>G(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>G(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>G(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>G(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>G(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>G(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>G(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>G(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>G(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>G(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>G(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>G(()=>import(`./_DktWaxA8.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>G(()=>import(`./_BpxKj3fb.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>G(()=>import(`./_r_JHGP4r.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>G(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>G(()=>import(`./_BUXTK4lJ.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>G(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>G(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>G(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>G(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>G(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>G(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>G(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>G(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>G(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>G(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>G(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>G(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>G(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>G(()=>import(`./_CQQsLoJf2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>G(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>G(()=>import(`./_DAX0iAZb2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>G(()=>import(`./_DRHywp9A2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>G(()=>import(`./_Cc-O1azs.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>G(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>G(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>G(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>G(()=>import(`./_XoS-gv2A.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>G(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>G(()=>import(`./_rH6un46m2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>G(()=>import(`./_DT4PVQNh.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>G(()=>import(`./_ySYn5emK2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>G(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>G(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>G(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>G(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>G(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>G(()=>import(`./_jNIFnvkH.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>G(()=>import(`./_lTS8Eg0V2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>G(()=>import(`./_CTz_hU3k2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>G(()=>import(`./_Dp6nvOUq2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>G(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>G(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>G(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>G(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>G(()=>import(`./_DSgRvNDs.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>G(()=>import(`./_jSREeQIf.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>G(()=>import(`./_xH8kCfq2.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>G(()=>import(`./_CRjIS-nr.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>G(()=>import(`./_HmZ46EU-.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>G(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>G(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>G(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>G(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>G(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>G(()=>import(`./_DngrSHmN.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>G(()=>import(`./_gaXUm7Ph.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>G(()=>import(`./_DjvE6GSd.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>G(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>G(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>G(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>G(()=>import(`./_Bxc-rPnR.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>G(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>G(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>G(()=>import(`./_rbd-OpBS.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>G(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>G(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>G(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>G(()=>import(`./_k8h5DW7b.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>G(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>G(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>G(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>G(()=>import(`./_CbOW3Qss.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>G(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>G(()=>import(`./_CsORzCSG.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>G(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>G(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>G(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>G(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>G(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>G(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>G(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>G(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>G(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>G(()=>import(`./_CZpWy771.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>G(()=>import(`./_B2t7eRJv2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>G(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>G(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>G(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>G(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>G(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>G(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>G(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>G(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>G(()=>import(`./_CJhxWkis2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>G(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>G(()=>import(`./_6Fcx5D9i.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>G(()=>import(`./_DC2Xj-J82.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>G(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>G(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>G(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>G(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>G(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>G(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>G(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>G(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>G(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>G(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>G(()=>import(`./_CILSW09C.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>G(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>G(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>G(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>G(()=>import(`./_Bw8AbEkz.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>G(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>G(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>G(()=>import(`./_C4ksDlX4.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>G(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>G(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>G(()=>import(`./_cJF5JKj1.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>G(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>G(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>G(()=>import(`./_C32Tdcjq.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>G(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>G(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>G(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>G(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>G(()=>import(`./_BjM37MRx.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>G(()=>import(`./_hEOkUobY.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>G(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>G(()=>import(`./_BhHBCWCj.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>G(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>G(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>G(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>G(()=>import(`./_CIDwMDlU.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>G(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>G(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>G(()=>import(`./_CRQMg1X9.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>G(()=>import(`./_IKBWE1IQ.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>G(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>G(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>G(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>G(()=>import(`./_O6zku0Kn.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>G(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>G(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>G(()=>import(`./_BsOS4GJz2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>G(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>G(()=>import(`./_CgF-PZ5_.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>G(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>G(()=>import(`./_Qm4Ud6cR.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>G(()=>import(`./_4fQaDKgf.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>G(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>G(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>G(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>G(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>G(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>G(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>G(()=>import(`./_B-UOuIXW2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>G(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>G(()=>import(`./_CLZUfNOi.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>G(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>G(()=>import(`./_DpyJdHLB2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>G(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>G(()=>import(`./_DNKb4wZ8.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>G(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>G(()=>import(`./_Bm2CKqh32.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>G(()=>import(`./_CaCXvqxm.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>G(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>G(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>G(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>G(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>G(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>G(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>G(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>G(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>G(()=>import(`./_BNp5XLge2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>G(()=>import(`./_SbEDD5sS2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>G(()=>import(`./_DPGFJ6Li2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>G(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>G(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>G(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>G(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>G(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>G(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>G(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>G(()=>import(`./_DsvFQlDq.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>G(()=>import(`./_DGsXFfnh2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>G(()=>import(`./_PIyxaGSC.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>G(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>G(()=>import(`./_CMLA9XwU2.js`),[]))}],tO=Object.fromEntries(eO.map(e=>[e.id,e.import])),nO=Object.fromEntries(eO.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),rO={...tO,...nO},iO=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>G(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>G(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>G(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>G(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>G(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>G(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>G(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>G(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>G(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>G(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>G(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>G(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>G(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>G(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>G(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>G(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>G(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>G(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>G(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>G(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>G(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>G(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>G(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>G(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>G(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>G(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>G(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>G(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>G(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>G(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>G(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>G(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>G(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>G(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>G(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>G(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>G(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>G(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>G(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>G(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>G(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>G(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>G(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>G(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>G(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>G(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>G(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>G(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>G(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>G(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>G(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>G(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>G(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>G(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>G(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>G(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>G(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>G(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>G(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>G(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>G(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>G(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>G(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>G(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>G(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),aO=t({createOnigurumaEngine:()=>NO,getDefaultWasmLoader:()=>MO,loadWasm:()=>EO,setDefaultWasmLoader:()=>jO}),oO=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sO(){return 2147483648}function cO(){return typeof performance<`u`?performance.now():Date.now()}var lO=(e,t)=>e+(t-e%t)%t;async function uO(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=sO();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,lO(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:cO,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var dO=Object.defineProperty,fO=(e,t,n)=>t in e?dO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pO=(e,t,n)=>fO(e,typeof t==`symbol`?t:t+``,n),mO=null;function hO(e){throw new oO(e.UTF8ToString(e.getLastOnigError()))}var gO=class e{constructor(t){pO(this,`utf16Length`),pO(this,`utf8Length`),pO(this,`utf16Value`),pO(this,`utf8Value`),pO(this,`utf16OffsetToUtf8`),pO(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},_O=class e{constructor(t){if(pO(this,`id`,++e.LAST_ID),pO(this,`_onigBinding`),pO(this,`content`),pO(this,`utf16Length`),pO(this,`utf8Length`),pO(this,`utf16OffsetToUtf8`),pO(this,`utf8OffsetToUtf16`),pO(this,`ptr`),!mO)throw new oO(`Must invoke loadWasm first.`);this._onigBinding=mO,this.content=t;let n=new gO(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=mO.omalloc(1e4),e._sharedPtrInUse=!0,mO.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(mO)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};pO(_O,`LAST_ID`,0),pO(_O,`_sharedPtr`,0),pO(_O,`_sharedPtrInUse`,!1);var vO=_O,yO=class{constructor(e){if(pO(this,`_onigBinding`),pO(this,`_ptr`),!mO)throw new oO(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new gO(e[r]);t[r]=i.createString(mO),n[r]=i.utf8Length}let r=mO.omalloc(4*e.length);mO.HEAPU32.set(t,r/4);let i=mO.omalloc(4*e.length);mO.HEAPU32.set(n,i/4);let a=mO.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)mO.ofree(t[n]);mO.ofree(i),mO.ofree(r),a===0&&hO(mO),this._onigBinding=mO,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new vO(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function bO(e){return typeof e.instantiator==`function`}function xO(e){return typeof e.default==`function`}function SO(e){return e.data!==void 0}function CO(e){return typeof Response<`u`&&e instanceof Response}function wO(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var TO;function EO(e){if(TO)return TO;async function t(){mO=await uO(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),bO(n)?n=await n.instantiator(t):xO(n)?n=await n.default(t):(SO(n)&&(n=n.data),CO(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await OO(n)(t):await kO(n)(t):wO(n)||n instanceof WebAssembly.Module?n=await DO(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await DO(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return TO=t(),TO}function DO(e){return t=>WebAssembly.instantiate(e,t)}function OO(e){return t=>WebAssembly.instantiateStreaming(e,t)}function kO(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var AO;function jO(e){AO=e}function MO(){return AO}async function NO(e){return e&&await EO(e),{createScanner(e){return new yO(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new vO(e)}}}var PO=JD({});XD(PO,aO);var FO=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function IO(e){return LO(e)}function LO(e){return Array.isArray(e)?RO(e):e instanceof RegExp?e:typeof e==`object`?zO(e):e}function RO(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=LO(e[n]);return t}function zO(e){let t={};for(let n in e)t[n]=LO(e[n]);return t}function BO(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function VO(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?VO(e.substring(0,e.length-1)):e.substr(~t+1)}var HO=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,UO=class{static hasCaptures(e){return e!==null&&(HO.lastIndex=0,HO.test(e))}static replaceCaptures(e,t,n){return e.replace(HO,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function WO(e,t){return e<t?-1:+(e>t)}function GO(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=WO(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function KO(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function qO(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var JO=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},YO=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ek(e),t)}static createFromParsedTheme(e,t){return rk(e,t)}_cachedMatchRoot=new JO(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ZO(e.parent,t.parentScopes));return n?new $O(n.fontStyle,n.foreground,n.background):null}},XO=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ZO(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!QO(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function QO(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var $O=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ek(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&KO(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&KO(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new tk(l,u,e,o,s,c)}}return n}var tk=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},nk=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(nk||{});function rk(e,t){e.sort((e,t)=>{let n=WO(e.scope,t.scope);return n!==0||(n=GO(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ik(t),o=new $O(n,a.getId(r),a.getId(i)),s=new sk(new ok(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new YO(a,o,s)}var ik=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ak=Object.freeze([]),ok=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ak,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},sk=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),ok.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(GO(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ok(e,t,n,r,i))}},ck=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=uk(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function lk(e){return e}function uk(e){return e}function dk(e,t){let n=[],r=pk(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(fk(i)){let e=[];do e.push(i),i=r.next();while(fk(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function fk(e){return!!e&&!!e.match(/[\w\.:]+/)}function pk(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function mk(e){typeof e.dispose==`function`&&e.dispose()}var hk=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},gk=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},_k=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},vk=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new hk(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new _k;for(let n of e)yk(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof hk){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function yk(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof hk?xk({baseGrammar:a,selfGrammar:i},r):bk(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new hk(e))}function bk(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Sk([r],t,n)}}function xk(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Sk(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Sk(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Sk(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?BO({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Sk(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ok(i);switch(a.kind){case 0:xk({...t,selfGrammar:t.baseGrammar},n);break;case 1:xk(t,n);break;case 2:bk(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?bk(a.ruleName,i,n):xk(i,n)}else a.kind===4?n.add(new gk(a.scopeName,a.ruleName)):n.add(new hk(a.scopeName))}}}var Ck=class{kind=0},wk=class{kind=1},Tk=class{constructor(e){this.ruleName=e}kind=2},Ek=class{constructor(e){this.scopeName=e}kind=3},Dk=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ok(e){if(e===`$base`)return new Ck;if(e===`$self`)return new wk;let t=e.indexOf(`#`);return t===-1?new Ek(e):t===0?new Tk(e.substring(1)):new Dk(e.substring(0,t),e.substring(t+1))}var kk=/\\(\d+)/,Ak=/\\(\d+)/g,Ate=-1,jk=-2;function Mk(e){return e}function Nk(e){return e}var Pk=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=UO.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=UO.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${VO(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:UO.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:UO.replaceCaptures(this._contentName,e,t)}},jte=class extends Pk{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Mte=class extends Pk{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new zk(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fk=class extends Pk{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ik=class extends Pk{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new zk(i,this.id),this.beginCaptures=a,this._end=new zk(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Lk=class extends Pk{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new zk(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new zk(o,jk),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Bk,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Rk=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new jte(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mte(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=BO({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Fk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Lk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ik(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ok(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Fk||e instanceof Ik||e instanceof Lk)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},zk=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&kk.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ak.lastIndex=0,this.source.replace(Ak,(e,t)=>qO(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Bk=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Vk(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Vk(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Vk=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
36
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function qE(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=IT);let l=JE(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!BE(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!wE(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function JE(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=YE(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function YE(e,t,n){let r=MT(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=oE(r.attribute,Object.assign({},e.settings.characterReferences,{subset:KE.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?pE:mE)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=oE(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:KE.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&fE(n,o)>fE(n,e.alternative)&&(o=e.alternative),s=o+oE(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?KE.single:KE.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var XE=[`<`,`&`];function ZE(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:oE(e.value,Object.assign({},r.settings.characterReferences,{subset:XE}))}function QE(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ZE(e,t,n,r)}function $E(e,t,n,r){return r.all(e)}var eD=RT(`type`,{invalid:tD,unknown:nD,handlers:{comment:uE,doctype:dE,element:qE,raw:QE,root:$E,text:ZE}});function tD(e){throw Error("Expected node, not `"+e+"`")}function nD(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var rD={},iD={},aD=[];function oD(e,t){let n=t||rD,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:sD,all:cD,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||iT,characterReferences:n.characterReferences||iD,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?IT:FT,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function sD(e,t,n){return eD(e,t,n,this)}function cD(e){let t=[],n=e&&e.children||aD,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var lD=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),MC(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||FC(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&rT(e.composedPath())||(OD(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(OD(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(OD(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){OD(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();OD(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);OD(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=mD(i)&&this.hoveredLine?.lineElement===i.lineElement;pD(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),pD(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),mD(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(gD(i)&&p!=null){p(i);break}if(hD(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!mD(i))break;pD(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,OD(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),OD(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),OD(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();rT(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(nT(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=oD(tT());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);fD(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(yD(t));if(fD(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(fD(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(fD(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&rT(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=yD(e);if(t&&rT(n))return;let r=bD(e);return r==null?this.pathFromAnnotationSlot(e):yD(r)}pathFromAnnotationSlot(e){let t=SD(xD(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:yD(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=CD(t)?t:CD(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}FC(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,jC(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{MC(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!TD(this.renderedSelectedLinesState,n),i=!TD(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);_D(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=DD(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=DD(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:vD(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:vD(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ED(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ED(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function uD({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:dD({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function dD({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function fD(e){return e!=null&&`kind`in e&&e.kind===`line`}function pD(e){return e!=null&&`kind`in e&&e.kind===`token`}function mD(e){return fD(e)||pD(e)}function hD(e){return`type`in e&&e.type===`line-info`}function gD(e){return`kind`in e&&e.kind===`merge-conflict-action`}function _D(e){return e===`current`||e===`incoming`||e===`both`}function vD(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function yD(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function bD(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function xD(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function SD(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function CD(e){return e!=null&&typeof e.elementFromPoint==`function`}function wD(e,t){return e===t||FC(e??void 0,t??void 0)}function TD(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&wD(e?.range??null,t.range)}function ED(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function DD(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function OD(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var kD=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),MD(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?FD(t):ID(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:AD(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:jD(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&ND(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function AD(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function jD(e){return Math.max(Math.ceil(e),0)}function MD(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ND(e,{codeWidthChanged:!0,numberWidthChanged:!0}):PD(e))}function ND(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function PD(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function FD(e){e.codeElement.isConnected&&PD(e)}function ID(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var LD=new Map,RD=new Map,zD=new Map,BD=new Set;function VD(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!BD.has(t))return!1;return!0}function HD(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(BD.has(n.name))continue;let e=LD.get(n.name);e??(e=n,LD.set(n.name,e)),BD.add(e.name),t.loadLanguageSync(e.data)}}function UD(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var WD=Object.defineProperty,GD=Object.getOwnPropertyDescriptor,KD=Object.getOwnPropertyNames,qD=Object.prototype.hasOwnProperty,JD=(e,t)=>{let n={};for(var r in e)WD(n,r,{get:e[r],enumerable:!0});return t||WD(n,Symbol.toStringTag,{value:`Module`}),n},YD=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=KD(t),a=0,o=i.length,s;a<o;a++)s=i[a],!qD.call(e,s)&&s!==n&&WD(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=GD(t,s))||r.enumerable});return e},XD=(e,t,n)=>(YD(e,t,`default`),n&&YD(n,t,`default`)),ZD=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),QD=function(e){return`/`+e},$D={},G=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=QD(t,n),t=s(t),t in $D)return;$D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ZD,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},eO=[{id:`abap`,name:`ABAP`,import:(()=>G(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>G(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>G(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>G(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>G(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>G(()=>import(`./_8z_taKm3.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>G(()=>import(`./_ByJ8bIho.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>G(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>G(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>G(()=>import(`./_CpUOMlac.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>G(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>G(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>G(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>G(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>G(()=>import(`./_yvxe882E.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>G(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>G(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>G(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>G(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>G(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>G(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>G(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>G(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>G(()=>import(`./_iFGGC9pM2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>G(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>G(()=>import(`./_CCxovD8F2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>G(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>G(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>G(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>G(()=>import(`./_BHXWNTj72.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>G(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>G(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>G(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>G(()=>import(`./_DTfT-sFF2.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>G(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>G(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>G(()=>import(`./_CMGOcqMA2.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>G(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>G(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>G(()=>import(`./_JVRw7xKf.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>G(()=>import(`./_afjtTIwy.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>G(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>G(()=>import(`./_CqfjUWNC.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>G(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>G(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>G(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>G(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>G(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>G(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>G(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>G(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>G(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>G(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>G(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>G(()=>import(`./_DB4u0VFp.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>G(()=>import(`./_CYIktEVH.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>G(()=>import(`./_DVlxgdsm.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>G(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>G(()=>import(`./_7EfSt1VP.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>G(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>G(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>G(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>G(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>G(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>G(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>G(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>G(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>G(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>G(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>G(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>G(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>G(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>G(()=>import(`./_ByVz1pEI2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>G(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>G(()=>import(`./_Cp-Aarc52.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>G(()=>import(`./_doUtVqO32.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>G(()=>import(`./_DJ1rqVCG.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>G(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>G(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>G(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>G(()=>import(`./_CHLq34up.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>G(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>G(()=>import(`./_Km9UGEJN2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>G(()=>import(`./_DmYu9jHv.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>G(()=>import(`./_xYLJb0_42.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>G(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>G(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>G(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>G(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>G(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>G(()=>import(`./_Bg_ZrvlF.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>G(()=>import(`./_DHNkWyG72.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>G(()=>import(`./_DNtDpT7J2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>G(()=>import(`./_txg_BrbE2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>G(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>G(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>G(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>G(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>G(()=>import(`./_DWHvByuS.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>G(()=>import(`./_DVszDPmx.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>G(()=>import(`./_BkCe1Qp0.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>G(()=>import(`./_DI0WPTfJ.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>G(()=>import(`./_CwjXbHzo.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>G(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>G(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>G(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>G(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>G(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>G(()=>import(`./_DcATy5r-.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>G(()=>import(`./_DZxfPQXv.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>G(()=>import(`./_DWKZhwbB.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>G(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>G(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>G(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>G(()=>import(`./_BG98a-Bd.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>G(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>G(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>G(()=>import(`./_D6mnVZvL.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>G(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>G(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>G(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>G(()=>import(`./_599s_mPO.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>G(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>G(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>G(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>G(()=>import(`./_D2PHPuf-.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>G(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>G(()=>import(`./_C2awCEWl.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>G(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>G(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>G(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>G(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>G(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>G(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>G(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>G(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>G(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>G(()=>import(`./_B1jQI_MS.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>G(()=>import(`./_BIZVez4e2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>G(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>G(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>G(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>G(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>G(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>G(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>G(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>G(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>G(()=>import(`./_DNYpQ8c_2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>G(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>G(()=>import(`./_BEA0rtsf.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>G(()=>import(`./_CK7dNIXj2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>G(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>G(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>G(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>G(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>G(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>G(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>G(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>G(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>G(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>G(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>G(()=>import(`./_CwmqjsDb.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>G(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>G(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>G(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>G(()=>import(`./_BX-1MhYY.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>G(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>G(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>G(()=>import(`./_CQW9g4EM.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>G(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>G(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>G(()=>import(`./_Br-vX1Tu.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>G(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>G(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>G(()=>import(`./_Cz_1vtBu.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>G(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>G(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>G(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>G(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>G(()=>import(`./_C1v_RN4j.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>G(()=>import(`./_NVM5qbq7.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>G(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>G(()=>import(`./_B1j_sdSo.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>G(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>G(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>G(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>G(()=>import(`./_DPSelcsm.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>G(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>G(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>G(()=>import(`./_DwJU6EeU.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>G(()=>import(`./_BkYaxto4.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>G(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>G(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>G(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>G(()=>import(`./_DA2HAsmL.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>G(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>G(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>G(()=>import(`./_CiA4dPfT2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>G(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>G(()=>import(`./_CE1QtCTP.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>G(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>G(()=>import(`./_Djl1TRVn.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>G(()=>import(`./_zSSacvcn.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>G(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>G(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>G(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>G(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>G(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>G(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>G(()=>import(`./_CNdGjx_J2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>G(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>G(()=>import(`./_DdqCKkdW.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>G(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>G(()=>import(`./_DPt_dOB32.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>G(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>G(()=>import(`./_Q4XgVPG6.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>G(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>G(()=>import(`./_C1uLH64z2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>G(()=>import(`./_Ccm3rKVf.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>G(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>G(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>G(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>G(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>G(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>G(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>G(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>G(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>G(()=>import(`./_BF0cJ2cO2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>G(()=>import(`./_BTLEtyOE2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>G(()=>import(`./_Zlv_lPYo2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>G(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>G(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>G(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>G(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>G(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>G(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>G(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>G(()=>import(`./_CYvarg9W.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>G(()=>import(`./_DDFWuRVz2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>G(()=>import(`./_WrsJ1SVx.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>G(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>G(()=>import(`./_CMLA9XwU2.js`),[]))}],tO=Object.fromEntries(eO.map(e=>[e.id,e.import])),nO=Object.fromEntries(eO.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),rO={...tO,...nO},iO=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>G(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>G(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>G(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>G(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>G(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>G(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>G(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>G(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>G(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>G(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>G(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>G(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>G(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>G(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>G(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>G(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>G(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>G(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>G(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>G(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>G(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>G(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>G(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>G(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>G(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>G(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>G(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>G(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>G(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>G(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>G(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>G(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>G(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>G(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>G(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>G(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>G(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>G(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>G(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>G(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>G(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>G(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>G(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>G(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>G(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>G(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>G(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>G(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>G(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>G(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>G(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>G(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>G(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>G(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>G(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>G(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>G(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>G(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>G(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>G(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>G(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>G(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>G(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>G(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>G(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),aO=t({createOnigurumaEngine:()=>NO,getDefaultWasmLoader:()=>MO,loadWasm:()=>EO,setDefaultWasmLoader:()=>jO}),oO=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sO(){return 2147483648}function cO(){return typeof performance<`u`?performance.now():Date.now()}var lO=(e,t)=>e+(t-e%t)%t;async function uO(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=sO();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,lO(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:cO,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var dO=Object.defineProperty,fO=(e,t,n)=>t in e?dO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pO=(e,t,n)=>fO(e,typeof t==`symbol`?t:t+``,n),mO=null;function hO(e){throw new oO(e.UTF8ToString(e.getLastOnigError()))}var gO=class e{constructor(t){pO(this,`utf16Length`),pO(this,`utf8Length`),pO(this,`utf16Value`),pO(this,`utf8Value`),pO(this,`utf16OffsetToUtf8`),pO(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},_O=class e{constructor(t){if(pO(this,`id`,++e.LAST_ID),pO(this,`_onigBinding`),pO(this,`content`),pO(this,`utf16Length`),pO(this,`utf8Length`),pO(this,`utf16OffsetToUtf8`),pO(this,`utf8OffsetToUtf16`),pO(this,`ptr`),!mO)throw new oO(`Must invoke loadWasm first.`);this._onigBinding=mO,this.content=t;let n=new gO(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=mO.omalloc(1e4),e._sharedPtrInUse=!0,mO.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(mO)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};pO(_O,`LAST_ID`,0),pO(_O,`_sharedPtr`,0),pO(_O,`_sharedPtrInUse`,!1);var vO=_O,yO=class{constructor(e){if(pO(this,`_onigBinding`),pO(this,`_ptr`),!mO)throw new oO(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new gO(e[r]);t[r]=i.createString(mO),n[r]=i.utf8Length}let r=mO.omalloc(4*e.length);mO.HEAPU32.set(t,r/4);let i=mO.omalloc(4*e.length);mO.HEAPU32.set(n,i/4);let a=mO.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)mO.ofree(t[n]);mO.ofree(i),mO.ofree(r),a===0&&hO(mO),this._onigBinding=mO,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new vO(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function bO(e){return typeof e.instantiator==`function`}function xO(e){return typeof e.default==`function`}function SO(e){return e.data!==void 0}function CO(e){return typeof Response<`u`&&e instanceof Response}function wO(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var TO;function EO(e){if(TO)return TO;async function t(){mO=await uO(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),bO(n)?n=await n.instantiator(t):xO(n)?n=await n.default(t):(SO(n)&&(n=n.data),CO(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await OO(n)(t):await kO(n)(t):wO(n)||n instanceof WebAssembly.Module?n=await DO(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await DO(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return TO=t(),TO}function DO(e){return t=>WebAssembly.instantiate(e,t)}function OO(e){return t=>WebAssembly.instantiateStreaming(e,t)}function kO(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var AO;function jO(e){AO=e}function MO(){return AO}async function NO(e){return e&&await EO(e),{createScanner(e){return new yO(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new vO(e)}}}var PO=JD({});XD(PO,aO);var FO=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function IO(e){return LO(e)}function LO(e){return Array.isArray(e)?RO(e):e instanceof RegExp?e:typeof e==`object`?zO(e):e}function RO(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=LO(e[n]);return t}function zO(e){let t={};for(let n in e)t[n]=LO(e[n]);return t}function BO(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function VO(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?VO(e.substring(0,e.length-1)):e.substr(~t+1)}var HO=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,UO=class{static hasCaptures(e){return e!==null&&(HO.lastIndex=0,HO.test(e))}static replaceCaptures(e,t,n){return e.replace(HO,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function WO(e,t){return e<t?-1:+(e>t)}function GO(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=WO(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function KO(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function qO(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var JO=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},YO=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ek(e),t)}static createFromParsedTheme(e,t){return rk(e,t)}_cachedMatchRoot=new JO(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ZO(e.parent,t.parentScopes));return n?new $O(n.fontStyle,n.foreground,n.background):null}},XO=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ZO(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!QO(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function QO(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var $O=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ek(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&KO(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&KO(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new tk(l,u,e,o,s,c)}}return n}var tk=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},nk=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(nk||{});function rk(e,t){e.sort((e,t)=>{let n=WO(e.scope,t.scope);return n!==0||(n=GO(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ik(t),o=new $O(n,a.getId(r),a.getId(i)),s=new sk(new ok(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new YO(a,o,s)}var ik=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ak=Object.freeze([]),ok=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ak,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},sk=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),ok.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(GO(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ok(e,t,n,r,i))}},ck=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=uk(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function lk(e){return e}function uk(e){return e}function dk(e,t){let n=[],r=pk(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(fk(i)){let e=[];do e.push(i),i=r.next();while(fk(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function fk(e){return!!e&&!!e.match(/[\w\.:]+/)}function pk(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function mk(e){typeof e.dispose==`function`&&e.dispose()}var hk=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},gk=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},_k=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},vk=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new hk(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new _k;for(let n of e)yk(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof hk){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function yk(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof hk?xk({baseGrammar:a,selfGrammar:i},r):bk(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new hk(e))}function bk(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Sk([r],t,n)}}function xk(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Sk(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Sk(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Sk(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?BO({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Sk(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ok(i);switch(a.kind){case 0:xk({...t,selfGrammar:t.baseGrammar},n);break;case 1:xk(t,n);break;case 2:bk(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?bk(a.ruleName,i,n):xk(i,n)}else a.kind===4?n.add(new gk(a.scopeName,a.ruleName)):n.add(new hk(a.scopeName))}}}var Ck=class{kind=0},wk=class{kind=1},Tk=class{constructor(e){this.ruleName=e}kind=2},Ek=class{constructor(e){this.scopeName=e}kind=3},Dk=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ok(e){if(e===`$base`)return new Ck;if(e===`$self`)return new wk;let t=e.indexOf(`#`);return t===-1?new Ek(e):t===0?new Tk(e.substring(1)):new Dk(e.substring(0,t),e.substring(t+1))}var kk=/\\(\d+)/,Ak=/\\(\d+)/g,Ate=-1,jk=-2;function Mk(e){return e}function Nk(e){return e}var Pk=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=UO.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=UO.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${VO(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:UO.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:UO.replaceCaptures(this._contentName,e,t)}},jte=class extends Pk{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Mte=class extends Pk{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new zk(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fk=class extends Pk{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ik=class extends Pk{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new zk(i,this.id),this.beginCaptures=a,this._end=new zk(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Lk=class extends Pk{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new zk(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new zk(o,jk),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Bk,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Rk=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new jte(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mte(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=BO({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Fk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Lk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ik(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ok(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Fk||e instanceof Ik||e instanceof Lk)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},zk=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&kk.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ak.lastIndex=0,this.source.replace(Ak,(e,t)=>qO(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Bk=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Vk(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Vk(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Vk=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
37
37
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Hk=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Nte=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Hk(e,8),this._embeddedLanguagesMatcher=new Pte(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Hk(0,0);_getBasicScopeAttributes=new JO(e=>new Hk(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Pte=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>qO(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Uk=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Wk(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Fte(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Uk(i,!0);f()}return new Uk(i,!1);function f(){let o=Ite(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ate){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Kk(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Ik){let r=o;Kk(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Lk){let r=o;Kk(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Kk(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Fte(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Lk&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=zte(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==jk){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Kk(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ite(e,t,n,r,i,a){let o=Lte(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Rte(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Lte(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Gk(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Rte(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Gk(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Gk(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function zte(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Kk(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Wk(e,p,n&&d.start===0,d.start,f,i,!1,0),mk(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Bte(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Bte=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Vte(e,t,n,r,i,a,o,s){return new Ute(e,t,n,r,i,a,o,s)}function qk(e,t,n,r,i){let a=dk(t,Jk),o=Rk.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Jk(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Hte(t[r],e))return n=r+1,!0;return!1})}function Hte(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Ute=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Nte(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Yk(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=dk(e,Jk);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)qk(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&qk(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Mk(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Nk(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Yk(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Rk.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Zk.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=ck.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Xk.createRootAndLookUpScopeName(a,r,this):Xk.createRoot(`unknown`,r),t=new Zk(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
38
38
|
`;let a=this.createOnigString(e),o=a.content.length,s=new Gte(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Wk(this,a,i,0,t,s,!0,r);return mk(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Yk(e,t){return e=IO(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Xk=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=XO.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new XO(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new XO(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),ck.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Zk=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Xk.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Nk(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Xk.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Mk(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Xk.fromExtension(r,n.contentNameScopesList))}},Wte=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):dk(e,Jk).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>dk(e,Jk).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Gte=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=ck.set(n,0,lk(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=ck.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Kte=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Vte(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},qte=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Kte(YO.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(YO.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Wte(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new vk(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Qk=Zk.NULL;function $k(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function eA(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Jte(e){return Array.isArray(e)?e:[e]}async function tA(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function nA(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function rA(e){return e===`ansi`||nA(e)}function iA(e){return e===`none`}function aA(e){return iA(e)}var Yte=/(\r?\n)/g;function oA(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Yte),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var sA={light:`#333333`,dark:`#bbbbbb`},cA={light:`#fffffe`,dark:`#1e1e1e`},lA=`__shiki_resolved`;function uA(e){if(e?.[lA])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?sA.light:sA.dark,n||=t.type===`light`?cA.light:cA.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,lA,{enumerable:!1,writable:!1,value:!0}),t}async function dA(e){return[...new Set((await Promise.all(e.filter(e=>!rA(e)).map(async e=>await tA(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function fA(e){return(await Promise.all(e.map(async e=>aA(e)?null:uA(await tA(e))))).filter(e=>!!e)}function pA(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new FO(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Xte=class extends qte{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=uA(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=YO.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=pA(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new FO(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Zte=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},mA=0;function Qte(e){mA+=1,e.warnings!==!1&&mA>=10&&mA%10==0&&console.warn(`[Shiki] ${mA} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new FO("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(uA),i=new Xte(new Zte(e.engine,n),r,n,e.langAlias),a;function o(t){return pA(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new FO(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new FO(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await dA(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await fA(e))}function g(){if(t)throw new FO(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--mA)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function $te(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([fA(e.themes||[]),dA(e.langs||[]),e.engine]);return Qte({...e,themes:t,langs:n,engine:r})}var hA=new WeakMap;function gA(e,t){hA.set(e,t)}function _A(e){return hA.get(e)}var vA=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Jte(n).map(e=>[e,Qk])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return ene(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function ene(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function tne(e,t){if(!(e instanceof vA))throw new FO(`Invalid grammar state`);return e.getInternalStack(t)}var nne=/,/,rne=/ /;function yA(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(nA(e.resolveLangAlias(n.lang||`text`))||iA(r))return oA(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new FO(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new FO(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return ane(t,o,i,a,n)}function ine(...e){if(e.length===2)return _A(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(nA(i)||iA(a))throw new FO(`Plain language does not have grammar state`);if(i===`ansi`)throw new FO(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new vA(bA(n,c,o,s,r).stateStack,c.name,o.name)}function ane(e,t,n,r,i){let a=bA(e,t,n,r,i),o=new vA(a.stateStack,t.name,n.name);return gA(a.tokens,o),a.tokens}function bA(e,t,n,r,i){let a=$k(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=oA(e),u=i.grammarState?tne(i.grammarState,n.name)??Qk:i.grammarContextCode==null?Qk:bA(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=eA(r[ck.getForeground(s)],a),u=ck.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=ck.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(nne).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(rne))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?one(t.scopes):sne(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function one(e){return e.map(e=>({scopeName:e}))}function sne(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:lne(e,i,t.slice(0,r))}}return n}function xA(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function cne(e,t,n){if(!xA(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)xA(e[r],n[i])&&--r,--i;return r===-1}function lne(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(cne(e,t,n)){r.push(a);break}return r}function SA(e,t,n,r=yA){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:_A(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=une(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new vA(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&gA(s,c),s}function une(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var CA=/\s+/g;function wA(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(CA)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(CA);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var dne=/:?lang=["']([^"']+)["']/g,fne=/(?:```|~~~)([\w-]+)/g,pne=/\\begin\{([\w-]+)\}/g,mne=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,hne=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function gne(e){let t=oA(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function _ne(e,t,n){let r=new Set;for(let t of e.matchAll(dne)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(fne)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(pne)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(mne)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(hne.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var vne=[`color`,`background-color`];function yne(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function bne(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function xne(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=bne(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return yne(e,a)})):e}function Sne(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>TA(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&vne.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new FO('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function TA(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&nk.Italic&&(t[`font-style`]=`italic`),e.fontStyle&nk.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&nk.Underline&&n.push(`underline`),e.fontStyle&nk.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function EA(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Cne(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=gne(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new FO(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new FO(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new FO(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));wne(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return xne(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new FO(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=DA(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new FO(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new FO(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&wA(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function wne(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new FO(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new FO(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function DA(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(DA).join(``):``}var Tne=[Cne()];function OA(e){let t=Ene(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Tne]}function Ene(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var kA=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],AA={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Dne(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function jA(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function One(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)AA[r]&&t.push({type:`setDecoration`,value:AA[r]});else if(r<=29){let e=AA[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:kA[r-30]}});else if(r===38){let n=jA(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:kA[r-40]}});else if(r===48){let n=jA(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:kA[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:kA[r-100+8]}})}}return t}function kne(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Dne(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=One(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Ane={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function jne(e=Ane){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<kA.length;e++)r.push(t(kA[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Mne=/#([0-9a-f]{3,8})/i,Nne=/var\((--[\w-]+-ansi-[\w-]+)\)/,Pne={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Fne(e,t,n){let r=$k(e,n),i=oA(t),a=jne(Object.fromEntries(kA.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Pne[t]]}))),o=kne();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=eA(i,r),o=eA(o,r),n.decorations.has(`dim`)&&(i=Ine(i));let s=nk.None;return n.decorations.has(`bold`)&&(s|=nk.Bold),n.decorations.has(`italic`)&&(s|=nk.Italic),n.decorations.has(`underline`)&&(s|=nk.Underline),n.decorations.has(`strikethrough`)&&(s|=nk.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Ine(e){let t=e.match(Mne);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Nne);return n?`var(${n[1]}-dim)`:e}function MA(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!nA(r)&&!iA(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Fne(r,t,n)}return yA(e,t,n)}function NA(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new FO("`themes` option must not be empty");let p=SA(e,t,n,MA);if(c=_A(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new FO(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Sne(e,h,u,l,d))),c&&gA(a,c);let g=f.map(e=>$k(e.theme,n));i=PA(f,m,g,u,l,`fg`,d),r=PA(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=$k(n.theme,n);a=MA(e,t,n);let l=e.getTheme(n.theme);r=eA(l.bg,s),i=eA(l.fg,s),o=l.name,c=_A(a)}else throw new FO("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function PA(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=eA(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new FO('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${eA(t[r][a],n[r])||`inherit`}, ${eA(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var FA=/^\s+$/,Lne=/^(\s*)(.*?)(\s*)$/;function IA(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>IA(e,t,n),codeToTokens:(t,n)=>NA(e,t,n)}){let i=t;for(let e of OA(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=NA(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=zne(a):d===`never`&&(a=Bne(a)),f&&(a=Vne(a));let p={...r,get source(){return i}};for(let e of OA(n))a=e.tokens?.call(p,a)||a;return Rne(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Rne(e,t,n,r=_A(e)){let i=OA(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:wA,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
39
39
|
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=EA(a.htmlStyle||TA(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&gA(m,r),m}function zne(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&nk.Underline||i.fontStyle&nk.Strikethrough));o&&FA.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Bne(e){return e.map(e=>e.flatMap(e=>{if(FA.test(e.content))return e;let t=e.content.match(Lne);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Vne(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=EA(e.htmlStyle||TA(e)),i=EA(n.htmlStyle||TA(n)),a=e.fontStyle&&(e.fontStyle&nk.Underline||e.fontStyle&nk.Strikethrough),o=n.fontStyle&&(n.fontStyle&nk.Underline||n.fontStyle&nk.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Hne=oD;function Une(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>IA(e,t,n),codeToTokens:(t,n)=>NA(e,t,n)},i=Hne(IA(e,t,n,r));for(let e of OA(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Wne(e){let t=await $te(e);return{getLastGrammarState:(...e)=>ine(t,...e),codeToTokensBase:(e,n)=>MA(t,e,n),codeToTokensWithThemes:(e,n)=>SA(t,e,n),codeToTokens:(e,n)=>NA(t,e,n),codeToHast:(e,n)=>IA(t,e,n),codeToHtml:(e,n)=>Une(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Gne(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,rA(n))return[];let r=t[n];if(!r)throw new FO(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(aA(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new FO(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Wne({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Kne(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function qne(e,t){let n=Kne(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var LA=Gne({langs:rO,themes:iO,engine:()=>(0,PO.createOnigurumaEngine)(G(()=>import(`./_BnjxR4X6.js`),[]))}),{codeToHtml:Jne,codeToHast:Yne,codeToTokens:Xne,codeToTokensBase:Zne,codeToTokensWithThemes:Qne,getSingletonHighlighter:$ne,getLastGrammarState:ere}=qne(LA,{guessEmbeddedLanguages:_ne}),RA=4294967295,tre=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:RA,end:RA,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function zA(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function nre(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var BA=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),VA=String.raw;function HA(e,t){if(e==null)throw Error(t??`Value expected`);return e}var UA=VA`\[\^?`,WA=`c.? | C(?:-.?)?|${VA`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${VA`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${VA`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${VA`o\{[^\}]*\}?`}|${VA`\d{1,3}`}`,GA=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,KA=new RegExp(VA`
|
|
@@ -1529,7 +1529,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Pj(e),e])),DM=new Map([[`s`,fM(383)],[fM(383
|
|
|
1529
1529
|
`;if(t.endsWith(`
|
|
1530
1530
|
`))return`
|
|
1531
1531
|
`;if(t.endsWith(`\r`))return`\r`}return`
|
|
1532
|
-
`}function IL(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function LL(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function RL(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function zL(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function BL(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function VL({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function HL(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:NF(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function UL(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var WL=-1,GL=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++WL}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:bC},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new kD,this.scrollSyncManager=new ZF,this.interactionManager=new lD(`diff`,uD(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return HL(e)}createHunksRenderer(e){return new xL(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=WC(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(uD(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!PC(this.appliedThemeCSS.theme,this.options.theme??bC)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){MC(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=VL(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),YL(this.pre,qL({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||XL(this.headerElement,JL({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),AF(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Kw(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!UL(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(HF(`merge`,e,t),this.setHydratedState(t),await BL(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=VL(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!KL(u,this.deletionFile)||!KL(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&xP(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Kw(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(rL(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:ee=!1,disableFileHeader:te=!1}=this.options;if(te&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,OC);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||aI(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return hI({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=tL(e,this.hunksRenderer.getExpandedHunksMap(),t);return rL(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(nL(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return pI({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return mI({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=cI(o);if(e<s){let c=lI({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=fI({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=cI(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){jC(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||yL(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!zL(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${NP(r)}`,a=this.annotationCache.get(i);if(a==null||!RL(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:gF(NP(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=_F();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:MF(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):MF(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=fF;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??oD(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,yC,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,gC,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,_C,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,vC,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=vF(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=TF(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??bC,s=typeof o==`string`?o:{...o},c=xF(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=FF({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:EF(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=DF(this.themeCSSStyle.textContent??``,xF(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&RF()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?PF(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ZL(t[0]),a=ZL(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=oD(i),r.content.innerHTML=oD(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=kF({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=kF({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=kF({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=ZL(r?.[0]),a=ZL(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=ZL(n?.[0]),i=ZL(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=oD(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?PF(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ZL(t[0]),i=ZL(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};pF(u,this.appliedPreAttributes)||(jF(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function KL(e,t){return e==null||t==null?e==null&&t==null:Jw(e,t)}function qL({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function JL({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function YL(e,t,n=!1){return!n&&e==null&&t}function XL(e,t,n=!1){return e==null&&t&&!n}function ZL(e){if(e!=null&&e.type===`element`)return e.children??[]}function QL(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`.diff-main`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var $L={diffFile:`_dk`},eR=`<div></div>`,tR=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,nR=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,rR=new CSSStyleSheet;rR.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+sS);var iR=it(`e0`,0);function aR(e){B(e.a,$L.diffFile)}var oR=N(11,L(`e1`,e=>Tt(e,{file:e.d,comments:e.e,draft:e.f,onMount:function(){let t=t=>{if(!t)return;let n=document.createElement(`div`);n.style.cssText=tR;let r=document.createElement(`p`);r.textContent=t.text,r.style.cssText=`margin:0;white-space:pre-wrap;`;let i=document.createElement(`button`);return i.textContent=`remove`,i.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;align-self:flex-start;font-size:.75rem;opacity:.7;`,i.onclick=()=>e.g?.(t.id),n.append(r,i),n},n=()=>{let t=document.createElement(`div`);t.style.cssText=tR;let n=document.createElement(`textarea`);n.placeholder=`Leave a comment…`,n.rows=3,n.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(lr()?`font-size:16px;`:``);let r=document.createElement(`button`);r.textContent=`Comment`,r.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`;let i=document.createElement(`button`);i.textContent=`Cancel`,i.style.cssText=nR,r.onclick=()=>{n.value.trim()&&e.h?.(n.value)},i.onclick=()=>e.i?.(),n.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&r.onclick(),e.key===`Escape`&&i.onclick()};let a=document.createElement(`div`);a.style.cssText=`display:flex;gap:.4rem;`,a.append(r,i),t.append(n,a);let o=()=>n.scrollIntoView({block:`center`,behavior:`smooth`});return n.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,o),n.addEventListener(`blur`,()=>e.removeEventListener(`resize`,o),{once:!0}))}),setTimeout(()=>{n.scrollIntoView({block:`center`,behavior:`instant`}),n.focus()},0),t},r=new Map,i,a={draft:!0},o,s=new GL({diffStyle:ur()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.j?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let r=e.metadata||{};return r.draft?o??=n():t(r.comment)}}),c=()=>{let t=[],n=new Map;for(let i of e.e||[]){let e=r.get(i.id)||{comment:i};n.set(i.id,e),t.push({side:i.side,lineNumber:i.line_end,metadata:e})}return r=n,e.f&&(i!==e.f&&(i=e.f,a={draft:!0},o=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:a})),t},l=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(rR)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,rR])},u=()=>{if(e.d.old==null&&e.d.new==null){e.k?.(`could not read ${e.d.path}`);return}let t=s.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:c()});Promise.resolve(t).then(()=>{l(),mS(e.a)}).catch(t=>e.k?.(`diff render: ${t}`))};u();let d=new AbortController;return lr()&&QL(iR(e),d.signal),{instance:s,render:u,dragAbort:d,unregSearch:pS(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f}},onUpdate:function(){(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),7),sR=M(3,oR),cR=M(4,oR),lR=M(5,oR),uR=M(6,oR),dR=M(7,oR),fR=M(8,oR),pR=M(9,oR),mR=M(10,oR),hR={iconBtn:`_cT _cP`,spinning:`_cU _cQ`,sheetBackdrop:`_cV`,fileSheet:`_cW`,sheetHead:`_cX`,sheetList:`_cY`,sheetFile:`_cZ`,seen:`_c0`,sheetPath:`_c1`,status:`_c2`},gR=`<!><!><!>`,_R=O(6,`<span class=dim>✓</span>`),vR=N(10,e=>{B(e.a,[hR.sheetFile,`mono`,{[hR.seen]:e._._.p.has(e.j)}]),_R(e,+!e._._.p.has(e.j))}),yR=I(20,vR,e=>e._._),bR=L(`d0`,e=>A(e.a,`click`,function(){PR(e._._,!1),e._._.m(e.j)})),xR=e=>{yR(e),wR(e),B(e.d,hR.sheetPath),bR(e)},SR=O(5,`<span>💬</span>`),CR=N(11,e=>SR(e,+!e._._.r.has(e.j))),wR=I(22,CR,e=>e._._),TR=M(9,e=>{z(e.d,`title`,e.j),V(e.e,e.j),vR(e),CR(e)}),ER=(e,t)=>{B(e.b,[hR.status,t]),V(e.c,t)},DR=k(6,`<button type=button><span> </span><span><bdi> </bdi></span><!><!></button>`,` D D l E m%b%`,xR,(e,t)=>{TR(e,t[0]?.key),ER(e,t[0]?.status)}),OR=P(0,0,e=>DR(e,[e._.j,`key`])),kR=L(`d1`,e=>{A(e.a,`click`,function(){PR(e._,!1)}),A(e.f,`click`,function(){PR(e._,!1)})}),AR=e=>{OR._(e),jR._(e),MR._(e),B(e.a,hR.sheetBackdrop),B(e.b,hR.fileSheet),B(e.c,hR.sheetHead),B(e.f,hR.iconBtn),B(e.g,hR.sheetList),kR(e)},jR=P(0,0,e=>V(e.d,e._.q)),MR=P(0,0,e=>V(e.e,e._.s)),NR=O(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span class=dim><!>/<!> viewed</span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D DbD%c%l l `,AR),PR=Ue(13,e=>NR(e,+!e.n)),FR=N(5,e=>PR(e,e.d,e.e)),IR=M(3,FR),LR=M(4,FR),RR=F(yR),zR=M(15,e=>{BR(e,e.p.size),RR(e)}),BR=M(16,jR),VR=(e,t)=>zR(e,t||new Set),HR=M(17,F(wR)),UR=(e,t)=>HR(e,t||new Set),WR=M(18,MR),GR=N(11,e=>WR(e,e.i??e.k)),KR=M(8,GR),qR=M(10,GR),JR=M(9,e=>{qR(e,e.j?.length),OR(e)}),YR=M(12),XR=((e,t,n,r,i,a)=>`<div class=diff-view>${e}<div><div><!><span><!> file<!> changed <!><!></span><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><button title="Find in the review (⌘/Ctrl+F)">${r}<span>Find</span></button><label title="Include uncommitted and untracked files in the review. Off by default — the review is commit-to-commit."><input type=checkbox> include uncommitted</label>${i}</div><!><div class=diff-main><!><!><!><!><!><!><!></div></div>${a}</div>`)(Cy,eg,Cs,Dx,Nx,gR),ZR=((e,t,n,r,i,a)=>`D/${e}& D D%b D%c%c%b%l%l D D/${t}&l D/${n}&l Db%l D/${r}& l D l/${i}&l%b D%b%b%b%b%b%b%m/${a}&l`)(` b`,tg,ws,Ox,Px,`b%c`),QR=e=>B(e.a,xy.diffPad),$R=e=>B(e.a,xy.diffPad),ez=e=>B(e.a,xy.diffPad),tz=P(5,0,e=>V(e.a,e._.x)),nz=tz,rz=N(2,e=>z(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),iz=I(34,e=>{V(e.b,e._._._.q),rz(e)},e=>e._._._),az=e=>{iz(e),oz(e)},oz=I(35,rz,e=>e._._._),sz=I(26,e=>V(e.b,e._._._.i),e=>e._._._),cz=e=>{sz(e),lz(e),dz(e),fz(e),pz(e),mz(e),hz(e)},lz=I(27,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),uz=N(3,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),dz=I(28,e=>{V(e.c,e._._._.k),uz(e)},e=>e._._._),fz=I(29,uz,e=>e._._._),pz=I(30,uz,e=>e._._._),mz=I(31,uz,e=>e._._._),hz=I(32,uz,e=>e._._._),gz=N(2,e=>z(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),_z=I(34,e=>{V(e.b,e._._._.q),gz(e)},e=>e._._._),vz=e=>{_z(e),yz(e)},yz=I(35,gz,e=>e._._._),bz=I(33,e=>V(e.a,e._._._.p),e=>e._._._),xz=bz,Sz=I(26,e=>V(e.b,e._._._.i),e=>e._._._),Cz=L(`i37`,e=>A(e.a,`click`,function(e){e.stopPropagation()})),wz=e=>{Sz(e),Tz(e),Dz(e),Oz(e),kz(e),Az(e),jz(e),Cz(e)},Tz=I(27,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),Ez=N(3,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),Dz=I(28,e=>{V(e.c,e._._._.k),Ez(e)},e=>e._._._),Oz=I(29,Ez,e=>e._._._),kz=I(30,Ez,e=>e._._._),Az=I(31,Ez,e=>e._._._),jz=I(32,Ez,e=>e._._._),Mz=N(10,e=>z(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),Nz=M(7,Mz),Pz=M(8,e=>{V(e.c,gy(e.i)),Mz(e)}),Fz=M(9,e=>{V(e.d,gy(e.j)),Mz(e)}),Iz=(e,t)=>V(e.b,t>0?` · `:``),Lz=(e,t)=>{Nz(e,t[0]?.pr?.headRefName),Fz(e,t[0]?.pr?.headRefOid),Pz(e,t[0]?.head),Iz(e,t[1])},Rz=(e,t)=>V(e.a,t>0?` · `:``),zz=(e,t)=>V(e.b,t),Bz=(e,t)=>V(e.c,t),Vz=k(0,`<!><!> #<!>`,`%b%c%`,0,(e,t)=>{zz(e,t[0]?.worktree),Bz(e,t[0]?.pr?.number),Rz(e,t[1])}),Hz=k(1,`<span><!><!> → <!></span>`,` D%b%c%`,0,Lz),Uz=I(142,e=>{Vz(e,[e._._.c8,`id`]),Hz(e,[e._._.c8,`id`])},e=>e._._),Wz=ut(`i35`,`<span class=dim><!> — this view has a newer tip than the PR page.</span><span></span>`,`D%l `,e=>{Uz(e),B(e.b,[`mono`,xy.toastMeta])}),Gz=O(6,`<span class=chip>local <!></span>`,` Db%`,az),Kz=N(7,e=>Gz(e,+!e._._._.c7.has(e._._.d))),qz=I(141,Kz,e=>e._._._),Jz=e=>{qz(e),Yz(e),$z(e),eB(e),nB(e),rB(e),iB(e),B(e.a,xy.repoMeta)},Yz=I(23,Kz,e=>e._._),Xz=O(1,`<a class="chip pr" target=_blank rel=noopener>#<!></a><span class=dim> </span>`,` Db%lD `,cz),Zz=N(10,e=>z(e.c,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),Qz=N(8,e=>V(e.d,e._._.g?e._._.g.headRefName:e._._.q)),$z=I(24,e=>{Xz(e,+!e._._.g),Zz(e),Qz(e)},e=>e._._),eB=I(30,Zz,e=>e._._),tB=N(9,e=>z(e.e,`title`,`${e._._.n} ${e._._.o}`)),nB=I(31,e=>{V(e.f,e._._.n),tB(e)},e=>e._._),rB=I(32,tB,e=>e._._),iB=I(34,e=>{Zz(e),Qz(e)},e=>e._._),aB=P(30,0,e=>V(e.b,e._.bm.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),oB=e=>{aB._(e),B(e.a,xy.centerPad)},sB=I(133,L(`i39`,e=>Tt(e,{onMount:function(){e._._._._._._.b9(e.a,()=>{PV(e._,!0)})}})),e=>e._._._._._._),cB=e=>{sB(e),B(e.a,xy.diffWait)},lB=N(10,e=>V(e.c,e._._._.b3.has(e._._.d)?`▸`:`▾`)),uB=I(132,lB,e=>e._._._),dB=L(`i38`,e=>A(e.a,`click`,function(){let t=new Set(e._._._.b3);t.delete(e._._.d)||t.add(e._._.d),wW(e._._._,t)})),fB=e=>{uB(e),hB(e),gB(e),bB(e),xB(e),SB(e),wB(e),TB(e),EB(e),B(e.a,xy.repoSep),B(e.b,xy.treeChev),dB(e)},pB=O(9,`<span class=chip>local <!></span>`,` Db%`,vz),mB=N(11,e=>pB(e,+!e._._._.c7.has(e._._.d))),hB=I(141,mB,e=>e._._._),gB=I(23,e=>{lB(e),mB(e)},e=>e._._),_B=O(4,`<a class="chip pr" target=_blank rel=noopener>#<!></a><span class=dim> </span>`,` Db%lD `,wz,`<span class=dim> </span>`,`D `,xz),vB=N(14,e=>z(e.f,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),yB=N(12,e=>V(e.g,e._._.g?e._._.g.headRefName:e._._.q)),bB=I(24,e=>{_B(e,+!e._._.g),vB(e),yB(e)},e=>e._._),xB=I(25,e=>V(e.d,e._._.h),e=>e._._),SB=I(30,vB,e=>e._._),CB=N(13,e=>z(e.h,`title`,`${e._._.n} ${e._._.o}`)),wB=I(31,e=>{V(e.i,e._._.n),CB(e)},e=>e._._),TB=I(32,CB,e=>e._._),EB=I(34,e=>{vB(e),yB(e)},e=>e._._),DB=P(23,0,e=>DS(e.a,e._.au)),OB=e=>{DB._(e),kB._(e),AB._(e),jB._(e),$S(e.a),OS(e.a,sG(e)),RS(e.a),zS(e.a),HS(e.a)},kB=P(23,0,e=>iC(e.a,e._.av)),AB=P(23,0,e=>tC(e.a,e._.bs)),jB=P(23,0,e=>US(e.a,cG(e))),MB=I(127,e=>V(e.e,e._._.ar?`, plus uncommitted`:``),e=>e._._),NB=e=>{MB(e),PB(e),FB(e),IB(e),LB(e)},PB=I(11,e=>V(e.a,gy(e._.h))),FB=I(12,e=>V(e.b,e._.i)),IB=I(13,e=>V(e.c,gy(e._.j))),LB=I(14,e=>V(e.d,e._.k)),RB=ut(`i36`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,NB),zB=e=>{Vr(e.a),Gr(e.a,RB(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},BB=N(6,e=>Ur(e.a,`${e.d} #${e.f}`)),VB=M(3,BB),HB=M(5,BB),UB=(e,t)=>{VB(e,t[0]?.worktree),HB(e,t[0]?.pr?.number),WB(e,t[0]?.pr?.headRefName),GB(e,t[0]?.head),KB(e,t[0]?.localHead),qB(e,t[0]?.branch)},WB=M(8,F(FB)),GB=M(7,F(PB)),KB=M(9,F(IB)),qB=M(10,F(LB)),JB=I(127,e=>V(e.b,e._._.ar?` — showing uncommitted changes only`:``),e=>e._._),YB=e=>{JB(e),XB(e)},XB=I(7,e=>V(e.a,e._.g)),ZB=ut(`i32`,`already in <!><!>.`,`b%b%`,YB),QB=e=>{Vr(e.a),Gr(e.a,ZB(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},$B=N(5,e=>Ur(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),eV=M(3,$B),tV=M(4,$B),nV=(e,t)=>{eV(e,t[0]?.pr),tV(e,t[0]?.worktree),rV(e,t[0]?.base)},rV=M(6,F(XB)),iV=I(127,e=>V(e.b,e._._.ar?` — showing uncommitted changes only`:``),e=>e._._),aV=e=>{iV(e),oV(e)},oV=I(5,e=>V(e.a,e._.e)),sV=ut(`i31`,`<!><!>.`,`%b%`,aV),cV=e=>{Vr(e.a),Gr(e.a,sV(e)),Nr(e.a,`warn`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},lV=(e,t)=>Ur(e.a,`${t}: base not found`),uV=(e,t)=>{lV(e,t[0]?.worktree),dV(e,t[0]?.base)},dV=M(4,F(oV)),fV=N(2,e=>V(e.b,e._.ay.trim()?`No matches in diffs.`:`No files match "${e._.aq}".`)),pV=P(30,1,fV),mV=e=>{pV._(e),hV._(e),B(e.a,xy.centerPad)},hV=P(30,1,fV),gV=I(125,e=>{z(e.a,`disabled`,e._._.ap),V(e.b,e._._.ap?`Reloading…`:`Reload`)},e=>e._._),_V=L(`i33`,e=>A(e.a,`click`,function(){e._._.bi()})),vV=ut(`i34`,`<button class=btn> </button>`,` D `,e=>{gV(e),_V(e)}),yV=P(28,0,e=>Yr(e.a,lG(e))),bV=e=>{yV._(e),Vr(e.a),Jr(e.a,an({content:vV(e)})),Gr(e.a,Wz(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Ur(e.a,`GitHub is behind`),Rr(e.a),Br(e.a,{})},xV=I(124,e=>V(e.a,e._._.ao),e=>e._._),SV=ut(`i30`,` `,` `,xV),CV=e=>{Vr(e.a),Gr(e.a,SV(e)),Yr(e.a,uG(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},wV=N(1,e=>lR(e.a,e._._._._._._.am&&e._._._._._._.am?.key===e._._.l?e._._._._._._.am:null)),TV=I(123,wV,e=>e._._._._._._),EV=e=>{TV(e),OV(e),kV(e),AV(e),jV(e),MV(e),aR(e.a),fR(e.a,fG(e)),mR(e.a,dG(e))},DV=N(2,e=>dR(e.a,pG(e))),OV=I(145,DV,e=>e._._._._._._),kV=I(146,e=>uR(e.a,mG(e)),e=>e._._._._._._),AV=I(26,e=>{sR(e.a,e._._.k),DV(e)},e=>e._._),jV=I(27,e=>{pR(e.a,hG(e)),wV(e)},e=>e._._),MV=I(28,e=>cR(e.a,e._._.w),e=>e._._),NV=O(0,`<div></div>`,` `,cB,eR,(e=>`/${e}&`)(` b`),EV),PV=j(1,e=>NV(e,+!!e.b)),FV=O(8,`<p>binary file</p>`,` `,ez,`<p>file too large to display</p>`,` `,$R,`<p>file could not be read</p>`,` `,QR,`<!><!><!>`,`b%`,e=>PV(e,!1)),IV=N(25,e=>FV(e,e.s?0:e.t?1:e.u==null&&e.v==null?2:e.y?3:4),4),LV=j(24,e=>{Bt(e,`a`,e.y),IV(e)}),RV=N(12,e=>LV(e,!e._._._._.aj.has(e.l))),zV=N(15,e=>jt(e,`h`,e._._._._.aj.has(e.l),gG(e)),2),BV=I(122,e=>{RV(e),zV(e)},e=>e._._._._),VV=L(`i40`,e=>{A(e.a,`toggle`,function(t,n){if(LV(e,n.open),!n.open){let e=n.closest(`.diff-main`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}}),A(e.g,`click`,function(e){e.stopPropagation()}),Mt(e,`h`)}),HV=e=>{BV(e),WV(e),JV(e),YV(e),B(e.a,xy.file),B(e.d,xy.path),B(e.g,xy.viewed),VV(e)},UV=N(13,e=>z(e.a,`hidden`,!e._._._._.bz.has(e.l))),WV=I(137,UV,e=>e._._._._),GV=F(MV),KV=M(22,e=>{ZV(e,e.w.length),GV(e)}),qV=N(14,e=>KV(e,e._._._._.c3.get(e.l)||[])),JV=I(140,qV,e=>e._._._._),YV=I(144,zV,e=>e._._._._),XV=O(5,`<span class=chip>💬 <!></span>`,`Db%`,nz),ZV=M(23,e=>{XV(e,+!e.x),tz(e)}),QV=F(jV),$V=M(11,e=>{z(e.a,`data-key`,e.l),qV(e),RV(e),UV(e),zV(e),QV(e)}),eH=(e,t)=>{B(e.b,[xy.status,t]),V(e.c,t)},tH=(e,t)=>{z(e.d,`title`,t),V(e.e,t)},nH=M(18,IV),rH=M(19,IV),iH=M(20,IV),aH=M(21,IV),oH=(e,t)=>cH(e,t[0]),sH=F(AV),cH=M(10,e=>{$V(e,e.k?.key),eH(e,e.k?.status),tH(e,e.k?.path),nH(e,e.k?.binary),rH(e,e.k?.tooLarge),iH(e,e.k?.old),aH(e,e.k?.new),sH(e)}),lH=k(0,`<details><summary><span> </span><span><bdi> </bdi></span><!><label><input type=checkbox><span class=dim>viewed</span></label></summary><!></details>`,` E D l E m%b D m%`,HV,oH),uH=I(36,e=>lH(e,[e._._.s,`key`]),e=>e._._),dH=e=>{uH(e),B(e.a,xy.files)},fH=N(5,e=>z(e.a,`hidden`,!e._.w&&!e._.g&&e._._.b2!==e._.d),3),pH=I(131,fH,e=>e._._),mH=e=>{pH(e),_H(e),yH(e),bH._(e),SH._(e),CH._(e),wH._(e),B(e.a,xy.repoSection)},hH=O(2,`<div></div>`,` `,dH),gH=N(4,e=>hH(e,e._._.bo>1&&e._._.b3.has(e._.d)?1:0),2),_H=I(132,gH,e=>e._._),vH=O(1,`<button><span> </span><span class=mono> </span><!><span class="chip lane">on <!></span><span class=chip>vs <!></span><!></button>`,` D D lD l%b Db%l Db%l%`,fB,`<p><!><span class="chip lane">on <!></span><span class=chip>vs <!></span><!></p>`,` D%b Db%l Db%l%`,Jz),yH=I(135,e=>{vH(e,e._._.bo>1?0:1),gH(e)},e=>e._._),bH=P(0,0,e=>{fH(e),gH(e)}),xH=N(3,e=>z(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),SH=P(0,0,e=>{xH(e),fH(e)}),CH=P(0,0,xH),wH=P(0,0,fH),TH=F(uH),EH=M(18,e=>{FH(e,e.s.length),TH(e)}),DH=N(4,e=>EH(e,e._.c0.get(e.d)||[])),OH=We(31,DH),kH=e=>{OH._(e),MH._(e)},AH=(e,t)=>RH(e,t.length),jH=N(5,e=>AH(e,e._.c1.get(e.d)||[])),MH=We(31,jH),NH=O(0,`<section><!><!></section>`,` D%b%`,mH),PH=N(20,e=>NH(e,e.t||e.g?0:1)),FH=M(19,PH),IH=F(gB,Yz),LH=M(3,e=>{DH(e),jH(e),bH(e),IH(e)}),RH=M(22,wH),zH=F(bB,$z),BH=M(6,e=>{HH(e,e.g?.number),UH(e,e.g?.url),WH(e,e.g?.title),GH(e,e.g?.headRefName),PH(e),SH(e),zH(e)}),VH=(e,t)=>{LH(e,t[0]?.id),BH(e,t[0]?.pr),qH(e,t[0]?.worktree),JH(e,t[0]?.head),YH(e,t[0]?.base),XH(e,t[0]?.baseSha),ZH(e,t[0]?.full_name),QH(e,t[0]?.branch),$H(e,t[0]?.localHead)},HH=M(8,F(Sz,sz)),UH=M(9,F(Tz,lz)),WH=M(10,F(Dz,dz)),GH=M(11,F(Oz,fz)),KH=F(xB),qH=M(7,e=>{CH(e),KH(e)}),JH=M(12,F(SB,eB,kz,pz)),YH=M(13,F(wB,nB,Az,mz)),XH=M(14,F(TB,rB,jz,hz)),ZH=M(15,F(bz)),QH=M(16,F(EB,iB,_z,iz)),$H=M(17,F(yz,oz)),eU=P(9,0,e=>Cx(e.a,e._.af)),tU=e=>{eU._(e),nU._(e),rU._(e),_x(e.a)},nU=P(9,0,e=>wx(e.a,e._.ci)),rU=P(9,0,e=>Tx(e.a,e._.cj)),iU=L(`i29`,e=>A(e.a,`click`,function(){e._.ae?.()})),aU=e=>{B(e.a,xy.iconBtn),Hb(e.b),Ub(e.b,14),Wb(e.b),iU(e)},oU=N(83,L(`i43`,e=>Tt(e,{active:e.ab,load:e.bf,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.aa||``,lastNonce:e.ac||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,jn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.a9&&e.bh()},{signal:t.signal}),jn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.ap)return;let r=t.data,i=r&&r[e.a9];if(!i)return;let a=cy(i);!a||!e.bc||a===e.bc||e.bk()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.bi(),this.wasActive=!!this.active;let t=e.aa||``,n=e.ac||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.ba(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.be&&clearTimeout(e.be),this.abort.abort()}})),11),sU=M(82,oU),cU=N(81,e=>sU(e,_G(e))),lU=M(80,e=>{cU(e),oU(e)}),uU=N(78,e=>lU(e,vG(e))),dU=M(77,e=>{uU(e),oU(e)}),fU=N(75,e=>dU(e,yG(e)),4),pU=M(72,e=>{fU(e),oU(e)}),mU=M(97,F(WV)),hU=(e,t)=>Fb(e.a,t),gU=N(100,e=>hU(e,e.bm.filter(t=>(e.c1.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.c1.get(t.id)||[]})))),_U=M(99,e=>{gU(e),MH(e)}),vU=N(94,e=>_U(e,new Map(e.bm.map(t=>[t.id,e.bv.filter(e=>e.repo===t.id)])))),yU=M(93,e=>{JR(e.a6,e.bv),eG(e,e.bv?.length),mU(e,new Set(e.bv.map(e=>e.key))),vU(e)}),bU=N(92,e=>yU(e,e.bt?e.bs.filter(t=>e.bt.has(t.key)||t.key===e.b1):e.bs),2),xU=M(90,e=>{bU(e),AB(e)}),SU=N(88,e=>xU(e,(()=>{let t=dy(e.aq);return e.bp.filter(e=>t(e.key))})())),CU=M(87,e=>{$W(e,e.bp?.length),SU(e)}),wU=M(105,F(hB,qz)),TU=k(29,mr,(e=>`/${e}&`)(hr),zB,UB),EU=(e,t)=>{wU(e,new Set(t.map(e=>e.id))),TU(e,[t,`id`])},DU=k(26,mr,(e=>`/${e}&`)(hr),cV,uV),OU=k(27,mr,(e=>`/${e}&`)(hr),QB,nV),kU=k(31,`<!><!><!>`,`b%`,kH,VH),AU=M(109,yV),jU=N(107,e=>AU(e,xG(e))),MU=F(Uz),NU=M(106,e=>{nG(e,e.c8?.length),jU(e),MU(e)}),PU=N(85,e=>NU(e,e.bm.filter(t=>t.githubDrift&&!e.b4.has(t.id)))),FU=M(84,e=>{QW(e,e.bm.length),CU(e,e.bm.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),EU(e,e.bm.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),DU(e,[e.bm.filter(e=>e.baseMissing),`id`]),OU(e,[e.bm.filter(e=>e.contained&&e.files.length),`id`]),kU(e,[e.bm,`id`]),vU(e),gU(e),PU(e),aB(e)}),IU=M(98,OH),LU=e=>{IU(e,new Map(e.bm.map(t=>[t.id,e.bp.filter(e=>e.repo===t.id)])))},RU=M(116,nU),zU=N(114,e=>RU(e,SG(e)),2),BU=M(117,rU),VU=N(115,e=>BU(e,CG(e)),3),HU=O(30,`<p> </p>`,` D `,oB,`<p> </p>`,` D `,mV),UU=N(96,e=>HU(e,e.ag&&!e.br?0:e.ag&&!e.bx&&!e.b0?1:2),3),WU=j(42,e=>{pU(e,bG(e)),FU(e,e.ag||[]),LU(e),zU(e),VU(e),UU(e)}),GU=(e,t)=>{Mb(e.a,t),UR(e.a6,t)},KU=F(JV),qU=M(101,e=>{GU(e,new Set(e.c3.keys())),KU(e)}),JU=M(112,F(kV)),YU=M(111,F(OV)),XU=N(49,e=>YU(e,TG(e)),2),ZU=j(43,e=>{NW(e,e.ah?.length),qU(e,(()=>{let t=new Map;for(let n of e.ah){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),JU(e,wG(e)),XU(e),zU(e),VU(e)}),QU=M(110,F(YV)),$U=N(46,e=>QU(e,EG(e))),eW=F(BV),tW=j(45,e=>{Ab(e.a,e.aj),VR(e.a6,e.aj),PW(e,e.aj?.size),$U(e),eW(e)}),nW=F(TV),rW=j(48,e=>{XU(e),nW(e)}),iW=O(25,mr,(e=>`/${e}&`)(hr),CV),aW=F(xV),oW=j(50,e=>{iW(e,+!e.ao),aW(e)}),sW=F(gV),cW=j(51,e=>{B(e.n,[xy.iconBtn,{[xy.spinning]:e.ap}]),z(e.n,`disabled`,e.ap),oU(e),sW(e)}),lW=j(52,e=>{Wx(e.w,e.aq),SU(e),pV(e)}),uW=F(iV,JB,MB),dW=j(53,e=>{At(e,`v`,e.ar),fU(e),uU(e),uW(e)}),fW=j(54,e=>{Nb(e.a,e.as),B(e.l,[xy.treeToggle,{[xy.on]:e.as}]),z(e.l,`title`,e.as?`Hide file tree`:`Show file tree`)}),pW=j(55,e=>IR(e.a6,e.at)),mW=O(23,CS,(e=>`/${e}&`)(wS),OB),hW=j(56,e=>{B(e.r,[`btn`,xy.findBtn,{[xy.on]:e.au}]),mW(e,+!e.au),DB(e)}),gW=M(119),_W=L(`i42`,e=>{e.ab&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`.palette`)||(t.preventDefault(),hW(e,!0),yW(e,e.av+1)))},{capture:!0,signal:ke(e,0)})}),vW=N(58,e=>{Oe(e,0),_W(e)}),yW=j(57,e=>{gW(e,DG(e)),vW(e),kB(e)}),bW=M(91,bU),xW=e=>{bW(e,e.ay.trim()?new Set(e.az):null)},SW=j(59,e=>{FW(e,e.ax?.query),IW(e,e.ax?.keys),LW(e,e.ax?.hit),xW(e)}),CW=F(_H,uB),wW=j(65,e=>{Tb(e.a,e.b3),CW(e)}),TW=j(66,e=>{PU(e),jU(e)}),EW=(e,t)=>{HW(e,t.cbs),UW(e,t.io)},DW=(e,t)=>{WW(e,t.sig),GW(e,t.timer)},OW=M(120),kW=M(118,e=>{Ib(e.a,e.ck),YR(e.a6,e.ck),OW(e,OG(e))}),AW=L(`i41`,e=>{A(e.l,`click`,function(){fW(e,!e.as),$n(e.as)}),A(e.n,`click`,function(){e.bi()}),A(e.p,`click`,function(){pW(e,!0)}),A(e.r,`click`,function(){e.cl()}),A(e.v,`change`,function(t){dW(e,t.target.checked),tr(e.ar),e.bf(e.ar)})});function jW(e){Ob(e.a),Eb(e.a,MG(e)),B(e.b,xy.diffCol),B(e.c,xy.diffHead),B(e.e,xy.diffStats),B(e.k,xy.diffTools),ng(e.m),rg(e.m,14),ig(e.m),Ts(e.o),Es(e.o,14),Ds(e.o),B(e.p,[`btn`,xy.filesBtn]),kx(e.s),Ax(e.s,14),jx(e.s),B(e.t,xy.findLabel),B(e.u,xy.twoDot),Yx(e.w),Gx(e.w,jG(e)),LR(e.a6,AG(e)),WU(e,null),ZU(e,[]),tW(e,new Set),rW(e,null),oW(e,null),cW(e,!1),lW(e,``),dW(e,er()),fW(e,Qn()),pW(e,!1),hW(e,!1),yW(e,0),SW(e,{query:``,hit:null,keys:[]}),wW(e,new Set),TW(e,new Set),EW(e,{io:null,cbs:null}),DW(e,{sig:``,timer:0}),kW(e,kG(e)),AW(e)}var MW=O(9,Kb,(e=>`/${e}&`)(qb),tU),NW=M(44,e=>{V(e.i,e.ai?`· ${dt(e.ai)} comment${dt(e.ai===1?``:`s`)}`:``),MW(e,+!e.ai)}),PW=M(47,e=>V(e.h,e.al?` · ${dt(e.al)} viewed`:``)),FW=M(60,hV),IW=M(61),LW=M(62,e=>{RW(e,e.b0?.key),zW(e,e.b0?.repo),UU(e)}),RW=M(63,bU),zW=M(64,F(pH)),BW=M(71),VW=N(70,e=>BW(e,NG(e))),HW=M(68,VW),UW=M(69,VW),WW=M(74,e=>{fU(e),oU(e)}),GW=M(76,e=>{cU(e),oU(e)}),KW=M(79,oU),qW=M(113,e=>{zU(e),VU(e)}),JW=M(35,e=>{KW(e,PG(e)),qW(e,FG(e)),fU(e),oU(e),$U(e),XU(e)}),YW=M(36,e=>{fU(e),oU(e)}),XW=M(37,e=>{oU(e),vW(e)}),ZW=M(38,oU),QW=M(86,F(yH)),$W=M(89,e=>{V(e.f,e.br),V(e.g,e.br===1?``:`s`),KR(e.a6,e.br),UU(e)}),eG=M(95,e=>{V(e.q,e.bx),UU(e)}),tG=O(28,mr,(e=>`/${e}&`)(hr),bV),nG=(e,t)=>tG(e,+!t),rG=M(39,VU),iG=O(3,(e=>`<button title="Back to terminal">${e}</button>`)(Bb),(e=>` D/${e}&l`)(Vb),aU),aG=M(40,e=>iG(e,+!e.ae)),oG=M(41,eU);function sG(e){return t=>{hW(e._,t)}}function cG(e){return function(t){e._.cm(t)}}function lG(e){return function(){e._.cb()}}function uG(e){return function(){oW(e._,null)}}function dG(e){return function(t){oW(e._._._._._._,t)}}function fG(e){return function(){rW(e._._._._._._,null)}}function pG(e){return function(t){e._._._._._._.cd(e._._.k,t)}}function mG(e){return function(t){e._._._._._._.ce(t)}}function hG(e){return function(t){rW(e._._._._._._,{key:e._._.l,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function gG(e){return function(){e._._._._.cc(e.l)}}function _G(e){return()=>{e.be&&clearTimeout(e.be),e.be=setTimeout(()=>{e.be=0,e.bi()},250)}}function vG(e){return()=>(TW(e,new Set),e.bf(e.ar,!0))}function yG(e){return async(t=e.ar,n=!1)=>{cW(e,!0),oW(e,null);try{let r=new URLSearchParams;t&&r.set(`uncommitted`,`1`),n&&r.set(`refresh`,`1`);let i=r.size?`?${r}`:``,[a,o]=await Promise.all([cn(`/api/workspaces/${e.a9}/diff${i}`),cn(`/api/workspaces/${e.a9}/review`)]);WU(e,a),ZU(e,o.comments||[]),tW(e,new Set(o.viewed||[])),e.bc=sy(a),e.aa&&e.ba(e.aa)}catch(t){oW(e,String(t.message||t))}cW(e,!1)}}function bG(e){return t=>{if(!t)return;let n=e.ag||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set;for(let e of n)(!r||e.id!==r.id)&&i.add(e.id);wW(e,i);let a=Date.now(),o=()=>{let e=scrollEl?.(),n=e?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!e||!n){Date.now()-a<2500&&requestAnimationFrame(o);return}let r=n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:Math.max(0,r-8)})};requestAnimationFrame(o)}}function xG(e){return()=>{TW(e,new Set([...e.b4,...e.c8.map(e=>e.id)]))}}function SG(e){return async()=>await oy(my(e.ah,e.ag))?(await e.cf(),!0):(oW(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function CG(e){return async t=>{try{await cn(`/api/sessions/${t}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${my(e.ah,e.ag)}`,...uy()||{}})}),await e.cf(),e.ad?.(t)}catch(t){oW(e,String(t.message||t))}}}function wG(e){return async t=>{ZU(e,e.ah.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function TG(e){return async(t,n)=>{let r=e.am;rW(e,null);try{let i=await cn(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:t.repo,path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});ZU(e,e.ah.concat(i))}catch(t){oW(e,String(t.message||t))}}}function EG(e){return t=>{let n=new Set(e.aj),r=!n.has(t);r?n.add(t):n.delete(t),tW(e,n),fetch(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`viewed`,key:t,viewed:r})}).catch(()=>{oW(e,`Saving viewed state failed — it may reset on reload.`)})}}function DG(e){return()=>{hW(e,!0),yW(e,e.av+1)}}function OG(e){return t=>{SW(e,t),t.hit&&setTimeout(()=>e.ck(t.hit.key),0)}}function kG(e){return t=>{let n=e.y.querySelector(`details[data-key="${CSS.escape(t)}"]`);n&&(n.open=!0,n.scrollIntoView({block:`start`}))}}function AG(e){return t=>{pW(e,t)}}function jG(e){return t=>{lW(e,t)}}function MG(e){return t=>{wW(e,t)}}function NG(e){return(t,n)=>{e.b6??=new WeakMap,e.b7??=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.b7.unobserve(n.target),e.b6.get(n.target)?.())},{rootMargin:`600px 0px`}),e.b6.set(t,n),e.b7.observe(t)}}function PG(e){return async()=>{try{let t=await cn(`/api/workspaces/${e.a9}/review`);ZU(e,t.comments||[]),tW(e,new Set(t.viewed||[]))}catch{}}}function FG(e){return async()=>{ZU(e,[]),rW(e,null),await fetch(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}R(`i19`,sG),R(`i20`,cG),R(`i22`,lG),R(`i21`,uG),R(`i27`,dG),R(`i25`,fG),R(`i24`,pG),R(`i26`,mG),R(`i23`,hG),R(`i0`,gG),R(`i6`,_G),R(`i5`,vG),R(`i3`,yG),R(`i2`,bG),R(`i7`,xG),R(`i12`,SG),R(`i13`,CG),R(`i10`,wG),R(`i9`,TG),R(`i8`,EG),R(`i15`,DG),R(`i16`,OG),R(`i14`,kG),R(`i28`,AG),R(`i18`,jG),R(`i17`,MG),R(`i1`,NG),R(`i4`,PG),R(`i11`,FG);var IG=Object.defineProperty,LG=Object.getOwnPropertyDescriptor,RG=(e,t)=>{for(var n in t)IG(e,n,{get:t[n],enumerable:!0})},zG=(e,t,n,r)=>{for(var i=r>1?void 0:r?LG(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&IG(t,n,i),i},q=(e,t)=>(n,r)=>t(n,r,e),BG=`Terminal input`,VG={get:()=>BG,set:e=>BG=e},HG=`Too much output to announce, navigate to rows manually to read`,UG={get:()=>HG,set:e=>HG=e};function WG(e){return e.replace(/\r?\n/g,`\r`)}function GG(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function KG(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function qG(e,t,n,r){e.stopPropagation(),e.clipboardData&&JG(e.clipboardData.getData(`text/plain`),t,n,r)}function JG(e,t,n,r){e=WG(e),e=GG(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function YG(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function XG(e,t,n,r,i){YG(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ZG(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function QG(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var $G=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},eK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},tK=``,nK=` `,rK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new iK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},iK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},aK=class e extends rK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new iK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ZG(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},oK=`di$target`,sK=`di$dependencies`,cK=new Map;function lK(e){return e[sK]||[]}function uK(e){if(cK.has(e))return cK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);dK(t,e,r)};return t._id=e,cK.set(e,t),t}function dK(e,t,n){t[oK]===t?t[sK].push({id:e,index:n}):(t[sK]=[{id:e,index:n}],t[oK]=t)}var fK=uK(`BufferService`),pK=uK(`CoreMouseService`),mK=uK(`CoreService`),hK=uK(`CharsetService`),gK=uK(`InstantiationService`),_K=uK(`LogService`),vK=uK(`OptionsService`),yK=uK(`OscLinkService`),bK=uK(`UnicodeService`),xK=uK(`DecorationService`),SK=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new aK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):CK(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};SK=zG([q(0,fK),q(1,vK),q(2,yK)],SK);function CK(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1532
|
+
`}function IL(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function LL(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function RL(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function zL(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function BL(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function VL({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function HL(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:NF(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function UL(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var WL=-1,GL=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++WL}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:bC},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new kD,this.scrollSyncManager=new ZF,this.interactionManager=new lD(`diff`,uD(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return HL(e)}createHunksRenderer(e){return new xL(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=WC(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(uD(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!PC(this.appliedThemeCSS.theme,this.options.theme??bC)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){MC(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=VL(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),YL(this.pre,qL({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||XL(this.headerElement,JL({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),AF(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Kw(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!UL(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(HF(`merge`,e,t),this.setHydratedState(t),await BL(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=VL(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!KL(u,this.deletionFile)||!KL(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&xP(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Kw(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(rL(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:ee=!1,disableFileHeader:te=!1}=this.options;if(te&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,OC);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||aI(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return hI({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=tL(e,this.hunksRenderer.getExpandedHunksMap(),t);return rL(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(nL(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return pI({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return mI({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=cI(o);if(e<s){let c=lI({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=fI({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=cI(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){jC(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||yL(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!zL(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${NP(r)}`,a=this.annotationCache.get(i);if(a==null||!RL(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:gF(NP(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=_F();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:MF(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):MF(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=fF;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??oD(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,yC,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,gC,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,_C,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,vC,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=vF(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=TF(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??bC,s=typeof o==`string`?o:{...o},c=xF(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=FF({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:EF(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=DF(this.themeCSSStyle.textContent??``,xF(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&RF()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?PF(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ZL(t[0]),a=ZL(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=oD(i),r.content.innerHTML=oD(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=kF({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=kF({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=kF({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=ZL(r?.[0]),a=ZL(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=ZL(n?.[0]),i=ZL(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=oD(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?PF(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ZL(t[0]),i=ZL(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};pF(u,this.appliedPreAttributes)||(jF(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function KL(e,t){return e==null||t==null?e==null&&t==null:Jw(e,t)}function qL({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function JL({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function YL(e,t,n=!1){return!n&&e==null&&t}function XL(e,t,n=!1){return e==null&&t&&!n}function ZL(e){if(e!=null&&e.type===`element`)return e.children??[]}function QL(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`.diff-main`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var $L={diffFile:`_dh`},eR=`<div></div>`,tR=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,nR=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,rR=new CSSStyleSheet;rR.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+sS);var iR=it(`e0`,0);function aR(e){B(e.a,$L.diffFile)}var oR=N(11,L(`e1`,e=>Tt(e,{file:e.d,comments:e.e,draft:e.f,onMount:function(){let t=t=>{if(!t)return;let n=document.createElement(`div`);n.style.cssText=tR;let r=document.createElement(`p`);r.textContent=t.text,r.style.cssText=`margin:0;white-space:pre-wrap;`;let i=document.createElement(`button`);return i.textContent=`remove`,i.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;align-self:flex-start;font-size:.75rem;opacity:.7;`,i.onclick=()=>e.g?.(t.id),n.append(r,i),n},n=()=>{let t=document.createElement(`div`);t.style.cssText=tR;let n=document.createElement(`textarea`);n.placeholder=`Leave a comment…`,n.rows=3,n.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(lr()?`font-size:16px;`:``);let r=document.createElement(`button`);r.textContent=`Comment`,r.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`;let i=document.createElement(`button`);i.textContent=`Cancel`,i.style.cssText=nR,r.onclick=()=>{n.value.trim()&&e.h?.(n.value)},i.onclick=()=>e.i?.(),n.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&r.onclick(),e.key===`Escape`&&i.onclick()};let a=document.createElement(`div`);a.style.cssText=`display:flex;gap:.4rem;`,a.append(r,i),t.append(n,a);let o=()=>n.scrollIntoView({block:`center`,behavior:`smooth`});return n.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,o),n.addEventListener(`blur`,()=>e.removeEventListener(`resize`,o),{once:!0}))}),setTimeout(()=>{n.scrollIntoView({block:`center`,behavior:`instant`}),n.focus()},0),t},r=new Map,i,a={draft:!0},o,s=new GL({diffStyle:ur()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.j?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let r=e.metadata||{};return r.draft?o??=n():t(r.comment)}}),c=()=>{let t=[],n=new Map;for(let i of e.e||[]){let e=r.get(i.id)||{comment:i};n.set(i.id,e),t.push({side:i.side,lineNumber:i.line_end,metadata:e})}return r=n,e.f&&(i!==e.f&&(i=e.f,a={draft:!0},o=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:a})),t},l=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(rR)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,rR])},u=()=>{if(e.d.old==null&&e.d.new==null){e.k?.(`could not read ${e.d.path}`);return}let t=s.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:c()});Promise.resolve(t).then(()=>{l(),mS(e.a)}).catch(t=>e.k?.(`diff render: ${t}`))};u();let d=new AbortController;return lr()&&QL(iR(e),d.signal),{instance:s,render:u,dragAbort:d,unregSearch:pS(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f}},onUpdate:function(){(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),7),sR=M(3,oR),cR=M(4,oR),lR=M(5,oR),uR=M(6,oR),dR=M(7,oR),fR=M(8,oR),pR=M(9,oR),mR=M(10,oR),hR={iconBtn:`_cS _7`,spinning:`_cT _8`,sheetBackdrop:`_cU`,fileSheet:`_cV`,sheetHead:`_cW`,sheetList:`_cX`,sheetFile:`_cY`,seen:`_cZ`,sheetPath:`_c0`,status:`_c1`},gR=`<!><!><!>`,_R=O(6,`<span class=dim>✓</span>`),vR=N(10,e=>{B(e.a,[hR.sheetFile,`mono`,{[hR.seen]:e._._.p.has(e.j)}]),_R(e,+!e._._.p.has(e.j))}),yR=I(20,vR,e=>e._._),bR=L(`d0`,e=>A(e.a,`click`,function(){PR(e._._,!1),e._._.m(e.j)})),xR=e=>{yR(e),wR(e),B(e.d,hR.sheetPath),bR(e)},SR=O(5,`<span>💬</span>`),CR=N(11,e=>SR(e,+!e._._.r.has(e.j))),wR=I(22,CR,e=>e._._),TR=M(9,e=>{z(e.d,`title`,e.j),V(e.e,e.j),vR(e),CR(e)}),ER=(e,t)=>{B(e.b,[hR.status,t]),V(e.c,t)},DR=k(6,`<button type=button><span> </span><span><bdi> </bdi></span><!><!></button>`,` D D l E m%b%`,xR,(e,t)=>{TR(e,t[0]?.key),ER(e,t[0]?.status)}),OR=P(0,0,e=>DR(e,[e._.j,`key`])),kR=L(`d1`,e=>{A(e.a,`click`,function(){PR(e._,!1)}),A(e.f,`click`,function(){PR(e._,!1)})}),AR=e=>{OR._(e),jR._(e),MR._(e),B(e.a,hR.sheetBackdrop),B(e.b,hR.fileSheet),B(e.c,hR.sheetHead),B(e.f,hR.iconBtn),B(e.g,hR.sheetList),kR(e)},jR=P(0,0,e=>V(e.d,e._.q)),MR=P(0,0,e=>V(e.e,e._.s)),NR=O(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span class=dim><!>/<!> viewed</span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D DbD%c%l l `,AR),PR=Ue(13,e=>NR(e,+!e.n)),FR=N(5,e=>PR(e,e.d,e.e)),IR=M(3,FR),LR=M(4,FR),RR=F(yR),zR=M(15,e=>{BR(e,e.p.size),RR(e)}),BR=M(16,jR),VR=(e,t)=>zR(e,t||new Set),HR=M(17,F(wR)),UR=(e,t)=>HR(e,t||new Set),WR=M(18,MR),GR=N(11,e=>WR(e,e.i??e.k)),KR=M(8,GR),qR=M(10,GR),JR=M(9,e=>{qR(e,e.j?.length),OR(e)}),YR=M(12),XR=((e,t,n,r,i,a)=>`<div class=diff-view>${e}<div><div><!><span><!> file<!> changed <!><!></span><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><button title="Find in the review (⌘/Ctrl+F)">${r}<span>Find</span></button><label title="Include uncommitted and untracked files in the review. Off by default — the review is commit-to-commit."><input type=checkbox> include uncommitted</label>${i}</div><!><div class=diff-main><!><!><!><!><!><!><!></div></div>${a}</div>`)(Cy,eg,Cs,Dx,Nx,gR),ZR=((e,t,n,r,i,a)=>`D/${e}& D D%b D%c%c%b%l%l D D/${t}&l D/${n}&l Db%l D/${r}& l D l/${i}&l%b D%b%b%b%b%b%b%m/${a}&l`)(` b`,tg,ws,Ox,Px,`b%c`),QR=e=>B(e.a,xy.diffPad),$R=e=>B(e.a,xy.diffPad),ez=e=>B(e.a,xy.diffPad),tz=P(5,0,e=>V(e.a,e._.x)),nz=tz,rz=N(2,e=>z(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),iz=I(34,e=>{V(e.b,e._._._.q),rz(e)},e=>e._._._),az=e=>{iz(e),oz(e)},oz=I(35,rz,e=>e._._._),sz=I(26,e=>V(e.b,e._._._.i),e=>e._._._),cz=e=>{sz(e),lz(e),dz(e),fz(e),pz(e),mz(e),hz(e)},lz=I(27,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),uz=N(3,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),dz=I(28,e=>{V(e.c,e._._._.k),uz(e)},e=>e._._._),fz=I(29,uz,e=>e._._._),pz=I(30,uz,e=>e._._._),mz=I(31,uz,e=>e._._._),hz=I(32,uz,e=>e._._._),gz=N(2,e=>z(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),_z=I(34,e=>{V(e.b,e._._._.q),gz(e)},e=>e._._._),vz=e=>{_z(e),yz(e)},yz=I(35,gz,e=>e._._._),bz=I(33,e=>V(e.a,e._._._.p),e=>e._._._),xz=bz,Sz=I(26,e=>V(e.b,e._._._.i),e=>e._._._),Cz=L(`i37`,e=>A(e.a,`click`,function(e){e.stopPropagation()})),wz=e=>{Sz(e),Tz(e),Dz(e),Oz(e),kz(e),Az(e),jz(e),Cz(e)},Tz=I(27,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),Ez=N(3,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),Dz=I(28,e=>{V(e.c,e._._._.k),Ez(e)},e=>e._._._),Oz=I(29,Ez,e=>e._._._),kz=I(30,Ez,e=>e._._._),Az=I(31,Ez,e=>e._._._),jz=I(32,Ez,e=>e._._._),Mz=N(10,e=>z(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),Nz=M(7,Mz),Pz=M(8,e=>{V(e.c,gy(e.i)),Mz(e)}),Fz=M(9,e=>{V(e.d,gy(e.j)),Mz(e)}),Iz=(e,t)=>V(e.b,t>0?` · `:``),Lz=(e,t)=>{Nz(e,t[0]?.pr?.headRefName),Fz(e,t[0]?.pr?.headRefOid),Pz(e,t[0]?.head),Iz(e,t[1])},Rz=(e,t)=>V(e.a,t>0?` · `:``),zz=(e,t)=>V(e.b,t),Bz=(e,t)=>V(e.c,t),Vz=k(0,`<!><!> #<!>`,`%b%c%`,0,(e,t)=>{zz(e,t[0]?.worktree),Bz(e,t[0]?.pr?.number),Rz(e,t[1])}),Hz=k(1,`<span><!><!> → <!></span>`,` D%b%c%`,0,Lz),Uz=I(142,e=>{Vz(e,[e._._.c8,`id`]),Hz(e,[e._._.c8,`id`])},e=>e._._),Wz=ut(`i35`,`<span class=dim><!> — this view has a newer tip than the PR page.</span><span></span>`,`D%l `,e=>{Uz(e),B(e.b,[`mono`,xy.toastMeta])}),Gz=O(6,`<span class=chip>local <!></span>`,` Db%`,az),Kz=N(7,e=>Gz(e,+!e._._._.c7.has(e._._.d))),qz=I(141,Kz,e=>e._._._),Jz=e=>{qz(e),Yz(e),$z(e),eB(e),nB(e),rB(e),iB(e),B(e.a,xy.repoMeta)},Yz=I(23,Kz,e=>e._._),Xz=O(1,`<a class="chip pr" target=_blank rel=noopener>#<!></a><span class=dim> </span>`,` Db%lD `,cz),Zz=N(10,e=>z(e.c,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),Qz=N(8,e=>V(e.d,e._._.g?e._._.g.headRefName:e._._.q)),$z=I(24,e=>{Xz(e,+!e._._.g),Zz(e),Qz(e)},e=>e._._),eB=I(30,Zz,e=>e._._),tB=N(9,e=>z(e.e,`title`,`${e._._.n} ${e._._.o}`)),nB=I(31,e=>{V(e.f,e._._.n),tB(e)},e=>e._._),rB=I(32,tB,e=>e._._),iB=I(34,e=>{Zz(e),Qz(e)},e=>e._._),aB=P(30,0,e=>V(e.b,e._.bm.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),oB=e=>{aB._(e),B(e.a,xy.centerPad)},sB=I(133,L(`i39`,e=>Tt(e,{onMount:function(){e._._._._._._.b9(e.a,()=>{PV(e._,!0)})}})),e=>e._._._._._._),cB=e=>{sB(e),B(e.a,xy.diffWait)},lB=N(10,e=>V(e.c,e._._._.b3.has(e._._.d)?`▸`:`▾`)),uB=I(132,lB,e=>e._._._),dB=L(`i38`,e=>A(e.a,`click`,function(){let t=new Set(e._._._.b3);t.delete(e._._.d)||t.add(e._._.d),wW(e._._._,t)})),fB=e=>{uB(e),hB(e),gB(e),bB(e),xB(e),SB(e),wB(e),TB(e),EB(e),B(e.a,xy.repoSep),B(e.b,xy.treeChev),dB(e)},pB=O(9,`<span class=chip>local <!></span>`,` Db%`,vz),mB=N(11,e=>pB(e,+!e._._._.c7.has(e._._.d))),hB=I(141,mB,e=>e._._._),gB=I(23,e=>{lB(e),mB(e)},e=>e._._),_B=O(4,`<a class="chip pr" target=_blank rel=noopener>#<!></a><span class=dim> </span>`,` Db%lD `,wz,`<span class=dim> </span>`,`D `,xz),vB=N(14,e=>z(e.f,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),yB=N(12,e=>V(e.g,e._._.g?e._._.g.headRefName:e._._.q)),bB=I(24,e=>{_B(e,+!e._._.g),vB(e),yB(e)},e=>e._._),xB=I(25,e=>V(e.d,e._._.h),e=>e._._),SB=I(30,vB,e=>e._._),CB=N(13,e=>z(e.h,`title`,`${e._._.n} ${e._._.o}`)),wB=I(31,e=>{V(e.i,e._._.n),CB(e)},e=>e._._),TB=I(32,CB,e=>e._._),EB=I(34,e=>{vB(e),yB(e)},e=>e._._),DB=P(23,0,e=>DS(e.a,e._.au)),OB=e=>{DB._(e),kB._(e),AB._(e),jB._(e),$S(e.a),OS(e.a,sG(e)),RS(e.a),zS(e.a),HS(e.a)},kB=P(23,0,e=>iC(e.a,e._.av)),AB=P(23,0,e=>tC(e.a,e._.bs)),jB=P(23,0,e=>US(e.a,cG(e))),MB=I(127,e=>V(e.e,e._._.ar?`, plus uncommitted`:``),e=>e._._),NB=e=>{MB(e),PB(e),FB(e),IB(e),LB(e)},PB=I(11,e=>V(e.a,gy(e._.h))),FB=I(12,e=>V(e.b,e._.i)),IB=I(13,e=>V(e.c,gy(e._.j))),LB=I(14,e=>V(e.d,e._.k)),RB=ut(`i36`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,NB),zB=e=>{Vr(e.a),Gr(e.a,RB(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},BB=N(6,e=>Ur(e.a,`${e.d} #${e.f}`)),VB=M(3,BB),HB=M(5,BB),UB=(e,t)=>{VB(e,t[0]?.worktree),HB(e,t[0]?.pr?.number),WB(e,t[0]?.pr?.headRefName),GB(e,t[0]?.head),KB(e,t[0]?.localHead),qB(e,t[0]?.branch)},WB=M(8,F(FB)),GB=M(7,F(PB)),KB=M(9,F(IB)),qB=M(10,F(LB)),JB=I(127,e=>V(e.b,e._._.ar?` — showing uncommitted changes only`:``),e=>e._._),YB=e=>{JB(e),XB(e)},XB=I(7,e=>V(e.a,e._.g)),ZB=ut(`i32`,`already in <!><!>.`,`b%b%`,YB),QB=e=>{Vr(e.a),Gr(e.a,ZB(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},$B=N(5,e=>Ur(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),eV=M(3,$B),tV=M(4,$B),nV=(e,t)=>{eV(e,t[0]?.pr),tV(e,t[0]?.worktree),rV(e,t[0]?.base)},rV=M(6,F(XB)),iV=I(127,e=>V(e.b,e._._.ar?` — showing uncommitted changes only`:``),e=>e._._),aV=e=>{iV(e),oV(e)},oV=I(5,e=>V(e.a,e._.e)),sV=ut(`i31`,`<!><!>.`,`%b%`,aV),cV=e=>{Vr(e.a),Gr(e.a,sV(e)),Nr(e.a,`warn`),Lr(e.a,`inline`),Jr(e.a),Rr(e.a),Yr(e.a),Br(e.a,{})},lV=(e,t)=>Ur(e.a,`${t}: base not found`),uV=(e,t)=>{lV(e,t[0]?.worktree),dV(e,t[0]?.base)},dV=M(4,F(oV)),fV=N(2,e=>V(e.b,e._.ay.trim()?`No matches in diffs.`:`No files match "${e._.aq}".`)),pV=P(30,1,fV),mV=e=>{pV._(e),hV._(e),B(e.a,xy.centerPad)},hV=P(30,1,fV),gV=I(125,e=>{z(e.a,`disabled`,e._._.ap),V(e.b,e._._.ap?`Reloading…`:`Reload`)},e=>e._._),_V=L(`i33`,e=>A(e.a,`click`,function(){e._._.bi()})),vV=ut(`i34`,`<button class=btn> </button>`,` D `,e=>{gV(e),_V(e)}),yV=P(28,0,e=>Yr(e.a,lG(e))),bV=e=>{yV._(e),Vr(e.a),Jr(e.a,an({content:vV(e)})),Gr(e.a,Wz(e)),Nr(e.a,`info`),Lr(e.a,`inline`),Ur(e.a,`GitHub is behind`),Rr(e.a),Br(e.a,{})},xV=I(124,e=>V(e.a,e._._.ao),e=>e._._),SV=ut(`i30`,` `,` `,xV),CV=e=>{Vr(e.a),Gr(e.a,SV(e)),Yr(e.a,uG(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},wV=N(1,e=>lR(e.a,e._._._._._._.am&&e._._._._._._.am?.key===e._._.l?e._._._._._._.am:null)),TV=I(123,wV,e=>e._._._._._._),EV=e=>{TV(e),OV(e),kV(e),AV(e),jV(e),MV(e),aR(e.a),fR(e.a,fG(e)),mR(e.a,dG(e))},DV=N(2,e=>dR(e.a,pG(e))),OV=I(145,DV,e=>e._._._._._._),kV=I(146,e=>uR(e.a,mG(e)),e=>e._._._._._._),AV=I(26,e=>{sR(e.a,e._._.k),DV(e)},e=>e._._),jV=I(27,e=>{pR(e.a,hG(e)),wV(e)},e=>e._._),MV=I(28,e=>cR(e.a,e._._.w),e=>e._._),NV=O(0,`<div></div>`,` `,cB,eR,(e=>`/${e}&`)(` b`),EV),PV=j(1,e=>NV(e,+!!e.b)),FV=O(8,`<p>binary file</p>`,` `,ez,`<p>file too large to display</p>`,` `,$R,`<p>file could not be read</p>`,` `,QR,`<!><!><!>`,`b%`,e=>PV(e,!1)),IV=N(25,e=>FV(e,e.s?0:e.t?1:e.u==null&&e.v==null?2:e.y?3:4),4),LV=j(24,e=>{Bt(e,`a`,e.y),IV(e)}),RV=N(12,e=>LV(e,!e._._._._.aj.has(e.l))),zV=N(15,e=>jt(e,`h`,e._._._._.aj.has(e.l),gG(e)),2),BV=I(122,e=>{RV(e),zV(e)},e=>e._._._._),VV=L(`i40`,e=>{A(e.a,`toggle`,function(t,n){if(LV(e,n.open),!n.open){let e=n.closest(`.diff-main`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}}),A(e.g,`click`,function(e){e.stopPropagation()}),Mt(e,`h`)}),HV=e=>{BV(e),WV(e),JV(e),YV(e),B(e.a,xy.file),B(e.d,xy.path),B(e.g,xy.viewed),VV(e)},UV=N(13,e=>z(e.a,`hidden`,!e._._._._.bz.has(e.l))),WV=I(137,UV,e=>e._._._._),GV=F(MV),KV=M(22,e=>{ZV(e,e.w.length),GV(e)}),qV=N(14,e=>KV(e,e._._._._.c3.get(e.l)||[])),JV=I(140,qV,e=>e._._._._),YV=I(144,zV,e=>e._._._._),XV=O(5,`<span class=chip>💬 <!></span>`,`Db%`,nz),ZV=M(23,e=>{XV(e,+!e.x),tz(e)}),QV=F(jV),$V=M(11,e=>{z(e.a,`data-key`,e.l),qV(e),RV(e),UV(e),zV(e),QV(e)}),eH=(e,t)=>{B(e.b,[xy.status,t]),V(e.c,t)},tH=(e,t)=>{z(e.d,`title`,t),V(e.e,t)},nH=M(18,IV),rH=M(19,IV),iH=M(20,IV),aH=M(21,IV),oH=(e,t)=>cH(e,t[0]),sH=F(AV),cH=M(10,e=>{$V(e,e.k?.key),eH(e,e.k?.status),tH(e,e.k?.path),nH(e,e.k?.binary),rH(e,e.k?.tooLarge),iH(e,e.k?.old),aH(e,e.k?.new),sH(e)}),lH=k(0,`<details><summary><span> </span><span><bdi> </bdi></span><!><label><input type=checkbox><span class=dim>viewed</span></label></summary><!></details>`,` E D l E m%b D m%`,HV,oH),uH=I(36,e=>lH(e,[e._._.s,`key`]),e=>e._._),dH=e=>{uH(e),B(e.a,xy.files)},fH=N(5,e=>z(e.a,`hidden`,!e._.w&&!e._.g&&e._._.b2!==e._.d),3),pH=I(131,fH,e=>e._._),mH=e=>{pH(e),_H(e),yH(e),bH._(e),SH._(e),CH._(e),wH._(e),B(e.a,xy.repoSection)},hH=O(2,`<div></div>`,` `,dH),gH=N(4,e=>hH(e,e._._.bo>1&&e._._.b3.has(e._.d)?1:0),2),_H=I(132,gH,e=>e._._),vH=O(1,`<button><span> </span><span class=mono> </span><!><span class="chip lane">on <!></span><span class=chip>vs <!></span><!></button>`,` D D lD l%b Db%l Db%l%`,fB,`<p><!><span class="chip lane">on <!></span><span class=chip>vs <!></span><!></p>`,` D%b Db%l Db%l%`,Jz),yH=I(135,e=>{vH(e,e._._.bo>1?0:1),gH(e)},e=>e._._),bH=P(0,0,e=>{fH(e),gH(e)}),xH=N(3,e=>z(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),SH=P(0,0,e=>{xH(e),fH(e)}),CH=P(0,0,xH),wH=P(0,0,fH),TH=F(uH),EH=M(18,e=>{FH(e,e.s.length),TH(e)}),DH=N(4,e=>EH(e,e._.c0.get(e.d)||[])),OH=We(31,DH),kH=e=>{OH._(e),MH._(e)},AH=(e,t)=>RH(e,t.length),jH=N(5,e=>AH(e,e._.c1.get(e.d)||[])),MH=We(31,jH),NH=O(0,`<section><!><!></section>`,` D%b%`,mH),PH=N(20,e=>NH(e,e.t||e.g?0:1)),FH=M(19,PH),IH=F(gB,Yz),LH=M(3,e=>{DH(e),jH(e),bH(e),IH(e)}),RH=M(22,wH),zH=F(bB,$z),BH=M(6,e=>{HH(e,e.g?.number),UH(e,e.g?.url),WH(e,e.g?.title),GH(e,e.g?.headRefName),PH(e),SH(e),zH(e)}),VH=(e,t)=>{LH(e,t[0]?.id),BH(e,t[0]?.pr),qH(e,t[0]?.worktree),JH(e,t[0]?.head),YH(e,t[0]?.base),XH(e,t[0]?.baseSha),ZH(e,t[0]?.full_name),QH(e,t[0]?.branch),$H(e,t[0]?.localHead)},HH=M(8,F(Sz,sz)),UH=M(9,F(Tz,lz)),WH=M(10,F(Dz,dz)),GH=M(11,F(Oz,fz)),KH=F(xB),qH=M(7,e=>{CH(e),KH(e)}),JH=M(12,F(SB,eB,kz,pz)),YH=M(13,F(wB,nB,Az,mz)),XH=M(14,F(TB,rB,jz,hz)),ZH=M(15,F(bz)),QH=M(16,F(EB,iB,_z,iz)),$H=M(17,F(yz,oz)),eU=P(9,0,e=>Cx(e.a,e._.af)),tU=e=>{eU._(e),nU._(e),rU._(e),_x(e.a)},nU=P(9,0,e=>wx(e.a,e._.ci)),rU=P(9,0,e=>Tx(e.a,e._.cj)),iU=L(`i29`,e=>A(e.a,`click`,function(){e._.ae?.()})),aU=e=>{B(e.a,xy.iconBtn),Hb(e.b),Ub(e.b,14),Wb(e.b),iU(e)},oU=N(83,L(`i43`,e=>Tt(e,{active:e.ab,load:e.bf,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.aa||``,lastNonce:e.ac||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,jn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.a9&&e.bh()},{signal:t.signal}),jn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.ap)return;let r=t.data,i=r&&r[e.a9];if(!i)return;let a=cy(i);!a||!e.bc||a===e.bc||e.bk()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.bi(),this.wasActive=!!this.active;let t=e.aa||``,n=e.ac||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.ba(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.be&&clearTimeout(e.be),this.abort.abort()}})),11),sU=M(82,oU),cU=N(81,e=>sU(e,_G(e))),lU=M(80,e=>{cU(e),oU(e)}),uU=N(78,e=>lU(e,vG(e))),dU=M(77,e=>{uU(e),oU(e)}),fU=N(75,e=>dU(e,yG(e)),4),pU=M(72,e=>{fU(e),oU(e)}),mU=M(97,F(WV)),hU=(e,t)=>Fb(e.a,t),gU=N(100,e=>hU(e,e.bm.filter(t=>(e.c1.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.c1.get(t.id)||[]})))),_U=M(99,e=>{gU(e),MH(e)}),vU=N(94,e=>_U(e,new Map(e.bm.map(t=>[t.id,e.bv.filter(e=>e.repo===t.id)])))),yU=M(93,e=>{JR(e.a6,e.bv),eG(e,e.bv?.length),mU(e,new Set(e.bv.map(e=>e.key))),vU(e)}),bU=N(92,e=>yU(e,e.bt?e.bs.filter(t=>e.bt.has(t.key)||t.key===e.b1):e.bs),2),xU=M(90,e=>{bU(e),AB(e)}),SU=N(88,e=>xU(e,(()=>{let t=dy(e.aq);return e.bp.filter(e=>t(e.key))})())),CU=M(87,e=>{$W(e,e.bp?.length),SU(e)}),wU=M(105,F(hB,qz)),TU=k(29,mr,(e=>`/${e}&`)(hr),zB,UB),EU=(e,t)=>{wU(e,new Set(t.map(e=>e.id))),TU(e,[t,`id`])},DU=k(26,mr,(e=>`/${e}&`)(hr),cV,uV),OU=k(27,mr,(e=>`/${e}&`)(hr),QB,nV),kU=k(31,`<!><!><!>`,`b%`,kH,VH),AU=M(109,yV),jU=N(107,e=>AU(e,xG(e))),MU=F(Uz),NU=M(106,e=>{nG(e,e.c8?.length),jU(e),MU(e)}),PU=N(85,e=>NU(e,e.bm.filter(t=>t.githubDrift&&!e.b4.has(t.id)))),FU=M(84,e=>{QW(e,e.bm.length),CU(e,e.bm.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),EU(e,e.bm.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),DU(e,[e.bm.filter(e=>e.baseMissing),`id`]),OU(e,[e.bm.filter(e=>e.contained&&e.files.length),`id`]),kU(e,[e.bm,`id`]),vU(e),gU(e),PU(e),aB(e)}),IU=M(98,OH),LU=e=>{IU(e,new Map(e.bm.map(t=>[t.id,e.bp.filter(e=>e.repo===t.id)])))},RU=M(116,nU),zU=N(114,e=>RU(e,SG(e)),2),BU=M(117,rU),VU=N(115,e=>BU(e,CG(e)),3),HU=O(30,`<p> </p>`,` D `,oB,`<p> </p>`,` D `,mV),UU=N(96,e=>HU(e,e.ag&&!e.br?0:e.ag&&!e.bx&&!e.b0?1:2),3),WU=j(42,e=>{pU(e,bG(e)),FU(e,e.ag||[]),LU(e),zU(e),VU(e),UU(e)}),GU=(e,t)=>{Mb(e.a,t),UR(e.a6,t)},KU=F(JV),qU=M(101,e=>{GU(e,new Set(e.c3.keys())),KU(e)}),JU=M(112,F(kV)),YU=M(111,F(OV)),XU=N(49,e=>YU(e,TG(e)),2),ZU=j(43,e=>{NW(e,e.ah?.length),qU(e,(()=>{let t=new Map;for(let n of e.ah){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),JU(e,wG(e)),XU(e),zU(e),VU(e)}),QU=M(110,F(YV)),$U=N(46,e=>QU(e,EG(e))),eW=F(BV),tW=j(45,e=>{Ab(e.a,e.aj),VR(e.a6,e.aj),PW(e,e.aj?.size),$U(e),eW(e)}),nW=F(TV),rW=j(48,e=>{XU(e),nW(e)}),iW=O(25,mr,(e=>`/${e}&`)(hr),CV),aW=F(xV),oW=j(50,e=>{iW(e,+!e.ao),aW(e)}),sW=F(gV),cW=j(51,e=>{B(e.n,[xy.iconBtn,{[xy.spinning]:e.ap}]),z(e.n,`disabled`,e.ap),oU(e),sW(e)}),lW=j(52,e=>{Wx(e.w,e.aq),SU(e),pV(e)}),uW=F(iV,JB,MB),dW=j(53,e=>{At(e,`v`,e.ar),fU(e),uU(e),uW(e)}),fW=j(54,e=>{Nb(e.a,e.as),B(e.l,[xy.treeToggle,{[xy.on]:e.as}]),z(e.l,`title`,e.as?`Hide file tree`:`Show file tree`)}),pW=j(55,e=>IR(e.a6,e.at)),mW=O(23,CS,(e=>`/${e}&`)(wS),OB),hW=j(56,e=>{B(e.r,[`btn`,xy.findBtn,{[xy.on]:e.au}]),mW(e,+!e.au),DB(e)}),gW=M(119),_W=L(`i42`,e=>{e.ab&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`.palette`)||(t.preventDefault(),hW(e,!0),yW(e,e.av+1)))},{capture:!0,signal:ke(e,0)})}),vW=N(58,e=>{Oe(e,0),_W(e)}),yW=j(57,e=>{gW(e,DG(e)),vW(e),kB(e)}),bW=M(91,bU),xW=e=>{bW(e,e.ay.trim()?new Set(e.az):null)},SW=j(59,e=>{FW(e,e.ax?.query),IW(e,e.ax?.keys),LW(e,e.ax?.hit),xW(e)}),CW=F(_H,uB),wW=j(65,e=>{Tb(e.a,e.b3),CW(e)}),TW=j(66,e=>{PU(e),jU(e)}),EW=(e,t)=>{HW(e,t.cbs),UW(e,t.io)},DW=(e,t)=>{WW(e,t.sig),GW(e,t.timer)},OW=M(120),kW=M(118,e=>{Ib(e.a,e.ck),YR(e.a6,e.ck),OW(e,OG(e))}),AW=L(`i41`,e=>{A(e.l,`click`,function(){fW(e,!e.as),$n(e.as)}),A(e.n,`click`,function(){e.bi()}),A(e.p,`click`,function(){pW(e,!0)}),A(e.r,`click`,function(){e.cl()}),A(e.v,`change`,function(t){dW(e,t.target.checked),tr(e.ar),e.bf(e.ar)})});function jW(e){Ob(e.a),Eb(e.a,MG(e)),B(e.b,xy.diffCol),B(e.c,xy.diffHead),B(e.e,xy.diffStats),B(e.k,xy.diffTools),ng(e.m),rg(e.m,14),ig(e.m),Ts(e.o),Es(e.o,14),Ds(e.o),B(e.p,[`btn`,xy.filesBtn]),kx(e.s),Ax(e.s,14),jx(e.s),B(e.t,xy.findLabel),B(e.u,xy.twoDot),Yx(e.w),Gx(e.w,jG(e)),LR(e.a6,AG(e)),WU(e,null),ZU(e,[]),tW(e,new Set),rW(e,null),oW(e,null),cW(e,!1),lW(e,``),dW(e,er()),fW(e,Qn()),pW(e,!1),hW(e,!1),yW(e,0),SW(e,{query:``,hit:null,keys:[]}),wW(e,new Set),TW(e,new Set),EW(e,{io:null,cbs:null}),DW(e,{sig:``,timer:0}),kW(e,kG(e)),AW(e)}var MW=O(9,Kb,(e=>`/${e}&`)(qb),tU),NW=M(44,e=>{V(e.i,e.ai?`· ${dt(e.ai)} comment${dt(e.ai===1?``:`s`)}`:``),MW(e,+!e.ai)}),PW=M(47,e=>V(e.h,e.al?` · ${dt(e.al)} viewed`:``)),FW=M(60,hV),IW=M(61),LW=M(62,e=>{RW(e,e.b0?.key),zW(e,e.b0?.repo),UU(e)}),RW=M(63,bU),zW=M(64,F(pH)),BW=M(71),VW=N(70,e=>BW(e,NG(e))),HW=M(68,VW),UW=M(69,VW),WW=M(74,e=>{fU(e),oU(e)}),GW=M(76,e=>{cU(e),oU(e)}),KW=M(79,oU),qW=M(113,e=>{zU(e),VU(e)}),JW=M(35,e=>{KW(e,PG(e)),qW(e,FG(e)),fU(e),oU(e),$U(e),XU(e)}),YW=M(36,e=>{fU(e),oU(e)}),XW=M(37,e=>{oU(e),vW(e)}),ZW=M(38,oU),QW=M(86,F(yH)),$W=M(89,e=>{V(e.f,e.br),V(e.g,e.br===1?``:`s`),KR(e.a6,e.br),UU(e)}),eG=M(95,e=>{V(e.q,e.bx),UU(e)}),tG=O(28,mr,(e=>`/${e}&`)(hr),bV),nG=(e,t)=>tG(e,+!t),rG=M(39,VU),iG=O(3,(e=>`<button title="Back to terminal">${e}</button>`)(Bb),(e=>` D/${e}&l`)(Vb),aU),aG=M(40,e=>iG(e,+!e.ae)),oG=M(41,eU);function sG(e){return t=>{hW(e._,t)}}function cG(e){return function(t){e._.cm(t)}}function lG(e){return function(){e._.cb()}}function uG(e){return function(){oW(e._,null)}}function dG(e){return function(t){oW(e._._._._._._,t)}}function fG(e){return function(){rW(e._._._._._._,null)}}function pG(e){return function(t){e._._._._._._.cd(e._._.k,t)}}function mG(e){return function(t){e._._._._._._.ce(t)}}function hG(e){return function(t){rW(e._._._._._._,{key:e._._.l,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function gG(e){return function(){e._._._._.cc(e.l)}}function _G(e){return()=>{e.be&&clearTimeout(e.be),e.be=setTimeout(()=>{e.be=0,e.bi()},250)}}function vG(e){return()=>(TW(e,new Set),e.bf(e.ar,!0))}function yG(e){return async(t=e.ar,n=!1)=>{cW(e,!0),oW(e,null);try{let r=new URLSearchParams;t&&r.set(`uncommitted`,`1`),n&&r.set(`refresh`,`1`);let i=r.size?`?${r}`:``,[a,o]=await Promise.all([cn(`/api/workspaces/${e.a9}/diff${i}`),cn(`/api/workspaces/${e.a9}/review`)]);WU(e,a),ZU(e,o.comments||[]),tW(e,new Set(o.viewed||[])),e.bc=sy(a),e.aa&&e.ba(e.aa)}catch(t){oW(e,String(t.message||t))}cW(e,!1)}}function bG(e){return t=>{if(!t)return;let n=e.ag||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set;for(let e of n)(!r||e.id!==r.id)&&i.add(e.id);wW(e,i);let a=Date.now(),o=()=>{let e=scrollEl?.(),n=e?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!e||!n){Date.now()-a<2500&&requestAnimationFrame(o);return}let r=n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:Math.max(0,r-8)})};requestAnimationFrame(o)}}function xG(e){return()=>{TW(e,new Set([...e.b4,...e.c8.map(e=>e.id)]))}}function SG(e){return async()=>await oy(my(e.ah,e.ag))?(await e.cf(),!0):(oW(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function CG(e){return async t=>{try{await cn(`/api/sessions/${t}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${my(e.ah,e.ag)}`,...uy()||{}})}),await e.cf(),e.ad?.(t)}catch(t){oW(e,String(t.message||t))}}}function wG(e){return async t=>{ZU(e,e.ah.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function TG(e){return async(t,n)=>{let r=e.am;rW(e,null);try{let i=await cn(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:t.repo,path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});ZU(e,e.ah.concat(i))}catch(t){oW(e,String(t.message||t))}}}function EG(e){return t=>{let n=new Set(e.aj),r=!n.has(t);r?n.add(t):n.delete(t),tW(e,n),fetch(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`viewed`,key:t,viewed:r})}).catch(()=>{oW(e,`Saving viewed state failed — it may reset on reload.`)})}}function DG(e){return()=>{hW(e,!0),yW(e,e.av+1)}}function OG(e){return t=>{SW(e,t),t.hit&&setTimeout(()=>e.ck(t.hit.key),0)}}function kG(e){return t=>{let n=e.y.querySelector(`details[data-key="${CSS.escape(t)}"]`);n&&(n.open=!0,n.scrollIntoView({block:`start`}))}}function AG(e){return t=>{pW(e,t)}}function jG(e){return t=>{lW(e,t)}}function MG(e){return t=>{wW(e,t)}}function NG(e){return(t,n)=>{e.b6??=new WeakMap,e.b7??=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.b7.unobserve(n.target),e.b6.get(n.target)?.())},{rootMargin:`600px 0px`}),e.b6.set(t,n),e.b7.observe(t)}}function PG(e){return async()=>{try{let t=await cn(`/api/workspaces/${e.a9}/review`);ZU(e,t.comments||[]),tW(e,new Set(t.viewed||[]))}catch{}}}function FG(e){return async()=>{ZU(e,[]),rW(e,null),await fetch(`/api/workspaces/${e.a9}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}R(`i19`,sG),R(`i20`,cG),R(`i22`,lG),R(`i21`,uG),R(`i27`,dG),R(`i25`,fG),R(`i24`,pG),R(`i26`,mG),R(`i23`,hG),R(`i0`,gG),R(`i6`,_G),R(`i5`,vG),R(`i3`,yG),R(`i2`,bG),R(`i7`,xG),R(`i12`,SG),R(`i13`,CG),R(`i10`,wG),R(`i9`,TG),R(`i8`,EG),R(`i15`,DG),R(`i16`,OG),R(`i14`,kG),R(`i28`,AG),R(`i18`,jG),R(`i17`,MG),R(`i1`,NG),R(`i4`,PG),R(`i11`,FG);var IG=Object.defineProperty,LG=Object.getOwnPropertyDescriptor,RG=(e,t)=>{for(var n in t)IG(e,n,{get:t[n],enumerable:!0})},zG=(e,t,n,r)=>{for(var i=r>1?void 0:r?LG(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&IG(t,n,i),i},q=(e,t)=>(n,r)=>t(n,r,e),BG=`Terminal input`,VG={get:()=>BG,set:e=>BG=e},HG=`Too much output to announce, navigate to rows manually to read`,UG={get:()=>HG,set:e=>HG=e};function WG(e){return e.replace(/\r?\n/g,`\r`)}function GG(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function KG(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function qG(e,t,n,r){e.stopPropagation(),e.clipboardData&&JG(e.clipboardData.getData(`text/plain`),t,n,r)}function JG(e,t,n,r){e=WG(e),e=GG(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function YG(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function XG(e,t,n,r,i){YG(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ZG(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function QG(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var $G=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},eK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},tK=``,nK=` `,rK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new iK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},iK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},aK=class e extends rK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new iK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ZG(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},oK=`di$target`,sK=`di$dependencies`,cK=new Map;function lK(e){return e[sK]||[]}function uK(e){if(cK.has(e))return cK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);dK(t,e,r)};return t._id=e,cK.set(e,t),t}function dK(e,t,n){t[oK]===t?t[sK].push({id:e,index:n}):(t[sK]=[{id:e,index:n}],t[oK]=t)}var fK=uK(`BufferService`),pK=uK(`CoreMouseService`),mK=uK(`CoreService`),hK=uK(`CharsetService`),gK=uK(`InstantiationService`),_K=uK(`LogService`),vK=uK(`OptionsService`),yK=uK(`OscLinkService`),bK=uK(`UnicodeService`),xK=uK(`DecorationService`),SK=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new aK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):CK(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};SK=zG([q(0,fK),q(1,vK),q(2,yK)],SK);function CK(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1533
1533
|
|
|
1534
1534
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var wK=uK(`CharSizeService`),TK=uK(`CoreBrowserService`),EK=uK(`MouseService`),DK=uK(`RenderService`),OK=uK(`SelectionService`),kK=uK(`CharacterJoinerService`),AK=uK(`ThemeService`),jK=uK(`LinkProviderService`),MK=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?RK.isErrorNoTelemetry(e)?new RK(e.message+`
|
|
1535
1535
|
|
|
@@ -1611,5 +1611,5 @@ out vec4 outColor;
|
|
|
1611
1611
|
|
|
1612
1612
|
void main() {
|
|
1613
1613
|
outColor = v_color;
|
|
1614
|
-
}`,l2=8,u2=l2*Float32Array.BYTES_PER_ELEMENT,d2=20*l2,f2=class{constructor(){this.attributes=new Float32Array(d2),this.count=0}},p2=0,m2=0,h2=0,g2=0,_2=0,v2=0,y2=0,b2=class extends G${constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new f2,this._verticesCursor=new f2;let i=this._gl;this._program=p1(z0(i,s2,c2)),this._register(H$(()=>i.deleteProgram(this._program))),this._projectionLocation=p1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(H$(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(H$(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=p1(i.createBuffer()),this._register(H$(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,u2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,u2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,u2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,R0),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*t2,d=e.cells[u+n2],f=e.cells[u+r2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*l2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*l2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*l2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:p2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:p2=(n&16777215)<<8;break;case 0:default:p2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:p2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:p2=(r&16777215)<<8;break;case 0:default:p2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=V0(e.attributes,this._terminal.rows*this._terminal.cols*l2)),m2=i*this._dimensions.device.cell.width,h2=o*this._dimensions.device.cell.height,g2=(p2>>24&255)/255,_2=(p2>>16&255)/255,v2=(p2>>8&255)/255,y2=1,this._addRectangle(e.attributes,t,m2,h2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,g2,_2,v2,y2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},x2=class extends G${constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(H$(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=p1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=j0(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=N1,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},S2=class extends x2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&k0(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},C2=typeof window==`object`?window:globalThis,w2=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new _0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new _0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};w2.INSTANCE=new w2;var T2=w2;function E2(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}T2.INSTANCE.onDidChangeZoomLevel,T2.INSTANCE.onDidChangeFullscreen;var D2=typeof navigator==`object`?navigator.userAgent:``;D2.indexOf(`Firefox`);var O2=D2.indexOf(`AppleWebKit`)>=0;!(D2.indexOf(`Chrome`)>=0)&&D2.indexOf(`Safari`),D2.indexOf(`Electron/`),D2.indexOf(`Android`);var k2=!1;if(typeof C2.matchMedia==`function`){let e=C2.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=C2.matchMedia(`(display-mode: fullscreen)`);k2=e.matches,E2(C2,e,({matches:e})=>{k2&&t.matches||(k2=e)})}function A2(){return k2}var j2=`en`,M2=!1,N2=!1,P2=!1,F2=j2,I2,L2=globalThis,R2;typeof L2.vscode<`u`&&typeof L2.vscode.process<`u`?R2=L2.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(R2=process);var z2=typeof R2?.versions?.electron==`string`&&R2?.type===`renderer`;if(typeof R2==`object`){R2.platform,R2.platform,M2=R2.platform===`linux`,M2&&R2.env.SNAP&&R2.env.SNAP_REVISION,R2.env.CI||R2.env.BUILD_ARTIFACTSTAGINGDIRECTORY,F2=j2;let e=R2.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,F2=t.resolvedLanguage||j2,t.languagePack?.translationsConfigFile}catch{}N2=!0}else typeof navigator==`object`&&!z2?(I2=navigator.userAgent,I2.indexOf(`Windows`),I2.indexOf(`Macintosh`),(I2.indexOf(`Macintosh`)>=0||I2.indexOf(`iPad`)>=0||I2.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,M2=I2.indexOf(`Linux`)>=0,I2?.indexOf(`Mobi`),P2=!0,F2=globalThis._VSCODE_NLS_LANGUAGE||j2,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var B2=N2;P2&&typeof L2.importScripts==`function`&&L2.origin;var V2=I2,H2=F2,U2;(e=>{function t(){return H2}e.value=t;function n(){return H2.length===2?H2===`en`:H2.length>=3&&H2[0]===`e`&&H2[1]===`n`&&H2[2]===`-`}e.isDefaultVariant=n;function r(){return H2===`en`}e.isDefault=r})(U2||={});var W2=typeof L2.postMessage==`function`&&!L2.importScripts;(()=>{if(W2){let e=[];L2.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),L2.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var G2=!!(V2&&V2.indexOf(`Chrome`)>=0);V2&&V2.indexOf(`Firefox`),!G2&&V2&&V2.indexOf(`Safari`),V2&&V2.indexOf(`Edg/`),V2&&V2.indexOf(`Android`);var K2=typeof navigator==`object`?navigator:{};B2||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||K2&&K2.clipboard&&K2.clipboard.writeText,B2||K2&&K2.clipboard&&K2.clipboard.readText,B2||A2()||K2.keyboard,`ontouchstart`in C2||K2.maxTouchPoints,C2.PointerEvent&&(`ontouchstart`in C2||navigator.maxTouchPoints);var q2=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},J2=new q2,Y2=new q2,X2=new q2;Array(230);var Z2;(e=>{function t(e){return J2.keyCodeToStr(e)}e.toString=t;function n(e){return J2.strToKeyCode(e)}e.fromString=n;function r(e){return Y2.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return X2.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Y2.strToKeyCode(e)||X2.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return J2.keyCodeToStr(e)}e.toElectronAccelerator=o})(Z2||={});var Q2=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),$2;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof e4?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Q2})})($2||={});var e4=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Q2:(this._emitter||=new _0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var t4;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(t4||={});var n4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new _0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await i0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};n4.EMPTY=n4.fromArray([]);function r4(e){return i4(e,0)}function i4(e,t){switch(typeof e){case`object`:return e===null?a4(349,t):Array.isArray(e)?c4(e,t):l4(e,t);case`string`:return s4(e,t);case`boolean`:return o4(e,t);case`number`:return a4(e,t);case`undefined`:return a4(937,t);default:return a4(617,t)}}function a4(e,t){return(t<<5)-t+e|0}function o4(e,t){return a4(e?433:863,t)}function s4(e,t){t=a4(149417,t);for(let n=0,r=e.length;n<r;n++)t=a4(e.charCodeAt(n),t);return t}function c4(e,t){return t=a4(104579,t),e.reduce((e,t)=>i4(t,e),t)}function l4(e,t){return t=a4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=s4(n,t),i4(e[n],t)),t)}var{registerWindow:Wre,getWindow:u4,getDocument:Gre,getWindows:Kre,getWindowsCount:qre,getWindowId:Jre,getWindowById:Yre,hasWindow:Xre,onDidRegisterWindow:Zre,onWillUnregisterWindow:Qre,onDidUnregisterWindow:$re}=function(){let e=new Map,t={window:C2,disposables:new W$};e.set(C2.vscodeWindowId,t);let n=new _0,r=new _0,i=new _0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return G$.None;let a=new W$,o={window:t,disposables:a.add(new W$)};return e.set(t.vscodeWindowId,o),a.add(H$(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(f4(t,m4.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:C2},getDocument(e){return u4(e).document}}}(),d4=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function f4(e,t,n,r){return new d4(e,t,n,r)}var p4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};p4.None=new p4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=r4(n),a=r.get(i);if(a)a.users+=1;else{let o=new _0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(H$(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var m4={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:O2?`webkitAnimationStart`:`animationstart`,ANIMATION_END:O2?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:O2?`webkitAnimationIteration`:`animationiteration`},h4=class extends G${constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new K$,this._charAtlasDisposable=this._register(new K$),this._observerDisposable=this._register(new K$),this._model=new o2,this._workCell=new L0,this._workCell2=new L0,this._rectangleRenderer=this._register(new K$),this._glyphRenderer=this._register(new K$),this._onChangeTextureAtlas=this._register(new _0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new _0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new _0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new j1(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new S2(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=x1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(f4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(f4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,M0(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=F0(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=F0(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(H$(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),M0(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Q0(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=j0(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=V$(i0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),i0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new P0(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=_4(e,n.rows-1,0),t=_4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new g4(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*t2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+n2]!==this._cellColorResolver.result.bg||this._model.cells[v+r2]!==this._cellColorResolver.result.fg||this._model.cells[v+i2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=a2),this._model.cells[v]=g,this._model.cells[v+n2]=this._cellColorResolver.result.bg,this._model.cells[v+r2]=this._cellColorResolver.result.fg,this._model.cells[v+i2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*t2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,e1,0,0),this._model.cells[b]=0,this._model.cells[b+n2]=this._cellColorResolver.result.bg,this._model.cells[b+r2]=this._cellColorResolver.result.fg,this._model.cells[b+i2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},g4=class extends $1{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function _4(e,t,n=0){return Math.max(Math.min(e,t),n)}var v4=`di$target`,y4=`di$dependencies`,b4=new Map;function x4(e){if(b4.has(e))return b4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);S4(t,e,r)};return t._id=e,b4.set(e,t),t}function S4(e,t,n){t[v4]===t?t[y4].push({id:e,index:n}):(t[y4]=[{id:e,index:n}],t[v4]=t)}x4(`BufferService`),x4(`CoreMouseService`),x4(`CoreService`),x4(`CharsetService`),x4(`InstantiationService`),x4(`LogService`);var C4=x4(`OptionsService`);x4(`OscLinkService`),x4(`UnicodeService`),x4(`DecorationService`);var w4={trace:0,debug:1,info:2,warn:3,error:4,off:5},T4=`xterm.js: `,E4=class extends G${constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),D4=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=w4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:T4)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};E4=w$([T$(0,C4)],E4);var D4,O4=class extends G${constructor(e){if(Q$&&$$()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new _0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new _0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new h4(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(i0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(i0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(i0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(i0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(H$(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},k4=2,A4=1,j4=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(k4,Math.floor(u/e.css.cell.width)),rows:Math.max(A4,Math.floor(l/e.css.cell.height))}}},M4=`3.7.8`,N4=M4,P4=typeof Buffer==`function`,F4=typeof TextDecoder==`function`?new TextDecoder:void 0,I4=typeof TextEncoder==`function`?new TextEncoder:void 0,L4=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),R4=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(L4),z4=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,B4=String.fromCharCode.bind(String),V4=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),H4=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),U4=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),W4=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=L4[t>>18&63]+L4[t>>12&63]+L4[t>>6&63]+L4[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},G4=typeof btoa==`function`?e=>btoa(e):P4?e=>Buffer.from(e,`binary`).toString(`base64`):W4,K4=P4?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(B4.apply(null,e.subarray(n,n+4096)));return G4(t.join(``))},q4=(e,t=!1)=>t?H4(K4(e)):K4(e),J4=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?B4(192|t>>>6)+B4(128|t&63):B4(224|t>>>12&15)+B4(128|t>>>6&63)+B4(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return B4(240|t>>>18&7)+B4(128|t>>>12&63)+B4(128|t>>>6&63)+B4(128|t&63)},Y4=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,X4=e=>e.replace(Y4,J4),Z4=P4?e=>Buffer.from(e,`utf8`).toString(`base64`):I4?e=>K4(I4.encode(e)):e=>G4(X4(e)),Q4=(e,t=!1)=>t?H4(Z4(e)):Z4(e),$4=e=>Q4(e,!0),e3=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,t3=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return B4((t>>>10)+55296)+B4((t&1023)+56320);case 3:return B4((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return B4((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},n3=e=>e.replace(e3,t3),r3=e=>{if(e=e.replace(/\s+/g,``),!z4.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=R4[e.charAt(a++)]<<18|R4[e.charAt(a++)]<<12|(n=R4[e.charAt(a++)])<<6|(r=R4[e.charAt(a++)]),n===64?i.push(B4(t>>16&255)):r===64?i.push(B4(t>>16&255,t>>8&255)):i.push(B4(t>>16&255,t>>8&255,t&255));return i.join(``)},i3=typeof atob==`function`?e=>atob(U4(e)):P4?e=>Buffer.from(e,`base64`).toString(`binary`):r3,a3=P4?e=>V4(Buffer.from(e,`base64`)):e=>V4(i3(e).split(``).map(e=>e.charCodeAt(0))),o3=e=>a3(c3(e)),s3=P4?e=>Buffer.from(e,`base64`).toString(`utf8`):F4?e=>F4.decode(a3(e)):e=>n3(i3(e)),c3=e=>U4(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),l3=e=>s3(c3(e)),u3=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},d3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),f3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,d3(t));e(`fromBase64`,function(){return l3(this)}),e(`toBase64`,function(e){return Q4(this,e)}),e(`toBase64URI`,function(){return Q4(this,!0)}),e(`toBase64URL`,function(){return Q4(this,!0)}),e(`toUint8Array`,function(){return o3(this)})},p3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,d3(t));e(`toBase64`,function(e){return q4(this,e)}),e(`toBase64URI`,function(){return q4(this,!0)}),e(`toBase64URL`,function(){return q4(this,!0)})},m3={version:M4,VERSION:N4,atob:i3,atobPolyfill:r3,btoa:G4,btoaPolyfill:W4,fromBase64:l3,toBase64:Q4,encode:Q4,encodeURI:$4,encodeURL:$4,utob:X4,btou:n3,decode:l3,isValid:u3,fromUint8Array:q4,toUint8Array:o3,extendString:f3,extendUint8Array:p3,extendBuiltins:()=>{f3(),p3()}},h3=class{constructor(e=new _3,t=new g3){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},g3=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},_3=class{encodeText(e){return m3.encode(e)}decodeText(e){let t=m3.decode(e);return!m3.isValid(e)||m3.encode(t)!==e?``:t}},v3=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=b3.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function y3(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var b3=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!y3(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},x3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function S3(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var C3=class{constructor(e=S3,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||x3;this._linkProvider=this._terminal.registerLinkProvider(new v3(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function w3(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function T3(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function E3(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function D3(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var O3=450,k3=12,A3=` ·│┃()[]{}<>'"\`,;│|`;function j3(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||A3.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},O3)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>k3&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&oy(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var M3=5;function N3(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<M3)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await oy(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}var $={iconBtn:`_b5 _cP`,termWrap:`_b6`,term:`_b7`,xterm:`_b8`,termDead:`_b9`,termCopied:`_b_`,termCopiedFade:`_ca`,termUploading:`_cb`,trapBackdrop:`_cc`,pasteTrap:`_cd`,kbSlot:`_ce`,keyBar:`_cf`,kspacer:`_cg`,sessBtn:`_ch`,sessDot:`_ci`,sessPop:`_cj`,sessRow:`_ck`,current:`_cl`,sessOpen:`_cm`,sessTitle:`_cn`,sessX:`_co`,armed:`_cp`,sessEdit:`_cq`,sessNew:`_cr`,lone:`_cs`,kbarWs:`_ct`,kbarWsName:`_cu`,kbtn:`_cv _cP`,kbtnEsc:`_cw`,dpadGrid:`_cx`,repeat:`_cy`,kbToggle:`_cz`,on:`_cA`,bigGlyph:`_cB`,enter:`_cC`},P3=ri,F3=(e=>`/${e}&`)(ii);function I3(e){si(e.a,`M15 4L8 20`)}var L3=(e,t)=>ai(e.a,t),R3=(e,t)=>oi(e.a,t),z3=ri,B3=(e=>`/${e}&`)(ii);function V3(e){si(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var H3=(e,t)=>ai(e.a,t),U3=(e,t)=>oi(e.a,t),W3=ri,G3=(e=>`/${e}&`)(ii);function K3(e){si(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var q3=(e,t)=>ai(e.a,t),J3=(e,t)=>oi(e.a,t),Y3=ri,X3=(e=>`/${e}&`)(ii);function Z3(e){si(e.a,`M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z M3 16L10 13L21 18 M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z`)}var Q3=(e,t)=>ai(e.a,t),$3=(e,t)=>oi(e.a,t),e6=`<div><div></div><!><!><!><!></div><!><!>`,t6=` D b%b%b%b%l%c`,n6=400,r6=55,i6=3e4,a6=150,o6=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`attach`}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`key`,label:`⇥`,seq:` `},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],s6=L(`u20`,e=>A(e.a,`click`,function(){e._._._.f.click()})),c6=e=>{Z3(e.b),Q3(e.b,16),$3(e.b),s6(e)},l6=e=>B(e.a,$.termCopied),u6=e=>B(e.a,$.termUploading),d6=L(`u19`,e=>{A(e.a,`pointerdown`,function(e){e.preventDefault()}),A(e.a,`click`,function(){e._._._._.al()})}),f6=e=>{K3(e.b),q3(e.b,16),J3(e.b),d6(e)},p6=P(0,2,e=>{B(e.a,[$.repeat,{[$.enter]:e._.e===`↵`,[$.bigGlyph]:e._.e===`↵`||e._.e===`⇥`}]),V(e.b,e._.e)}),m6=L(`u21`,e=>{A(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.af(e._.f)}),A(e.a,`pointerup`,function(){e._._._._.ag()}),A(e.a,`pointercancel`,function(){e._._._._.ag()}),A(e.a,`pointerleave`,function(){e._._._._.ag()}),A(e.a,`contextmenu`,function(e){e.preventDefault()})}),h6=O(0,(e=>`<button title=Paste>${e}</button>`)(W3),(e=>` D/${e}&l`)(G3),f6,(e=>`<button title="Attach image">${e}</button>`)(Y3),(e=>` D/${e}&l`)(X3),c6,`<button> </button>`,` D `,e=>{p6._(e),m6(e)}),g6=(e,t)=>h6(e,t===`paste`?0:t===`attach`?1:2),_6=(e,t)=>{g6(e,t[0]?.kind),v6(e,t[0]?.label),y6(e,t[0]?.seq)},v6=M(4),y6=M(5),b6=k(0,`<!><!><!>`,`b%`,0,_6),x6=(e,t)=>b6(e,[t]),S6=(e,t)=>x6(e,t[0]),C6=I(60,L(`u17`,e=>A(e.a,`click`,function(){e._._.a7?.send(`\x1B`)})),e=>e._._),w6=L(`u18`,e=>A(e.a,`pointerdown`,function(e){e.preventDefault()})),T6=e=>{C6(e),B(e.a,[$.kbtn,$.kbtnEsc]),w6(e)},E6=P(5,0,L(`u8`,e=>{e._.a5&&setTimeout(()=>e.c?.focus(),50)})),D6=L(`u9`,e=>{A(e.a,`click`,function(){j8(e._,!1)}),A(e.b,`click`,function(e){e.stopPropagation()}),A(e.c,`paste`,function(t){t.preventDefault(),e._.ak(t.clipboardData)}),A(e.d,`click`,function(){j8(e._,!1)})}),O6=e=>{E6._(e),B(e.a,$.trapBackdrop),B(e.b,$.pasteTrap),D6(e)},k6=L(`u7`,e=>A(e.b,`click`,function(){E8(e._,!1)})),A6=e=>{B(e.a,$.termDead),k6(e)},j6=I(51,e=>B(e.b,[`dot`,ti(e._._.r)]),e=>e._._),M6=e=>{j6(e),N6(e),B(e.a,$.kbarWs),B(e.c,$.kbarWsName)},N6=I(57,e=>V(e.d,e._._.y),e=>e._._),P6=L(`u15`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.p?.(e.d)})),F6=e=>{B(e.a,$.iconBtn),e.b,Ni(e.b,15),Li(e.b),P6(e)},I6=M(3,e=>{z(e.a,`title`,`New ${e.d} session`),Ii(e.b,e.d)}),L6=(e,t)=>I6(e,t[0]),R6=N(1,e=>{B(e.a,[$.sessX,{[$.armed]:e._._._.g===e._.k}]),z(e.a,`title`,e._._._.g===e._.k?`Really kill this session?`:`Kill session`)}),z6=I(8,R6,e=>e._._._),B6=L(`u13`,e=>A(e.a,`click`,function(t,n){e._._._.g===e._.k?(c8(e._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._.w?.(e._.k)):c8(e._._._,e._.k)})),V6=e=>{z6(e),H6._(e),B6(e)},H6=P(7,0,R6),U6=L(`u12`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.v?.(e._.k)})),W6=e=>{B(e.a,[$.sessX,$.sessEdit]),Om(e.b),km(e.b,12),Am(e.b),U6(e)},G6=N(11,e=>B(e.a,[$.sessRow,{[$.current]:e.k===e._._._._.t}])),K6=I(53,G6,e=>e._._._._),q6=L(`u14`,e=>A(e.b,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e.k!==e._._._._.t&&e._._._._.u?.(e.k)})),J6=e=>{K6(e),X6(e),Q6(e),B(e.b,$.sessOpen),e.d,Ni(e.d,14),Li(e.d),B(e.e,$.sessTitle),q6(e)},Y6=O(6,(e=>`<button title="Rename session">${e}</button>`)(Em),(e=>` D/${e}&l`)(Dm),W6),X6=I(54,e=>Y6(e,+!e._._._._.v),e=>e._._._._),Z6=O(7,`<button>×</button>`,` `,V6),Q6=I(55,e=>Z6(e,+!e._._._._.w),e=>e._._._._),$6=M(10,e=>{G6(e),H6(e)}),e8=(e,t)=>B(e.c,[`dot`,ti(t)]),t8=N(15,e=>V(e.f,e.o||e.n)),n8=M(13,e=>{Ii(e.d,e.n),t8(e)}),r8=M(14,t8),i8=k(0,(e=>`<div><button><span></span>${e}<span> </span></button><!><!></div>`)(Ci),(e=>` D D b/${e}& D m%b%l`)(`b%c`),J6,(e,t)=>{$6(e,t[0]?.id),e8(e,t[0]?.state),n8(e,t[0]?.agent),r8(e,t[0]?.title)}),a8=I(52,e=>i8(e,[e._._._.s||[],`id`]),e=>e._._._),o8=a8,s8=I(50,e=>Ii(e.b,e._._.q||`shell`),e=>e._._),c8=j(6,F(z6)),l8=(e,t)=>{z(e.a,`popovertarget`,t),z(e.d,`id`,t)},u8=L(`u16`,e=>A(e.d,`toggle`,function(t,n){if(c8(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),d8=e=>{s8(e),f8(e),m8(e),g8(e),B(e.a,[$.kbtn,$.sessBtn]),e.b,Ni(e.b,16),Li(e.b),B(e.d,$.sessPop),c8(e,null),l8(e,Xe(e)),u8(e)},f8=I(51,e=>B(e.c,[`dot`,$.sessDot,ti(e._._.r)]),e=>e._._),p8=O(4,`<!><!><!>`,`b%`,o8),m8=I(52,e=>{B(e.f,[$.sessNew,{[$.lone]:(e._._.s||[]).length<=1}]),p8(e,(e._._.s||[]).length>1?0:1)},e=>e._._),h8=k(5,(e=>`<button>${e}</button>`)(Ci),(e=>` D/${e}&l`)(`b%c`),F6,L6),g8=I(56,e=>h8(e,[[...e._._.x||[],`shell`],e=>e]),e=>e._._),_8=L(`u11`,e=>{A(e.a,`click`,function(){e._._.m?.()}),A(e.c,`click`,function(){e._._.n?.()}),A(e.e,`click`,function(){e._._.o?.()})}),v8=e=>{B(e.a,$.kbtn),ng(e.b),rg(e.b,16),ig(e.b),B(e.c,$.kbtn),hi(e.d),gi(e.d,16),_i(e.d),B(e.e,$.kbtn),ui(e.f),di(e.f,16),fi(e.f),_8(e)},eie=L(`u10`,e=>A(e.a,`click`,function(){e._._.l?.()})),tie=O(2,(e=>`<button title="Back to terminal">${e}</button>`)(Bb),(e=>` D/${e}&l`)(Vb),e=>{B(e.a,$.kbtn),Hb(e.b),Ub(e.b,16),Wb(e.b),eie(e)},((e,t,n)=>`<button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button title="Review changes">${n}</button>`)(eg,pi,ci),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l`)(tg,mi,li),v8),nie=O(10,`<button title=Escape>esc</button>`,` `,T6),rie=O(3,(e=>`<button title=Sessions>${e}<span></span></button><div popover=auto><!><div></div></div>`)(Ci),(e=>` D/${e}& l D%b l`)(`b%c`),d8),y8=N(13,e=>rie(e,e._.k!==`diff`&&e._.p?0:1)),b8=P(6,0,e=>{tie(e,e._.k===`diff`?0:1),nie(e,+(e._.k===`diff`)),y8(e)}),iie=(e,t)=>{z(e.g,`popovertarget`,t),z(e.l,`id`,t)},aie=k(11,`<!><!><!>`,`b%`,0,S6),oie=L(`u23`,e=>{A(e.f,`change`,function(t,n){for(let t of n.files||[])e._.ah(t);n.value=``}),A(e.g,`pointerdown`,function(e){e.preventDefault()}),A(e.i,`pointerdown`,function(e){e.preventDefault()}),A(e.l,`pointerdown`,function(e){e.preventDefault()}),A(e.l,`toggle`,function(t,n){if(t.newState===`open`){let t=e.g.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.bottom=`auto`}})}),sie=e=>{b8._(e),x8._(e),S8._(e),C8._(e),lie._(e),B(e.a,$.kbSlot),B(e.b,$.keyBar),B(e.d,$.kspacer),B(e.g,[$.kbtn,`dpad-btn`]),I3(e.h),L3(e.h,16),R3(e.h),V3(e.j),H3(e.j,16),U3(e.j),B(e.l,$.dpadGrid),iie(e,Xe(e)),aie(e,[o6]),oie(e)},x8=P(6,0,y8),cie=O(4,`<span aria-hidden=true><span></span><span> </span></span>`,` D b D `,M6),S8=P(6,0,e=>cie(e,+!e._.y)),C8=P(6,0,e=>{B(e.i,[$.kbtn,$.kbToggle,{[$.on]:e._.a1}]),z(e.i,`title`,e._.a1?`Hide keyboard`:`Show keyboard`)}),lie=P(6,0,L(`u22`,e=>A(e.i,`click`,function(){D8(e._,!e._.a1),e._.a7?.setKeyboard(e._.a1)}))),w8=$e(`u6`,1),uie=Qe(42),die=O(4,`<div><button class="btn primary">Reconnect</button></div>`,` D `,A6),T8=N(45,L(`u24`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new x$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:5e3,allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,linkHandler:{activate(e,t){fr(t)}}}),i=new j4;r.loadAddon(i),r.open(e.b);let a=lr();try{let e=new O4;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new h3(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>oy(t).then(()=>{})}))}catch{}r.loadAddon(new C3((e,t)=>fr(t))),i.fit();let o=a?E3(r):null,s=o?o.write:e=>r.write(e),c=w3({sessionId:e.t,term:r,write:s,onDead:()=>{E8(e,!0)},isVisible:()=>!!e.z},n);r.onData(e=>c.send(e)),r.attachCustomKeyEventHandler(t=>t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&c.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&oy(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.ab())}),!1):!(a&&t.type===`keydown`&&t.key===`Backspace`));let l=()=>{if(!e.b.clientWidth)return;let t=i.proposeDimensions();!t||t.cols===r.cols&&t.rows===r.rows||(i.fit(),c.resize(r.cols,r.rows))},u=new ResizeObserver(l);u.observe(e.b),n.addEventListener(`abort`,()=>u.disconnect());let d=()=>requestAnimationFrame(l);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||d()},{signal:n}),window.addEventListener(`pageshow`,d,{signal:n}),window.addEventListener(`focus`,d,{signal:n}),window.visualViewport?.addEventListener(`resize`,d,{signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.ah(t)}},{capture:!0,signal:n}),e.a7={send(e){c.send(e)},setKeyboard(e){let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a1&&i-t.height<a6&&(D8(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=j3(r,w8(e),{onStart(){o?.setFrozen(!0)},onEnd(){o?.setFrozen(!1)},onCopy(){e.ab()}},n);T3(r,w8(e),n,i.selecting),D3(r,e=>c.send(e),n)}else N3(r,w8(e),()=>e.ab(),n);e.z&&!a&&r.focus();let f={term:r,socket:c,abort:t,suspend:void 0};return e.z||(f.suspend=setTimeout(()=>c.disconnect(),i6)),f},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.z?(!e.a0&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a0&&!e.a2&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),i6)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),7),E8=j(26,e=>{die(e,+!e.a0),T8(e)}),D8=j(27,e=>{T8(e),C8(e)}),fie=O(6,((e,t)=>`<div><div><!><div></div><!><input type=file accept=image/* hidden><button title="More keys">${e}</button><button>${t}</button><!><div popover=auto></div></div></div>`)(P3,z3),((e,t)=>` D D%b b%b b D/${e}&l D/${t}&l%b m`)(F3,B3),sie),O8=j(28,e=>{fie(e,+!e.a2),T8(e)}),pie=O(2,`<div>uploading…</div>`,` `,u6),k8=j(29,e=>pie(e,+!e.a3)),mie=O(3,`<div>Copied</div>`,` `,l6),A8=j(30,e=>mie(e,+!e.a4)),hie=O(5,`<div><div><p class=dim>Long-press below and choose Paste</p><input placeholder="Paste here…"><button class=btn>Cancel</button></div></div>`,` D Db b `,O6),j8=j(31,e=>{hie(e,+!e.a5),E6(e)}),gie=(e,t)=>Tie(e,t.current),_ie=(e,t)=>Die(e,t.timer),vie=(e,t)=>kie(e,t.current),yie=L(`u25`,e=>{O8(e,lr()),A(e.a,`dragover`,function(e){e.preventDefault()}),A(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.ah(n)})});function bie(e){B(e.a,$.termWrap),B(e.b,$.term),E8(e,!1),D8(e,!1),O8(e,!1),k8(e,!1),A8(e,!1),j8(e,!1),gie(e,{current:null}),_ie(e,{timer:0}),vie(e,{current:null}),yie(e)}var xie=M(41),M8=N(40,e=>xie(e,F8(e))),Sie=M(46),Cie=M(47),N8=N(44,e=>{Sie(e,I8(e)),Cie(e,L8(e))}),wie=M(43,e=>{N8(e),T8(e)}),P8=N(34,e=>wie(e,R8(e))),Tie=M(33,e=>{M8(e),P8(e),N8(e),T8(e)}),Eie=M(37,T8),Die=M(36,e=>Eie(e,z8(e))),Oie=M(42),kie=M(39,e=>{Oie(e,B8(e)),M8(e)}),Aie=M(9,P8),jie=M(10,e=>{z(e.a,`hidden`,e.k===`diff`),b8(e)}),Mie=F(K6),Nie=M(19,e=>{T8(e),Mie(e)}),Pie=M(25,T8),Fie=M(11),Iie=M(12),Lie=M(13),Rie=M(14),zie=M(15,x8),Bie=M(16,F(s8)),Vie=M(17,F(f8,j6)),Hie=M(18,F(m8,a8)),Uie=M(20),Wie=M(21,F(X6)),Gie=M(22,F(Q6)),Kie=M(23,F(g8)),qie=F(N6),Jie=M(24,e=>{S8(e),qie(e)});function F8(e){return t=>{uie(e)(),e.a7?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.a7?.send(t),r6)},n6),e.ad=n}}function I8(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.ah(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.a7?.send(n)}j8(e,!1)}}function L8(e){return async()=>{if(!navigator.clipboard?.read){j8(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.ah(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.a7?.send(n)}}}catch{j8(e,!0)}}}function R8(e){return async t=>{if(t){k8(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.j}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.a7?.send(`${n.path} `)}finally{k8(e,!1)}}}}function z8(e){return()=>{clearTimeout(e.aa),A8(e,!0),e.aa=setTimeout(()=>{A8(e,!1)},1200)}}function B8(e){return()=>{let t=e.ad;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.ad=null)}}R(`u1`,F8),R(`u4`,I8),R(`u5`,L8),R(`u3`,R8),R(`u0`,z8),R(`u2`,B8);var V8={iconBtn:`_bm _cP`,spinning:`_bn _cQ`,usageModal:`_bo`,manageHead:`_bp`,usageRow:`_bq`,usageName:`_br`,usageStale:`_bs`,stale:`_bt`,usageMeters:`_bu`,meter:`_bv`,meterReset:`_bw`,meterLabel:`_bx`,meterTrack:`_by`,meterFill:`_bz`,warm:`_bA`,hot:`_bB`,meterPct:`_bC`,usageList:`_bD`},Yie=Bc,Xie=(e=>`/${e}&`)(Vc);function H8(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function Zie(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:H8(n)}var Qie=(e,t)=>V(e.i,t?`↻ ${dt(t)}`:``),U8=N(13,e=>Qie(e,Zie(e.m,e._.i!=null))),W8=We(5,U8),$ie=e=>{W8._(e),B(e.a,V8.meter),B(e.b,V8.meterLabel),B(e.d,V8.meterTrack),B(e.f,V8.meterPct),B(e.h,V8.meterReset)},G8=N(16,e=>z(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),eae=M(15,e=>{V(e.g,e.p),G8(e)}),tae=(e,t)=>{B(e.e,[V8.meterFill,{hot:t>=90,warm:t>=70&&t<90}]),ht(e.e,`width:${Math.min(100,Math.max(2,t))}%`),eae(e,Math.round(t))},nae=M(12,e=>{U8(e),G8(e)}),rae=M(14,e=>{V(e.c,e.o),G8(e)}),iae=(e,t)=>{tae(e,t[0]?.used_percent),nae(e,t[0]?.resets_at),rae(e,t[0]?.window)},K8=P(4,0,e=>{z(e.a,`title`,`plan-usage could not reach this provider — these are its last cached numbers, ${H8(e._.i*1e3)} old`),V(e.b,H8(e._.i*1e3))}),aae=e=>{K8._(e),B(e.a,V8.usageStale)},q8=P(3,0,e=>V(e.a,e._.k.replace(/^default_/,``).replaceAll(`_`,` `))),oae=q8,sae=O(4,`<span>⚠ <!> old</span>`,` Db%`,aae),cae=M(8,e=>{B(e.a,[V8.usageRow,{[V8.stale]:e.i!=null}]),sae(e,+(e.i==null)),K8(e),W8(e)}),lae=e=>{B(e.b,V8.usageName),B(e.f,V8.usageMeters)},uae=(e,t)=>V(e.c,t),dae=O(3,`<span class=dim> </span>`,`D `,oae),fae=M(10,e=>{dae(e,+!e.k),q8(e)}),pae=k(5,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,$ie,iae),mae=(e,t)=>pae(e,[t||[],`window`]),hae=k(0,`<div><div><strong> </strong><!><!></div><div></div></div>`,` D E l%b%l `,lae,(e,t)=>{cae(e,t[0]?.stale_seconds),uae(e,t[0]?.agent),fae(e,t[0]?.plan),mae(e,t[0]?.windows)}),J8=I(14,e=>hae(e,[e._._.h||[],e=>`${e.agent}-${e.account||``}`]),e=>e._._),gae=e=>{J8(e),B(e.a,V8.usageList)},Y8=I(13,e=>V(e.a,e._._.g),e=>e._._),_ae=O(4,`<p class=dim><span class=spin></span> Loading usage…</p>`,0,0,`<p class=dim> </p>`,`D `,Y8,`<div></div>`,` `,gae),X8=I(12,e=>_ae(e,e._.f?e._.f?.error?1:2:0)),vae=L(`w2`,e=>A(e.c,`click`,function(){e._.k()})),yae=e=>{X8(e),Z8(e),bae(e),B(e.a,V8.manageHead),Ts(e.d),Es(e.d,13),Ds(e.d),vae(e)},Z8=I(15,e=>{B(e.c,[V8.iconBtn,{[V8.spinning]:e._.i}]),z(e.c,`disabled`,e._.i)}),bae=I(16,e=>z(e.b,`id`,e._.l)),xae=lt(`w3`,(e=>`<header><div><h2>Usage</h2></div><button title="Refresh usage" aria-label="Refresh usage">${e}</button></header><!><!>`)(Cs),(e=>` E l D/${e}&m%c`)(ws),yae),Sae=F(X8),Q8=j(5,e=>{Cae(e,e.f?.error),wae(e,e.f?.agents),Sae(e)}),Cae=M(6,F(Y8)),wae=M(7,F(J8)),$8=j(8,F(Z8)),Tae=M(10),Eae=L(`w4`,e=>Tt(e,{onMount:function(){e.j(!1)}})),Dae=M(9,e=>{Tae(e,e5(e)),Eae(e)}),Oae=M(11,e=>il(e.a,e.l));function kae(e){cl(e.a),Hc(e.a,xae(e)),al(e.a,`Usage`),nl(e.a,V8.usageModal),ol(e.a),Yc(e.a),dl(e.a),ul(e.a,{}),Q8(e,null),$8(e,!1),Dae(e,t5(e)),Oae(e,Xe(e))}var Aae=(e,t)=>Qc(e.a,t),jae=(e,t)=>tl(e.a,t);function e5(e){return async()=>{$8(e,!0),await e.j(!0),$8(e,!1)}}function t5(e){return async t=>{try{Q8(e,await cn(`/api/usage${t?`?refresh`:``}`))}catch(t){Q8(e,{error:String(t.message||t)})}}}R(`w1`,e5),R(`w0`,t5);var n5={promptDlg:`_bE`,promptTitle:`_bF`},Mae=Bc,Nae=(e=>`/${e}&`)(Vc),Pae=lt(`p2`,`Cancel`),Fae=Qe(2,`B2`),r5=I(15,e=>V(e.b,e._.i)),Iae=L(`p4`,e=>{Pt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._.n()):t.key===`Escape`&&e._.l&&c5(e._,!1)})}),Lae=e=>{r5(e),i5(e),a5(e),Rae(e),B(e.a,n5.promptTitle),Iae(e)},i5=I(17,e=>z(e.c,`placeholder`,e._.k)),a5=I(18,e=>Nt(e,`c`,e._.l,f5(e))),Rae=I(19,e=>z(e.a,`id`,e._.o)),zae=lt(`p6`,`<h2> </h2><input>`,` D l `,Lae,0,`B2`),o5=I(16,e=>V(e.b,e._.j||`OK`)),Bae=L(`p3`,e=>A(e.a,`click`,function(){e._.n()})),Vae=e=>{o5(e),s5(e),e.c,bs(e.c,Pae(e)),Ss(e.c,{class:`btn`}),Bae(e)},s5=I(18,e=>z(e.a,`disabled`,!e._.l.trim())),Hae=ut(`p5`,(e=>`<button type=button class="btn primary"> </button><div class=spacer></div>${e}`)(vs),(e=>` D lb/${e}&`)(ys),Vae),c5=Ue(9),l5=N(5,e=>c5(e,e.d,e.e)),Uae=M(3,e=>{Qc(e.a,e.d),l5(e)}),Wae=M(4,e=>{tl(e.a,e.e),l5(e)}),Gae=M(13),u5=N(12,e=>Gae(e,p5(e))),Kae=F(s5,a5),d5=j(11,e=>{u5(e),Kae(e)}),qae=(e,t)=>d5(e,t||``),Jae=M(7,u5),Yae=M(14,e=>il(e.a,e.o)),Xae=L(`p7`,e=>Tt(e,{onMount:function(){setTimeout(()=>{let t=Fae(e)();t?.focus(),t?.select()},0)}}));function Zae(e){cl(e.a),dl(e.a,an({content:Hae(e)})),Hc(e.a,zae(e)),nl(e.a,n5.promptDlg),ol(e.a),Yc(e.a),ul(e.a,{}),Yae(e,Xe(e)),Xae(e)}var Qae=F(r5),$ae=M(8,e=>{al(e.a,e.i),Qae(e)}),eoe=M(9,F(o5)),toe=M(10,F(i5));function f5(e){return t=>{d5(e._,t)}}function p5(e){return()=>{let t=e.l.trim();t&&e.h(t)}}R(`p0`,f5),R(`p1`,p5);var noe=(e=>`<div>${e}<div><!><!><div></div></div><!><!></div>`)(bg),roe=(e=>` D/${e}& D%b%b l%b%l`)(xg),ioe=e=>B(e.a,Cm.padInline),m5=P(7,0,e=>Uae(e.a,!!e._.a5)),aoe=e=>{m5._(e),g5._(e),_5._(e),y5._(e),b5._(e),Zae(e.a),$ae(e.a,`Rename session`),eoe(e.a,`Rename`),Wae(e.a,h7(e)),toe(e.a)},h5=N(1,e=>qae(e.a,e._.a6||e._.a7)),g5=P(7,0,h5),_5=P(7,0,h5),v5=N(2,e=>Jae(e.a,g7(e))),y5=P(7,0,v5),b5=P(7,0,v5),x5=I(69,e=>V(e.a,e._._.a3),e=>e._._),ooe=ut(`x31`,` `,` `,x5),soe=e=>{Vr(e.a),Gr(e.a,ooe(e)),Yr(e.a,_7(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},S5=P(6,0,e=>Aae(e.a,e._.a2)),coe=e=>{S5._(e),kae(e.a),jae(e.a,v7(e))},C5=N(3,e=>V(e.c,e._._.a4?`Starting…`:`Start ${e._._.n||`claude`}`)),w5=I(63,C5,e=>e._._),loe=L(`x32`,e=>A(e.b,`click`,function(){e._._.am(e._._.n||`claude`,!0)})),uoe=e=>{w5(e),T5(e),B(e.a,Cm.emptySess),loe(e)},T5=I(70,e=>{z(e.b,`disabled`,e._._.a4),C5(e)},e=>e._._),E5=N(8,e=>Pie(e.b,e._._.m&&e._._.x===`term`&&e.g===e._._.al),3),D5=I(62,E5,e=>e._._),doe=e=>{D5(e),O5(e),k5(e),j5(e),M5(e),N5(e),F5(e),I5(e),L5(e),bie(e.b),Uie(e.b,S7(e)),Rie(e.b,x7(e)),Fie(e.b,b7(e)),Iie(e.b,y7(e))},O5=I(64,e=>Kie(e.b,e._._.q),e=>e._._),k5=I(65,e=>{jie(e.b,e._._.x),E5(e)},e=>e._._),A5=N(11,e=>zie(e.b,C7(e))),j5=I(75,e=>{Aie(e.b,e._._.aa),Lie(e.b,w7(e)),A5(e)},e=>e._._),M5=I(76,e=>Jie(e.b,e._._.af),e=>e._._),N5=I(77,e=>{Hie(e.b,e._._.ai),Wie(e.b,T7(e))},e=>e._._),foe=de(3,0,2),P5=N(7,e=>foe(e,e.g===e._._.al)),F5=I(79,e=>{E5(e),P5(e)},e=>e._._),I5=I(80,e=>Gie(e.b,E7(e)),e=>e._._),L5=I(82,A5,e=>e._._),poe=M(6,e=>{Nie(e.b,e.g),E5(e),P5(e)}),moe=(e,t)=>Vie(e.b,t),hoe=(e,t)=>Bie(e.b,t),goe=k(0,(e=>`<!><!>${e}<!><!><!>`)(e6),(e=>`b%b/${e}&%b%c`)(t6),doe,(e,t)=>{poe(e,t[0]?.id),moe(e,t[0]?.state),hoe(e,t[0]?.agent)}),R5=P(5,0,e=>goe(e,[e._.ai,`id`])),_oe=e=>{R5._(e),z5._(e)},voe=O(1,`<div><p class=dim>No sessions in this workspace.</p><button class="btn primary"> </button></div>`,` Db D `,uoe),z5=P(5,0,e=>voe(e,+!!e._.ak)),B5=N(4,e=>XW(e.b,e._.m&&e._.x===`diff`)),V5=P(4,0,B5),H5=e=>{V5._(e),U5._(e),W5._(e),G5._(e),K5._(e),q5._(e),jW(e.b),rG(e.b,O7(e)),aG(e.b,D7(e))},yoe=de(3,0,2),U5=P(4,0,e=>{yoe(e,e._.x===`diff`),B5(e)}),W5=P(4,0,e=>YW(e.b,e._.z)),G5=P(4,0,e=>ZW(e.b,e._.a0)),K5=P(4,0,e=>JW(e.b,e._.aa)),q5=P(4,0,e=>oG(e.b,e._.ai||[])),boe=M(59,b5),xoe=O(5,`<!><!><!><!>`,`b%b%`,_oe,`<p>Loading sessions…</p>`,` `,ioe),Soe=F(F5),Coe=M(47,e=>{Q_(e.b,e.al),Soe(e)}),J5=N(45,e=>Coe(e,(()=>{if(e.v&&e.ai?.some(t=>t.id===e.v))return e.v;let t=Xn(e.aa);return t&&e.ai?.some(e=>e.id===t)?t:e.ai?.[0]?.id??null})()),2),woe=F(N5),Toe=M(44,e=>{Iv(e.b,e.ai),Zoe(e,e.ai?.length),xoe(e,+!e.ai),J5(e),q5(e),R5(e),woe(e)}),Y5=N(39,e=>Toe(e,e.u??e.l?.[e.aa]?.sessions??null),2),X5=N(57,L(`x33`,e=>Tt(e,{active:e.m,load:e.au,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.timer??=setInterval(r.refresh,1e4)):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return jn().addEventListener(`sessions.changed`,t=>{let n=t.data?.workspaceId;r.started&&(!n||n===e.aa)&&r.refresh()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),fee(()=>{if(!this.active)return;let t=In(e.aa);t&&e.ag(t.pr);let n=Rn(e.aa);n&&(i7(e,n),a7(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),3),Eoe=M(56,X5),Z5=N(55,e=>Eoe(e,A7(e)),2),Doe=M(54,Z5),Q5=N(52,e=>Doe(e,j7(e)),6),Ooe=F(L5),koe=M(60,e=>{Mv(e.b,M7(e)),Ooe(e)}),$5=N(49,e=>koe(e,N7(e)),2),Aoe=M(48,e=>{Q5(e),$5(e)}),e7=N(37,e=>Aoe(e,P7(e))),joe=M(58,F(I5)),t7=N(22,e=>joe(e,F7(e))),n7=j(20,e=>{boe(e,k7(e)),Y5(e),e7(e),Q5(e),t7(e)}),r7=N(38,L(`x34`,e=>{e.v&&Zn(e.aa,e.v)})),i7=j(21,e=>{J5(e),Q5(e),t7(e),r7(e)}),Moe=F(k5),a7=j(23,e=>{rv(e.b,e.x),B(e.f,[Cm.termArea,{[Cm.asBar]:e.x===`diff`}]),U5(e),Moe(e)}),Noe=O(4,(e=>`<!><!>${e}<!><!><!>`)(XR),(e=>`b%b/${e}&%b%c`)(ZR),H5),o7=j(24,e=>Noe(e,+!e.y)),s7=j(25,W5),c7=N(43,L(`x35`,e=>{if(e.m){let t=In(e.aa);t&&e.ag(t.pr);let n=Rn(e.aa);n&&(i7(e,n),a7(e,`term`))}}),2),Poe=M(42,e=>{Pv(e.b,I7(e)),c7(e),X5(e)}),l7=j(26,e=>{Poe(e,L7(e)),G5(e)}),u7=j(27,e=>lv(e.b,e.a1)),Foe=O(6,Yie,(e=>`/${e}&`)(Xie),coe),d7=j(28,e=>{Foe(e,+!e.a2),S5(e)}),Ioe=O(3,mr,(e=>`/${e}&`)(hr),soe),Loe=F(x5),f7=j(29,e=>{Ioe(e,+!e.a3),Loe(e)}),p7=j(30,F(T5)),Roe=O(7,Mae,(e=>`/${e}&`)(Nae),aoe),m7=j(31,e=>{Hoe(e,e.a5?.title),Uoe(e,e.a5?.agent),Woe(e,e.a5?.id),Roe(e,+!e.a5),m5(e)}),zoe=(e,t)=>{nse(e,t.wanted),rse(e,t.run)},Boe=M(61);function Voe(e){B(e.a,Cm.workView),yv(e.b),$_(e.b,G7(e)),iv(e.b,W7(e)),uv(e.b,U7(e)),bv(e.b,H7(e)),Hv(e.b,V7(e)),Vv(e.b,B7(e)),zv(e.b,z7(e)),B(e.c,Cm.mainCol),n7(e,null),i7(e,null),a7(e,`term`),o7(e,!1),s7(e,``),l7(e,0),u7(e,!1),d7(e,!1),f7(e,null),p7(e,!1),m7(e,null),zoe(e,{wanted:!1,run:void 0}),Boe(e,R7(e))}var Hoe=M(32,g5),Uoe=M(33,_5),Woe=M(34,y5),Goe=(e,t)=>{J_(e.b,t),qoe(e,t?.id),Joe(e,t?.status),Yoe(e,t?.name)},Koe=F(j5),qoe=M(36,e=>{Y5(e),J5(e),c7(e),e7(e),Q5(e),r7(e),$5(e),X5(e),K5(e),Koe(e)}),Joe=M(40,Q5),Yoe=M(41,F(M5)),Xoe=Goe,Zoe=M(46,z5),Qoe=M(11,e=>{Tv(e.b,e.l),Y5(e)}),$oe=F(D5),ese=L(`x36`,e=>{e.m||u7(e,!1),A(e.a,`keydown`,e.m&&(t=>{if(t.key===`Escape`&&e.a1&&!document.querySelector(`dialog[open]`)&&u7(e,!1),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.x===`diff`?a7(e,`term`):(o7(e,!0),a7(e,`diff`))),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.ai?.length??0)>1){t.preventDefault();let n=e.ai.map(e=>e.id);i7(e,n[(Math.max(0,n.indexOf(e.al))+(t.key===`]`?1:n.length-1))%n.length]),a7(e,`term`)}}))}),tse=M(12,e=>{xv(e.b,e.m),c7(e),X5(e),V5(e),$oe(e),ese(e)}),nse=M(51,e=>{Q5(e),Z5(e)}),rse=M(53,Z5),ise=F(w5),ase=M(13,e=>{Q5(e),ise(e)}),ose=M(14,e=>{Dv(e.b,e.o),$5(e)}),sse=(e,t)=>Sv(e.b,t),cse=F(O5),lse=M(16,e=>{Av(e.b,e.q),cse(e)}),use=(e,t)=>Lv(e.b,t),dse=M(18,e=>Ov(e.b,e.s)),fse=(e,t)=>Uv(e.b,t);function h7(e){return function(t){t||m7(e._,null)}}function g7(e){return function(t){e._.ax(e._.a8,t),m7(e._,null)}}function _7(e){return function(){f7(e._,null)}}function v7(e){return t=>{d7(e._,t)}}function y7(e){return function(){u7(e._._,!0)}}function b7(e){return function(){a7(e._._,`term`)}}function x7(e){return function(){e._._.ag()}}function S7(e){return function(t){i7(e._._,t)}}function C7(e){return function(t){e._._.ay(e._._.aa,t)}}function w7(e){return function(){e._._.s?.(e._._.aa)}}function T7(e){return function(t){let n=(e._._.ai||[]).find(e=>e.id===t);n&&m7(e._._,n)}}function E7(e){return function(t){e._._.aw(t)}}function D7(e){return function(){a7(e._,`term`)}}function O7(e){return function(t){i7(e._,t),a7(e._,`term`)}}function k7(e){return async(t,n)=>{n=n.trim(),n&&(n7(e,(e.u||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function A7(e){return t=>(t&&(e.ap=!0),(e.ar??=zn(e.as))())}function j7(e){return async()=>{let t=e.ap;e.ap=!1;try{let n=await cn(`/api/workspaces/${e.aa}/sessions`);if(!n.length&&t&&e.ae===`active`){let t=await e.am(e.n||`claude`,!1);n=t?[t]:[]}n7(e,n);let r=Xn(e.aa);r&&n.some(e=>e.id===r)&&i7(e,r),e.u.some(t=>t.id===e.v)||i7(e,e.u?.[0]?.id||null)}catch(t){if(n7(e,e.u||[]),ln(t))return;f7(e,String(t.message||t))}}}function M7(e){return function(t,n){e.ay(t,n)}}function N7(e){return async(t,n)=>{if(t===e.aa){let r=await e.am(n,!0);r&&Zn(t,r.id);return}try{Zn(t,(await cn(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.o?.(t)}catch(t){f7(e,String(t.message||t))}}}function P7(e){return async(t,n)=>{p7(e,!0);try{let r=await cn(`/api/workspaces/${e.aa}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});return n&&(n7(e,(e.u||[]).concat(r)),i7(e,r.id)),r}catch(t){return f7(e,String(t.message||t)),null}finally{p7(e,!1)}}}function F7(e){return async t=>{try{await cn(`/api/sessions/${t}`,{method:`DELETE`}),n7(e,(e.u||[]).filter(e=>e.id!==t)),e.v===t&&i7(e,e.u?.[0]?.id||null)}catch(t){f7(e,`Kill session failed: ${String(t.message||t)}`)}}}function I7(e){return function(t){e.ag(t)}}function L7(e){return t=>{s7(e,t||``),t&&l7(e,e.a0+1),o7(e,!0),a7(e,`diff`)}}function R7(e){return t=>{m7(e,t)}}function z7(e){return function(t){e.az(t)}}function B7(e){return function(t){e.aw(t)}}function V7(e){return function(){d7(e,!0)}}function H7(e){return function(t){f7(e,t)}}function U7(e){return t=>{u7(e,t)}}function W7(e){return t=>{a7(e,t)}}function G7(e){return function(t){i7(e,t)}}R(`x29`,h7),R(`x30`,g7),R(`x17`,_7),R(`x28`,v7),R(`x26`,y7),R(`x25`,b7),R(`x24`,x7),R(`x21`,S7),R(`x20`,C7),R(`x27`,w7),R(`x23`,T7),R(`x22`,E7),R(`x19`,D7),R(`x18`,O7),R(`x5`,k7),R(`x3`,A7),R(`x2`,j7),R(`x13`,M7),R(`x6`,N7),R(`x1`,P7),R(`x4`,F7),R(`x16`,I7),R(`x0`,L7),R(`x7`,R7),R(`x15`,z7),R(`x14`,B7),R(`x12`,V7),R(`x11`,H7),R(`x10`,U7),R(`x9`,W7),R(`x8`,G7);var K7=I(49,e=>V(e.a,e._._.a2),e=>e._._),pse=ut(`n19`,` `,` `,K7),mse=e=>{Vr(e.a),Gr(e.a,pse(e)),Yr(e.a,I9(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},q7=I(42,e=>sse(e.b,e._._.p),e=>e._._),hse=e=>{q7(e),J7(e),Y7(e),Q7(e),$7(e),e9(e),t9(e),n9._(e),r9._(e),Voe(e.b),use(e.b,R9(e)),fse(e.b,L9(e))},J7=I(43,e=>Qoe(e.b,e._._.q),e=>e._._),Y7=I(44,e=>{ase(e.b,e._._.r?e._._.r?.preferredAgent:`claude`),lse(e.b,e._._.r?e._._.r?.agents:[`claude`])},e=>e._._),X7=N(5,e=>tse(e.b,!e._._.y&&!e._._.ad&&e._.f===e._._.t),3),gse=de(3,0,2),Z7=N(4,e=>gse(e,e._.f===e._._.t)),Q7=I(45,e=>{X7(e),Z7(e)},e=>e._._),$7=I(46,X7,e=>e._._),e9=I(50,e=>ose(e.b,z9(e)),e=>e._._),t9=I(51,X7,e=>e._._),n9=P(0,0,e=>Xoe(e.b,e._.e)),r9=P(0,0,e=>{dse(e.b,B9(e)),X7(e),Z7(e)}),_se=O(0,(e=>`<!><!>${e}<!><!><!>`)(noe),(e=>`b%b/${e}&%b%c`)(roe),hse),vse=M(4,e=>{bse(e,e.e?.id),_se(e,+!e.e),n9(e)}),i9=N(3,e=>vse(e,e._.p.find(t=>t.id===e.c))),a9=We(5,i9),yse=a9,bse=M(5,r9),xse=M(2,i9),Sse=(e,t)=>xse(e,t[0]),o9=N(1,e=>dm(e.a,V9(e))),s9=P(4,0,o9),Cse=e=>{s9._(e),c9._(e),l9._(e),om(e.a),pm(e.a,H9(e))},c9=P(4,0,e=>fm(e.a,e._.y)),l9=P(4,0,o9),u9=P(3,0,e=>jf(e.a,U9(e))),wse=e=>{u9._(e),d9._(e),f9._(e),Xd(e.a),uf(e.a,W9(e))},d9=P(3,0,e=>lf(e.a,!!e._.z)),f9=P(3,0,e=>Af(e.a,e._.ad)),p9=P(2,0,e=>qo(e.a,e._.p)),Tse=e=>{p9._(e),m9._(e),h9._(e),g9._(e),v9._(e),y9._(e),b9._(e),Ho(e.a),Io(e.a,J9(e)),Qo(e.a,q9(e)),rs(e.a,K9(e)),go(e.a,G9(e)),Oo(e.a),ko(e.a)},m9=P(2,0,e=>fs(e.a,e._.q)),h9=P(2,0,e=>Fo(e.a,e._.r)),g9=P(2,0,e=>Xo(e.a,e._.t)),_9=N(1,e=>ls(e.a,!e._.a1&&e._.ae)),v9=P(2,0,e=>{ho(e.a,e._.a1),_9(e)}),y9=P(2,0,e=>{is(e.a,Z9(e)),Zo(e.a,X9(e)),$o(e.a,Y9(e))}),b9=P(2,0,_9),x9=N(36,L(`n21`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0,timer:void 0};Un(e.n),or(n);let i=(t,n)=>{n&&(Ln(t,n),Zn(t,n)),e.a9(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),dr()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),fr(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a8()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a8(!0))},{signal:n}),o(),jn().addEventListener(`workspaces.changed`,()=>{e.a3(),o()},{signal:n}),jn().addEventListener(`sessions.changed`,()=>{clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),jn().addEventListener(`status.changed`,t=>{t.data&&(O9(e,t.data),r.statusStale=!1)},{signal:n}),r.timer=setInterval(o,6e4);let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce),clearInterval(this.timer)}})),3),Ese=F(e9),Dse=M(35,e=>{x9(e),y9(e),l9(e),Ese(e)}),S9=N(22,e=>Dse(e,Q9(e))),Ose=O(2,(e=>`<!>${e}`)(Ri),(e=>`b/${e}&`)(zi),Tse),C9=N(41,e=>Ose(e,e.a1||e.ae?0:1)),kse=M(40,e=>{C9(e),b9(e)}),w9=N(38,e=>kse(e,!e.y&&!e.ab)),Ase=M(37,w9),T9=N(20,e=>Ase(e,e.p.find(t=>t.id===e.t))),jse=O(3,pl,(e=>`/${e}&`)(ml),wse),Mse=F(t9),Nse=M(39,e=>{jse(e,+!e.ad),f9(e),Mse(e)}),E9=N(26,e=>Nse(e,e.p.find(t=>t.id===e.z))),Pse=F(q7),D9=j(15,e=>{S9(e),T9(e),E9(e),p9(e),u9(e),s9(e),a9(e),Pse(e)}),Fse=F(J7),O9=j(16,e=>{m9(e),Fse(e)}),Ise=F(Y7),Lse=j(17,e=>{h9(e),Ise(e)}),Rse=k(5,`<!><!><!>`,`b%`,yse,Sse),zse=M(29,x9),k9=N(23,e=>zse(e,$9(e))),A9=j(21,e=>{Rse(e,[e.v,e=>e]),k9(e),S9(e)}),Bse=F(Q7),j9=j(19,e=>{A9(e,e.t?[e.t]:[]),k9(e),T9(e),g9(e),Bse(e)}),Vse=O(4,qf,(e=>`/${e}&`)(Jf),Cse),Hse=F($7),M9=j(24,e=>{Vse(e,+!e.y),w9(e),c9(e),Hse(e)}),N9=j(25,e=>{E9(e),d9(e)}),P9=j(27,e=>{C9(e),v9(e)}),Use=O(1,mr,(e=>`/${e}&`)(hr),mse),Wse=F(K7),F9=j(28,e=>{Use(e,+!e.a2),Wse(e)});L(`n20`,e=>A(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),P9(e,!e.a1)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.p.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a9(n.id))}}));function I9(e){return function(){F9(e._,null)}}function L9(e){return function(){M9(e._._,!0)}}function R9(e){return function(t,n){Ln(t,n),Zn(t,n),e._._.a9(t)}}function z9(e){return function(t){e._._.a9(t)}}function B9(e){return function(t){N9(e._._,t||e._.f)}}function V9(e){return function(t){e._.p.some(e=>e.id===t.id)||D9(e._,[t,...e._.p]),M9(e._,!1),e._.a9(t.id)}}function H9(e){return t=>{M9(e._,t)}}function U9(e){return function(t){D9(e._,e._.p.map(e=>e.id===t.id?t:e))}}function W9(e){return function(t){t||N9(e._,null)}}function G9(e){return t=>{P9(e._,t)}}function K9(e){return function(){M9(e._,!0),P9(e._,!1)}}function q9(e){return function(t){N9(e._,t.id),M9(e._,!1),P9(e._,!1)}}function J9(e){return function(t){Lse(e._,t)}}function Y9(e){return function(t,n){P9(e._,!1),cn(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{Ln(t.id,n.id),e._.a9(t.id)}).catch(t=>{F9(e._,`New session failed: ${String(t.message||t)}`)})}}function X9(e){return function(t){Fn(t.id),e._.a9(t.id)}}function Z9(e){return function(t){e._.a9(t.id)}}function Q9(e){return async t=>{e.p.find(e=>e.id===t)?.status===`archived`&&(await cn(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),D9(e,e.p.map(e=>e.id===t?{...e,status:`active`}:e))),j9(e,t),M9(e,!1),N9(e,null),P9(e,!1),e.v.includes(t)||A9(e,e.v.concat(t)),qn(t)}}function $9(e){return async()=>{try{let t=await cn(`/api/workspaces`);D9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));A9(e,e.v.filter(e=>n.has(e))),e.t&&!n.has(e.t)&&(j9(e,e.v[e.v?.length-1]||null),qn(e.t))}catch(t){if(ln(t))return;F9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function Gse(e){return(t=!1)=>(e.a5||=t,(e.a6??=zn(async()=>{let t=e.a5;e.a5=!1;try{O9(e,await cn(`/api/status${t?`?fresh`:``}`))}catch(e){if(!ln(e))throw e}}))())}R(`n3`,I9),R(`n18`,L9),R(`n16`,R9),R(`n15`,z9),R(`n17`,B9),R(`n14`,V9),R(`n13`,H9),R(`n12`,U9),R(`n11`,W9),R(`n10`,G9),R(`n9`,K9),R(`n8`,q9),R(`n4`,J9),R(`n7`,Y9),R(`n6`,X9),R(`n5`,Z9),R(`n2`,Q9),R(`n0`,$9),R(`n1`,Gse);var Kse=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};De(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Kse(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){Zt(t.b,e)}});var qse=e=>B(e.a,sn.boot),Jse=(e,t)=>V(e.b,t instanceof Error?t.message:String(t));ut(`b1`,`<div><p> </p></div>`,` E `,qse,(e,t)=>Jse(e,t[0])),ut(`b0`,`<div><span class=spin></span>Loading workspaces…</div>`,` `,e=>B(e.a,sn.boot)),tt();export{t};
|
|
1615
|
-
//# sourceMappingURL=index-
|
|
1614
|
+
}`,l2=8,u2=l2*Float32Array.BYTES_PER_ELEMENT,d2=20*l2,f2=class{constructor(){this.attributes=new Float32Array(d2),this.count=0}},p2=0,m2=0,h2=0,g2=0,_2=0,v2=0,y2=0,b2=class extends G${constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new f2,this._verticesCursor=new f2;let i=this._gl;this._program=p1(z0(i,s2,c2)),this._register(H$(()=>i.deleteProgram(this._program))),this._projectionLocation=p1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(H$(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(H$(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=p1(i.createBuffer()),this._register(H$(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,u2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,u2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,u2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,R0),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*t2,d=e.cells[u+n2],f=e.cells[u+r2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*l2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*l2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*l2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*l2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:p2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:p2=(n&16777215)<<8;break;case 0:default:p2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:p2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:p2=(r&16777215)<<8;break;case 0:default:p2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=V0(e.attributes,this._terminal.rows*this._terminal.cols*l2)),m2=i*this._dimensions.device.cell.width,h2=o*this._dimensions.device.cell.height,g2=(p2>>24&255)/255,_2=(p2>>16&255)/255,v2=(p2>>8&255)/255,y2=1,this._addRectangle(e.attributes,t,m2,h2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,g2,_2,v2,y2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},x2=class extends G${constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(H$(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=p1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=j0(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=N1,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},S2=class extends x2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&k0(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},C2=typeof window==`object`?window:globalThis,w2=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new _0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new _0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};w2.INSTANCE=new w2;var T2=w2;function E2(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}T2.INSTANCE.onDidChangeZoomLevel,T2.INSTANCE.onDidChangeFullscreen;var D2=typeof navigator==`object`?navigator.userAgent:``;D2.indexOf(`Firefox`);var O2=D2.indexOf(`AppleWebKit`)>=0;!(D2.indexOf(`Chrome`)>=0)&&D2.indexOf(`Safari`),D2.indexOf(`Electron/`),D2.indexOf(`Android`);var k2=!1;if(typeof C2.matchMedia==`function`){let e=C2.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=C2.matchMedia(`(display-mode: fullscreen)`);k2=e.matches,E2(C2,e,({matches:e})=>{k2&&t.matches||(k2=e)})}function A2(){return k2}var j2=`en`,M2=!1,N2=!1,P2=!1,F2=j2,I2,L2=globalThis,R2;typeof L2.vscode<`u`&&typeof L2.vscode.process<`u`?R2=L2.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(R2=process);var z2=typeof R2?.versions?.electron==`string`&&R2?.type===`renderer`;if(typeof R2==`object`){R2.platform,R2.platform,M2=R2.platform===`linux`,M2&&R2.env.SNAP&&R2.env.SNAP_REVISION,R2.env.CI||R2.env.BUILD_ARTIFACTSTAGINGDIRECTORY,F2=j2;let e=R2.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,F2=t.resolvedLanguage||j2,t.languagePack?.translationsConfigFile}catch{}N2=!0}else typeof navigator==`object`&&!z2?(I2=navigator.userAgent,I2.indexOf(`Windows`),I2.indexOf(`Macintosh`),(I2.indexOf(`Macintosh`)>=0||I2.indexOf(`iPad`)>=0||I2.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,M2=I2.indexOf(`Linux`)>=0,I2?.indexOf(`Mobi`),P2=!0,F2=globalThis._VSCODE_NLS_LANGUAGE||j2,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var B2=N2;P2&&typeof L2.importScripts==`function`&&L2.origin;var V2=I2,H2=F2,U2;(e=>{function t(){return H2}e.value=t;function n(){return H2.length===2?H2===`en`:H2.length>=3&&H2[0]===`e`&&H2[1]===`n`&&H2[2]===`-`}e.isDefaultVariant=n;function r(){return H2===`en`}e.isDefault=r})(U2||={});var W2=typeof L2.postMessage==`function`&&!L2.importScripts;(()=>{if(W2){let e=[];L2.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),L2.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var G2=!!(V2&&V2.indexOf(`Chrome`)>=0);V2&&V2.indexOf(`Firefox`),!G2&&V2&&V2.indexOf(`Safari`),V2&&V2.indexOf(`Edg/`),V2&&V2.indexOf(`Android`);var K2=typeof navigator==`object`?navigator:{};B2||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||K2&&K2.clipboard&&K2.clipboard.writeText,B2||K2&&K2.clipboard&&K2.clipboard.readText,B2||A2()||K2.keyboard,`ontouchstart`in C2||K2.maxTouchPoints,C2.PointerEvent&&(`ontouchstart`in C2||navigator.maxTouchPoints);var q2=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},J2=new q2,Y2=new q2,X2=new q2;Array(230);var Z2;(e=>{function t(e){return J2.keyCodeToStr(e)}e.toString=t;function n(e){return J2.strToKeyCode(e)}e.fromString=n;function r(e){return Y2.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return X2.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Y2.strToKeyCode(e)||X2.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return J2.keyCodeToStr(e)}e.toElectronAccelerator=o})(Z2||={});var Q2=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),$2;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof e4?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Q2})})($2||={});var e4=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Q2:(this._emitter||=new _0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var t4;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(t4||={});var n4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new _0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await i0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};n4.EMPTY=n4.fromArray([]);function r4(e){return i4(e,0)}function i4(e,t){switch(typeof e){case`object`:return e===null?a4(349,t):Array.isArray(e)?c4(e,t):l4(e,t);case`string`:return s4(e,t);case`boolean`:return o4(e,t);case`number`:return a4(e,t);case`undefined`:return a4(937,t);default:return a4(617,t)}}function a4(e,t){return(t<<5)-t+e|0}function o4(e,t){return a4(e?433:863,t)}function s4(e,t){t=a4(149417,t);for(let n=0,r=e.length;n<r;n++)t=a4(e.charCodeAt(n),t);return t}function c4(e,t){return t=a4(104579,t),e.reduce((e,t)=>i4(t,e),t)}function l4(e,t){return t=a4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=s4(n,t),i4(e[n],t)),t)}var{registerWindow:Wre,getWindow:u4,getDocument:Gre,getWindows:Kre,getWindowsCount:qre,getWindowId:Jre,getWindowById:Yre,hasWindow:Xre,onDidRegisterWindow:Zre,onWillUnregisterWindow:Qre,onDidUnregisterWindow:$re}=function(){let e=new Map,t={window:C2,disposables:new W$};e.set(C2.vscodeWindowId,t);let n=new _0,r=new _0,i=new _0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return G$.None;let a=new W$,o={window:t,disposables:a.add(new W$)};return e.set(t.vscodeWindowId,o),a.add(H$(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(f4(t,m4.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:C2},getDocument(e){return u4(e).document}}}(),d4=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function f4(e,t,n,r){return new d4(e,t,n,r)}var p4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};p4.None=new p4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=r4(n),a=r.get(i);if(a)a.users+=1;else{let o=new _0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(H$(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var m4={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:O2?`webkitAnimationStart`:`animationstart`,ANIMATION_END:O2?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:O2?`webkitAnimationIteration`:`animationiteration`},h4=class extends G${constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new K$,this._charAtlasDisposable=this._register(new K$),this._observerDisposable=this._register(new K$),this._model=new o2,this._workCell=new L0,this._workCell2=new L0,this._rectangleRenderer=this._register(new K$),this._glyphRenderer=this._register(new K$),this._onChangeTextureAtlas=this._register(new _0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new _0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new _0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new j1(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new S2(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=x1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(f4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(f4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,M0(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=F0(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=F0(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(H$(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),M0(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Q0(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=j0(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=V$(i0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),i0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new P0(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=_4(e,n.rows-1,0),t=_4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new g4(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*t2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+n2]!==this._cellColorResolver.result.bg||this._model.cells[v+r2]!==this._cellColorResolver.result.fg||this._model.cells[v+i2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=a2),this._model.cells[v]=g,this._model.cells[v+n2]=this._cellColorResolver.result.bg,this._model.cells[v+r2]=this._cellColorResolver.result.fg,this._model.cells[v+i2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*t2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,e1,0,0),this._model.cells[b]=0,this._model.cells[b+n2]=this._cellColorResolver.result.bg,this._model.cells[b+r2]=this._cellColorResolver.result.fg,this._model.cells[b+i2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},g4=class extends $1{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function _4(e,t,n=0){return Math.max(Math.min(e,t),n)}var v4=`di$target`,y4=`di$dependencies`,b4=new Map;function x4(e){if(b4.has(e))return b4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);S4(t,e,r)};return t._id=e,b4.set(e,t),t}function S4(e,t,n){t[v4]===t?t[y4].push({id:e,index:n}):(t[y4]=[{id:e,index:n}],t[v4]=t)}x4(`BufferService`),x4(`CoreMouseService`),x4(`CoreService`),x4(`CharsetService`),x4(`InstantiationService`),x4(`LogService`);var C4=x4(`OptionsService`);x4(`OscLinkService`),x4(`UnicodeService`),x4(`DecorationService`);var w4={trace:0,debug:1,info:2,warn:3,error:4,off:5},T4=`xterm.js: `,E4=class extends G${constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),D4=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=w4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:T4)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};E4=w$([T$(0,C4)],E4);var D4,O4=class extends G${constructor(e){if(Q$&&$$()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new _0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new _0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new h4(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(i0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(i0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(i0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(i0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(H$(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},k4=2,A4=1,j4=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(k4,Math.floor(u/e.css.cell.width)),rows:Math.max(A4,Math.floor(l/e.css.cell.height))}}},M4=`3.7.8`,N4=M4,P4=typeof Buffer==`function`,F4=typeof TextDecoder==`function`?new TextDecoder:void 0,I4=typeof TextEncoder==`function`?new TextEncoder:void 0,L4=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),R4=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(L4),z4=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,B4=String.fromCharCode.bind(String),V4=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),H4=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),U4=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),W4=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=L4[t>>18&63]+L4[t>>12&63]+L4[t>>6&63]+L4[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},G4=typeof btoa==`function`?e=>btoa(e):P4?e=>Buffer.from(e,`binary`).toString(`base64`):W4,K4=P4?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(B4.apply(null,e.subarray(n,n+4096)));return G4(t.join(``))},q4=(e,t=!1)=>t?H4(K4(e)):K4(e),J4=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?B4(192|t>>>6)+B4(128|t&63):B4(224|t>>>12&15)+B4(128|t>>>6&63)+B4(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return B4(240|t>>>18&7)+B4(128|t>>>12&63)+B4(128|t>>>6&63)+B4(128|t&63)},Y4=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,X4=e=>e.replace(Y4,J4),Z4=P4?e=>Buffer.from(e,`utf8`).toString(`base64`):I4?e=>K4(I4.encode(e)):e=>G4(X4(e)),Q4=(e,t=!1)=>t?H4(Z4(e)):Z4(e),$4=e=>Q4(e,!0),e3=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,t3=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return B4((t>>>10)+55296)+B4((t&1023)+56320);case 3:return B4((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return B4((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},n3=e=>e.replace(e3,t3),r3=e=>{if(e=e.replace(/\s+/g,``),!z4.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=R4[e.charAt(a++)]<<18|R4[e.charAt(a++)]<<12|(n=R4[e.charAt(a++)])<<6|(r=R4[e.charAt(a++)]),n===64?i.push(B4(t>>16&255)):r===64?i.push(B4(t>>16&255,t>>8&255)):i.push(B4(t>>16&255,t>>8&255,t&255));return i.join(``)},i3=typeof atob==`function`?e=>atob(U4(e)):P4?e=>Buffer.from(e,`base64`).toString(`binary`):r3,a3=P4?e=>V4(Buffer.from(e,`base64`)):e=>V4(i3(e).split(``).map(e=>e.charCodeAt(0))),o3=e=>a3(c3(e)),s3=P4?e=>Buffer.from(e,`base64`).toString(`utf8`):F4?e=>F4.decode(a3(e)):e=>n3(i3(e)),c3=e=>U4(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),l3=e=>s3(c3(e)),u3=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},d3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),f3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,d3(t));e(`fromBase64`,function(){return l3(this)}),e(`toBase64`,function(e){return Q4(this,e)}),e(`toBase64URI`,function(){return Q4(this,!0)}),e(`toBase64URL`,function(){return Q4(this,!0)}),e(`toUint8Array`,function(){return o3(this)})},p3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,d3(t));e(`toBase64`,function(e){return q4(this,e)}),e(`toBase64URI`,function(){return q4(this,!0)}),e(`toBase64URL`,function(){return q4(this,!0)})},m3={version:M4,VERSION:N4,atob:i3,atobPolyfill:r3,btoa:G4,btoaPolyfill:W4,fromBase64:l3,toBase64:Q4,encode:Q4,encodeURI:$4,encodeURL:$4,utob:X4,btou:n3,decode:l3,isValid:u3,fromUint8Array:q4,toUint8Array:o3,extendString:f3,extendUint8Array:p3,extendBuiltins:()=>{f3(),p3()}},h3=class{constructor(e=new _3,t=new g3){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},g3=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},_3=class{encodeText(e){return m3.encode(e)}decodeText(e){let t=m3.decode(e);return!m3.isValid(e)||m3.encode(t)!==e?``:t}},v3=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=b3.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function y3(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var b3=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!y3(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},x3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function S3(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var C3=class{constructor(e=S3,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||x3;this._linkProvider=this._terminal.registerLinkProvider(new v3(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function w3(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function T3(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function E3(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function D3(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var O3=450,k3=12,A3=` ·│┃()[]{}<>'"\`,;│|`;function j3(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||A3.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},O3)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>k3&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&oy(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var M3=5;function N3(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<M3)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await oy(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}var $={iconBtn:`_bD _7`,termWrap:`_bE`,term:`_bF`,xterm:`_bG`,termDead:`_bH`,termCopied:`_bI`,termCopiedFade:`_bJ`,termUploading:`_bK`,trapBackdrop:`_bL`,pasteTrap:`_bM`,kbSlot:`_bN`,keyBar:`_bO`,kspacer:`_bP`,sessBtn:`_bQ`,sessDot:`_bR`,sessPop:`_bS`,sessRow:`_bT`,current:`_bU`,sessOpen:`_bV`,sessTitle:`_bW`,sessX:`_bX`,armed:`_bY`,sessEdit:`_bZ`,sessNew:`_b0`,lone:`_b1`,kbarWs:`_b2`,kbarWsName:`_b3`,kbtn:`_b4 _7`,kbtnEsc:`_b5`,dpadGrid:`_b6`,repeat:`_b7`,kbToggle:`_b8`,on:`_b9`,bigGlyph:`_b_`,enter:`_ca`},P3=ri,F3=(e=>`/${e}&`)(ii);function I3(e){si(e.a,`M15 4L8 20`)}var L3=(e,t)=>ai(e.a,t),R3=(e,t)=>oi(e.a,t),z3=ri,B3=(e=>`/${e}&`)(ii);function V3(e){si(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var H3=(e,t)=>ai(e.a,t),U3=(e,t)=>oi(e.a,t),W3=ri,G3=(e=>`/${e}&`)(ii);function K3(e){si(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var q3=(e,t)=>ai(e.a,t),J3=(e,t)=>oi(e.a,t),Y3=ri,X3=(e=>`/${e}&`)(ii);function Z3(e){si(e.a,`M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z M3 16L10 13L21 18 M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z`)}var Q3=(e,t)=>ai(e.a,t),$3=(e,t)=>oi(e.a,t),e6=`<div><div></div><!><!><!><!></div><!><!>`,t6=` D b%b%b%b%l%c`,n6=400,r6=55,i6=3e4,a6=150,o6=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`attach`}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`key`,label:`⇥`,seq:` `},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],s6=L(`u20`,e=>A(e.a,`click`,function(){e._._._.f.click()})),c6=e=>{Z3(e.b),Q3(e.b,16),$3(e.b),s6(e)},l6=e=>B(e.a,$.termCopied),u6=e=>B(e.a,$.termUploading),d6=L(`u19`,e=>{A(e.a,`pointerdown`,function(e){e.preventDefault()}),A(e.a,`click`,function(){e._._._._.al()})}),f6=e=>{K3(e.b),q3(e.b,16),J3(e.b),d6(e)},p6=P(0,2,e=>{B(e.a,[$.repeat,{[$.enter]:e._.e===`↵`,[$.bigGlyph]:e._.e===`↵`||e._.e===`⇥`}]),V(e.b,e._.e)}),m6=L(`u21`,e=>{A(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.af(e._.f)}),A(e.a,`pointerup`,function(){e._._._._.ag()}),A(e.a,`pointercancel`,function(){e._._._._.ag()}),A(e.a,`pointerleave`,function(){e._._._._.ag()}),A(e.a,`contextmenu`,function(e){e.preventDefault()})}),h6=O(0,(e=>`<button title=Paste>${e}</button>`)(W3),(e=>` D/${e}&l`)(G3),f6,(e=>`<button title="Attach image">${e}</button>`)(Y3),(e=>` D/${e}&l`)(X3),c6,`<button> </button>`,` D `,e=>{p6._(e),m6(e)}),g6=(e,t)=>h6(e,t===`paste`?0:t===`attach`?1:2),_6=(e,t)=>{g6(e,t[0]?.kind),v6(e,t[0]?.label),y6(e,t[0]?.seq)},v6=M(4),y6=M(5),b6=k(0,`<!><!><!>`,`b%`,0,_6),x6=(e,t)=>b6(e,[t]),S6=(e,t)=>x6(e,t[0]),C6=I(60,L(`u17`,e=>A(e.a,`click`,function(){e._._.a7?.send(`\x1B`)})),e=>e._._),w6=L(`u18`,e=>A(e.a,`pointerdown`,function(e){e.preventDefault()})),T6=e=>{C6(e),B(e.a,[$.kbtn,$.kbtnEsc]),w6(e)},E6=P(5,0,L(`u8`,e=>{e._.a5&&setTimeout(()=>e.c?.focus(),50)})),D6=L(`u9`,e=>{A(e.a,`click`,function(){j8(e._,!1)}),A(e.b,`click`,function(e){e.stopPropagation()}),A(e.c,`paste`,function(t){t.preventDefault(),e._.ak(t.clipboardData)}),A(e.d,`click`,function(){j8(e._,!1)})}),O6=e=>{E6._(e),B(e.a,$.trapBackdrop),B(e.b,$.pasteTrap),D6(e)},k6=L(`u7`,e=>A(e.b,`click`,function(){E8(e._,!1)})),A6=e=>{B(e.a,$.termDead),k6(e)},j6=I(51,e=>B(e.b,[`dot`,ti(e._._.r)]),e=>e._._),M6=e=>{j6(e),N6(e),B(e.a,$.kbarWs),B(e.c,$.kbarWsName)},N6=I(57,e=>V(e.d,e._._.y),e=>e._._),P6=L(`u15`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.p?.(e.d)})),F6=e=>{B(e.a,$.iconBtn),e.b,Ni(e.b,15),Li(e.b),P6(e)},I6=M(3,e=>{z(e.a,`title`,`New ${e.d} session`),Ii(e.b,e.d)}),L6=(e,t)=>I6(e,t[0]),R6=N(1,e=>{B(e.a,[$.sessX,{[$.armed]:e._._._.g===e._.k}]),z(e.a,`title`,e._._._.g===e._.k?`Really kill this session?`:`Kill session`)}),z6=I(8,R6,e=>e._._._),B6=L(`u13`,e=>A(e.a,`click`,function(t,n){e._._._.g===e._.k?(c8(e._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._.w?.(e._.k)):c8(e._._._,e._.k)})),V6=e=>{z6(e),H6._(e),B6(e)},H6=P(7,0,R6),U6=L(`u12`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.v?.(e._.k)})),W6=e=>{B(e.a,[$.sessX,$.sessEdit]),Om(e.b),km(e.b,12),Am(e.b),U6(e)},G6=N(11,e=>B(e.a,[$.sessRow,{[$.current]:e.k===e._._._._.t}])),K6=I(53,G6,e=>e._._._._),q6=L(`u14`,e=>A(e.b,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e.k!==e._._._._.t&&e._._._._.u?.(e.k)})),J6=e=>{K6(e),X6(e),Q6(e),B(e.b,$.sessOpen),e.d,Ni(e.d,14),Li(e.d),B(e.e,$.sessTitle),q6(e)},Y6=O(6,(e=>`<button title="Rename session">${e}</button>`)(Em),(e=>` D/${e}&l`)(Dm),W6),X6=I(54,e=>Y6(e,+!e._._._._.v),e=>e._._._._),Z6=O(7,`<button>×</button>`,` `,V6),Q6=I(55,e=>Z6(e,+!e._._._._.w),e=>e._._._._),$6=M(10,e=>{G6(e),H6(e)}),e8=(e,t)=>B(e.c,[`dot`,ti(t)]),t8=N(15,e=>V(e.f,e.o||e.n)),n8=M(13,e=>{Ii(e.d,e.n),t8(e)}),r8=M(14,t8),i8=k(0,(e=>`<div><button><span></span>${e}<span> </span></button><!><!></div>`)(Ci),(e=>` D D b/${e}& D m%b%l`)(`b%c`),J6,(e,t)=>{$6(e,t[0]?.id),e8(e,t[0]?.state),n8(e,t[0]?.agent),r8(e,t[0]?.title)}),a8=I(52,e=>i8(e,[e._._._.s||[],`id`]),e=>e._._._),o8=a8,s8=I(50,e=>Ii(e.b,e._._.q||`shell`),e=>e._._),c8=j(6,F(z6)),l8=(e,t)=>{z(e.a,`popovertarget`,t),z(e.d,`id`,t)},u8=L(`u16`,e=>A(e.d,`toggle`,function(t,n){if(c8(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),d8=e=>{s8(e),f8(e),m8(e),g8(e),B(e.a,[$.kbtn,$.sessBtn]),e.b,Ni(e.b,16),Li(e.b),B(e.d,$.sessPop),c8(e,null),l8(e,Xe(e)),u8(e)},f8=I(51,e=>B(e.c,[`dot`,$.sessDot,ti(e._._.r)]),e=>e._._),p8=O(4,`<!><!><!>`,`b%`,o8),m8=I(52,e=>{B(e.f,[$.sessNew,{[$.lone]:(e._._.s||[]).length<=1}]),p8(e,(e._._.s||[]).length>1?0:1)},e=>e._._),h8=k(5,(e=>`<button>${e}</button>`)(Ci),(e=>` D/${e}&l`)(`b%c`),F6,L6),g8=I(56,e=>h8(e,[[...e._._.x||[],`shell`],e=>e]),e=>e._._),_8=L(`u11`,e=>{A(e.a,`click`,function(){e._._.m?.()}),A(e.c,`click`,function(){e._._.n?.()}),A(e.e,`click`,function(){e._._.o?.()})}),v8=e=>{B(e.a,$.kbtn),ng(e.b),rg(e.b,16),ig(e.b),B(e.c,$.kbtn),hi(e.d),gi(e.d,16),_i(e.d),B(e.e,$.kbtn),ui(e.f),di(e.f,16),fi(e.f),_8(e)},eie=L(`u10`,e=>A(e.a,`click`,function(){e._._.l?.()})),tie=O(2,(e=>`<button title="Back to terminal">${e}</button>`)(Bb),(e=>` D/${e}&l`)(Vb),e=>{B(e.a,$.kbtn),Hb(e.b),Ub(e.b,16),Wb(e.b),eie(e)},((e,t,n)=>`<button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button title="Review changes">${n}</button>`)(eg,pi,ci),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l`)(tg,mi,li),v8),nie=O(10,`<button title=Escape>esc</button>`,` `,T6),rie=O(3,(e=>`<button title=Sessions>${e}<span></span></button><div popover=auto><!><div></div></div>`)(Ci),(e=>` D/${e}& l D%b l`)(`b%c`),d8),y8=N(13,e=>rie(e,e._.k!==`diff`&&e._.p?0:1)),b8=P(6,0,e=>{tie(e,e._.k===`diff`?0:1),nie(e,+(e._.k===`diff`)),y8(e)}),iie=(e,t)=>{z(e.g,`popovertarget`,t),z(e.l,`id`,t)},aie=k(11,`<!><!><!>`,`b%`,0,S6),oie=L(`u23`,e=>{A(e.f,`change`,function(t,n){for(let t of n.files||[])e._.ah(t);n.value=``}),A(e.g,`pointerdown`,function(e){e.preventDefault()}),A(e.i,`pointerdown`,function(e){e.preventDefault()}),A(e.l,`pointerdown`,function(e){e.preventDefault()}),A(e.l,`toggle`,function(t,n){if(t.newState===`open`){let t=e.g.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.bottom=`auto`}})}),sie=e=>{b8._(e),x8._(e),S8._(e),C8._(e),lie._(e),B(e.a,$.kbSlot),B(e.b,$.keyBar),B(e.d,$.kspacer),B(e.g,[$.kbtn,`dpad-btn`]),I3(e.h),L3(e.h,16),R3(e.h),V3(e.j),H3(e.j,16),U3(e.j),B(e.l,$.dpadGrid),iie(e,Xe(e)),aie(e,[o6]),oie(e)},x8=P(6,0,y8),cie=O(4,`<span aria-hidden=true><span></span><span> </span></span>`,` D b D `,M6),S8=P(6,0,e=>cie(e,+!e._.y)),C8=P(6,0,e=>{B(e.i,[$.kbtn,$.kbToggle,{[$.on]:e._.a1}]),z(e.i,`title`,e._.a1?`Hide keyboard`:`Show keyboard`)}),lie=P(6,0,L(`u22`,e=>A(e.i,`click`,function(){D8(e._,!e._.a1),e._.a7?.setKeyboard(e._.a1)}))),w8=$e(`u6`,1),uie=Qe(42),die=O(4,`<div><button class="btn primary">Reconnect</button></div>`,` D `,A6),T8=N(45,L(`u24`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new x$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:5e3,allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,linkHandler:{activate(e,t){fr(t)}}}),i=new j4;r.loadAddon(i),r.open(e.b);let a=lr();try{let e=new O4;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new h3(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>oy(t).then(()=>{})}))}catch{}r.loadAddon(new C3((e,t)=>fr(t))),i.fit();let o=a?E3(r):null,s=o?o.write:e=>r.write(e),c=w3({sessionId:e.t,term:r,write:s,onDead:()=>{E8(e,!0)},isVisible:()=>!!e.z},n);r.onData(e=>c.send(e)),r.attachCustomKeyEventHandler(t=>t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&c.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&oy(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.ab())}),!1):!(a&&t.type===`keydown`&&t.key===`Backspace`));let l=()=>{if(!e.b.clientWidth)return;let t=i.proposeDimensions();!t||t.cols===r.cols&&t.rows===r.rows||(i.fit(),c.resize(r.cols,r.rows))},u=new ResizeObserver(l);u.observe(e.b),n.addEventListener(`abort`,()=>u.disconnect());let d=()=>requestAnimationFrame(l);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||d()},{signal:n}),window.addEventListener(`pageshow`,d,{signal:n}),window.addEventListener(`focus`,d,{signal:n}),window.visualViewport?.addEventListener(`resize`,d,{signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.ah(t)}},{capture:!0,signal:n}),e.a7={send(e){c.send(e)},setKeyboard(e){let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a1&&i-t.height<a6&&(D8(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=j3(r,w8(e),{onStart(){o?.setFrozen(!0)},onEnd(){o?.setFrozen(!1)},onCopy(){e.ab()}},n);T3(r,w8(e),n,i.selecting),D3(r,e=>c.send(e),n)}else N3(r,w8(e),()=>e.ab(),n);e.z&&!a&&r.focus();let f={term:r,socket:c,abort:t,suspend:void 0};return e.z||(f.suspend=setTimeout(()=>c.disconnect(),i6)),f},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.z?(!e.a0&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a0&&!e.a2&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),i6)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),7),E8=j(26,e=>{die(e,+!e.a0),T8(e)}),D8=j(27,e=>{T8(e),C8(e)}),fie=O(6,((e,t)=>`<div><div><!><div></div><!><input type=file accept=image/* hidden><button title="More keys">${e}</button><button>${t}</button><!><div popover=auto></div></div></div>`)(P3,z3),((e,t)=>` D D%b b%b b D/${e}&l D/${t}&l%b m`)(F3,B3),sie),O8=j(28,e=>{fie(e,+!e.a2),T8(e)}),pie=O(2,`<div>uploading…</div>`,` `,u6),k8=j(29,e=>pie(e,+!e.a3)),mie=O(3,`<div>Copied</div>`,` `,l6),A8=j(30,e=>mie(e,+!e.a4)),hie=O(5,`<div><div><p class=dim>Long-press below and choose Paste</p><input placeholder="Paste here…"><button class=btn>Cancel</button></div></div>`,` D Db b `,O6),j8=j(31,e=>{hie(e,+!e.a5),E6(e)}),gie=(e,t)=>Tie(e,t.current),_ie=(e,t)=>Die(e,t.timer),vie=(e,t)=>kie(e,t.current),yie=L(`u25`,e=>{O8(e,lr()),A(e.a,`dragover`,function(e){e.preventDefault()}),A(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.ah(n)})});function bie(e){B(e.a,$.termWrap),B(e.b,$.term),E8(e,!1),D8(e,!1),O8(e,!1),k8(e,!1),A8(e,!1),j8(e,!1),gie(e,{current:null}),_ie(e,{timer:0}),vie(e,{current:null}),yie(e)}var xie=M(41),M8=N(40,e=>xie(e,F8(e))),Sie=M(46),Cie=M(47),N8=N(44,e=>{Sie(e,I8(e)),Cie(e,L8(e))}),wie=M(43,e=>{N8(e),T8(e)}),P8=N(34,e=>wie(e,R8(e))),Tie=M(33,e=>{M8(e),P8(e),N8(e),T8(e)}),Eie=M(37,T8),Die=M(36,e=>Eie(e,z8(e))),Oie=M(42),kie=M(39,e=>{Oie(e,B8(e)),M8(e)}),Aie=M(9,P8),jie=M(10,e=>{z(e.a,`hidden`,e.k===`diff`),b8(e)}),Mie=F(K6),Nie=M(19,e=>{T8(e),Mie(e)}),Pie=M(25,T8),Fie=M(11),Iie=M(12),Lie=M(13),Rie=M(14),zie=M(15,x8),Bie=M(16,F(s8)),Vie=M(17,F(f8,j6)),Hie=M(18,F(m8,a8)),Uie=M(20),Wie=M(21,F(X6)),Gie=M(22,F(Q6)),Kie=M(23,F(g8)),qie=F(N6),Jie=M(24,e=>{S8(e),qie(e)});function F8(e){return t=>{uie(e)(),e.a7?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.a7?.send(t),r6)},n6),e.ad=n}}function I8(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.ah(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.a7?.send(n)}j8(e,!1)}}function L8(e){return async()=>{if(!navigator.clipboard?.read){j8(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.ah(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.a7?.send(n)}}}catch{j8(e,!0)}}}function R8(e){return async t=>{if(t){k8(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.j}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.a7?.send(`${n.path} `)}finally{k8(e,!1)}}}}function z8(e){return()=>{clearTimeout(e.aa),A8(e,!0),e.aa=setTimeout(()=>{A8(e,!1)},1200)}}function B8(e){return()=>{let t=e.ad;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.ad=null)}}R(`u1`,F8),R(`u4`,I8),R(`u5`,L8),R(`u3`,R8),R(`u0`,z8),R(`u2`,B8);var V8={iconBtn:`_cb _7`,spinning:`_cc _8`,usageModal:`_cd`,manageHead:`_ce`,usageRow:`_cf`,usageName:`_cg`,usageStale:`_ch`,stale:`_ci`,usageMeters:`_cj`,meter:`_ck`,meterReset:`_cl`,meterLabel:`_cm`,meterTrack:`_cn`,meterFill:`_co`,warm:`_cp`,hot:`_cq`,meterPct:`_cr`,usageList:`_cs`},Yie=Bc,Xie=(e=>`/${e}&`)(Vc);function H8(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function Zie(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:H8(n)}var Qie=(e,t)=>V(e.i,t?`↻ ${dt(t)}`:``),U8=N(13,e=>Qie(e,Zie(e.m,e._.i!=null))),W8=We(5,U8),$ie=e=>{W8._(e),B(e.a,V8.meter),B(e.b,V8.meterLabel),B(e.d,V8.meterTrack),B(e.f,V8.meterPct),B(e.h,V8.meterReset)},G8=N(16,e=>z(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),eae=M(15,e=>{V(e.g,e.p),G8(e)}),tae=(e,t)=>{B(e.e,[V8.meterFill,{hot:t>=90,warm:t>=70&&t<90}]),ht(e.e,`width:${Math.min(100,Math.max(2,t))}%`),eae(e,Math.round(t))},nae=M(12,e=>{U8(e),G8(e)}),rae=M(14,e=>{V(e.c,e.o),G8(e)}),iae=(e,t)=>{tae(e,t[0]?.used_percent),nae(e,t[0]?.resets_at),rae(e,t[0]?.window)},K8=P(4,0,e=>{z(e.a,`title`,`plan-usage could not reach this provider — these are its last cached numbers, ${H8(e._.i*1e3)} old`),V(e.b,H8(e._.i*1e3))}),aae=e=>{K8._(e),B(e.a,V8.usageStale)},q8=P(3,0,e=>V(e.a,e._.k.replace(/^default_/,``).replaceAll(`_`,` `))),oae=q8,sae=O(4,`<span>⚠ <!> old</span>`,` Db%`,aae),cae=M(8,e=>{B(e.a,[V8.usageRow,{[V8.stale]:e.i!=null}]),sae(e,+(e.i==null)),K8(e),W8(e)}),lae=e=>{B(e.b,V8.usageName),B(e.f,V8.usageMeters)},uae=(e,t)=>V(e.c,t),dae=O(3,`<span class=dim> </span>`,`D `,oae),fae=M(10,e=>{dae(e,+!e.k),q8(e)}),pae=k(5,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,$ie,iae),mae=(e,t)=>pae(e,[t||[],`window`]),hae=k(0,`<div><div><strong> </strong><!><!></div><div></div></div>`,` D E l%b%l `,lae,(e,t)=>{cae(e,t[0]?.stale_seconds),uae(e,t[0]?.agent),fae(e,t[0]?.plan),mae(e,t[0]?.windows)}),J8=I(14,e=>hae(e,[e._._.h||[],e=>`${e.agent}-${e.account||``}`]),e=>e._._),gae=e=>{J8(e),B(e.a,V8.usageList)},Y8=I(13,e=>V(e.a,e._._.g),e=>e._._),_ae=O(4,`<p class=dim><span class=spin></span> Loading usage…</p>`,0,0,`<p class=dim> </p>`,`D `,Y8,`<div></div>`,` `,gae),X8=I(12,e=>_ae(e,e._.f?e._.f?.error?1:2:0)),vae=L(`w2`,e=>A(e.c,`click`,function(){e._.k()})),yae=e=>{X8(e),Z8(e),bae(e),B(e.a,V8.manageHead),Ts(e.d),Es(e.d,13),Ds(e.d),vae(e)},Z8=I(15,e=>{B(e.c,[V8.iconBtn,{[V8.spinning]:e._.i}]),z(e.c,`disabled`,e._.i)}),bae=I(16,e=>z(e.b,`id`,e._.l)),xae=lt(`w3`,(e=>`<header><div><h2>Usage</h2></div><button title="Refresh usage" aria-label="Refresh usage">${e}</button></header><!><!>`)(Cs),(e=>` E l D/${e}&m%c`)(ws),yae),Sae=F(X8),Q8=j(5,e=>{Cae(e,e.f?.error),wae(e,e.f?.agents),Sae(e)}),Cae=M(6,F(Y8)),wae=M(7,F(J8)),$8=j(8,F(Z8)),Tae=M(10),Eae=L(`w4`,e=>Tt(e,{onMount:function(){e.j(!1)}})),Dae=M(9,e=>{Tae(e,e5(e)),Eae(e)}),Oae=M(11,e=>il(e.a,e.l));function kae(e){cl(e.a),Hc(e.a,xae(e)),al(e.a,`Usage`),nl(e.a,V8.usageModal),ol(e.a),Yc(e.a),dl(e.a),ul(e.a,{}),Q8(e,null),$8(e,!1),Dae(e,t5(e)),Oae(e,Xe(e))}var Aae=(e,t)=>Qc(e.a,t),jae=(e,t)=>tl(e.a,t);function e5(e){return async()=>{$8(e,!0),await e.j(!0),$8(e,!1)}}function t5(e){return async t=>{try{Q8(e,await cn(`/api/usage${t?`?refresh`:``}`))}catch(t){Q8(e,{error:String(t.message||t)})}}}R(`w1`,e5),R(`w0`,t5);var n5={promptDlg:`__`,promptTitle:`_ba`},Mae=Bc,Nae=(e=>`/${e}&`)(Vc),Pae=lt(`p2`,`Cancel`),Fae=Qe(2,`B2`),r5=I(15,e=>V(e.b,e._.i)),Iae=L(`p4`,e=>{Pt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._.n()):t.key===`Escape`&&e._.l&&c5(e._,!1)})}),Lae=e=>{r5(e),i5(e),a5(e),Rae(e),B(e.a,n5.promptTitle),Iae(e)},i5=I(17,e=>z(e.c,`placeholder`,e._.k)),a5=I(18,e=>Nt(e,`c`,e._.l,f5(e))),Rae=I(19,e=>z(e.a,`id`,e._.o)),zae=lt(`p6`,`<h2> </h2><input>`,` D l `,Lae,0,`B2`),o5=I(16,e=>V(e.b,e._.j||`OK`)),Bae=L(`p3`,e=>A(e.a,`click`,function(){e._.n()})),Vae=e=>{o5(e),s5(e),e.c,bs(e.c,Pae(e)),Ss(e.c,{class:`btn`}),Bae(e)},s5=I(18,e=>z(e.a,`disabled`,!e._.l.trim())),Hae=ut(`p5`,(e=>`<button type=button class="btn primary"> </button><div class=spacer></div>${e}`)(vs),(e=>` D lb/${e}&`)(ys),Vae),c5=Ue(9),l5=N(5,e=>c5(e,e.d,e.e)),Uae=M(3,e=>{Qc(e.a,e.d),l5(e)}),Wae=M(4,e=>{tl(e.a,e.e),l5(e)}),Gae=M(13),u5=N(12,e=>Gae(e,p5(e))),Kae=F(s5,a5),d5=j(11,e=>{u5(e),Kae(e)}),qae=(e,t)=>d5(e,t||``),Jae=M(7,u5),Yae=M(14,e=>il(e.a,e.o)),Xae=L(`p7`,e=>Tt(e,{onMount:function(){setTimeout(()=>{let t=Fae(e)();t?.focus(),t?.select()},0)}}));function Zae(e){cl(e.a),dl(e.a,an({content:Hae(e)})),Hc(e.a,zae(e)),nl(e.a,n5.promptDlg),ol(e.a),Yc(e.a),ul(e.a,{}),Yae(e,Xe(e)),Xae(e)}var Qae=F(r5),$ae=M(8,e=>{al(e.a,e.i),Qae(e)}),eoe=M(9,F(o5)),toe=M(10,F(i5));function f5(e){return t=>{d5(e._,t)}}function p5(e){return()=>{let t=e.l.trim();t&&e.h(t)}}R(`p0`,f5),R(`p1`,p5);var noe=(e=>`<div>${e}<div><!><!><div></div></div><!><!></div>`)(bg),roe=(e=>` D/${e}& D%b%b l%b%l`)(xg),ioe=e=>B(e.a,Cm.padInline),m5=P(7,0,e=>Uae(e.a,!!e._.a5)),aoe=e=>{m5._(e),g5._(e),_5._(e),y5._(e),b5._(e),Zae(e.a),$ae(e.a,`Rename session`),eoe(e.a,`Rename`),Wae(e.a,h7(e)),toe(e.a)},h5=N(1,e=>qae(e.a,e._.a6||e._.a7)),g5=P(7,0,h5),_5=P(7,0,h5),v5=N(2,e=>Jae(e.a,g7(e))),y5=P(7,0,v5),b5=P(7,0,v5),x5=I(69,e=>V(e.a,e._._.a3),e=>e._._),ooe=ut(`x31`,` `,` `,x5),soe=e=>{Vr(e.a),Gr(e.a,ooe(e)),Yr(e.a,_7(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},S5=P(6,0,e=>Aae(e.a,e._.a2)),coe=e=>{S5._(e),kae(e.a),jae(e.a,v7(e))},C5=N(3,e=>V(e.c,e._._.a4?`Starting…`:`Start ${e._._.n||`claude`}`)),w5=I(63,C5,e=>e._._),loe=L(`x32`,e=>A(e.b,`click`,function(){e._._.am(e._._.n||`claude`,!0)})),uoe=e=>{w5(e),T5(e),B(e.a,Cm.emptySess),loe(e)},T5=I(70,e=>{z(e.b,`disabled`,e._._.a4),C5(e)},e=>e._._),E5=N(8,e=>Pie(e.b,e._._.m&&e._._.x===`term`&&e.g===e._._.al),3),D5=I(62,E5,e=>e._._),doe=e=>{D5(e),O5(e),k5(e),j5(e),M5(e),N5(e),F5(e),I5(e),L5(e),bie(e.b),Uie(e.b,S7(e)),Rie(e.b,x7(e)),Fie(e.b,b7(e)),Iie(e.b,y7(e))},O5=I(64,e=>Kie(e.b,e._._.q),e=>e._._),k5=I(65,e=>{jie(e.b,e._._.x),E5(e)},e=>e._._),A5=N(11,e=>zie(e.b,C7(e))),j5=I(75,e=>{Aie(e.b,e._._.aa),Lie(e.b,w7(e)),A5(e)},e=>e._._),M5=I(76,e=>Jie(e.b,e._._.af),e=>e._._),N5=I(77,e=>{Hie(e.b,e._._.ai),Wie(e.b,T7(e))},e=>e._._),foe=de(3,0,2),P5=N(7,e=>foe(e,e.g===e._._.al)),F5=I(79,e=>{E5(e),P5(e)},e=>e._._),I5=I(80,e=>Gie(e.b,E7(e)),e=>e._._),L5=I(82,A5,e=>e._._),poe=M(6,e=>{Nie(e.b,e.g),E5(e),P5(e)}),moe=(e,t)=>Vie(e.b,t),hoe=(e,t)=>Bie(e.b,t),goe=k(0,(e=>`<!><!>${e}<!><!><!>`)(e6),(e=>`b%b/${e}&%b%c`)(t6),doe,(e,t)=>{poe(e,t[0]?.id),moe(e,t[0]?.state),hoe(e,t[0]?.agent)}),R5=P(5,0,e=>goe(e,[e._.ai,`id`])),_oe=e=>{R5._(e),z5._(e)},voe=O(1,`<div><p class=dim>No sessions in this workspace.</p><button class="btn primary"> </button></div>`,` Db D `,uoe),z5=P(5,0,e=>voe(e,+!!e._.ak)),B5=N(4,e=>XW(e.b,e._.m&&e._.x===`diff`)),V5=P(4,0,B5),H5=e=>{V5._(e),U5._(e),W5._(e),G5._(e),K5._(e),q5._(e),jW(e.b),rG(e.b,O7(e)),aG(e.b,D7(e))},yoe=de(3,0,2),U5=P(4,0,e=>{yoe(e,e._.x===`diff`),B5(e)}),W5=P(4,0,e=>YW(e.b,e._.z)),G5=P(4,0,e=>ZW(e.b,e._.a0)),K5=P(4,0,e=>JW(e.b,e._.aa)),q5=P(4,0,e=>oG(e.b,e._.ai||[])),boe=M(59,b5),xoe=O(5,`<!><!><!><!>`,`b%b%`,_oe,`<p>Loading sessions…</p>`,` `,ioe),Soe=F(F5),Coe=M(47,e=>{Q_(e.b,e.al),Soe(e)}),J5=N(45,e=>Coe(e,(()=>{if(e.v&&e.ai?.some(t=>t.id===e.v))return e.v;let t=Xn(e.aa);return t&&e.ai?.some(e=>e.id===t)?t:e.ai?.[0]?.id??null})()),2),woe=F(N5),Toe=M(44,e=>{Iv(e.b,e.ai),Zoe(e,e.ai?.length),xoe(e,+!e.ai),J5(e),q5(e),R5(e),woe(e)}),Y5=N(39,e=>Toe(e,e.u??e.l?.[e.aa]?.sessions??null),2),X5=N(57,L(`x33`,e=>Tt(e,{active:e.m,load:e.au,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.timer??=setInterval(r.refresh,1e4)):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return jn().addEventListener(`sessions.changed`,t=>{let n=t.data?.workspaceId;r.started&&(!n||n===e.aa)&&r.refresh()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),fee(()=>{if(!this.active)return;let t=In(e.aa);t&&e.ag(t.pr);let n=Rn(e.aa);n&&(i7(e,n),a7(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),3),Eoe=M(56,X5),Z5=N(55,e=>Eoe(e,A7(e)),2),Doe=M(54,Z5),Q5=N(52,e=>Doe(e,j7(e)),6),Ooe=F(L5),koe=M(60,e=>{Mv(e.b,M7(e)),Ooe(e)}),$5=N(49,e=>koe(e,N7(e)),2),Aoe=M(48,e=>{Q5(e),$5(e)}),e7=N(37,e=>Aoe(e,P7(e))),joe=M(58,F(I5)),t7=N(22,e=>joe(e,F7(e))),n7=j(20,e=>{boe(e,k7(e)),Y5(e),e7(e),Q5(e),t7(e)}),r7=N(38,L(`x34`,e=>{e.v&&Zn(e.aa,e.v)})),i7=j(21,e=>{J5(e),Q5(e),t7(e),r7(e)}),Moe=F(k5),a7=j(23,e=>{rv(e.b,e.x),B(e.f,[Cm.termArea,{[Cm.asBar]:e.x===`diff`}]),U5(e),Moe(e)}),Noe=O(4,(e=>`<!><!>${e}<!><!><!>`)(XR),(e=>`b%b/${e}&%b%c`)(ZR),H5),o7=j(24,e=>Noe(e,+!e.y)),s7=j(25,W5),c7=N(43,L(`x35`,e=>{if(e.m){let t=In(e.aa);t&&e.ag(t.pr);let n=Rn(e.aa);n&&(i7(e,n),a7(e,`term`))}}),2),Poe=M(42,e=>{Pv(e.b,I7(e)),c7(e),X5(e)}),l7=j(26,e=>{Poe(e,L7(e)),G5(e)}),u7=j(27,e=>lv(e.b,e.a1)),Foe=O(6,Yie,(e=>`/${e}&`)(Xie),coe),d7=j(28,e=>{Foe(e,+!e.a2),S5(e)}),Ioe=O(3,mr,(e=>`/${e}&`)(hr),soe),Loe=F(x5),f7=j(29,e=>{Ioe(e,+!e.a3),Loe(e)}),p7=j(30,F(T5)),Roe=O(7,Mae,(e=>`/${e}&`)(Nae),aoe),m7=j(31,e=>{Hoe(e,e.a5?.title),Uoe(e,e.a5?.agent),Woe(e,e.a5?.id),Roe(e,+!e.a5),m5(e)}),zoe=(e,t)=>{nse(e,t.wanted),rse(e,t.run)},Boe=M(61);function Voe(e){B(e.a,Cm.workView),yv(e.b),$_(e.b,G7(e)),iv(e.b,W7(e)),uv(e.b,U7(e)),bv(e.b,H7(e)),Hv(e.b,V7(e)),Vv(e.b,B7(e)),zv(e.b,z7(e)),B(e.c,Cm.mainCol),n7(e,null),i7(e,null),a7(e,`term`),o7(e,!1),s7(e,``),l7(e,0),u7(e,!1),d7(e,!1),f7(e,null),p7(e,!1),m7(e,null),zoe(e,{wanted:!1,run:void 0}),Boe(e,R7(e))}var Hoe=M(32,g5),Uoe=M(33,_5),Woe=M(34,y5),Goe=(e,t)=>{J_(e.b,t),qoe(e,t?.id),Joe(e,t?.status),Yoe(e,t?.name)},Koe=F(j5),qoe=M(36,e=>{Y5(e),J5(e),c7(e),e7(e),Q5(e),r7(e),$5(e),X5(e),K5(e),Koe(e)}),Joe=M(40,Q5),Yoe=M(41,F(M5)),Xoe=Goe,Zoe=M(46,z5),Qoe=M(11,e=>{Tv(e.b,e.l),Y5(e)}),$oe=F(D5),ese=L(`x36`,e=>{e.m||u7(e,!1),A(e.a,`keydown`,e.m&&(t=>{if(t.key===`Escape`&&e.a1&&!document.querySelector(`dialog[open]`)&&u7(e,!1),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.x===`diff`?a7(e,`term`):(o7(e,!0),a7(e,`diff`))),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.ai?.length??0)>1){t.preventDefault();let n=e.ai.map(e=>e.id);i7(e,n[(Math.max(0,n.indexOf(e.al))+(t.key===`]`?1:n.length-1))%n.length]),a7(e,`term`)}}))}),tse=M(12,e=>{xv(e.b,e.m),c7(e),X5(e),V5(e),$oe(e),ese(e)}),nse=M(51,e=>{Q5(e),Z5(e)}),rse=M(53,Z5),ise=F(w5),ase=M(13,e=>{Q5(e),ise(e)}),ose=M(14,e=>{Dv(e.b,e.o),$5(e)}),sse=(e,t)=>Sv(e.b,t),cse=F(O5),lse=M(16,e=>{Av(e.b,e.q),cse(e)}),use=(e,t)=>Lv(e.b,t),dse=M(18,e=>Ov(e.b,e.s)),fse=(e,t)=>Uv(e.b,t);function h7(e){return function(t){t||m7(e._,null)}}function g7(e){return function(t){e._.ax(e._.a8,t),m7(e._,null)}}function _7(e){return function(){f7(e._,null)}}function v7(e){return t=>{d7(e._,t)}}function y7(e){return function(){u7(e._._,!0)}}function b7(e){return function(){a7(e._._,`term`)}}function x7(e){return function(){e._._.ag()}}function S7(e){return function(t){i7(e._._,t)}}function C7(e){return function(t){e._._.ay(e._._.aa,t)}}function w7(e){return function(){e._._.s?.(e._._.aa)}}function T7(e){return function(t){let n=(e._._.ai||[]).find(e=>e.id===t);n&&m7(e._._,n)}}function E7(e){return function(t){e._._.aw(t)}}function D7(e){return function(){a7(e._,`term`)}}function O7(e){return function(t){i7(e._,t),a7(e._,`term`)}}function k7(e){return async(t,n)=>{n=n.trim(),n&&(n7(e,(e.u||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function A7(e){return t=>(t&&(e.ap=!0),(e.ar??=zn(e.as))())}function j7(e){return async()=>{let t=e.ap;e.ap=!1;try{let n=await cn(`/api/workspaces/${e.aa}/sessions`);if(!n.length&&t&&e.ae===`active`){let t=await e.am(e.n||`claude`,!1);n=t?[t]:[]}n7(e,n);let r=Xn(e.aa);r&&n.some(e=>e.id===r)&&i7(e,r),e.u.some(t=>t.id===e.v)||i7(e,e.u?.[0]?.id||null)}catch(t){if(n7(e,e.u||[]),ln(t))return;f7(e,String(t.message||t))}}}function M7(e){return function(t,n){e.ay(t,n)}}function N7(e){return async(t,n)=>{if(t===e.aa){let r=await e.am(n,!0);r&&Zn(t,r.id);return}try{Zn(t,(await cn(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.o?.(t)}catch(t){f7(e,String(t.message||t))}}}function P7(e){return async(t,n)=>{p7(e,!0);try{let r=await cn(`/api/workspaces/${e.aa}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});return n&&(n7(e,(e.u||[]).concat(r)),i7(e,r.id)),r}catch(t){return f7(e,String(t.message||t)),null}finally{p7(e,!1)}}}function F7(e){return async t=>{try{await cn(`/api/sessions/${t}`,{method:`DELETE`}),n7(e,(e.u||[]).filter(e=>e.id!==t)),e.v===t&&i7(e,e.u?.[0]?.id||null)}catch(t){f7(e,`Kill session failed: ${String(t.message||t)}`)}}}function I7(e){return function(t){e.ag(t)}}function L7(e){return t=>{s7(e,t||``),t&&l7(e,e.a0+1),o7(e,!0),a7(e,`diff`)}}function R7(e){return t=>{m7(e,t)}}function z7(e){return function(t){e.az(t)}}function B7(e){return function(t){e.aw(t)}}function V7(e){return function(){d7(e,!0)}}function H7(e){return function(t){f7(e,t)}}function U7(e){return t=>{u7(e,t)}}function W7(e){return t=>{a7(e,t)}}function G7(e){return function(t){i7(e,t)}}R(`x29`,h7),R(`x30`,g7),R(`x17`,_7),R(`x28`,v7),R(`x26`,y7),R(`x25`,b7),R(`x24`,x7),R(`x21`,S7),R(`x20`,C7),R(`x27`,w7),R(`x23`,T7),R(`x22`,E7),R(`x19`,D7),R(`x18`,O7),R(`x5`,k7),R(`x3`,A7),R(`x2`,j7),R(`x13`,M7),R(`x6`,N7),R(`x1`,P7),R(`x4`,F7),R(`x16`,I7),R(`x0`,L7),R(`x7`,R7),R(`x15`,z7),R(`x14`,B7),R(`x12`,V7),R(`x11`,H7),R(`x10`,U7),R(`x9`,W7),R(`x8`,G7);var K7=I(49,e=>V(e.a,e._._.a2),e=>e._._),pse=ut(`n19`,` `,` `,K7),mse=e=>{Vr(e.a),Gr(e.a,pse(e)),Yr(e.a,I9(e)),Jr(e.a),Rr(e.a),Nr(e.a),Lr(e.a),Ur(e.a),Br(e.a,{})},q7=I(42,e=>sse(e.b,e._._.p),e=>e._._),hse=e=>{q7(e),J7(e),Y7(e),Q7(e),$7(e),e9(e),t9(e),n9._(e),r9._(e),Voe(e.b),use(e.b,R9(e)),fse(e.b,L9(e))},J7=I(43,e=>Qoe(e.b,e._._.q),e=>e._._),Y7=I(44,e=>{ase(e.b,e._._.r?e._._.r?.preferredAgent:`claude`),lse(e.b,e._._.r?e._._.r?.agents:[`claude`])},e=>e._._),X7=N(5,e=>tse(e.b,!e._._.y&&!e._._.ad&&e._.f===e._._.t),3),gse=de(3,0,2),Z7=N(4,e=>gse(e,e._.f===e._._.t)),Q7=I(45,e=>{X7(e),Z7(e)},e=>e._._),$7=I(46,X7,e=>e._._),e9=I(50,e=>ose(e.b,z9(e)),e=>e._._),t9=I(51,X7,e=>e._._),n9=P(0,0,e=>Xoe(e.b,e._.e)),r9=P(0,0,e=>{dse(e.b,B9(e)),X7(e),Z7(e)}),_se=O(0,(e=>`<!><!>${e}<!><!><!>`)(noe),(e=>`b%b/${e}&%b%c`)(roe),hse),vse=M(4,e=>{bse(e,e.e?.id),_se(e,+!e.e),n9(e)}),i9=N(3,e=>vse(e,e._.p.find(t=>t.id===e.c))),a9=We(5,i9),yse=a9,bse=M(5,r9),xse=M(2,i9),Sse=(e,t)=>xse(e,t[0]),o9=N(1,e=>dm(e.a,V9(e))),s9=P(4,0,o9),Cse=e=>{s9._(e),c9._(e),l9._(e),om(e.a),pm(e.a,H9(e))},c9=P(4,0,e=>fm(e.a,e._.y)),l9=P(4,0,o9),u9=P(3,0,e=>jf(e.a,U9(e))),wse=e=>{u9._(e),d9._(e),f9._(e),Xd(e.a),uf(e.a,W9(e))},d9=P(3,0,e=>lf(e.a,!!e._.z)),f9=P(3,0,e=>Af(e.a,e._.ad)),p9=P(2,0,e=>qo(e.a,e._.p)),Tse=e=>{p9._(e),m9._(e),h9._(e),g9._(e),v9._(e),y9._(e),b9._(e),Ho(e.a),Io(e.a,J9(e)),Qo(e.a,q9(e)),rs(e.a,K9(e)),go(e.a,G9(e)),Oo(e.a),ko(e.a)},m9=P(2,0,e=>fs(e.a,e._.q)),h9=P(2,0,e=>Fo(e.a,e._.r)),g9=P(2,0,e=>Xo(e.a,e._.t)),_9=N(1,e=>ls(e.a,!e._.a1&&e._.ae)),v9=P(2,0,e=>{ho(e.a,e._.a1),_9(e)}),y9=P(2,0,e=>{is(e.a,Z9(e)),Zo(e.a,X9(e)),$o(e.a,Y9(e))}),b9=P(2,0,_9),x9=N(36,L(`n21`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0,timer:void 0};Un(e.n),or(n);let i=(t,n)=>{n&&(Ln(t,n),Zn(t,n)),e.a9(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),dr()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),fr(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a8()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a8(!0))},{signal:n}),o(),jn().addEventListener(`workspaces.changed`,()=>{e.a3(),o()},{signal:n}),jn().addEventListener(`sessions.changed`,()=>{clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),jn().addEventListener(`status.changed`,t=>{t.data&&(O9(e,t.data),r.statusStale=!1)},{signal:n}),r.timer=setInterval(o,6e4);let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce),clearInterval(this.timer)}})),3),Ese=F(e9),Dse=M(35,e=>{x9(e),y9(e),l9(e),Ese(e)}),S9=N(22,e=>Dse(e,Q9(e))),Ose=O(2,(e=>`<!>${e}`)(Ri),(e=>`b/${e}&`)(zi),Tse),C9=N(41,e=>Ose(e,e.a1||e.ae?0:1)),kse=M(40,e=>{C9(e),b9(e)}),w9=N(38,e=>kse(e,!e.y&&!e.ab)),Ase=M(37,w9),T9=N(20,e=>Ase(e,e.p.find(t=>t.id===e.t))),jse=O(3,pl,(e=>`/${e}&`)(ml),wse),Mse=F(t9),Nse=M(39,e=>{jse(e,+!e.ad),f9(e),Mse(e)}),E9=N(26,e=>Nse(e,e.p.find(t=>t.id===e.z))),Pse=F(q7),D9=j(15,e=>{S9(e),T9(e),E9(e),p9(e),u9(e),s9(e),a9(e),Pse(e)}),Fse=F(J7),O9=j(16,e=>{m9(e),Fse(e)}),Ise=F(Y7),Lse=j(17,e=>{h9(e),Ise(e)}),Rse=k(5,`<!><!><!>`,`b%`,yse,Sse),zse=M(29,x9),k9=N(23,e=>zse(e,$9(e))),A9=j(21,e=>{Rse(e,[e.v,e=>e]),k9(e),S9(e)}),Bse=F(Q7),j9=j(19,e=>{A9(e,e.t?[e.t]:[]),k9(e),T9(e),g9(e),Bse(e)}),Vse=O(4,qf,(e=>`/${e}&`)(Jf),Cse),Hse=F($7),M9=j(24,e=>{Vse(e,+!e.y),w9(e),c9(e),Hse(e)}),N9=j(25,e=>{E9(e),d9(e)}),P9=j(27,e=>{C9(e),v9(e)}),Use=O(1,mr,(e=>`/${e}&`)(hr),mse),Wse=F(K7),F9=j(28,e=>{Use(e,+!e.a2),Wse(e)});L(`n20`,e=>A(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),P9(e,!e.a1)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.p.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a9(n.id))}}));function I9(e){return function(){F9(e._,null)}}function L9(e){return function(){M9(e._._,!0)}}function R9(e){return function(t,n){Ln(t,n),Zn(t,n),e._._.a9(t)}}function z9(e){return function(t){e._._.a9(t)}}function B9(e){return function(t){N9(e._._,t||e._.f)}}function V9(e){return function(t){e._.p.some(e=>e.id===t.id)||D9(e._,[t,...e._.p]),M9(e._,!1),e._.a9(t.id)}}function H9(e){return t=>{M9(e._,t)}}function U9(e){return function(t){D9(e._,e._.p.map(e=>e.id===t.id?t:e))}}function W9(e){return function(t){t||N9(e._,null)}}function G9(e){return t=>{P9(e._,t)}}function K9(e){return function(){M9(e._,!0),P9(e._,!1)}}function q9(e){return function(t){N9(e._,t.id),M9(e._,!1),P9(e._,!1)}}function J9(e){return function(t){Lse(e._,t)}}function Y9(e){return function(t,n){P9(e._,!1),cn(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{Ln(t.id,n.id),e._.a9(t.id)}).catch(t=>{F9(e._,`New session failed: ${String(t.message||t)}`)})}}function X9(e){return function(t){Fn(t.id),e._.a9(t.id)}}function Z9(e){return function(t){e._.a9(t.id)}}function Q9(e){return async t=>{e.p.find(e=>e.id===t)?.status===`archived`&&(await cn(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),D9(e,e.p.map(e=>e.id===t?{...e,status:`active`}:e))),j9(e,t),M9(e,!1),N9(e,null),P9(e,!1),e.v.includes(t)||A9(e,e.v.concat(t)),qn(t)}}function $9(e){return async()=>{try{let t=await cn(`/api/workspaces`);D9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));A9(e,e.v.filter(e=>n.has(e))),e.t&&!n.has(e.t)&&(j9(e,e.v[e.v?.length-1]||null),qn(e.t))}catch(t){if(ln(t))return;F9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function Gse(e){return(t=!1)=>(e.a5||=t,(e.a6??=zn(async()=>{let t=e.a5;e.a5=!1;try{O9(e,await cn(`/api/status${t?`?fresh`:``}`))}catch(e){if(!ln(e))throw e}}))())}R(`n3`,I9),R(`n18`,L9),R(`n16`,R9),R(`n15`,z9),R(`n17`,B9),R(`n14`,V9),R(`n13`,H9),R(`n12`,U9),R(`n11`,W9),R(`n10`,G9),R(`n9`,K9),R(`n8`,q9),R(`n4`,J9),R(`n7`,Y9),R(`n6`,X9),R(`n5`,Z9),R(`n2`,Q9),R(`n0`,$9),R(`n1`,Gse);var Kse=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};De(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Kse(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){Zt(t.b,e)}});var qse=e=>B(e.a,sn.boot),Jse=(e,t)=>V(e.b,t instanceof Error?t.message:String(t));ut(`b1`,`<div><p> </p></div>`,` E `,qse,(e,t)=>Jse(e,t[0])),ut(`b0`,`<div><span class=spin></span>Loading workspaces…</div>`,` `,e=>B(e.a,sn.boot)),tt();export{t};
|
|
1615
|
+
//# sourceMappingURL=index-DZa_eHPR.js.map
|