vibora 4.5.0 → 4.5.2
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.
|
@@ -162,4 +162,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
162
162
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:l,tableRow:o}};function s(m,y,S,g){return u(f(m,S,g),m.align)}function o(m,y,S,g){const _=d(m,S,g),v=u([_]);return v.slice(0,v.indexOf(`
|
|
163
163
|
`))}function l(m,y,S,g){const _=S.enter("tableCell"),v=S.enter("phrasing"),x=S.containerPhrasing(m,{...g,before:a,after:a});return v(),_(),x}function u(m,y){return ynt(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function f(m,y,S){const g=m.children;let _=-1;const v=[],x=y.enter("table");for(;++_<g.length;)v[_]=d(g[_],y,S);return x(),v}function d(m,y,S){const g=m.children;let _=-1;const v=[],x=y.enter("tableRow");for(;++_<g.length;)v[_]=l(g[_],m,y,S);return x(),v}function p(m,y,S){let g=tde.inlineCode(m,y,S);return S.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function srt(){return{exit:{taskListCheckValueChecked:AQ,taskListCheckValueUnchecked:AQ,paragraph:lrt}}}function ort(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:urt}}}function AQ(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function lrt(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function urt(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=tde.listItem(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function crt(){return[ztt(),unt(),hnt(),Jnt(),srt()]}function drt(e){return{extensions:[Htt(),cnt(e),pnt(),art(e),ort()]}}const frt={tokenize:vrt,partial:!0},nde={tokenize:yrt,partial:!0},rde={tokenize:_rt,partial:!0},ide={tokenize:Ert,partial:!0},hrt={tokenize:Srt,partial:!0},ade={name:"wwwAutolink",tokenize:grt,previous:ode},sde={name:"protocolAutolink",tokenize:brt,previous:lde},Mu={name:"emailAutolink",tokenize:mrt,previous:ude},Sl={};function prt(){return{text:Sl}}let Ud=48;for(;Ud<123;)Sl[Ud]=Mu,Ud++,Ud===58?Ud=65:Ud===91&&(Ud=97);Sl[43]=Mu;Sl[45]=Mu;Sl[46]=Mu;Sl[95]=Mu;Sl[72]=[Mu,sde];Sl[104]=[Mu,sde];Sl[87]=[Mu,ade];Sl[119]=[Mu,ade];function mrt(e,t,n){const r=this;let i,a;return s;function s(d){return!fP(d)||!ude.call(r,r.previous)||w8(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return fP(d)?(e.consume(d),o):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(hrt,f,u)(d):d===45||d===95||$i(d)?(a=!0,e.consume(d),l):f(d)}function u(d){return e.consume(d),i=!0,l}function f(d){return a&&i&&na(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function grt(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ode.call(r,r.previous)||w8(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(frt,e.attempt(nde,e.attempt(rde,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function brt(e,t,n){const r=this;let i="",a=!1;return s;function s(d){return(d===72||d===104)&&lde.call(r,r.previous)&&!w8(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(na(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),a?u:(a=!0,l)):n(d)}function u(d){return d===null||vx(d)||Gn(d)||Uf(d)||AT(d)?n(d):e.attempt(nde,e.attempt(rde,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function vrt(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function yrt(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(ide,l,o)(u):u===null||Gn(u)||Uf(u)||u!==45&&AT(u)?l(u):(a=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!a?n(u):t(u)}}function _rt(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(ide,t,a)(s):s===null||Gn(s)||Uf(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function Ert(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Gn(o)||Uf(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Gn(o)||Uf(o)?t(o):r(o)}function a(o){return na(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):na(o)?(e.consume(o),s):n(o)}}function Srt(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return $i(a)?n(a):t(a)}}function ode(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Gn(e)}function lde(e){return!na(e)}function ude(e){return!(e===47||fP(e))}function fP(e){return e===43||e===45||e===46||e===95||$i(e)}function w8(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const xrt={tokenize:Nrt,partial:!0};function wrt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:krt,continuation:{tokenize:Ort},exit:Rrt}},text:{91:{name:"gfmFootnoteCall",tokenize:Art},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Trt,resolveTo:Crt}}}}function Trt(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const u=fo(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Crt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Art(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(a>999||d===93&&!s||d===null||d===91||Gn(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(fo(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Gn(d)||(s=!0),a++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),a++,u):u(d)}}function krt(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(y)}function f(y){if(s>999||y===93&&!o||y===null||y===91||Gn(y))return n(y);if(y===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=fo(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Gn(y)||(o=!0),s++,e.consume(y),y===92?d:f}function d(y){return y===91||y===92||y===93?(e.consume(y),s++,f):f(y)}function p(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(a)||i.push(a),En(e,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return t(y)}}function Ort(e,t,n){return e.check(I0,t,e.attempt(xrt,t,n))}function Rrt(e){e.exit("gfmFootnoteDefinition")}function Nrt(e,t,n){const r=this;return En(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function Irt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},d={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},p=[["enter",f,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&es(p,p.length,0,kT(m,s.slice(u+1,l),o)),es(p,p.length,0,[["exit",d,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",f,o]]),es(s,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const u=this.previous,f=this.events;let d=0;return p;function p(y){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const S=ym(u);if(y===126)return d>1?l(y):(s.consume(y),d++,m);if(d<2&&!n)return l(y);const g=s.exit("strikethroughSequenceTemporary"),_=ym(y);return g._open=!_||_===2&&!!S,g._close=!S||S===2&&!!_,o(y)}}}class Drt{constructor(){this.map=[]}add(t,n,r){Lrt(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function Lrt(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Prt(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Mrt(){return{flow:{null:{name:"table",tokenize:jrt,resolveAll:Frt}}}}function jrt(e,t,n){const r=this;let i=0,a=0,s;return o;function o(L){let D=r.events.length-1;for(;D>-1;){const V=r.events[D][1].type;if(V==="lineEnding"||V==="linePrefix")D--;else break}const z=D>-1?r.events[D][1].type:null,M=z==="tableHead"||z==="tableRow"?C:l;return M===C&&r.parser.lazy[r.now().line]?n(L):M(L)}function l(L){return e.enter("tableHead"),e.enter("tableRow"),u(L)}function u(L){return L===124||(s=!0,a+=1),f(L)}function f(L){return L===null?n(L):It(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),m):n(L):dn(L)?En(e,f,"whitespace")(L):(a+=1,s&&(s=!1,i+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),d(L)))}function d(L){return L===null||L===124||Gn(L)?(e.exit("data"),f(L)):(e.consume(L),L===92?p:d)}function p(L){return L===92||L===124?(e.consume(L),d):d(L)}function m(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),s=!1,dn(L)?En(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):y(L))}function y(L){return L===45||L===58?g(L):L===124?(s=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),S):w(L)}function S(L){return dn(L)?En(e,g,"whitespace")(L):g(L)}function g(L){return L===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):L===45?(a+=1,_(L)):L===null||It(L)?T(L):w(L)}function _(L){return L===45?(e.enter("tableDelimiterFiller"),v(L)):w(L)}function v(L){return L===45?(e.consume(L),v):L===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(L))}function x(L){return dn(L)?En(e,T,"whitespace")(L):T(L)}function T(L){return L===124?y(L):L===null||It(L)?!s||i!==a?w(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):w(L)}function w(L){return n(L)}function C(L){return e.enter("tableRow"),R(L)}function R(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),R):L===null||It(L)?(e.exit("tableRow"),t(L)):dn(L)?En(e,R,"whitespace")(L):(e.enter("data"),O(L))}function O(L){return L===null||L===124||Gn(L)?(e.exit("data"),R(L)):(e.consume(L),L===92?N:O)}function N(L){return L===92||L===124?(e.consume(L),O):O(L)}}function Frt(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,f,d;const p=new Drt;for(;++n<e.length;){const m=e[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(o=!1,l!==0&&(kQ(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",u,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",f,t]])),i=y.type==="tableDelimiterRow"?2:f?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],d=X_(p,t,a,i,void 0,d),a=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],d=X_(p,t,a,i,void 0,d)),a=s,s=[a[1],n,0,0])):y.type==="tableHead"?(o=!0,l=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],d=X_(p,t,a,i,n,d)):s[1]!==0&&(d=X_(p,t,s,i,n,d)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&kQ(p,t,l,u,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=Prt(t.events,n))}return e}function X_(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Jh(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const l=Jh(t.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Jh(t.events,n[2]),f=Jh(t.events,n[3]),d={type:o,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,S=n[3]-n[2]-1;e.add(y,S,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(a.end=Object.assign({},Jh(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function kQ(e,t,n,r,i){const a=[],s=Jh(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Jh(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Brt={name:"tasklistCheck",tokenize:$rt};function Urt(){return{text:{91:Brt}}}function $rt(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),a)}function a(l){return Gn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return It(l)?t(l):dn(l)?e.check({tokenize:zrt},t,n)(l):n(l)}}function zrt(e,t,n){return En(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Hrt(e){return Tce([prt(),wrt(),Irt(e),Mrt(),Urt()])}const Wrt={};function Vrt(e){const t=this,n=e||Wrt,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Hrt(n)),a.push(crt()),s.push(drt(n))}const Grt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,qrt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,Krt=({legacyTitle:e=!1,tagName:t="div"}={})=>n=>{ia(n,"blockquote",(r,i,a)=>{let s="",o="",l=!0,u=r.children.map(f=>{if(l&&f.type==="paragraph"){const d=f.children[0],p=d.type==="text"?d.value:"",m=e?qrt:Grt,y=p.match(m);if(y&&(l=!1,s=y[1].toLocaleLowerCase(),o=e&&y[2]||s.toLocaleUpperCase(),p.includes(`
|
|
164
164
|
`)&&(f.children[0]={type:"text",value:p.replace(m,"").replace(/^\n+/,"")}),!p.includes(`
|
|
165
|
-
`))){const S=[];f.children.forEach((g,_)=>{_!=0&&(_==1&&g.type==="break"||S.push(g))}),f.children=[...S]}}return f});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[Yrt(s),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function Yrt(e){let t=Xrt[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const Xrt={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function Zrt(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let i=!1;try{i=!!document.execCommand("copy")}catch{i=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(i)}function cde(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?cde(t.parentElement):null}function Qrt(e){var t=n=>{var r=cde(n.target);r&&(r.classList.add("active"),Zrt(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};k.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var i;(i=e.current)==null||i.removeEventListener("click",t,!1)}},[e])}var Jrt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],eit=e=>e;const tit=oe.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:a,disableCopy:s=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:f,wrapperElement:d={},warpperElement:p={},urlTransform:m}=e,y=s9e(e,Jrt),S=oe.useRef(null);k.useImperativeHandle(t,()=>ru({},e,{mdp:S}),[S,e]);var g=(n||"")+" "+(r||"");Qrt(S);var _=[...y.rehypePlugins||[]],v={allowElement:(w,C,R)=>y.allowElement?y.allowElement(w,C,R):/^[A-Za-z0-9]+$/.test(w.tagName)};o||_.push(yce);var x=[Krt,...y.remarkPlugins||[],Vrt],T=ru({},p,d);return b.jsx("div",ru({ref:S,onScroll:l,onMouseOver:u},T,{className:g,style:a,children:b.jsx(Ptt,ru({},v,y,{skipHtml:!o,urlTransform:m||eit,rehypePlugins:f?f("rehype",_):_,remarkPlugins:f?f("remark",x):x,children:i||""}))}))});var nit=function(t){return n=>{ia(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=ru({},r.properties,{"data-meta":String(r.data.meta)}))})}},rit=function(t){return n=>{ia(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var i=r.properties.dataMeta;typeof i=="string"&&(r.data.meta=i),delete r.properties.dataMeta}})}};const iit=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\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uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,ait=Object.hasOwnProperty;class sit{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=oit(t,n===!0);const a=i;for(;ait.call(r.occurrences,i);)r.occurrences[a]++,i=a+"-"+r.occurrences[a];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function oit(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(iit,"").replace(/ /g,"-"))}function dde(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const lit={},OQ=new sit;function uit(e){const n=(e||lit).prefix||"";return function(r){OQ.reset(),ia(r,"element",function(i){dde(i)&&!i.properties.id&&(i.properties.id=n+OQ.slug(fp(i)))})}}const fde=(function(e){if(e==null)return fit;if(typeof e=="string")return dit(e);if(typeof e=="object")return cit(e);if(typeof e=="function")return T8(e);throw new Error("Expected function, string, or array as `test`")});function cit(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fde(e[n]);return T8(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function dit(e){return T8(t);function t(n){return n.tagName===e}}function T8(e){return t;function t(n,r,i){return!!(hit(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fit(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function hit(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const RQ={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},pit={};function mit(e){const t=e||pit;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",a=t.content,s=t.group,o=fde(t.test);let l;return i==="after"||i==="before"?l=f:i==="wrap"?l=d:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(p){ia(p,"element",function(m,y,S){if(dde(m)&&m.properties.id&&o(m,y,S))return Object.assign(m.properties,Z_(r,m)),l(m,y,S)})};function u(p){const m=NQ(a||RQ,p);return p.children[i==="prepend"?"unshift":"push"](bI(p,Z_(n,p),m)),[tv]}function f(p,m,y){if(typeof m!="number"||!y)return;const S=NQ(a||RQ,p),g=bI(p,Z_(n,p),S);let _=i==="before"?[g,p]:[p,g];if(s){const v=hde(s,p);v&&!Array.isArray(v)&&v.type==="element"&&(v.children=_,_=[v])}return y.children.splice(m,1,..._),[tv,m+_.length]}function d(p){let m=p.children,y=[];return typeof a=="function"?(m=[],y=a(p)):a&&(y=C8(a)),p.children=[bI(p,Z_(n,p),Array.isArray(y)?[...m,...y]:[...m,y])],[tv]}}function C8(e){return Bf(e)}function bI(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function NQ(e,t){const n=hde(e,t);return Array.isArray(n)?n:[n]}function hde(e,t){return typeof e=="function"?e(t):C8(e)}function Z_(e,t){return typeof e=="function"?e(t):e?C8(e):{}}const git=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{ia(r,(i,a,s)=>{if(i.type==="element"||i.type==="root"){let o=!1;i.children=i.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return o=!0,!1;if(u===n)return o=!1,!1}return!o})}})}};var bit={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function vit(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var yit=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var a=n.children&&n.children[0];a&&a.properties&&a.properties.ariaHidden==="true"&&(a.properties=ru({class:"anchor"},a.properties),a.children=[bit])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=Iue(n.children);n.children.push(vit(s))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},_it=[uit,mit,git];const Eit=oe.forwardRef((e,t)=>{var n,r=[nit,yce,rit,..._it,[RKe,{rewrite:yit((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[DKe,{properties:"attr"}],...e.rehypePlugins||[],[sqe,{ignoreMissing:!0}]];return b.jsx(tit,ru({},e,{rehypePlugins:r,ref:t}))});function Sit(e,t){if(e.startsWith("/")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:"))return e;const n=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",r=n?n.split("/"):[],i=e.split("/");for(const a of i)a===".."?r.pop():a!=="."&&r.push(a);return r.join("/")}function xit(e,t,n){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("/api/"))return e;const r=Sit(e,n);return`/api/fs/image?${new URLSearchParams({path:r,root:t})}`}function wit({content:e,worktreePath:t,filePath:n}){const{resolvedTheme:r}=qc(),i=k.useMemo(()=>({img:({src:a,alt:s,...o})=>{if(!a)return null;const l=xit(a,t,n);return b.jsx("img",{src:l,alt:s||"",loading:"lazy",style:{maxWidth:"100%"},...o})},a:({href:a,children:s,...o})=>b.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...o,children:s})}),[t,n]);return b.jsx(Yy,{className:"h-full",children:b.jsx("div",{className:"p-4","data-color-mode":r==="light"?"light":"dark",children:b.jsx(Eit,{source:e,style:{backgroundColor:"transparent",fontSize:"14px"},components:i})})})}const Tit=1e3,Cit=n0(function({onBack:t}){const{worktreePath:n,readOnly:r,selectedFile:i,currentFile:a,isLoading:s,isSaving:o,loadError:l,isDirty:u,updateContent:f,saveFile:d,closeFile:p,toggleMarkdownView:m}=oie(),y=k.useRef(null);k.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const S=k.useCallback(w=>{!i||r||(f(i,w),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{d(i).catch(C=>{console.error("Auto-save failed:",C)})},Tit))},[i,r,f,d]),g=k.useCallback(()=>{i&&(y.current&&(clearTimeout(y.current),y.current=null),p(i)),t?.()},[i,p,t]),_=k.useCallback(()=>{i&&m(i)},[i,m]);if(!i)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(s)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(l)return b.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:l});if(!a)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Unable to load file"});if(a.isBinary)return b.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[b.jsx("p",{children:"Binary file"}),b.jsxs("p",{className:"text-xs",children:[(a.size/1024).toFixed(1)," KB"]})]});if(a.isImage)return b.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1.5 bg-card border-b border-border text-xs",children:[b.jsx("span",{className:"text-muted-foreground truncate",title:i,children:i.split("/").pop()||i}),b.jsx("button",{onClick:g,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:b.jsx(fe,{icon:ci,size:14,strokeWidth:2})})]}),b.jsx("div",{className:"flex-1 overflow-auto p-4 bg-muted",children:b.jsx("img",{src:a.content,alt:i,className:"block mx-auto"})})]});const v=i.split("/").pop()||i,x=a.isMarkdown,T=x&&a.isMarkdownView;return b.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-2 py-1.5 bg-card border-b border-border text-xs",children:[b.jsxs("span",{className:"text-muted-foreground truncate flex-1 flex items-center gap-1",title:i,children:[v,!r&&u&&b.jsx("span",{className:"text-amber-500",children:"*"}),!r&&o&&b.jsx("span",{className:"text-muted-foreground italic",children:"(saving...)"})]}),a.truncated&&b.jsxs("span",{className:"text-destructive",children:["Truncated (",a.lineCount.toLocaleString()," lines)"]}),b.jsxs("span",{className:"text-muted-foreground",children:[(a.size/1024).toFixed(1)," KB"]}),x&&b.jsx("button",{onClick:_,className:Ue("p-1 rounded hover:bg-muted/50 transition-colors",T?"text-primary":"text-muted-foreground hover:text-foreground"),title:T?"Show code":"Preview markdown",children:b.jsx(fe,{icon:T?$1e:z1e,size:14,strokeWidth:2})}),b.jsx("button",{onClick:g,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:b.jsx(fe,{icon:ci,size:14,strokeWidth:2})})]}),b.jsx("div",{className:"flex-1 min-h-0",children:T?b.jsx(wit,{content:a.content,worktreePath:n||"",filePath:i}):b.jsx(uGe,{filePath:i,content:a.content,onChange:S,readOnly:r||!a.isEditable})})]})}),pde=k.createContext(void 0),Ait=n0(function(){const t=k.useContext(pde),{selectedFile:n,expandedDirs:r,fileTree:i,isLoadingTree:a,treeError:s,selectFile:o,loadFile:l,toggleDir:u,collapseAll:f}=oie(),d=k.useCallback(y=>{o(y),l(y),t?.(y)},[o,l,t]),p=k.useCallback(y=>{u(y)},[u]),m=k.useCallback(()=>{o(null),t?.(null)},[o,t]);return a?b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):s?b.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s}):n?b.jsx("div",{className:"flex h-full flex-col bg-background",children:b.jsx(Cit,{onBack:m})}):b.jsx(QWe,{entries:i||[],selectedFile:n,expandedDirs:r,onSelectFile:d,onToggleDir:p,onCollapseAll:f})});function _x({worktreePath:e,readOnly:t=!1,initialSelectedFile:n,onFileChange:r}){const i=M2e(e,t,n);return e?b.jsx(sie.Provider,{value:i,children:b.jsx(pde.Provider,{value:r,children:b.jsx(Ait,{})})}):b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}const hP=Ms("/tasks/$taskId")({component:kit,validateSearch:e=>({tab:["diff","browser","files"].includes(e.tab)?e.tab:void 0,file:typeof e.file=="string"?e.file:void 0})}),Q_={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},IQ={IN_PROGRESS:"bg-status-in-progress/20 text-status-in-progress",IN_REVIEW:"bg-status-in-review/20 text-status-in-review",DONE:"bg-status-done/20 text-status-done",CANCELED:"bg-status-canceled/20 text-status-canceled"};function kit(){const{taskId:e}=hP.useParams(),t=hP.useSearch(),n=Wi(),r=ome(),{data:i,isLoading:a}=wne(e),s=NM(),o=IM(),{viewState:l,setActiveTab:u,setFilesViewState:f}=u5(e),d=Lie(),p=Pie(),m=Mie(),y=jie(),S=Fie(),{data:g}=DM(),{data:_}=LM(),{data:v}=PM(),{data:x}=Tne(),{data:T}=bWe(i?.linearTicketId??null),{data:w=[]}=Ky(),C=w.find(xe=>xe.path===i?.repoPath),R=r.state,O=i?.aiMode??R?.aiMode,N=i?.description??R?.description,[L,D]=k.useState(!1),[z,M]=k.useState(!1),[V,W]=k.useState(!0),[$,q]=k.useState("terminal"),Y=pw(),B=t.tab??l.activeTab,j=t.file??l.filesViewState.selectedFile,U=k.useRef(null);k.useEffect(()=>{U.current===e||t.tab||(U.current=e,l.activeTab&&n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:l.activeTab==="diff"?void 0:l.activeTab,file:l.filesViewState.selectedFile||void 0},replace:!0}))},[e,t.tab,l.activeTab,l.filesViewState.selectedFile,n]);const K=k.useCallback(xe=>{const ve=xe;u(ve),n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:ve==="diff"?void 0:ve,file:ve==="files"&&j||void 0},replace:!0})},[e,n,u,j]),H=k.useCallback(xe=>{f({selectedFile:xe}),n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:"files",file:xe||void 0},replace:!0})},[e,n,f]),{terminals:J,sendInputToTerminal:se}=c5(),ae=J.find(xe=>i?.worktreePath&&xe.cwd.startsWith(i.worktreePath)),Q=xe=>{ae?(se(ae.id,xe),ln.info("Sent to Claude Code")):ln.error("No terminal available")},G=async()=>{if(!(!i?.repoPath||!i?.worktreePath))try{await d.mutateAsync({repoPath:i.repoPath,worktreePath:i.worktreePath,baseBranch:i.baseBranch}),ln.success("Synced from main")}catch(xe){const ve=xe instanceof Error?xe.message:"Sync failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Rebase this worktree onto the parent repo's ${De} branch. Error: "${ve}". Steps: 1) Check for uncommitted changes - stash or commit them first, 2) git fetch origin (in parent repo at ${i.repoPath}) to ensure ${De} is current, 3) git rebase ${De} (in worktree), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) If stashed, git stash pop. Worktree: ${i.worktreePath}, Parent repo: ${i.repoPath}.`)}:void 0})}},Z=async()=>{if(!(!i?.repoPath||!i?.worktreePath))try{await p.mutateAsync({repoPath:i.repoPath,worktreePath:i.worktreePath,baseBranch:i.baseBranch}),ln.success("Merged to main"),S.mutate(i.id),s.mutate({taskId:i.id,updates:{status:"DONE"}})}catch(xe){const ve=xe instanceof Error?xe.message:"Merge failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Merge this worktree's branch into the parent repo's ${De}. Error: "${ve}". Steps: 1) Ensure all changes in worktree are committed, 2) In parent repo at ${i.repoPath}, checkout ${De} and pull latest from origin, 3) Squash merge the worktree branch into ${De} (use git merge --squash, then commit), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Push ${De} to origin. Worktree: ${i.worktreePath}, Parent repo: ${i.repoPath}.`)}:void 0})}},ee=async()=>{if(i?.worktreePath)try{await m.mutateAsync({worktreePath:i.worktreePath}),ln.success("Pushed to origin")}catch(xe){const ve=xe instanceof Error?xe.message:"Push failed";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Push this worktree's branch to origin. Error: "${ve}". Steps: 1) Check for uncommitted changes and commit them, 2) If push is rejected, pull the latest changes first and resolve any conflicts, 3) Push to origin again. Worktree: ${i.worktreePath}.`)}:void 0})}},ne=async()=>{if(i?.repoPath)try{await y.mutateAsync({repoPath:i.repoPath,baseBranch:i.baseBranch}),ln.success("Parent synced with origin")}catch(xe){const ve=xe instanceof Error?xe.message:"Sync parent failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Sync the parent repo's ${De} branch with origin. Error: "${ve}". Steps: 1) git fetch origin, 2) git pull origin ${De} --ff-only, 3) If that fails, rebase with git rebase origin/${De}, 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Once in sync, git push origin ${De}. Work in the parent repo at ${i.repoPath}, not the worktree.`)}:void 0})}},te=()=>{ae&&se(ae.id,"commit")},be=()=>{ae&&se(ae.id,"Create a PR for this task and link it using: vibora current-task pr <url>")},_e=()=>{if(!i?.worktreePath)return;const xe=sae(i.worktreePath,g,_,v);oae(xe)},he=xe=>{i&&s.mutate({taskId:i.id,updates:{status:xe}})},ye=()=>{i&&o.mutate({taskId:i.id,deleteLinkedWorktree:V},{onSuccess:()=>{n({to:"/tasks"})}})},Ee=xe=>{M(xe),xe||W(!1)};return a?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):i?b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[b.jsxs("div",{className:"shrink-0 border-b border-border bg-background px-4 py-2",children:[b.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:i.title}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx("button",{type:"button",className:`rounded-full px-2 py-0.5 text-xs font-medium ${IQ[i.status]}`}),children:Q_[i.status]}),b.jsx(dE,{align:"end",children:b.jsx(hH,{value:i.status,onValueChange:he,children:Object.entries(Q_).map(([xe,ve])=>b.jsx(pH,{value:xe,children:ve},xe))})})]}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),children:b.jsx(fe,{icon:ute,size:16,strokeWidth:2})}),b.jsxs(dE,{align:"end",children:[b.jsxs(eo,{onClick:G,disabled:d.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:HE,size:14,strokeWidth:2}),"Pull from main"]}),b.jsxs(eo,{onClick:Z,disabled:p.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:zE,size:14,strokeWidth:2}),"Merge to main"]}),b.jsxs(eo,{onClick:ee,disabled:m.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:WE,size:14,strokeWidth:2}),"Push to origin"]}),b.jsxs(eo,{onClick:ne,disabled:y.isPending||!i.repoPath,children:[b.jsx(fe,{icon:GE,size:14,strokeWidth:2}),"Sync parent"]}),b.jsxs(eo,{onClick:te,disabled:!ae,children:[b.jsx(fe,{icon:VE,size:14,strokeWidth:2}),"Commit"]}),!i.prUrl&&b.jsxs(eo,{onClick:be,disabled:!ae,children:[b.jsx(fe,{icon:Ub,size:14,strokeWidth:2}),"Create PR"]})]})]}),b.jsxs(go,{open:z,onOpenChange:Ee,children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:16,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Task"}),b.jsxs(So,{children:['This will permanently delete "',i.title,'" and close its terminal.',V&&i.worktreePath&&" The linked worktree will also be removed."," ","This action cannot be undone."]}),i.worktreePath&&b.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[b.jsx(Ti,{checked:V,onCheckedChange:xe=>W(xe===!0),disabled:o.isPending}),"Also delete linked worktree"]})]}),b.jsxs(_o,{children:[b.jsx(xo,{disabled:o.isPending,children:"Cancel"}),b.jsx(Rv,{onClick:ye,variant:"destructive",disabled:o.isPending,children:o.isPending?"Deleting...":"Delete"})]})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[b.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>D(!0),title:"Task settings",children:b.jsx(fe,{icon:XI,size:14,strokeWidth:2})}),C?b.jsxs(wi,{to:"/repositories/$repoId",params:{repoId:C.id},className:"flex items-center gap-1 hover:text-foreground transition-colors",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}):b.jsxs("span",{className:"flex items-center gap-1",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}),b.jsx("div",{className:"ml-auto",children:b.jsx(Vb,{worktreePath:i.worktreePath})})]})]}),b.jsxs("div",{className:"hidden items-center gap-3 sm:flex",children:[b.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("h1",{className:"text-sm font-medium",children:i.title}),b.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>D(!0),title:"Task settings",children:b.jsx(fe,{icon:XI,size:14,strokeWidth:2})})]}),b.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[C?b.jsxs(wi,{to:"/repositories/$repoId",params:{repoId:C.id},className:"flex items-center gap-1 hover:text-foreground transition-colors",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}):b.jsxs("span",{className:"flex items-center gap-1",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}),b.jsx(fe,{icon:Vx,size:12,strokeWidth:2}),b.jsx("span",{className:"font-mono",children:i.branch}),i.prUrl&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-muted-foreground/50",children:"•"}),b.jsxs("a",{href:i.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),children:[b.jsx(fe,{icon:Ub,size:14,strokeWidth:2}),b.jsxs("span",{children:["#",i.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),i.linearTicketUrl&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-muted-foreground/50",children:"•"}),b.jsxs("a",{href:T?.url??i.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),title:T?.title,children:[b.jsx(fe,{icon:hM,size:14,strokeWidth:2}),b.jsx("span",{children:i.linearTicketId}),T?.status&&b.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",T.status,")"]})]})]})]})]}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx("button",{type:"button",className:`rounded-full px-2 py-0.5 text-xs font-medium ${IQ[i.status]}`}),children:Q_[i.status]}),b.jsx(dE,{align:"end",children:b.jsx(hH,{value:i.status,onValueChange:he,children:Object.entries(Q_).map(([xe,ve])=>b.jsx(pH,{value:xe,children:ve},xe))})})]}),b.jsxs("div",{className:"flex items-center gap-0",children:[b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:G,disabled:d.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:b.jsx(fe,{icon:HE,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:Z,disabled:p.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:b.jsx(fe,{icon:zE,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:ee,disabled:m.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Push to origin",children:b.jsx(fe,{icon:WE,size:16,strokeWidth:2,className:m.isPending?"animate-pulse":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:ne,disabled:y.isPending||!i.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:b.jsx(fe,{icon:GE,size:16,strokeWidth:2,className:y.isPending?"animate-spin":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:te,disabled:!ae,className:"text-muted-foreground hover:text-foreground",title:"Commit",children:b.jsx(fe,{icon:VE,size:16,strokeWidth:2})}),!i.prUrl&&b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:be,disabled:!ae,className:"text-muted-foreground hover:text-foreground",title:"Create Pull Request",children:b.jsx(fe,{icon:Ub,size:16,strokeWidth:2})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:_e,disabled:!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Open in editor",children:b.jsx(fe,{icon:fte,size:16,strokeWidth:2})})]}),b.jsxs(go,{open:z,onOpenChange:Ee,children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:16,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Task"}),b.jsxs(So,{children:['This will permanently delete "',i.title,'" and close its terminal.',V&&i.worktreePath&&" The linked worktree will also be removed."," ","This action cannot be undone."]}),i.worktreePath&&b.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[b.jsx(Ti,{checked:V,onCheckedChange:xe=>W(xe===!0),disabled:o.isPending}),"Also delete linked worktree"]})]}),b.jsxs(_o,{children:[b.jsx(xo,{disabled:o.isPending,children:"Cancel"}),b.jsx(Rv,{onClick:ye,variant:"destructive",disabled:o.isPending,children:o.isPending?"Deleting...":"Delete"})]})]})]})]})]}),Y?b.jsxs(su,{value:$,onValueChange:xe=>q(xe),className:"flex min-h-0 flex-1 flex-col",children:[b.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:b.jsxs(ou,{className:"w-full",children:[b.jsx(li,{value:"terminal",className:"flex-1",children:"Terminal"}),b.jsx(li,{value:"details",className:"flex-1",children:"Details"})]})}),b.jsx(Pi,{value:"terminal",className:"flex-1 min-h-0",children:b.jsx($X,{taskName:i.title,cwd:i.worktreePath,aiMode:O,description:N,startupScript:i.startupScript,serverPort:x})}),b.jsx(Pi,{value:"details",className:"flex-1 min-h-0 bg-background",children:b.jsxs(su,{value:B,onValueChange:K,className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between shrink-0 border-b border-border bg-background px-2 py-1",children:[b.jsxs(ou,{variant:"line",children:[b.jsxs(li,{value:"diff",children:[b.jsx(fe,{icon:Q$,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),b.jsxs(li,{value:"browser",children:[b.jsx(fe,{icon:KI,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),b.jsxs(li,{value:"files",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]}),b.jsx(Vb,{worktreePath:i.worktreePath})]}),b.jsx(Pi,{value:"diff",className:"flex-1 overflow-hidden",children:b.jsx(HX,{taskId:i.id,worktreePath:i.worktreePath})}),b.jsx(Pi,{value:"browser",className:"flex-1 overflow-hidden",children:b.jsx(WX,{taskId:i.id})}),b.jsx(Pi,{value:"files",className:"flex-1 overflow-hidden",children:b.jsx(_x,{worktreePath:i.worktreePath,initialSelectedFile:j,onFileChange:H})})]})})]}):b.jsxs(Vd,{direction:"horizontal",className:"min-h-0 flex-1",children:[b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsx($X,{taskName:i.title,cwd:i.worktreePath,aiMode:O,description:N,startupScript:i.startupScript,serverPort:x})}),b.jsx(Gd,{withHandle:!0}),b.jsx(Ss,{defaultSize:50,minSize:30,className:"bg-background",children:b.jsxs(su,{value:B,onValueChange:K,className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between shrink-0 border-b border-border bg-background px-2 py-1",children:[b.jsxs(ou,{variant:"line",children:[b.jsxs(li,{value:"diff",children:[b.jsx(fe,{icon:Q$,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),b.jsxs(li,{value:"browser",children:[b.jsx(fe,{icon:KI,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),b.jsxs(li,{value:"files",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]}),b.jsx(Vb,{worktreePath:i.worktreePath})]}),b.jsx(Pi,{value:"diff",className:"flex-1 overflow-hidden",children:b.jsx(HX,{taskId:i.id,worktreePath:i.worktreePath})}),b.jsx(Pi,{value:"browser",className:"flex-1 overflow-hidden",children:b.jsx(WX,{taskId:i.id})}),b.jsx(Pi,{value:"files",className:"flex-1 overflow-hidden",children:b.jsx(_x,{worktreePath:i.worktreePath,initialSelectedFile:j,onFileChange:H})})]})})]}),b.jsx(rae,{task:i,open:L,onOpenChange:D})]}):b.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[b.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),b.jsx(wi,{to:"/tasks",children:b.jsx(Ke,{variant:"outline",children:"Back to Tasks"})})]})}function Oit(e){const t=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return t?`https://${t[1]}/${t[2]}`:e.replace(/\.git$/,"")}function Rit(e){return qn({queryKey:["git-remote",e],queryFn:async()=>{if(!e)return null;const t=await fetch(`/api/git/remote?path=${encodeURIComponent(e)}`);return t.ok?(await t.json()).remoteUrl:null},enabled:!!e,staleTime:60*1e3})}function Nit(){const{repoId:e}=pP.useParams(),{tab:t,file:n}=pP.useSearch(),r=Wi(),{data:i,isLoading:a,error:s}=uwe(e),o=dwe(),l=One(),{data:u}=Rit(i?.path),[f,d]=k.useState(""),[p,m]=k.useState(""),[y,S]=k.useState(""),[g,_]=k.useState(!1),[v,x]=k.useState(!1),[T,w]=k.useState(!1),[C,R]=k.useState("terminal"),[O,N]=k.useState(null),[L,D]=k.useState(!1),[z,M]=k.useState(!1),[V,W]=k.useState(!1),$=k.useRef(null),q=k.useRef(null),Y=k.useRef(!1),B=k.useRef(!1),{terminals:j,terminalsLoaded:U,connected:K,createTerminal:H,attachXterm:J,resizeTerminal:se,setupImagePaste:ae,writeToTerminal:Q}=c5(),G=t||"settings",Z=pw();k.useEffect(()=>{At.repoTerminal.info("component mounted",{repoId:e,tab:t,activeTab:G})},[e,t,G]),k.useEffect(()=>{At.repoTerminal.debug("state changed",{terminalId:O,xtermReady:z,containerReady:V,connected:K,terminalsLoaded:U,terminalCount:j.length,repoPath:i?.path})},[O,z,V,K,U,j.length,i?.path]);const ee=k.useCallback(xe=>{r({to:"/repositories/$repoId",params:{repoId:e},search:xe==="settings"?{}:{tab:xe,file:n},replace:!0})},[r,e,n]),ne=k.useCallback(xe=>{r({to:"/repositories/$repoId",params:{repoId:e},search:{tab:"workspace",file:xe??void 0},replace:!0})},[r,e]);k.useEffect(()=>{i&&(d(i.displayName),m(i.startupScript||""),S(i.copyFiles||""),_(i.isCopierTemplate??!1),x(!1))},[i]),k.useEffect(()=>{if(i){const xe=f!==i.displayName||p!==(i.startupScript||"")||y!==(i.copyFiles||"")||g!==(i.isCopierTemplate??!1);x(xe)}},[f,p,y,g,i]);const te=()=>{i&&o.mutate({id:i.id,updates:{displayName:f.trim()||i.path.split("/").pop()||"repo",startupScript:p.trim()||null,copyFiles:y.trim()||null,isCopierTemplate:g}},{onSuccess:()=>{ln.success("Repository saved"),x(!1)},onError:xe=>{ln.error("Failed to save repository",{description:xe instanceof Error?xe.message:"Unknown error"})}})},be=async()=>{i&&(await l.mutateAsync(i.id),r({to:"/repositories"}))};k.useEffect(()=>{Y.current=!1,B.current=!1,N(null),D(!1)},[i?.path]),k.useEffect(()=>{if(!K||!i?.path||!U||G!=="workspace"||!z){At.repoTerminal.debug("find/create: waiting",{connected:K,path:i?.path,terminalsLoaded:U,activeTab:G,xtermReady:z});return}const xe=j.find(ve=>ve.cwd===i.path);if(xe){At.repoTerminal.info("found existing terminal",{id:xe.id,cwd:xe.cwd}),N(xe.id);return}if(!Y.current&&$.current){Y.current=!0,D(!0);const{cols:ve,rows:De}=$.current;At.repoTerminal.info("creating terminal",{name:i.displayName,cwd:i.path,cols:ve,rows:De}),H({name:i.displayName,cols:ve,rows:De,cwd:i.path})}},[K,i?.path,i?.displayName,U,j,G,H,z]),k.useEffect(()=>{if(!i?.path)return;const xe=j.find(De=>De.cwd===i.path);if(!xe)return;const ve=O&&j.some(De=>De.id===O);(!O||!ve)&&(N(xe.id),D(!1),O&&!ve&&(B.current=!1))},[j,i?.path,O]);const _e=k.useCallback(xe=>{At.repoTerminal.info("xterm ready"),$.current=xe,M(!0)},[]),he=k.useCallback((xe,ve)=>{O&&se(O,xe,ve)},[O,se]),ye=k.useCallback(xe=>{At.repoTerminal.info("container ready"),q.current=xe,W(!0)},[]),Ee=k.useCallback(xe=>{O&&Q(O,xe)},[O,Q]);return k.useEffect(()=>{if(!O||!z||!V){At.repoTerminal.debug("attach effect: waiting",{terminalId:O,xtermReady:z,containerReady:V});return}if(!$.current||!q.current){At.repoTerminal.warn("attach effect: refs not set despite ready states",{terminalId:O});return}if(B.current){At.repoTerminal.debug("attach effect: already attached",{terminalId:O});return}return At.repoTerminal.info("attaching terminal",{terminalId:O}),J(O,$.current),ae(q.current,O),B.current=!0,()=>{At.repoTerminal.debug("detaching terminal",{terminalId:O}),B.current=!1}},[O,z,V,J,ae]),a?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):s||!i?b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:b.jsxs(wi,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[b.jsx(fe,{icon:ete,size:16,strokeWidth:2}),"Repositories"]})}),b.jsx("div",{className:"flex flex-1 items-center justify-center",children:b.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[b.jsx(fe,{icon:ts,size:20,strokeWidth:2}),b.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-background px-4 py-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>w(!0),className:"text-muted-foreground hover:text-foreground",children:[b.jsx(fe,{icon:pM,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),b.jsx("span",{className:"max-sm:hidden",children:"New Task"})]}),b.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>r({to:"/tasks",search:{repo:i.displayName}}),className:"text-muted-foreground hover:text-foreground",title:"View Tasks",children:[b.jsx(fe,{icon:Dp,size:14,strokeWidth:2,"data-slot":"icon"}),b.jsx("span",{className:"max-sm:hidden",children:"Tasks"})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx(Vb,{worktreePath:i.path}),b.jsx("span",{className:"text-sm font-medium",children:i.displayName}),u&&b.jsx("a",{href:Oit(u),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors",title:u,children:b.jsx(fe,{icon:u.includes("github.com")?N1e:ote,size:14,strokeWidth:2})}),b.jsxs(go,{children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-xs",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:14,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Repository"}),b.jsxs(So,{children:['This will remove "',i.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),b.jsxs(_o,{children:[b.jsx(xo,{children:"Cancel"}),b.jsx(Ke,{variant:"destructive",onClick:be,children:"Delete"})]})]})]})]})]}),b.jsxs(su,{value:G,onValueChange:xe=>ee(xe),className:"flex flex-1 flex-col overflow-hidden",children:[b.jsx("div",{className:"shrink-0 border-b border-border bg-muted/50 px-4",children:b.jsxs(ou,{variant:"line",children:[b.jsx(li,{value:"settings",className:"px-3 py-1.5",children:"Settings"}),b.jsx(li,{value:"workspace",className:"px-3 py-1.5",children:"Workspace"})]})}),b.jsx(Pi,{value:"settings",className:"flex-1 overflow-hidden mt-0",children:b.jsx(Yy,{className:"h-full",children:b.jsx("div",{className:"p-4",children:b.jsxs("div",{className:"mx-auto max-w-xl space-y-6 bg-card rounded-lg p-6 border border-border",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2}),b.jsx("span",{className:"font-mono break-all",children:i.path})]}),b.jsxs(pf,{children:[b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"displayName",children:"Display Name"}),b.jsx(vn,{id:"displayName",value:f,onChange:xe=>d(xe.target.value),placeholder:i.path.split("/").pop()||"My Project"})]}),b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"startupScript",children:"Startup Script"}),b.jsx(bM,{id:"startupScript",value:p,onChange:xe=>m(xe.target.value),placeholder:"npm install && npm run dev",rows:3}),b.jsx(qa,{children:"Command to run in the terminal when creating a worktree."})]}),b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"copyFiles",children:"Copy Files"}),b.jsx(vn,{id:"copyFiles",value:y,onChange:xe=>S(xe.target.value),placeholder:".env, config.local.json"}),b.jsx(qa,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]}),b.jsxs(ir,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Ti,{checked:g,onCheckedChange:xe=>_(xe===!0)}),b.jsx(ar,{className:"cursor-pointer",children:"Use as Copier Template"})]}),b.jsx(qa,{children:"Mark as a template for creating new projects with Copier."})]})]}),b.jsx("div",{className:"flex items-center justify-end pt-4 border-t border-border",children:b.jsxs(Ke,{size:"sm",onClick:te,disabled:!v||o.isPending,children:[b.jsx(fe,{icon:hl,size:14,strokeWidth:2,"data-slot":"icon"}),o.isPending?"Saving...":"Save"]})})]})})})}),b.jsx(Pi,{value:"workspace",className:"flex-1 overflow-hidden mt-0",children:Z?b.jsxs(su,{value:C,onValueChange:xe=>R(xe),className:"flex min-h-0 flex-1 flex-col h-full",children:[b.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:b.jsxs(ou,{className:"w-full",children:[b.jsx(li,{value:"terminal",className:"flex-1",children:"Terminal"}),b.jsx(li,{value:"files",className:"flex-1",children:"Files"})]})}),b.jsx(Pi,{value:"terminal",className:"flex-1 min-h-0",children:b.jsxs("div",{className:"h-full flex flex-col",children:[!K&&b.jsx("div",{className:"shrink-0 px-2 py-1 bg-muted-foreground/20 text-muted-foreground text-xs",children:"Connecting to terminal server..."}),L&&!O&&b.jsx("div",{className:"flex-1 flex items-center justify-center bg-terminal-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"}),b.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:"Initializing terminal..."})]})}),b.jsx(vD,{className:"flex-1",onReady:_e,onResize:he,onContainerReady:ye,terminalId:O??void 0,setupImagePaste:ae,onSend:Ee})]})}),b.jsx(Pi,{value:"files",className:"flex-1 min-h-0",children:b.jsx(_x,{worktreePath:i.path,initialSelectedFile:n,onFileChange:ne})})]}):b.jsxs(Vd,{direction:"horizontal",className:"h-full",children:[b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsxs("div",{className:"h-full flex flex-col",children:[!K&&b.jsx("div",{className:"shrink-0 px-2 py-1 bg-muted-foreground/20 text-muted-foreground text-xs",children:"Connecting to terminal server..."}),L&&!O&&b.jsx("div",{className:"flex-1 flex items-center justify-center bg-terminal-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"}),b.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:"Initializing terminal..."})]})}),b.jsx(vD,{className:"flex-1",onReady:_e,onResize:he,onContainerReady:ye,terminalId:O??void 0,setupImagePaste:ae,onSend:Ee})]})}),b.jsx(Gd,{withHandle:!0}),b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsx(_x,{worktreePath:i.path,initialSelectedFile:n,onFileChange:ne})})]})})]}),b.jsx(MM,{open:T,onOpenChange:w,defaultRepository:i,showTrigger:!1})]})}const pP=Ms("/repositories/$repoId")({component:Nit,validateSearch:e=>({tab:e.tab==="workspace"?"workspace":void 0,file:typeof e.file=="string"?e.file:void 0})}),Iit=gRe.update({id:"/",path:"/",getParentRoute:()=>Oo}),Dit=SRe.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Oo}),Lit=mIe.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Oo}),Pit=aae.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Oo}),Mit=RIe.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Oo}),jit=UIe.update({id:"/review/",path:"/review/",getParentRoute:()=>Oo}),Fit=rDe.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Oo}),Bit=Dle.update({id:"/monitoring/",path:"/monitoring/",getParentRoute:()=>Oo}),Uit=hP.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Oo}),$it=pP.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Oo}),zit={IndexRoute:Iit,RepositoriesRepoIdRoute:$it,TasksTaskIdRoute:Uit,MonitoringIndexRoute:Bit,RepositoriesIndexRoute:Fit,ReviewIndexRoute:jit,SettingsIndexRoute:Mit,TasksIndexRoute:Pit,TerminalsIndexRoute:Lit,WorktreesIndexRoute:Dit},Hit=Oo._addFileChildren(zit)._addFileTypes(),Wit=new URLSearchParams(window.location.search),of=parseFloat(Wit.get("zoom")||"1");of!==1&&of>=.5&&of<=2&&(document.documentElement.style.fontSize=`${16*of}px`);const vc=of>=.5&&of<=2?of:1,Vit=new Rme({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),Git=rme({routeTree:Hit});Che.createRoot(document.getElementById("root")).render(b.jsx(k.StrictMode,{children:b.jsx(Gme,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:b.jsx(Nme,{client:Vit,children:b.jsx(B2e,{children:b.jsx(sme,{router:Git})})})})}));
|
|
165
|
+
`))){const S=[];f.children.forEach((g,_)=>{_!=0&&(_==1&&g.type==="break"||S.push(g))}),f.children=[...S]}}return f});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[Yrt(s),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function Yrt(e){let t=Xrt[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const Xrt={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function Zrt(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let i=!1;try{i=!!document.execCommand("copy")}catch{i=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(i)}function cde(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?cde(t.parentElement):null}function Qrt(e){var t=n=>{var r=cde(n.target);r&&(r.classList.add("active"),Zrt(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};k.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var i;(i=e.current)==null||i.removeEventListener("click",t,!1)}},[e])}var Jrt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],eit=e=>e;const tit=oe.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:a,disableCopy:s=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:f,wrapperElement:d={},warpperElement:p={},urlTransform:m}=e,y=s9e(e,Jrt),S=oe.useRef(null);k.useImperativeHandle(t,()=>ru({},e,{mdp:S}),[S,e]);var g=(n||"")+" "+(r||"");Qrt(S);var _=[...y.rehypePlugins||[]],v={allowElement:(w,C,R)=>y.allowElement?y.allowElement(w,C,R):/^[A-Za-z0-9]+$/.test(w.tagName)};o||_.push(yce);var x=[Krt,...y.remarkPlugins||[],Vrt],T=ru({},p,d);return b.jsx("div",ru({ref:S,onScroll:l,onMouseOver:u},T,{className:g,style:a,children:b.jsx(Ptt,ru({},v,y,{skipHtml:!o,urlTransform:m||eit,rehypePlugins:f?f("rehype",_):_,remarkPlugins:f?f("remark",x):x,children:i||""}))}))});var nit=function(t){return n=>{ia(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=ru({},r.properties,{"data-meta":String(r.data.meta)}))})}},rit=function(t){return n=>{ia(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var i=r.properties.dataMeta;typeof i=="string"&&(r.data.meta=i),delete r.properties.dataMeta}})}};const iit=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\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F\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDF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D2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,ait=Object.hasOwnProperty;class sit{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=oit(t,n===!0);const a=i;for(;ait.call(r.occurrences,i);)r.occurrences[a]++,i=a+"-"+r.occurrences[a];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function oit(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(iit,"").replace(/ /g,"-"))}function dde(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const lit={},OQ=new sit;function uit(e){const n=(e||lit).prefix||"";return function(r){OQ.reset(),ia(r,"element",function(i){dde(i)&&!i.properties.id&&(i.properties.id=n+OQ.slug(fp(i)))})}}const fde=(function(e){if(e==null)return fit;if(typeof e=="string")return dit(e);if(typeof e=="object")return cit(e);if(typeof e=="function")return T8(e);throw new Error("Expected function, string, or array as `test`")});function cit(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fde(e[n]);return T8(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function dit(e){return T8(t);function t(n){return n.tagName===e}}function T8(e){return t;function t(n,r,i){return!!(hit(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fit(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function hit(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const RQ={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},pit={};function mit(e){const t=e||pit;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",a=t.content,s=t.group,o=fde(t.test);let l;return i==="after"||i==="before"?l=f:i==="wrap"?l=d:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(p){ia(p,"element",function(m,y,S){if(dde(m)&&m.properties.id&&o(m,y,S))return Object.assign(m.properties,Z_(r,m)),l(m,y,S)})};function u(p){const m=NQ(a||RQ,p);return p.children[i==="prepend"?"unshift":"push"](bI(p,Z_(n,p),m)),[tv]}function f(p,m,y){if(typeof m!="number"||!y)return;const S=NQ(a||RQ,p),g=bI(p,Z_(n,p),S);let _=i==="before"?[g,p]:[p,g];if(s){const v=hde(s,p);v&&!Array.isArray(v)&&v.type==="element"&&(v.children=_,_=[v])}return y.children.splice(m,1,..._),[tv,m+_.length]}function d(p){let m=p.children,y=[];return typeof a=="function"?(m=[],y=a(p)):a&&(y=C8(a)),p.children=[bI(p,Z_(n,p),Array.isArray(y)?[...m,...y]:[...m,y])],[tv]}}function C8(e){return Bf(e)}function bI(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function NQ(e,t){const n=hde(e,t);return Array.isArray(n)?n:[n]}function hde(e,t){return typeof e=="function"?e(t):C8(e)}function Z_(e,t){return typeof e=="function"?e(t):e?C8(e):{}}const git=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{ia(r,(i,a,s)=>{if(i.type==="element"||i.type==="root"){let o=!1;i.children=i.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return o=!0,!1;if(u===n)return o=!1,!1}return!o})}})}};var bit={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function vit(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var yit=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var a=n.children&&n.children[0];a&&a.properties&&a.properties.ariaHidden==="true"&&(a.properties=ru({class:"anchor"},a.properties),a.children=[bit])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=Iue(n.children);n.children.push(vit(s))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},_it=[uit,mit,git];const Eit=oe.forwardRef((e,t)=>{var n,r=[nit,yce,rit,..._it,[RKe,{rewrite:yit((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[DKe,{properties:"attr"}],...e.rehypePlugins||[],[sqe,{ignoreMissing:!0}]];return b.jsx(tit,ru({},e,{rehypePlugins:r,ref:t}))});function Sit(e,t){if(e.startsWith("/")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:"))return e;const n=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",r=n?n.split("/"):[],i=e.split("/");for(const a of i)a===".."?r.pop():a!=="."&&r.push(a);return r.join("/")}function xit(e,t,n){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("/api/"))return e;const r=Sit(e,n);return`/api/fs/image?${new URLSearchParams({path:r,root:t})}`}function wit({content:e,worktreePath:t,filePath:n}){const{resolvedTheme:r}=qc(),i=k.useMemo(()=>({img:({src:a,alt:s,...o})=>{if(!a)return null;const l=xit(a,t,n);return b.jsx("img",{src:l,alt:s||"",loading:"lazy",style:{maxWidth:"100%"},...o})},a:({href:a,children:s,...o})=>b.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...o,children:s})}),[t,n]);return b.jsx(Yy,{className:"h-full",children:b.jsx("div",{className:"p-4","data-color-mode":r==="light"?"light":"dark",children:b.jsx(Eit,{source:e,style:{backgroundColor:"transparent",fontSize:"14px"},components:i})})})}const Tit=1e3,Cit=n0(function({onBack:t}){const{worktreePath:n,readOnly:r,selectedFile:i,currentFile:a,isLoading:s,isSaving:o,loadError:l,isDirty:u,updateContent:f,saveFile:d,closeFile:p,toggleMarkdownView:m}=oie(),y=k.useRef(null);k.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const S=k.useCallback(w=>{!i||r||(f(i,w),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{d(i).catch(C=>{console.error("Auto-save failed:",C)})},Tit))},[i,r,f,d]),g=k.useCallback(()=>{i&&(y.current&&(clearTimeout(y.current),y.current=null),p(i)),t?.()},[i,p,t]),_=k.useCallback(()=>{i&&m(i)},[i,m]);if(!i)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(s)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(l)return b.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:l});if(!a)return b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Unable to load file"});if(a.isBinary)return b.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[b.jsx("p",{children:"Binary file"}),b.jsxs("p",{className:"text-xs",children:[(a.size/1024).toFixed(1)," KB"]})]});if(a.isImage)return b.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1.5 bg-card border-b border-border text-xs",children:[b.jsx("span",{className:"text-muted-foreground truncate",title:i,children:i.split("/").pop()||i}),b.jsx("button",{onClick:g,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:b.jsx(fe,{icon:ci,size:14,strokeWidth:2})})]}),b.jsx("div",{className:"flex-1 overflow-auto p-4 bg-muted",children:b.jsx("img",{src:a.content,alt:i,className:"block mx-auto"})})]});const v=i.split("/").pop()||i,x=a.isMarkdown,T=x&&a.isMarkdownView;return b.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-2 py-1.5 bg-card border-b border-border text-xs",children:[b.jsxs("span",{className:"text-muted-foreground truncate flex-1 flex items-center gap-1",title:i,children:[v,!r&&u&&b.jsx("span",{className:"text-amber-500",children:"*"}),!r&&o&&b.jsx("span",{className:"text-muted-foreground italic",children:"(saving...)"})]}),a.truncated&&b.jsxs("span",{className:"text-destructive",children:["Truncated (",a.lineCount.toLocaleString()," lines)"]}),b.jsxs("span",{className:"text-muted-foreground",children:[(a.size/1024).toFixed(1)," KB"]}),x&&b.jsx("button",{onClick:_,className:Ue("p-1 rounded hover:bg-muted/50 transition-colors",T?"text-primary":"text-muted-foreground hover:text-foreground"),title:T?"Show code":"Preview markdown",children:b.jsx(fe,{icon:T?$1e:z1e,size:14,strokeWidth:2})}),b.jsx("button",{onClick:g,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:b.jsx(fe,{icon:ci,size:14,strokeWidth:2})})]}),b.jsx("div",{className:"flex-1 min-h-0",children:T?b.jsx(wit,{content:a.content,worktreePath:n||"",filePath:i}):b.jsx(uGe,{filePath:i,content:a.content,onChange:S,readOnly:r||!a.isEditable})})]})}),pde=k.createContext(void 0),Ait=n0(function(){const t=k.useContext(pde),{selectedFile:n,expandedDirs:r,fileTree:i,isLoadingTree:a,treeError:s,selectFile:o,loadFile:l,toggleDir:u,collapseAll:f}=oie(),d=k.useCallback(y=>{o(y),l(y),t?.(y)},[o,l,t]),p=k.useCallback(y=>{u(y)},[u]),m=k.useCallback(()=>{o(null),t?.(null)},[o,t]);return a?b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):s?b.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s}):n?b.jsx("div",{className:"flex h-full flex-col bg-background",children:b.jsx(Cit,{onBack:m})}):b.jsx(QWe,{entries:i||[],selectedFile:n,expandedDirs:r,onSelectFile:d,onToggleDir:p,onCollapseAll:f})});function _x({worktreePath:e,readOnly:t=!1,initialSelectedFile:n,onFileChange:r}){const i=M2e(e,t,n);return e?b.jsx(sie.Provider,{value:i,children:b.jsx(pde.Provider,{value:r,children:b.jsx(Ait,{})})}):b.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}const hP=Ms("/tasks/$taskId")({component:kit,validateSearch:e=>({tab:["diff","browser","files"].includes(e.tab)?e.tab:void 0,file:typeof e.file=="string"?e.file:void 0})}),Q_={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},IQ={IN_PROGRESS:"bg-status-in-progress/20 text-status-in-progress",IN_REVIEW:"bg-status-in-review/20 text-status-in-review",DONE:"bg-status-done/20 text-status-done",CANCELED:"bg-status-canceled/20 text-status-canceled"};function kit(){const{taskId:e}=hP.useParams(),t=hP.useSearch(),n=Wi(),r=ome(),{data:i,isLoading:a}=wne(e),s=NM(),o=IM(),{viewState:l,setActiveTab:u,setFilesViewState:f}=u5(e),d=Lie(),p=Pie(),m=Mie(),y=jie(),S=Fie(),{data:g}=DM(),{data:_}=LM(),{data:v}=PM(),{data:x}=Tne(),{data:T}=bWe(i?.linearTicketId??null),{data:w=[]}=Ky(),C=w.find(xe=>xe.path===i?.repoPath),R=r.state,O=i?.aiMode??R?.aiMode,N=i?.description??R?.description,[L,D]=k.useState(!1),[z,M]=k.useState(!1),[V,W]=k.useState(!0),[$,q]=k.useState("terminal"),Y=pw(),B=t.tab??l.activeTab,j=t.file??l.filesViewState.selectedFile,U=k.useRef(null);k.useEffect(()=>{U.current===e||t.tab||(U.current=e,l.activeTab&&n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:l.activeTab==="diff"?void 0:l.activeTab,file:l.filesViewState.selectedFile||void 0},replace:!0}))},[e,t.tab,l.activeTab,l.filesViewState.selectedFile,n]);const K=k.useCallback(xe=>{const ve=xe;u(ve),n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:ve==="diff"?void 0:ve,file:ve==="files"&&j||void 0},replace:!0})},[e,n,u,j]),H=k.useCallback(xe=>{f({selectedFile:xe}),n({to:"/tasks/$taskId",params:{taskId:e},search:{tab:"files",file:xe||void 0},replace:!0})},[e,n,f]),{terminals:J,sendInputToTerminal:se}=c5(),ae=J.find(xe=>i?.worktreePath&&xe.cwd.startsWith(i.worktreePath)),Q=xe=>{ae?(se(ae.id,xe),ln.info("Sent to Claude Code")):ln.error("No terminal available")},G=async()=>{if(!(!i?.repoPath||!i?.worktreePath))try{await d.mutateAsync({repoPath:i.repoPath,worktreePath:i.worktreePath,baseBranch:i.baseBranch}),ln.success("Synced from main")}catch(xe){const ve=xe instanceof Error?xe.message:"Sync failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Rebase this worktree onto the parent repo's ${De} branch. Error: "${ve}". Steps: 1) Check for uncommitted changes - stash or commit them first, 2) git fetch origin (in parent repo at ${i.repoPath}) to ensure ${De} is current, 3) git rebase ${De} (in worktree), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) If stashed, git stash pop. Worktree: ${i.worktreePath}, Parent repo: ${i.repoPath}.`)}:void 0})}},Z=async()=>{if(!(!i?.repoPath||!i?.worktreePath))try{await p.mutateAsync({repoPath:i.repoPath,worktreePath:i.worktreePath,baseBranch:i.baseBranch}),ln.success("Merged to main"),S.mutate(i.id),s.mutate({taskId:i.id,updates:{status:"DONE"}})}catch(xe){const ve=xe instanceof Error?xe.message:"Merge failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Merge this worktree's branch into the parent repo's ${De}. Error: "${ve}". Steps: 1) Ensure all changes in worktree are committed, 2) In parent repo at ${i.repoPath}, checkout ${De} and pull latest from origin, 3) Squash merge the worktree branch into ${De} (use git merge --squash, then commit), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Push ${De} to origin. Worktree: ${i.worktreePath}, Parent repo: ${i.repoPath}.`)}:void 0})}},ee=async()=>{if(i?.worktreePath)try{await m.mutateAsync({worktreePath:i.worktreePath}),ln.success("Pushed to origin")}catch(xe){const ve=xe instanceof Error?xe.message:"Push failed";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Push this worktree's branch to origin. Error: "${ve}". Steps: 1) Check for uncommitted changes and commit them, 2) If push is rejected, pull the latest changes first and resolve any conflicts, 3) Push to origin again. Worktree: ${i.worktreePath}.`)}:void 0})}},ne=async()=>{if(i?.repoPath)try{await y.mutateAsync({repoPath:i.repoPath,baseBranch:i.baseBranch}),ln.success("Parent synced with origin")}catch(xe){const ve=xe instanceof Error?xe.message:"Sync parent failed",De=i.baseBranch||"main";ln.error(ve,{action:ae?{label:"Resolve with Claude",onClick:()=>Q(`Sync the parent repo's ${De} branch with origin. Error: "${ve}". Steps: 1) git fetch origin, 2) git pull origin ${De} --ff-only, 3) If that fails, rebase with git rebase origin/${De}, 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Once in sync, git push origin ${De}. Work in the parent repo at ${i.repoPath}, not the worktree.`)}:void 0})}},te=()=>{ae&&se(ae.id,"commit")},be=()=>{ae&&se(ae.id,"Create a PR for this task and link it using: vibora current-task pr <url>")},_e=()=>{if(!i?.worktreePath)return;const xe=sae(i.worktreePath,g,_,v);oae(xe)},he=xe=>{i&&s.mutate({taskId:i.id,updates:{status:xe}})},ye=()=>{i&&o.mutate({taskId:i.id,deleteLinkedWorktree:V},{onSuccess:()=>{n({to:"/tasks"})}})},Ee=xe=>{M(xe),xe||W(!1)};return a?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):i?b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[b.jsxs("div",{className:"shrink-0 border-b border-border bg-background px-4 py-2",children:[b.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:i.title}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx("button",{type:"button",className:`rounded-full px-2 py-0.5 text-xs font-medium ${IQ[i.status]}`}),children:Q_[i.status]}),b.jsx(dE,{align:"end",children:b.jsx(hH,{value:i.status,onValueChange:he,children:Object.entries(Q_).map(([xe,ve])=>b.jsx(pH,{value:xe,children:ve},xe))})})]}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),children:b.jsx(fe,{icon:ute,size:16,strokeWidth:2})}),b.jsxs(dE,{align:"end",children:[b.jsxs(eo,{onClick:G,disabled:d.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:HE,size:14,strokeWidth:2}),"Pull from main"]}),b.jsxs(eo,{onClick:Z,disabled:p.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:zE,size:14,strokeWidth:2}),"Merge to main"]}),b.jsxs(eo,{onClick:ee,disabled:m.isPending||!i.worktreePath,children:[b.jsx(fe,{icon:WE,size:14,strokeWidth:2}),"Push to origin"]}),b.jsxs(eo,{onClick:ne,disabled:y.isPending||!i.repoPath,children:[b.jsx(fe,{icon:GE,size:14,strokeWidth:2}),"Sync parent"]}),b.jsxs(eo,{onClick:te,disabled:!ae,children:[b.jsx(fe,{icon:VE,size:14,strokeWidth:2}),"Commit"]}),!i.prUrl&&b.jsxs(eo,{onClick:be,disabled:!ae,children:[b.jsx(fe,{icon:Ub,size:14,strokeWidth:2}),"Create PR"]})]})]}),b.jsxs(go,{open:z,onOpenChange:Ee,children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:16,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Task"}),b.jsxs(So,{children:['This will permanently delete "',i.title,'" and close its terminal.',V&&i.worktreePath&&" The linked worktree will also be removed."," ","This action cannot be undone."]}),i.worktreePath&&b.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[b.jsx(Ti,{checked:V,onCheckedChange:xe=>W(xe===!0),disabled:o.isPending}),"Also delete linked worktree"]})]}),b.jsxs(_o,{children:[b.jsx(xo,{disabled:o.isPending,children:"Cancel"}),b.jsx(Rv,{onClick:ye,variant:"destructive",disabled:o.isPending,children:o.isPending?"Deleting...":"Delete"})]})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[b.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>D(!0),title:"Task settings",children:b.jsx(fe,{icon:XI,size:14,strokeWidth:2})}),C?b.jsxs(wi,{to:"/repositories/$repoId",params:{repoId:C.id},className:"flex items-center gap-1 hover:text-foreground transition-colors",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}):b.jsxs("span",{className:"flex items-center gap-1",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}),b.jsx("div",{className:"ml-auto",children:b.jsx(Vb,{worktreePath:i.worktreePath})})]})]}),b.jsxs("div",{className:"hidden items-center gap-3 sm:flex",children:[b.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("h1",{className:"text-sm font-medium",children:i.title}),b.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>D(!0),title:"Task settings",children:b.jsx(fe,{icon:XI,size:14,strokeWidth:2})})]}),b.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[C?b.jsxs(wi,{to:"/repositories/$repoId",params:{repoId:C.id},className:"flex items-center gap-1 hover:text-foreground transition-colors",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}):b.jsxs("span",{className:"flex items-center gap-1",children:[b.jsx(fe,{icon:np,size:12,strokeWidth:2}),b.jsx("span",{children:i.repoName})]}),b.jsx(fe,{icon:Vx,size:12,strokeWidth:2}),b.jsx("span",{className:"font-mono",children:i.branch}),i.prUrl&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-muted-foreground/50",children:"•"}),b.jsxs("a",{href:i.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),children:[b.jsx(fe,{icon:Ub,size:14,strokeWidth:2}),b.jsxs("span",{children:["#",i.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),i.linearTicketUrl&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-muted-foreground/50",children:"•"}),b.jsxs("a",{href:T?.url??i.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),title:T?.title,children:[b.jsx(fe,{icon:hM,size:14,strokeWidth:2}),b.jsx("span",{children:i.linearTicketId}),T?.status&&b.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",T.status,")"]})]})]})]})]}),b.jsxs(uE,{children:[b.jsx(cE,{render:b.jsx("button",{type:"button",className:`rounded-full px-2 py-0.5 text-xs font-medium ${IQ[i.status]}`}),children:Q_[i.status]}),b.jsx(dE,{align:"end",children:b.jsx(hH,{value:i.status,onValueChange:he,children:Object.entries(Q_).map(([xe,ve])=>b.jsx(pH,{value:xe,children:ve},xe))})})]}),b.jsxs("div",{className:"flex items-center gap-0",children:[b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:G,disabled:d.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:b.jsx(fe,{icon:HE,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:Z,disabled:p.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:b.jsx(fe,{icon:zE,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:ee,disabled:m.isPending||!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Push to origin",children:b.jsx(fe,{icon:WE,size:16,strokeWidth:2,className:m.isPending?"animate-pulse":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:ne,disabled:y.isPending||!i.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:b.jsx(fe,{icon:GE,size:16,strokeWidth:2,className:y.isPending?"animate-spin":""})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:te,disabled:!ae,className:"text-muted-foreground hover:text-foreground",title:"Commit",children:b.jsx(fe,{icon:VE,size:16,strokeWidth:2})}),!i.prUrl&&b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:be,disabled:!ae,className:"text-muted-foreground hover:text-foreground",title:"Create Pull Request",children:b.jsx(fe,{icon:Ub,size:16,strokeWidth:2})}),b.jsx(Ke,{variant:"ghost",size:"icon-sm",onClick:_e,disabled:!i.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Open in editor",children:b.jsx(fe,{icon:fte,size:16,strokeWidth:2})})]}),b.jsxs(go,{open:z,onOpenChange:Ee,children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:16,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Task"}),b.jsxs(So,{children:['This will permanently delete "',i.title,'" and close its terminal.',V&&i.worktreePath&&" The linked worktree will also be removed."," ","This action cannot be undone."]}),i.worktreePath&&b.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[b.jsx(Ti,{checked:V,onCheckedChange:xe=>W(xe===!0),disabled:o.isPending}),"Also delete linked worktree"]})]}),b.jsxs(_o,{children:[b.jsx(xo,{disabled:o.isPending,children:"Cancel"}),b.jsx(Rv,{onClick:ye,variant:"destructive",disabled:o.isPending,children:o.isPending?"Deleting...":"Delete"})]})]})]})]})]}),Y?b.jsxs(su,{value:$,onValueChange:xe=>q(xe),className:"flex min-h-0 flex-1 flex-col",children:[b.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:b.jsxs(ou,{className:"w-full",children:[b.jsx(li,{value:"terminal",className:"flex-1",children:"Terminal"}),b.jsx(li,{value:"details",className:"flex-1",children:"Details"})]})}),b.jsx(Pi,{value:"terminal",className:"flex-1 min-h-0",children:b.jsx($X,{taskName:i.title,cwd:i.worktreePath,aiMode:O,description:N,startupScript:i.startupScript,serverPort:x})}),b.jsx(Pi,{value:"details",className:"flex-1 min-h-0 bg-background",children:b.jsxs(su,{value:B,onValueChange:K,className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between shrink-0 border-b border-border bg-background px-2 py-1",children:[b.jsxs(ou,{variant:"line",children:[b.jsxs(li,{value:"diff",children:[b.jsx(fe,{icon:Q$,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),b.jsxs(li,{value:"browser",children:[b.jsx(fe,{icon:KI,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),b.jsxs(li,{value:"files",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]}),b.jsx(Vb,{worktreePath:i.worktreePath})]}),b.jsx(Pi,{value:"diff",className:"flex-1 overflow-hidden",children:b.jsx(HX,{taskId:i.id,worktreePath:i.worktreePath})}),b.jsx(Pi,{value:"browser",className:"flex-1 overflow-hidden",children:b.jsx(WX,{taskId:i.id})}),b.jsx(Pi,{value:"files",className:"flex-1 overflow-hidden",children:b.jsx(_x,{worktreePath:i.worktreePath,initialSelectedFile:j,onFileChange:H})})]})})]}):b.jsxs(Vd,{direction:"horizontal",className:"min-h-0 flex-1",children:[b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsx($X,{taskName:i.title,cwd:i.worktreePath,aiMode:O,description:N,startupScript:i.startupScript,serverPort:x})}),b.jsx(Gd,{withHandle:!0}),b.jsx(Ss,{defaultSize:50,minSize:30,className:"bg-background",children:b.jsxs(su,{value:B,onValueChange:K,className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between shrink-0 border-b border-border bg-background px-2 py-1",children:[b.jsxs(ou,{variant:"line",children:[b.jsxs(li,{value:"diff",children:[b.jsx(fe,{icon:Q$,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),b.jsxs(li,{value:"browser",children:[b.jsx(fe,{icon:KI,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),b.jsxs(li,{value:"files",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]}),b.jsx(Vb,{worktreePath:i.worktreePath})]}),b.jsx(Pi,{value:"diff",className:"flex-1 overflow-hidden",children:b.jsx(HX,{taskId:i.id,worktreePath:i.worktreePath})}),b.jsx(Pi,{value:"browser",className:"flex-1 overflow-hidden",children:b.jsx(WX,{taskId:i.id})}),b.jsx(Pi,{value:"files",className:"flex-1 overflow-hidden",children:b.jsx(_x,{worktreePath:i.worktreePath,initialSelectedFile:j,onFileChange:H})})]})})]}),b.jsx(rae,{task:i,open:L,onOpenChange:D})]}):b.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[b.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),b.jsx(wi,{to:"/tasks",children:b.jsx(Ke,{variant:"outline",children:"Back to Tasks"})})]})}function Oit(e){const t=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return t?`https://${t[1]}/${t[2]}`:e.replace(/\.git$/,"")}function Rit(e){return qn({queryKey:["git-remote",e],queryFn:async()=>{if(!e)return null;const t=await fetch(`/api/git/remote?path=${encodeURIComponent(e)}`);return t.ok?(await t.json()).remoteUrl:null},enabled:!!e,staleTime:60*1e3})}function Nit(){const{repoId:e}=pP.useParams(),{tab:t,file:n}=pP.useSearch(),r=Wi(),{data:i,isLoading:a,error:s}=uwe(e),o=dwe(),l=One(),{data:u}=Rit(i?.path),[f,d]=k.useState(""),[p,m]=k.useState(""),[y,S]=k.useState(""),[g,_]=k.useState(!1),[v,x]=k.useState(!1),[T,w]=k.useState(!1),[C,R]=k.useState("terminal"),[O,N]=k.useState(null),[L,D]=k.useState(!1),[z,M]=k.useState(!1),[V,W]=k.useState(!1),$=k.useRef(null),q=k.useRef(null),Y=k.useRef(!1),B=k.useRef(!1),{terminals:j,terminalsLoaded:U,connected:K,createTerminal:H,attachXterm:J,resizeTerminal:se,setupImagePaste:ae,writeToTerminal:Q}=c5(),G=t||"settings",Z=pw();k.useEffect(()=>{At.repoTerminal.info("component mounted",{repoId:e,tab:t,activeTab:G})},[e,t,G]),k.useEffect(()=>{At.repoTerminal.debug("state changed",{terminalId:O,xtermReady:z,containerReady:V,connected:K,terminalsLoaded:U,terminalCount:j.length,repoPath:i?.path})},[O,z,V,K,U,j.length,i?.path]);const ee=k.useCallback(xe=>{r({to:"/repositories/$repoId",params:{repoId:e},search:xe==="settings"?{}:{tab:xe,file:n},replace:!0})},[r,e,n]),ne=k.useCallback(xe=>{r({to:"/repositories/$repoId",params:{repoId:e},search:{tab:"workspace",file:xe??void 0},replace:!0})},[r,e]);k.useEffect(()=>{i&&(d(i.displayName),m(i.startupScript||""),S(i.copyFiles||""),_(i.isCopierTemplate??!1),x(!1))},[i]),k.useEffect(()=>{if(i){const xe=f!==i.displayName||p!==(i.startupScript||"")||y!==(i.copyFiles||"")||g!==(i.isCopierTemplate??!1);x(xe)}},[f,p,y,g,i]);const te=()=>{i&&o.mutate({id:i.id,updates:{displayName:f.trim()||i.path.split("/").pop()||"repo",startupScript:p.trim()||null,copyFiles:y.trim()||null,isCopierTemplate:g}},{onSuccess:()=>{ln.success("Repository saved"),x(!1)},onError:xe=>{ln.error("Failed to save repository",{description:xe instanceof Error?xe.message:"Unknown error"})}})},be=async()=>{i&&(await l.mutateAsync(i.id),r({to:"/repositories"}))};k.useEffect(()=>{Y.current=!1,B.current=!1,N(null),D(!1)},[i?.path]),k.useEffect(()=>{if(!K||!i?.path||!U||G!=="workspace"||!z){At.repoTerminal.debug("find/create: waiting",{connected:K,path:i?.path,terminalsLoaded:U,activeTab:G,xtermReady:z});return}const xe=j.find(ve=>ve.cwd===i.path&&ve.status==="running");if(xe){At.repoTerminal.info("found existing terminal",{id:xe.id,cwd:xe.cwd}),N(xe.id);return}if(!Y.current&&$.current){Y.current=!0,D(!0);const{cols:ve,rows:De}=$.current;At.repoTerminal.info("creating terminal",{name:i.displayName,cwd:i.path,cols:ve,rows:De}),H({name:i.displayName,cols:ve,rows:De,cwd:i.path})}},[K,i?.path,i?.displayName,U,j,G,H,z]),k.useEffect(()=>{if(!i?.path)return;const xe=j.find(De=>De.cwd===i.path&&De.status==="running");if(!xe)return;const ve=O&&j.some(De=>De.id===O);(!O||!ve)&&(N(xe.id),D(!1),O&&!ve&&(B.current=!1))},[j,i?.path,O]);const _e=k.useCallback(xe=>{At.repoTerminal.info("xterm ready"),$.current=xe,M(!0)},[]),he=k.useCallback((xe,ve)=>{O&&se(O,xe,ve)},[O,se]),ye=k.useCallback(xe=>{At.repoTerminal.info("container ready"),q.current=xe,W(!0)},[]),Ee=k.useCallback(xe=>{O&&Q(O,xe)},[O,Q]);return k.useEffect(()=>{if(!O||!z||!V){At.repoTerminal.debug("attach effect: waiting",{terminalId:O,xtermReady:z,containerReady:V});return}if(!$.current||!q.current){At.repoTerminal.warn("attach effect: refs not set despite ready states",{terminalId:O});return}if(B.current){At.repoTerminal.debug("attach effect: already attached",{terminalId:O});return}return At.repoTerminal.info("attaching terminal",{terminalId:O}),J(O,$.current),ae(q.current,O),B.current=!0,()=>{At.repoTerminal.debug("detaching terminal",{terminalId:O}),B.current=!1}},[O,z,V,J,ae]),a?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):s||!i?b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:b.jsxs(wi,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[b.jsx(fe,{icon:ete,size:16,strokeWidth:2}),"Repositories"]})}),b.jsx("div",{className:"flex flex-1 items-center justify-center",children:b.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[b.jsx(fe,{icon:ts,size:20,strokeWidth:2}),b.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-background px-4 py-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>w(!0),className:"text-muted-foreground hover:text-foreground",children:[b.jsx(fe,{icon:pM,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),b.jsx("span",{className:"max-sm:hidden",children:"New Task"})]}),b.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>r({to:"/tasks",search:{repo:i.displayName}}),className:"text-muted-foreground hover:text-foreground",title:"View Tasks",children:[b.jsx(fe,{icon:Dp,size:14,strokeWidth:2,"data-slot":"icon"}),b.jsx("span",{className:"max-sm:hidden",children:"Tasks"})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx(Vb,{worktreePath:i.path}),b.jsx("span",{className:"text-sm font-medium",children:i.displayName}),u&&b.jsx("a",{href:Oit(u),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors",title:u,children:b.jsx(fe,{icon:u.includes("github.com")?N1e:ote,size:14,strokeWidth:2})}),b.jsxs(go,{children:[b.jsx(bo,{render:b.jsx(Ke,{variant:"ghost",size:"icon-xs",className:"text-muted-foreground hover:text-destructive"}),children:b.jsx(fe,{icon:$c,size:14,strokeWidth:2})}),b.jsxs(vo,{children:[b.jsxs(yo,{children:[b.jsx(Eo,{children:"Delete Repository"}),b.jsxs(So,{children:['This will remove "',i.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),b.jsxs(_o,{children:[b.jsx(xo,{children:"Cancel"}),b.jsx(Ke,{variant:"destructive",onClick:be,children:"Delete"})]})]})]})]})]}),b.jsxs(su,{value:G,onValueChange:xe=>ee(xe),className:"flex flex-1 flex-col overflow-hidden",children:[b.jsx("div",{className:"shrink-0 border-b border-border bg-muted/50 px-4",children:b.jsxs(ou,{variant:"line",children:[b.jsx(li,{value:"settings",className:"px-3 py-1.5",children:"Settings"}),b.jsx(li,{value:"workspace",className:"px-3 py-1.5",children:"Workspace"})]})}),b.jsx(Pi,{value:"settings",className:"flex-1 overflow-hidden mt-0",children:b.jsx(Yy,{className:"h-full",children:b.jsx("div",{className:"p-4",children:b.jsxs("div",{className:"mx-auto max-w-xl space-y-6 bg-card rounded-lg p-6 border border-border",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[b.jsx(fe,{icon:Hi,size:14,strokeWidth:2}),b.jsx("span",{className:"font-mono break-all",children:i.path})]}),b.jsxs(pf,{children:[b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"displayName",children:"Display Name"}),b.jsx(vn,{id:"displayName",value:f,onChange:xe=>d(xe.target.value),placeholder:i.path.split("/").pop()||"My Project"})]}),b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"startupScript",children:"Startup Script"}),b.jsx(bM,{id:"startupScript",value:p,onChange:xe=>m(xe.target.value),placeholder:"npm install && npm run dev",rows:3}),b.jsx(qa,{children:"Command to run in the terminal when creating a worktree."})]}),b.jsxs(ir,{children:[b.jsx(ar,{htmlFor:"copyFiles",children:"Copy Files"}),b.jsx(vn,{id:"copyFiles",value:y,onChange:xe=>S(xe.target.value),placeholder:".env, config.local.json"}),b.jsx(qa,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]}),b.jsxs(ir,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Ti,{checked:g,onCheckedChange:xe=>_(xe===!0)}),b.jsx(ar,{className:"cursor-pointer",children:"Use as Copier Template"})]}),b.jsx(qa,{children:"Mark as a template for creating new projects with Copier."})]})]}),b.jsx("div",{className:"flex items-center justify-end pt-4 border-t border-border",children:b.jsxs(Ke,{size:"sm",onClick:te,disabled:!v||o.isPending,children:[b.jsx(fe,{icon:hl,size:14,strokeWidth:2,"data-slot":"icon"}),o.isPending?"Saving...":"Save"]})})]})})})}),b.jsx(Pi,{value:"workspace",className:"flex-1 overflow-hidden mt-0",children:Z?b.jsxs(su,{value:C,onValueChange:xe=>R(xe),className:"flex min-h-0 flex-1 flex-col h-full",children:[b.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:b.jsxs(ou,{className:"w-full",children:[b.jsx(li,{value:"terminal",className:"flex-1",children:"Terminal"}),b.jsx(li,{value:"files",className:"flex-1",children:"Files"})]})}),b.jsx(Pi,{value:"terminal",className:"flex-1 min-h-0",children:b.jsxs("div",{className:"h-full flex flex-col",children:[!K&&b.jsx("div",{className:"shrink-0 px-2 py-1 bg-muted-foreground/20 text-muted-foreground text-xs",children:"Connecting to terminal server..."}),L&&!O&&b.jsx("div",{className:"flex-1 flex items-center justify-center bg-terminal-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"}),b.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:"Initializing terminal..."})]})}),b.jsx(vD,{className:"flex-1",onReady:_e,onResize:he,onContainerReady:ye,terminalId:O??void 0,setupImagePaste:ae,onSend:Ee})]})}),b.jsx(Pi,{value:"files",className:"flex-1 min-h-0",children:b.jsx(_x,{worktreePath:i.path,initialSelectedFile:n,onFileChange:ne})})]}):b.jsxs(Vd,{direction:"horizontal",className:"h-full",children:[b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsxs("div",{className:"h-full flex flex-col",children:[!K&&b.jsx("div",{className:"shrink-0 px-2 py-1 bg-muted-foreground/20 text-muted-foreground text-xs",children:"Connecting to terminal server..."}),L&&!O&&b.jsx("div",{className:"flex-1 flex items-center justify-center bg-terminal-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx(fe,{icon:en,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"}),b.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:"Initializing terminal..."})]})}),b.jsx(vD,{className:"flex-1",onReady:_e,onResize:he,onContainerReady:ye,terminalId:O??void 0,setupImagePaste:ae,onSend:Ee})]})}),b.jsx(Gd,{withHandle:!0}),b.jsx(Ss,{defaultSize:50,minSize:30,children:b.jsx(_x,{worktreePath:i.path,initialSelectedFile:n,onFileChange:ne})})]})})]}),b.jsx(MM,{open:T,onOpenChange:w,defaultRepository:i,showTrigger:!1})]})}const pP=Ms("/repositories/$repoId")({component:Nit,validateSearch:e=>({tab:e.tab==="workspace"?"workspace":void 0,file:typeof e.file=="string"?e.file:void 0})}),Iit=gRe.update({id:"/",path:"/",getParentRoute:()=>Oo}),Dit=SRe.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Oo}),Lit=mIe.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Oo}),Pit=aae.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Oo}),Mit=RIe.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Oo}),jit=UIe.update({id:"/review/",path:"/review/",getParentRoute:()=>Oo}),Fit=rDe.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Oo}),Bit=Dle.update({id:"/monitoring/",path:"/monitoring/",getParentRoute:()=>Oo}),Uit=hP.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Oo}),$it=pP.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Oo}),zit={IndexRoute:Iit,RepositoriesRepoIdRoute:$it,TasksTaskIdRoute:Uit,MonitoringIndexRoute:Bit,RepositoriesIndexRoute:Fit,ReviewIndexRoute:jit,SettingsIndexRoute:Mit,TasksIndexRoute:Pit,TerminalsIndexRoute:Lit,WorktreesIndexRoute:Dit},Hit=Oo._addFileChildren(zit)._addFileTypes(),Wit=new URLSearchParams(window.location.search),of=parseFloat(Wit.get("zoom")||"1");of!==1&&of>=.5&&of<=2&&(document.documentElement.style.fontSize=`${16*of}px`);const vc=of>=.5&&of<=2?of:1,Vit=new Rme({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),Git=rme({routeTree:Hit});Che.createRoot(document.getElementById("root")).render(b.jsx(k.StrictMode,{children:b.jsx(Gme,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:b.jsx(Nme,{client:Vit,children:b.jsx(B2e,{children:b.jsx(sme,{router:Git})})})})}));
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/jpeg" href="/logo-dark.jpg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Vibora</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-rvVpMwsP.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-DujV-tJ5.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -20758,6 +20758,7 @@ class TerminalSession {
|
|
|
20758
20758
|
buffer;
|
|
20759
20759
|
onData;
|
|
20760
20760
|
onExit;
|
|
20761
|
+
onShouldDestroy;
|
|
20761
20762
|
isDetaching = false;
|
|
20762
20763
|
_tabId;
|
|
20763
20764
|
_positionInTab;
|
|
@@ -20774,6 +20775,7 @@ class TerminalSession {
|
|
|
20774
20775
|
this.buffer.setTerminalId(this.id);
|
|
20775
20776
|
this.onData = options.onData;
|
|
20776
20777
|
this.onExit = options.onExit;
|
|
20778
|
+
this.onShouldDestroy = options.onShouldDestroy;
|
|
20777
20779
|
}
|
|
20778
20780
|
get name() {
|
|
20779
20781
|
return this._name;
|
|
@@ -20881,6 +20883,7 @@ class TerminalSession {
|
|
|
20881
20883
|
this.exitCode = exitCode;
|
|
20882
20884
|
this.updateDb({ status: "exited", exitCode });
|
|
20883
20885
|
this.onExit(exitCode);
|
|
20886
|
+
this.onShouldDestroy?.();
|
|
20884
20887
|
}
|
|
20885
20888
|
});
|
|
20886
20889
|
}
|
|
@@ -20992,7 +20995,10 @@ class PTYManager {
|
|
|
20992
20995
|
tabId: record.tabId ?? undefined,
|
|
20993
20996
|
positionInTab: record.positionInTab ?? 0,
|
|
20994
20997
|
onData: (data) => this.callbacks.onData(record.id, data),
|
|
20995
|
-
onExit: (exitCode) => this.callbacks.onExit(record.id, exitCode)
|
|
20998
|
+
onExit: (exitCode) => this.callbacks.onExit(record.id, exitCode),
|
|
20999
|
+
onShouldDestroy: () => {
|
|
21000
|
+
queueMicrotask(() => destroyTerminalAndBroadcast(record.id));
|
|
21001
|
+
}
|
|
20996
21002
|
});
|
|
20997
21003
|
this.sessions.set(record.id, session);
|
|
20998
21004
|
log2.pty.info("Restored terminal", { terminalId: record.id, name: record.name });
|
|
@@ -21038,7 +21044,10 @@ class PTYManager {
|
|
|
21038
21044
|
tabId: options.tabId,
|
|
21039
21045
|
positionInTab: options.positionInTab,
|
|
21040
21046
|
onData: (data) => this.callbacks.onData(id, data),
|
|
21041
|
-
onExit: (exitCode) => this.callbacks.onExit(id, exitCode)
|
|
21047
|
+
onExit: (exitCode) => this.callbacks.onExit(id, exitCode),
|
|
21048
|
+
onShouldDestroy: () => {
|
|
21049
|
+
queueMicrotask(() => destroyTerminalAndBroadcast(id));
|
|
21050
|
+
}
|
|
21042
21051
|
});
|
|
21043
21052
|
this.sessions.set(id, session);
|
|
21044
21053
|
session.start();
|