@nice2dev/ui 1.1.9 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +27 -34
  3. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  4. package/dist/NiceButton-DHSgQT1_.js +112 -0
  5. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  6. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  7. package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
  8. package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
  9. package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
  10. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  11. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  12. package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
  13. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  14. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  15. package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
  16. package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
  17. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  18. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  19. package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
  20. package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
  21. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  22. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  23. package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
  24. package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
  25. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  26. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  27. package/dist/NiceForm-DUhxXArr.js +4817 -0
  28. package/dist/NiceForm-DVc0Xoly.js +4819 -0
  29. package/dist/NiceForm-qD_RKPYz.cjs +1 -0
  30. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  31. package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
  32. package/dist/NiceGantt-B_1lwEsp.js +328 -0
  33. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  34. package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
  35. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  36. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  37. package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
  38. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  39. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  40. package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
  41. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  42. package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
  43. package/dist/NiceLoginForm.css +1 -0
  44. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  45. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  46. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  47. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  48. package/dist/NiceMention-Dds9GQzk.cjs +430 -0
  49. package/dist/NiceMention-DlLXWddO.js +11268 -0
  50. package/dist/NiceMention.css +1 -1
  51. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  52. package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
  53. package/dist/NiceModal-TNlkaL_i.js +85 -0
  54. package/dist/NiceModal-sihGCfDy.js +95 -0
  55. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  56. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  57. package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
  58. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  59. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
  61. package/dist/NicePagination-8XsBbMNx.js +165 -0
  62. package/dist/NicePagination-CkOoXf0f.js +165 -0
  63. package/dist/NicePagination-D44waj9o.cjs +1 -0
  64. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  65. package/dist/NicePagination-DdxH8KMG.js +179 -0
  66. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  67. package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
  68. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  69. package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
  70. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  71. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  72. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  73. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  74. package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
  75. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  76. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  77. package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  79. package/dist/NiceSavedQueryPanel.css +1 -1
  80. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  81. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  82. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  83. package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
  84. package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
  85. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  86. package/dist/NiceSelect-BCbWtu1v.js +433 -0
  87. package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
  88. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  89. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  90. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  91. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  92. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  93. package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
  94. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  95. package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
  96. package/dist/NiceWindow.css +1 -1
  97. package/dist/charts-C047IMVn.cjs +768 -0
  98. package/dist/charts-C44vJber.cjs +768 -0
  99. package/dist/charts-CCXSb3xk.js +4752 -0
  100. package/dist/charts-CqETcUhH.js +4752 -0
  101. package/dist/charts-DouiiHOT.cjs +768 -0
  102. package/dist/charts-XVlDwU0y.js +4732 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.mjs +8 -8
  105. package/dist/core-BL-KmGYC.js +795 -0
  106. package/dist/core-BxiH7vkV.cjs +1 -0
  107. package/dist/core-Chg-oYCr.cjs +1 -0
  108. package/dist/core-CxBnKAhs.cjs +1 -0
  109. package/dist/core-DMV6_SEE.js +795 -0
  110. package/dist/core-D_LRh59n.js +795 -0
  111. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  112. package/dist/data-branching-YQtJJEtn.js +6273 -0
  113. package/dist/data-branching-oEH04O3i.js +6273 -0
  114. package/dist/data-branching-wmsbLNfa.cjs +1 -0
  115. package/dist/data-branching.cjs +1 -1
  116. package/dist/data-branching.mjs +1 -1
  117. package/dist/data.cjs +1 -1
  118. package/dist/data.d.ts +2 -53
  119. package/dist/data.mjs +3 -3
  120. package/dist/devops-Bt6EsfPa.cjs +17 -0
  121. package/dist/devops-CnZQ1rU5.js +8312 -0
  122. package/dist/devops-D5yIDM3e.js +8312 -0
  123. package/dist/devops-rVpB0ZAX.cjs +17 -0
  124. package/dist/devops.cjs +1 -1
  125. package/dist/devops.mjs +1 -1
  126. package/dist/editors.cjs +1 -1
  127. package/dist/editors.d.ts +8 -26
  128. package/dist/editors.mjs +55 -54
  129. package/dist/feedback.cjs +1 -1
  130. package/dist/feedback.d.ts +5 -0
  131. package/dist/feedback.mjs +3 -3
  132. package/dist/index.cjs +290 -290
  133. package/dist/index.css +1 -1
  134. package/dist/index.d.ts +239 -234
  135. package/dist/index.mjs +20262 -19440
  136. package/dist/lazy.cjs +1 -1
  137. package/dist/lazy.mjs +29 -29
  138. package/dist/navigation.cjs +1 -1
  139. package/dist/navigation.d.ts +4 -4
  140. package/dist/navigation.mjs +69 -69
  141. package/dist/no-code-4GtIBr6f.js +7503 -0
  142. package/dist/no-code-6WyYb3hL.cjs +331 -0
  143. package/dist/no-code-BH5oVFC6.js +8186 -0
  144. package/dist/no-code-Bdwh1vyS.cjs +332 -0
  145. package/dist/no-code-CnHG5_Vn.js +8186 -0
  146. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  147. package/dist/no-code.cjs +1 -1
  148. package/dist/no-code.css +1 -1
  149. package/dist/no-code.d.ts +25 -18
  150. package/dist/no-code.mjs +3 -3
  151. package/dist/overlays.cjs +1 -1
  152. package/dist/overlays.d.ts +24 -24
  153. package/dist/overlays.mjs +24 -490
  154. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  155. package/dist/pickerCommons-31hyz1gs.js +1122 -0
  156. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  157. package/dist/pickerCommons-BHirHJyn.js +548 -0
  158. package/dist/pickerCommons-BifIkPdk.cjs +1 -0
  159. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +10 -7
  162. package/package.json +5 -7
  163. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1,17 @@
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("@nice2dev/ui-core"),i=require("react"),me=new Set,Me=(g,y)=>{if(Object.is(g,y))return!0;try{return JSON.stringify(g)===JSON.stringify(y)}catch{return!1}};function ve(g,y,S,N,A,U="on its own the prop is only the initial value"){const F=i.useRef(N);if(process.env.NODE_ENV==="production"||A){F.current=N;return}const B=`${g}.${y}`;N!==void 0&&!me.has(B)&&!Me(N,F.current)&&(me.add(B),console.warn(`[Nice2Dev] <${g}> \`${y}\` changed after mount without \`${S}\`, so the change is ignored: ${U}. Pass \`${S}\` to control it.`)),F.current=N}const fe=[],ue=["var(--nice-color-success, #22c55e)","var(--nice-color-primary, #3b82f6)","var(--nice-color-warning, #f59e0b)","var(--nice-color-accent-pink, #ec4899)","var(--nice-color-accent, #8b5cf6)","var(--nice-info, #14b8a6)","var(--nice-warning, #f97316)","var(--nice-color-error, #ef4444)","var(--nice-color-accent, #6366f1)","var(--nice-success, #84cc16)"],ge=24,ye=40,be=28,Te=6,$e=4;function We(g,y,S,N){const A=[],U=[],F=new Map;g.forEach((m,b)=>F.set(m.hash,b));const B=new Map,T=[],G=new Map;let J=0;const D=new Map;if(y.forEach(m=>{if(!m.lastCommit)return;const b=D.get(m.lastCommit)||[];b.push({type:m.isRemote?"remote":"branch",name:m.name,commit:m.lastCommit,color:m.isHead?"var(--nice-color-success, #22c55e)":m.isRemote?"var(--nice-text-muted, #6b7280)":"var(--nice-color-primary, #3b82f6)"}),D.set(m.lastCommit,b)}),S.forEach(m=>{const b=D.get(m.commit)||[];b.push({type:"tag",name:m.name,commit:m.commit,color:"var(--nice-color-warning, #f59e0b)"}),D.set(m.commit,b)}),N){const m=D.get(N)||[];m.push({type:"head",name:"HEAD",commit:N,color:"var(--nice-color-error, #ef4444)"}),D.set(N,m)}return g.forEach((m,b)=>{let I=T.findIndex(W=>W===m.hash);I===-1&&(I=T.findIndex(W=>W===null),I===-1&&(I=T.length,T.push(null))),G.has(I)||(G.set(I,ue[J%ue.length]),J++),B.set(m.hash,I);const $=G.get(I)||ue[0];A.push({commit:m,x:I,y:b,color:$,refs:D.get(m.hash)||[]}),m.parents.forEach((W,E)=>{const P=F.get(W);if(P!==void 0){let O=B.get(W);O===void 0&&(E===0?(O=I,T[I]=W):(O=T.findIndex(Q=>Q===null),O===-1?(O=T.length,T.push(W)):T[O]=W),B.set(W,O));const K=G.get(O)||$;U.push({from:m.hash,to:W,fromX:I,fromY:b,toX:O,toY:P,color:E===0?$:K,type:E===0?I===O?"straight":"branch":"merge"})}}),(m.parents.length===0||!g.slice(b+1).some(W=>W.parents.includes(m.hash)))&&(T[I]=null)}),{nodes:A,edges:U}}const _e=({nodes:g,edges:y,selectedHash:S,compact:N,onNodeClick:A,onNodeDoubleClick:U})=>{const F=N?be:ye,B=N?$e:Te,G=(Math.max(...g.map(b=>b.x),0)+2)*ge,J=(g.length+1)*F,D=b=>ge/2+b*ge,m=b=>F/2+b*F;return e.jsxs("svg",{width:G,height:J,style:{minWidth:G,minHeight:J,display:"block"},children:[y.map((b,I)=>{const $=D(b.fromX),W=m(b.fromY),E=D(b.toX),P=m(b.toY);if(b.type==="straight")return e.jsx("line",{x1:$,y1:W,x2:E,y2:P,stroke:b.color,strokeWidth:2},I);const O=(W+P)/2,K=`M ${$} ${W} C ${$} ${O}, ${E} ${O}, ${E} ${P}`;return e.jsx("path",{d:K,fill:"none",stroke:b.color,strokeWidth:2,strokeDasharray:b.type==="merge"?"4,2":void 0},I)}),g.map(b=>{const I=D(b.x),$=m(b.y),W=b.commit.hash===S,E=b.commit.isMerge;return e.jsxs("g",{onClick:()=>A(b.commit.hash),onDoubleClick:()=>U(b.commit.hash),style:{cursor:"pointer"},children:[W&&e.jsx("circle",{cx:I,cy:$,r:B+4,fill:"none",stroke:"var(--nice-bg, #fff)",strokeWidth:2}),e.jsx("circle",{cx:I,cy:$,r:B,fill:E?"var(--nice-bg-elevated, #1e1e1e)":b.color,stroke:b.color,strokeWidth:E?2:0}),b.refs.length>0&&!N&&e.jsx("foreignObject",{x:I+10,y:$-8,width:200,height:16,children:e.jsx("div",{style:{display:"flex",gap:4,whiteSpace:"nowrap"},children:b.refs.map((P,O)=>e.jsxs("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:10,fontWeight:500,background:`${P.color}22`,color:P.color,border:`1px solid ${P.color}44`},children:[P.type==="tag"?e.jsx(n.NiceIcon,{name:"tag",size:10}):P.type==="head"?e.jsx(n.NiceIcon,{name:"cursor",size:10}):null,(P.type==="tag"||P.type==="head")&&" ",P.name]},O))})})]},b.commit.hash)})]})},je=({commits:g=fe,branches:y=fe,tags:S=fe,head:N,selectedCommit:A,branchFilter:U,authorFilter:F,dateRange:B,searchQuery:T,maxCommits:G=100,showRemotes:J=!0,showTags:D=!0,compact:m=!1,onCommitSelect:b,onCommitDoubleClick:I,onBranchCheckout:$,onBranchCreate:W,onTagCreate:E,onCherryPick:P,onRevert:O,onReset:K,onCompare:Q,onViewDiff:_,className:C,style:k,"data-testid":x})=>{const[q,z]=i.useState(A),[R,re]=i.useState(null),[L,H]=i.useState(!1),[ee,d]=i.useState(null),a=i.useRef(null),f=A??q,j=i.useMemo(()=>{let p=g;if(U&&U.length>0){const w=new Set;y.filter(Z=>U.includes(Z.name)).forEach(Z=>{Z.lastCommit&&w.add(Z.lastCommit)}),p=p.filter(Z=>w.has(Z.hash))}if(F&&F.length>0&&(p=p.filter(w=>F.some(Z=>w.author.name.toLowerCase().includes(Z.toLowerCase())||w.author.email.toLowerCase().includes(Z.toLowerCase())))),B&&(B.from&&(p=p.filter(w=>w.date>=B.from)),B.to&&(p=p.filter(w=>w.date<=B.to))),T&&T.trim()){const w=T.toLowerCase();p=p.filter(Z=>Z.hash.toLowerCase().includes(w)||Z.shortHash.toLowerCase().includes(w)||Z.message.toLowerCase().includes(w)||Z.author.name.toLowerCase().includes(w))}return p.slice(0,G)},[g,U,F,B,T,G,y]),{nodes:s,edges:M}=i.useMemo(()=>We(j,J?y:y.filter(p=>!p.isRemote),D?S:[],N),[j,y,S,N,J,D]),v=i.useMemo(()=>j.find(p=>p.hash===f),[j,f]),l=i.useCallback(p=>{if(L&&ee)Q?.(ee,p),H(!1),d(null);else if(L)d(p);else{z(p);const w=j.find(Z=>Z.hash===p);w&&b?.(w)}},[L,ee,j,b,Q]),r=i.useCallback(p=>{const w=j.find(Z=>Z.hash===p);w&&(I?.(w),_?.(p))},[j,I,_]),o=i.useCallback((p,w)=>{p.preventDefault(),re({x:p.clientX,y:p.clientY,commit:w})},[]),u=i.useCallback(()=>re(null),[]),h=p=>{const Z=new Date().getTime()-p.getTime(),ne=Math.floor(Z/(1e3*60*60*24));return ne===0?"Today":ne===1?"Yesterday":ne<7?`${ne} days ago`:p.toLocaleDateString()},V=m?be:ye;return e.jsxs("div",{className:`nice-git-graph ${C||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...k},"data-testid":x,onClick:u,children:[e.jsxs("div",{ref:a,style:{flex:1,overflow:"auto",display:"flex"},children:[e.jsx("div",{style:{flexShrink:0,borderRight:"1px solid var(--nice-border-color, #333)"},children:e.jsx(_e,{nodes:s,edges:M,selectedHash:f,compact:m,onNodeClick:l,onNodeDoubleClick:r})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[s.map(p=>e.jsxs("div",{onClick:()=>l(p.commit.hash),onDoubleClick:()=>r(p.commit.hash),onContextMenu:w=>o(w,p.commit),style:{height:V,padding:"0 12px",display:"flex",alignItems:"center",gap:12,cursor:"pointer",background:p.commit.hash===f?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderBottom:"1px solid var(--nice-bg-secondary, #2a2a2a)"},children:[p.commit.author.avatar?e.jsx("img",{src:p.commit.author.avatar,alt:"",style:{width:m?20:24,height:m?20:24,borderRadius:"50%",flexShrink:0}}):e.jsx("div",{style:{width:m?20:24,height:m?20:24,borderRadius:"50%",background:p.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:m?10:12,color:"var(--nice-color-white, #fff)",fontWeight:600,flexShrink:0},children:p.commit.author.name.charAt(0).toUpperCase()}),e.jsx("div",{style:{flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:m?12:13},children:p.commit.message}),p.commit.stats&&!m&&e.jsxs("div",{style:{display:"flex",gap:8,fontSize:11,color:"var(--nice-text-muted, #888)",flexShrink:0},children:[e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["+",p.commit.stats.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",p.commit.stats.deletions]})]}),e.jsx("code",{style:{fontSize:m?10:11,color:"var(--nice-text-muted, #888)",fontFamily:"monospace",flexShrink:0},children:p.commit.shortHash}),!m&&e.jsx("span",{style:{fontSize:11,color:"var(--nice-text-muted, #888)",flexShrink:0,width:100},children:p.commit.author.name}),e.jsx("span",{style:{fontSize:m?10:11,color:"var(--nice-text-muted, #666)",flexShrink:0,width:m?60:80,textAlign:"right"},children:h(p.commit.date)})]},p.commit.hash)),j.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:13},children:"No commits match the filters"})]})]}),v&&!m&&e.jsxs("div",{style:{width:320,borderLeft:"1px solid var(--nice-border-color, #333)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid var(--nice-border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[v.author.avatar?e.jsx("img",{src:v.author.avatar,alt:"",style:{width:32,height:32,borderRadius:"50%"}}):e.jsx("div",{style:{width:32,height:32,borderRadius:"50%",background:"var(--nice-color-primary, #3b82f6)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-on-primary, #fff)",fontWeight:600},children:v.author.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:13},children:v.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:v.author.email})]})]}),e.jsx("code",{style:{fontSize:11,color:"var(--nice-text-muted, #888)",fontFamily:"monospace"},children:v.hash})]}),e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--nice-border-color, #333)"},children:[e.jsx("div",{style:{fontSize:14,fontWeight:500,marginBottom:8},children:v.message}),v.body&&e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #aaa)",whiteSpace:"pre-wrap",maxHeight:120,overflow:"auto"},children:v.body})]}),v.stats&&e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:16},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:20,fontWeight:600},children:v.stats.filesChanged}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:"files changed"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--nice-color-success, #22c55e)"},children:["+",v.stats.additions]}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:"additions"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--nice-color-error, #ef4444)"},children:["-",v.stats.deletions]}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:"deletions"})]})]}),e.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("button",{onClick:()=>_?.(v.hash),style:{padding:"8px 12px",borderRadius:4,border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"View Changes"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>P?.(v.hash),style:{flex:1,padding:"6px 10px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Cherry Pick"}),e.jsx("button",{onClick:()=>O?.(v.hash),style:{flex:1,padding:"6px 10px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Revert"})]}),e.jsx("button",{onClick:()=>W?.(v.hash),style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Create Branch Here"}),e.jsx("button",{onClick:()=>E?.(v.hash),style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Create Tag Here"}),e.jsx("button",{onClick:()=>{H(!0),d(v.hash)},style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Compare with..."})]})]}),L&&e.jsxs("div",{style:{position:"absolute",top:8,left:"50%",transform:"translateX(-50%)",padding:"8px 16px",background:"var(--nice-color-primary, #3b82f6)",borderRadius:4,fontSize:12,fontWeight:500},children:[ee?`Select commit to compare with ${ee.slice(0,7)}`:"Select first commit",e.jsx("button",{onClick:()=>{H(!1),d(null)},style:{marginLeft:12,padding:"2px 8px",background:"var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))",border:"none",borderRadius:4,color:"var(--nice-color-white, #fff)",cursor:"pointer",fontSize:11},children:"Cancel"})]}),R&&e.jsx("div",{style:{position:"fixed",left:R.x,top:R.y,background:"var(--nice-bg-elevated, #252525)",border:"1px solid var(--nice-border-color, #444)",borderRadius:6,boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",minWidth:160,zIndex:1e3},children:[{label:"View Changes",onClick:()=>_?.(R.commit.hash)},{label:"Cherry Pick",onClick:()=>P?.(R.commit.hash)},{label:"Revert",onClick:()=>O?.(R.commit.hash)},{divider:!0},{label:"Create Branch",onClick:()=>W?.(R.commit.hash)},{label:"Create Tag",onClick:()=>E?.(R.commit.hash)},{divider:!0},{label:"Reset Soft",onClick:()=>K?.(R.commit.hash,"soft")},{label:"Reset Mixed",onClick:()=>K?.(R.commit.hash,"mixed")},{label:"Reset Hard",onClick:()=>K?.(R.commit.hash,"hard"),danger:!0}].map((p,w)=>"divider"in p?e.jsx("div",{style:{height:1,background:"var(--nice-bg-tertiary, #444)",margin:"4px 0"}},w):e.jsx("button",{onClick:()=>{p.onClick?.(),u()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in p&&p.danger?"var(--nice-color-error, #ef4444)":"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:Z=>{Z.currentTarget.style.background="var(--nice-bg-tertiary, #333)"},onMouseOut:Z=>{Z.currentTarget.style.background="transparent"},children:p.label},w))})]})},Pe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitGraph:je},Symbol.toStringTag,{value:"Module"})),ke=({branches:g,currentBranch:y,defaultBranch:S="main",protectionRules:N=[],showRemotes:A=!0,selectedBranch:U,onBranchSelect:F,onCheckout:B,onCreateBranch:T,onDeleteBranch:G,onRenameBranch:J,onMerge:D,onRebase:m,onSetUpstream:b,onPush:I,onPull:$,onCompare:W,onProtectionChange:E,className:P,style:O,"data-testid":K})=>{const[Q,_]=i.useState(""),[C,k]=i.useState("all"),[x,q]=i.useState(),[z,R]=i.useState(!1),[re,L]=i.useState(!1),[H,ee]=i.useState(!1),[d,a]=i.useState(""),[f,j]=i.useState(y||S),[s,M]=i.useState(""),[v,l]=i.useState(y||S),[r,o]=i.useState(null),u=U??x,h=i.useMemo(()=>{let c=g;if(C==="local"?c=c.filter(X=>!X.isRemote):C==="remote"?c=c.filter(X=>X.isRemote):A||(c=c.filter(X=>!X.isRemote)),Q.trim()){const X=Q.toLowerCase();c=c.filter(t=>t.name.toLowerCase().includes(X))}return c.sort((X,t)=>X.isHead?-1:t.isHead?1:X.name===S?-1:t.name===S?1:X.isRemote!==t.isRemote?X.isRemote?1:-1:X.name.localeCompare(t.name))},[g,C,A,Q,S]),V=i.useMemo(()=>{const c=h.filter(t=>!t.isRemote),X=h.filter(t=>t.isRemote);return{local:c,remote:X}},[h]),p=i.useCallback(c=>{q(c),F?.(c)},[F]),w=i.useCallback((c,X)=>{c.preventDefault(),o({x:c.clientX,y:c.clientY,branch:X})},[]),Z=i.useCallback(()=>o(null),[]),ne=i.useCallback(()=>{d.trim()&&(T?.(d.trim(),f),a(""),R(!1))},[d,f,T]),le=i.useCallback(()=>{s&&v&&s!==v&&(D?.(s,v),L(!1))},[s,v,D]),ce=c=>{if(!c)return"-";const t=new Date().getTime()-c.getTime(),ie=Math.floor(t/(1e3*60*60*24));return ie===0?"Today":ie===1?"Yesterday":ie<7?`${ie} days ago`:ie<30?`${Math.floor(ie/7)} weeks ago`:c.toLocaleDateString()},Y=i.useMemo(()=>g.find(c=>c.name===u),[g,u]),se=i.useCallback(c=>N.some(X=>new RegExp(X.pattern.replace(/\*/g,".*")).test(c)),[N]),ae=V.local,de=c=>{const X=c.name===u,t=c.isHead,ie=c.name===S,te=se(c.name);return e.jsxs("div",{onClick:()=>p(c.name),onDoubleClick:()=>B?.(c.name),onContextMenu:Be=>w(Be,c),style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",cursor:"pointer",background:X?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":t?"rgba(34, 197, 94, 0.08)":"transparent",borderLeft:t?"3px solid var(--nice-success, #22c55e)":"3px solid transparent"},children:[e.jsx(n.NiceIcon,{name:c.isRemote?"cloud":t?"map-pin":"box",size:16}),e.jsx("span",{style:{flex:1,fontSize:13,fontWeight:t?600:400,color:t?"var(--nice-color-success, #22c55e)":"var(--nice-text-primary, #e0e0e0)"},children:c.name}),e.jsxs("div",{style:{display:"flex",gap:4},children:[ie&&e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,background:"var(--nice-primary-tint-15, #3b82f622)",color:"var(--nice-color-primary, #3b82f6)",border:"1px solid #3b82f644"},children:"default"}),te&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,fontSize:10,background:"var(--nice-warning-tint-15, #f59e0b22)",color:"var(--nice-color-warning, #f59e0b)",border:"1px solid #f59e0b44"},children:[e.jsx(n.NiceIcon,{name:"lock",size:10})," protected"]})]}),c.upstream&&(c.ahead||c.behind)&&e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10,color:"var(--nice-text-muted, #888)"},children:[c.ahead?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,color:"var(--nice-color-success, #22c55e)"},children:[e.jsx(n.NiceIcon,{name:"arrow-up",size:10}),c.ahead]}):null,c.behind?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,color:"var(--nice-color-error, #ef4444)"},children:[e.jsx(n.NiceIcon,{name:"arrow-down",size:10}),c.behind]}):null]}),c.lastCommit&&e.jsx("span",{style:{fontSize:10,color:"var(--nice-text-muted, #666)",width:80,textAlign:"right"},children:ce(c.lastCommit.date)})]},c.name)};return e.jsxs("div",{className:`nice-branch-manager ${P||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...O},"data-testid":K,onClick:Z,children:[e.jsxs("div",{style:{width:350,display:"flex",flexDirection:"column",borderRight:"1px solid var(--nice-border-color, #333)"},children:[e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--nice-border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx(n.NiceIcon,{name:"box",size:18}),e.jsx("span",{style:{fontWeight:600,fontSize:14},children:"Branches"}),e.jsxs("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--nice-bg-tertiary, #333)",borderRadius:10,fontSize:11},children:[g.filter(c=>!c.isRemote).length," local"]})]}),e.jsx("input",{type:"text",placeholder:"Search branches...",value:Q,onChange:c=>_(c.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",fontSize:12,marginBottom:8}}),e.jsx("div",{style:{display:"flex",gap:4},children:["all","local","remote"].map(c=>e.jsx("button",{onClick:()=>k(c),style:{flex:1,padding:"6px 0",borderRadius:4,border:"none",background:C===c?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:C===c?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11,textTransform:"capitalize"},children:c},c))})]}),e.jsxs("div",{style:{padding:8,borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:8},children:[e.jsxs("button",{onClick:()=>R(!0),style:{flex:1,padding:"8px 12px",borderRadius:4,border:"none",background:"var(--nice-color-success, #22c55e)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"plus",size:14})," New Branch"]}),e.jsxs("button",{onClick:()=>L(!0),style:{flex:1,padding:"8px 12px",borderRadius:4,border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:14})," Merge"]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[V.local.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"8px 12px",fontSize:10,fontWeight:600,color:"var(--nice-text-muted, #888)",textTransform:"uppercase",background:"var(--nice-bg-elevated, #252525)"},children:["Local (",V.local.length,")"]}),V.local.map(de)]}),A&&V.remote.length>0&&C!=="local"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"8px 12px",fontSize:10,fontWeight:600,color:"var(--nice-text-muted, #888)",textTransform:"uppercase",background:"var(--nice-bg-elevated, #252525)",marginTop:8},children:["Remote (",V.remote.length,")"]}),V.remote.map(de)]}),h.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:12},children:"No branches match the filter"})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Y?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:16,borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:Y.isRemote?"cloud":Y.isHead?"map-pin":"box",size:24}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600},children:Y.name}),Y.description&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--nice-text-muted, #888)"},children:Y.description})]}),Y.isHead&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 12px",borderRadius:4,background:"var(--nice-success-tint-15, #22c55e22)",color:"var(--nice-color-success, #22c55e)",fontSize:12,fontWeight:500},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Current"]})]})}),e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--nice-border-color, #333)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:16},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Upstream"}),e.jsx("div",{style:{fontSize:13},children:Y.upstream||e.jsx("span",{style:{color:"var(--nice-text-muted, #666)"},children:"Not set"})})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Sync Status"}),e.jsx("div",{style:{display:"flex",gap:8,fontSize:13},children:Y.upstream?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:"var(--nice-color-success, #22c55e)"},children:[e.jsx(n.NiceIcon,{name:"arrow-up",size:13})," ",Y.ahead||0," ","ahead"]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:"var(--nice-color-error, #ef4444)"},children:[e.jsx(n.NiceIcon,{name:"arrow-down",size:13})," ",Y.behind||0," ","behind"]})]}):e.jsx("span",{style:{color:"var(--nice-text-muted, #666)"},children:"-"})})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Last Commit"}),e.jsx("div",{style:{fontSize:13},children:Y.lastCommit?e.jsxs(e.Fragment,{children:[e.jsx("code",{style:{fontSize:11,color:"var(--nice-text-muted, #aaa)"},children:Y.lastCommit.hash.slice(0,7)})," ",ce(Y.lastCommit.date)]}):e.jsx("span",{style:{color:"var(--nice-text-muted, #666)"},children:"-"})})]})]}),Y.lastCommit&&e.jsxs("div",{style:{marginTop:16,padding:12,background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:6,fontSize:12},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:4},children:Y.lastCommit.message}),e.jsxs("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:["by ",Y.lastCommit.author]})]})]}),e.jsx("div",{style:{padding:16},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8},children:[!Y.isHead&&e.jsxs("button",{onClick:()=>B?.(Y.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-color-success, #22c55e)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"map-pin",size:14})," Checkout"]}),Y.upstream&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>$?.(Y.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"arrow-down",size:14})," Pull"]}),e.jsxs("button",{onClick:()=>I?.(Y.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-color-accent, #8b5cf6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"arrow-up",size:14})," Push"]})]}),!Y.upstream&&!Y.isRemote&&e.jsx("button",{onClick:()=>b?.(Y.name,`origin/${Y.name}`),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12},children:"Set Upstream"}),e.jsxs("button",{onClick:()=>{M(Y.name),l(y||S),L(!0)},style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:14})," Merge into..."]}),e.jsxs("button",{onClick:()=>W?.(S,Y.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:14})," Compare"]}),!Y.isHead&&!Y.isRemote&&!se(Y.name)&&e.jsxs("button",{onClick:()=>G?.(Y.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--nice-color-error, #ef4444)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:12,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"trash",size:14})," Delete"]})]})})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)",fontSize:13},children:"Select a branch to view details"})}),z&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--nice-overlay-70, rgba(0, 0, 0, 0.7))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>R(!1),children:e.jsxs("div",{style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:24},onClick:c=>c.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Create New Branch"}),e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Branch Name"}),e.jsx("input",{type:"text",placeholder:"feature/my-feature",value:d,onChange:c=>a(c.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},autoFocus:!0})]}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Based on"}),e.jsx("select",{value:f,onChange:c=>j(c.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},children:ae.map(c=>e.jsxs("option",{value:c.name,children:[c.name," ",c.isHead?"(current)":""]},c.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>R(!1),style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:ne,disabled:!d.trim(),style:{padding:"10px 20px",borderRadius:6,border:"none",background:d.trim()?"var(--nice-color-success, #22c55e)":"var(--nice-bg-tertiary, #333)",color:d.trim()?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:d.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Create Branch"})]})]})}),re&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--nice-overlay-70, rgba(0, 0, 0, 0.7))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>L(!1),children:e.jsxs("div",{style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:24},onClick:c=>c.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Merge Branches"}),e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Merge from"}),e.jsxs("select",{value:s,onChange:c=>M(c.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},children:[e.jsx("option",{value:"",children:"Select branch..."}),ae.map(c=>e.jsx("option",{value:c.name,children:c.name},c.name))]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 0",color:"var(--nice-text-muted, #888)"},children:[e.jsx(n.NiceIcon,{name:"arrow-down",size:14})," into ",e.jsx(n.NiceIcon,{name:"arrow-down",size:14})]}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Merge into"}),e.jsx("select",{value:v,onChange:c=>l(c.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},children:ae.map(c=>e.jsxs("option",{value:c.name,children:[c.name," ",c.isHead?"(current)":""]},c.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>L(!1),style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:le,disabled:!s||!v||s===v,style:{padding:"10px 20px",borderRadius:6,border:"none",background:s&&v&&s!==v?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:s&&v&&s!==v?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:s&&v&&s!==v?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Merge"})]})]})}),r&&e.jsx("div",{style:{position:"fixed",left:r.x,top:r.y,background:"var(--nice-bg-elevated, #252525)",border:"1px solid var(--nice-border-color, #444)",borderRadius:6,boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",minWidth:160,zIndex:1e3},children:[!r.branch.isHead&&{label:"Checkout",onClick:()=>B?.(r.branch.name)},{label:"Compare",onClick:()=>W?.(S,r.branch.name)},{label:"Merge into current",onClick:()=>D?.(r.branch.name,y||S)},{divider:!0},!r.branch.isRemote&&{label:"Rename",onClick:()=>{const c=prompt("New name:",r.branch.name);c&&J?.(r.branch.name,c)}},!r.branch.isHead&&!r.branch.isRemote&&!se(r.branch.name)&&{label:"Delete",onClick:()=>G?.(r.branch.name),danger:!0}].filter(Boolean).map((c,X)=>c?"divider"in c?e.jsx("div",{style:{height:1,background:"var(--nice-bg-tertiary, #444)",margin:"4px 0"}},X):e.jsx("button",{onClick:()=>{c.onClick?.(),Z()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in c&&c.danger?"var(--nice-color-error, #ef4444)":"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:t=>t.currentTarget.style.background="var(--nice-bg-tertiary, #333)",onMouseOut:t=>t.currentTarget.style.background="transparent",children:c.label},X):null)})]})},Ee=Object.freeze(Object.defineProperty({__proto__:null,NiceBranchManager:ke},Symbol.toStringTag,{value:"Module"})),Ae=[],De=[{target:".nice-merge-request-builder",titleKey:"tutorial.mergeRequestBuilder.intro.title",title:"Merge request builder",contentKey:"tutorial.mergeRequestBuilder.intro.content",content:"Pick source and target branches, write the title and description, add reviewers, labels and linked issues, then preview and submit.",placement:"auto"}],Se=({branches:g=Ae,users:y=[],labels:S=[],issues:N=[],templates:A=[],diff:U,currentBranch:F,defaultTargetBranch:B="main",initialSourceBranch:T,platform:G="github",onSubmit:J,onCancel:D,onBranchChange:m,onPreview:b,tutorial:I,className:$,style:W,"data-testid":E})=>{const[P,O]=i.useState(""),[K,Q]=i.useState(""),[_,C]=i.useState(T||F||""),[k,x]=i.useState(B),[q,z]=i.useState(!1),[R,re]=i.useState([]),[L,H]=i.useState([]),[ee,d]=i.useState([]),[a,f]=i.useState([]),[j,s]=i.useState(!1),[M,v]=i.useState(!0),[l,r]=i.useState(!1),[o,u]=i.useState(!1),[h,V]=i.useState(!1),[p,w]=i.useState(!1),Z=i.useMemo(()=>_?_.replace(/^(feature|bugfix|hotfix|release)\//,"").replace(/[-_]/g," ").replace(/\b\w/g,ie=>ie.toUpperCase()):"",[_]),ne=i.useMemo(()=>g.filter(t=>!t.isRemote),[g]),le=i.useCallback((t,ie)=>{C(t),x(ie),m?.(t,ie)},[m]),ce=i.useCallback(()=>{if(!_||!k||!P.trim())return;const t={title:P.trim(),description:K.trim(),sourceBranch:_,targetBranch:k,isDraft:q,labels:R,reviewers:L,assignees:ee,linkedIssues:a,squashCommits:j,deleteSourceBranch:M};J?.(t)},[P,K,_,k,q,R,L,ee,a,j,M,J]),Y=t=>{Q(t.content),w(!1)},se=t=>{re(ie=>ie.includes(t)?ie.filter(te=>te!==t):[...ie,t])},ae=t=>{H(ie=>ie.includes(t)?ie.filter(te=>te!==t):[...ie,t])},de=t=>{f(ie=>ie.includes(t)?ie.filter(te=>te!==t):[...ie,t])},c={github:{title:"Pull Request",btn:"Create Pull Request"},gitlab:{title:"Merge Request",btn:"Create Merge Request"},bitbucket:{title:"Pull Request",btn:"Create Pull Request"},azure:{title:"Pull Request",btn:"Create Pull Request"}},X=_&&k&&_!==k&&P.trim();return e.jsxs("div",{className:`nice-merge-request-builder ${$||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",position:"relative",...W},"data-testid":E,children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:20},children:e.jsx(n.NiceTutorialButton,{steps:n.resolveTutorial(I,De)})}),e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)",display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:24}),e.jsxs("div",{children:[e.jsxs("h2",{style:{margin:0,fontSize:18,fontWeight:600},children:[q?"Draft ":"",c[G].title]}),e.jsxs("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--nice-text-muted, #888)"},children:["Create a new ",G==="gitlab"?"merge":"pull"," request"]})]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:20},children:[e.jsxs("div",{style:{background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:16,marginBottom:20},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"center"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:11,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"From"}),e.jsxs("select",{value:_,onChange:t=>le(t.target.value,k),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},children:[e.jsx("option",{value:"",children:"Select source branch..."}),ne.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name))]})]}),e.jsx("div",{style:{padding:"20px 0 0"},children:e.jsx("span",{style:{fontSize:20,color:"var(--nice-text-muted, #888)"},children:"→"})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:11,color:"var(--nice-text-muted, #888)",marginBottom:4},children:"Into"}),e.jsx("select",{value:k,onChange:t=>le(_,t.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13},children:ne.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name))})]})]}),U&&e.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:6,display:"flex",gap:16,fontSize:12},children:[e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["+",U.additions," additions"]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",U.deletions," deletions"]}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #888)"},children:[U.changedFiles," files changed"]})]}),_===k&&_&&e.jsx("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--nice-danger-tint-15, #ef444422)",color:"var(--nice-color-error, #ef4444)",borderRadius:6,fontSize:12},children:"Source and target branches cannot be the same"})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:6},children:"Title"}),e.jsx("input",{type:"text",value:P,onChange:t=>O(t.target.value),placeholder:Z||"Enter a title...",style:{width:"100%",padding:"12px 16px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",fontSize:14}}),!P&&Z&&e.jsxs("button",{onClick:()=>O(Z),style:{marginTop:4,padding:0,background:"none",border:"none",color:"var(--nice-color-primary, #3b82f6)",fontSize:11,cursor:"pointer"},children:['Use suggested: "',Z,'"']})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[e.jsx("label",{style:{fontSize:12,color:"var(--nice-text-muted, #888)"},children:"Description"}),A.length>0&&e.jsxs("button",{onClick:()=>w(!p),style:{padding:"4px 8px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-muted, #888)",fontSize:11,cursor:"pointer"},children:[e.jsx(n.NiceIcon,{name:"edit",size:14})," Templates"]})]}),e.jsx("textarea",{value:K,onChange:t=>Q(t.target.value),placeholder:"Describe your changes...",rows:8,style:{width:"100%",padding:"12px 16px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",fontSize:13,resize:"vertical",fontFamily:"inherit"}})]}),p&&A.length>0&&e.jsxs("div",{style:{marginBottom:16,padding:12,background:"var(--nice-bg-elevated, #252525)",borderRadius:6,border:"1px solid var(--nice-border-color, #444)"},children:[e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:8},children:"Select Template"}),A.map(t=>e.jsxs("button",{onClick:()=>Y(t),style:{display:"block",width:"100%",padding:"8px 12px",marginBottom:4,borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:[e.jsx("div",{style:{fontWeight:500},children:t.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:t.description})]},t.id))]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:16,marginBottom:20},children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>r(!l),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"tag",size:14})," Labels"]}),R.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-primary, #3b82f6)"},children:["(",R.length,")"]})]})}),l&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:S.map(t=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:R.includes(t.id),onChange:()=>se(t.id)}),e.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:t.color}}),e.jsx("span",{style:{fontSize:12},children:t.name})]},t.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>u(!o),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"users",size:14})," Reviewers"]}),L.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["(",L.length,")"]})]})}),o&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:y.map(t=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:L.includes(t.id),onChange:()=>ae(t.id)}),t.avatar?e.jsx("img",{src:t.avatar,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):e.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:"var(--nice-bg-tertiary, #666)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10},children:t.name[0]}),e.jsx("span",{style:{fontSize:12},children:t.name})]},t.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>V(!h),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",color:"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"link",size:14})," Linked Issues"]}),a.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-accent, #8b5cf6)"},children:["(",a.length,")"]})]})}),h&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:N.filter(t=>t.state==="open").map(t=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:a.includes(t.id),onChange:()=>de(t.id)}),e.jsxs("span",{style:{fontSize:12,color:"var(--nice-text-muted, #888)"},children:["#",t.number]}),e.jsx("span",{style:{fontSize:12,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.title})]},t.id))})]}),e.jsx("div",{children:e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #252525)",cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:q,onChange:t=>z(t.target.checked)}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"edit",size:14})," Create as Draft"]})]})})]}),e.jsxs("div",{style:{background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:16,marginBottom:20},children:[e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:12},children:"Merge Options"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:j,onChange:t=>s(t.target.checked)}),"Squash commits on merge"]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:M,onChange:t=>v(t.target.checked)}),"Delete source branch after merge"]})]})]}),U&&U.files.length>0&&e.jsxs("div",{style:{background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:16},children:[e.jsxs("div",{style:{fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:12},children:["Changed Files (",U.changedFiles,")"]}),e.jsx("div",{style:{maxHeight:200,overflow:"auto"},children:U.files.map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,fontSize:12},children:[e.jsx("span",{style:{width:12,height:12,borderRadius:2,background:t.status==="added"?"var(--nice-color-success, #22c55e)":t.status==="deleted"?"var(--nice-color-error, #ef4444)":t.status==="renamed"?"var(--nice-color-primary, #3b82f6)":"var(--nice-color-warning, #f59e0b)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,color:"var(--nice-color-white, #fff)"},children:t.status==="added"?"+":t.status==="deleted"?"-":t.status==="renamed"?"→":"M"}),e.jsx("span",{style:{flex:1,fontFamily:"monospace",fontSize:11},children:t.path}),e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)",fontSize:11},children:["+",t.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)",fontSize:11},children:["-",t.deletions]})]},t.path))})]})]}),e.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)",display:"flex",alignItems:"center",justifyContent:"flex-end",gap:12},children:[e.jsx("button",{onClick:D,style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:13},children:"Cancel"}),e.jsx("button",{onClick:()=>b?.({title:P,description:K,sourceBranch:_,targetBranch:k,isDraft:q,labels:R,reviewers:L,assignees:ee,linkedIssues:a,squashCommits:j,deleteSourceBranch:M}),disabled:!X,style:{padding:"10px 20px",borderRadius:6,border:"none",background:X?"var(--nice-bg-tertiary, #333)":"var(--nice-bg-elevated, #222)",color:X?"var(--nice-text-primary, #fff)":"var(--nice-text-muted, #666)",cursor:X?"pointer":"not-allowed",fontSize:13},children:"Preview"}),e.jsx("button",{onClick:ce,disabled:!X,style:{padding:"10px 24px",borderRadius:6,border:"none",background:X?"var(--nice-color-success, #22c55e)":"var(--nice-bg-elevated, #222)",color:X?"var(--nice-color-white, #fff)":"var(--nice-text-muted, #666)",cursor:X?"pointer":"not-allowed",fontSize:13,fontWeight:500},children:q?"Create Draft":c[G].btn})]})]})},Oe=Object.freeze(Object.defineProperty({__proto__:null,NiceMergeRequestBuilder:Se},Symbol.toStringTag,{value:"Module"})),Le=[],Ce=({files:g=Le,viewMode:y,showWhitespace:S,comments:N=[],selectedFile:A,showFileTree:U=!0,contextLines:F=3,baseRef:B,headRef:T,onFileSelect:G,onViewModeChange:J,onAddComment:D,onResolveComment:m,onExpandChunk:b,className:I,style:$,"data-testid":W})=>{const[E,P]=i.useState("split"),[O,K]=i.useState(!1),[Q,_]=i.useState(void 0),[C,k]=i.useState(new Set),[x,q]=i.useState(null),z=y??E,R=S??O,re=A??Q??g[0]?.path,L=i.useMemo(()=>g.find(l=>l.path===re),[g,re]),H=i.useMemo(()=>({additions:g.reduce((l,r)=>l+r.additions,0),deletions:g.reduce((l,r)=>l+r.deletions,0)}),[g]),ee=i.useCallback(l=>{_(l),G?.(l)},[G]),d=i.useCallback(l=>{P(l),J?.(l)},[J]),a=i.useCallback((l,r)=>{const o=`${l}:${r}`;k(u=>{const h=new Set(u);return h.has(o)?h.delete(o):h.add(o),h}),b?.(l,r)},[b]),f=i.useMemo(()=>N.filter(l=>l.filePath===re),[N,re]),j=l=>{switch(l){case"added":return{icon:"+",color:"var(--nice-color-success, #22c55e)"};case"deleted":return{icon:"-",color:"var(--nice-color-error, #ef4444)"};case"modified":return{icon:"M",color:"var(--nice-color-warning, #f59e0b)"};case"renamed":return{icon:"→",color:"var(--nice-color-primary, #3b82f6)"};case"copied":return{icon:"C",color:"var(--nice-color-accent, #8b5cf6)"}}},s=(l,r,o)=>{const u=l.type==="addition"?"var(--nice-success-tint-10, rgba(34, 197, 94, 0.1))":l.type==="deletion"?"var(--nice-danger-tint-10, rgba(239, 68, 68, 0.1))":l.type==="header"?"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))":"transparent",h=l.type==="addition"?"var(--nice-success-text, #4ade80)":l.type==="deletion"?"var(--nice-danger-text, #f87171)":l.type==="header"?"var(--nice-info-text, #60a5fa)":"var(--nice-text-primary, #e0e0e0)",V=o==="old"?l.lineNumberOld:o==="new"?l.lineNumberNew:void 0,p=R?l.content.replace(/ /g,"·").replace(/\t/g,"→ "):l.content;return e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:u,minHeight:20,fontSize:12,fontFamily:'"JetBrains Mono", "Fira Code", monospace'},children:[V!==void 0&&e.jsx("div",{style:{minWidth:50,padding:"0 8px",textAlign:"right",color:"var(--nice-text-muted, #666)",background:"var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",userSelect:"none",borderRight:"1px solid var(--nice-border-color, #333)"},children:V}),z==="unified"&&e.jsx("div",{style:{width:20,textAlign:"center",color:h,fontWeight:600},children:l.type==="addition"?"+":l.type==="deletion"?"-":" "}),e.jsx("div",{style:{flex:1,padding:"0 8px",color:h,whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:p||" "}),D&&V&&l.type!=="header"&&e.jsx("button",{onClick:()=>q({filePath:re,line:V,side:o||"new",body:""}),style:{width:24,border:"none",background:"transparent",color:"var(--nice-color-primary, #3b82f6)",cursor:"pointer",opacity:.3,transition:"opacity 0.2s"},onMouseEnter:w=>w.currentTarget.style.opacity="1",onMouseLeave:w=>w.currentTarget.style.opacity="0.3","aria-label":"Add comment",children:e.jsx(n.NiceIcon,{name:"message",size:14})})]},`${r}-${o||"unified"}`)},M=l=>e.jsx("div",{style:{borderTop:"1px solid var(--nice-border-color, #333)"},children:l.chunks.map((r,o)=>{const u=`${l.path}:${o}`;return C.has(u),e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>a(l.path,o),style:{padding:"6px 12px",background:"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))",borderBottom:"1px solid var(--nice-border-color, #333)",fontSize:11,color:"var(--nice-color-primary-light, #60a5fa)",cursor:"pointer",fontFamily:"monospace"},children:["@@ -",r.oldStart,",",r.oldLines," +",r.newStart,",",r.newLines," @@"," ",r.header||""]}),r.lines.map((h,V)=>s(h,V))]},o)})}),v=l=>e.jsx("div",{style:{borderTop:"1px solid var(--nice-border-color, #333)"},children:l.chunks.map((r,o)=>{const u=[],h=[];for(const p of r.lines)(p.type==="deletion"||p.type==="context")&&u.push(p),(p.type==="addition"||p.type==="context")&&h.push(p);const V=Math.max(u.length,h.length);for(;u.length<V;)u.push({content:"",type:"context"});for(;h.length<V;)h.push({content:"",type:"context"});return e.jsxs("div",{children:[e.jsxs("div",{style:{padding:"6px 12px",background:"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))",borderBottom:"1px solid var(--nice-border-color, #333)",fontSize:11,color:"var(--nice-color-primary-light, #60a5fa)",fontFamily:"monospace"},children:["@@ -",r.oldStart,",",r.oldLines," +",r.newStart,",",r.newLines," @@"," ",r.header||""]}),e.jsxs("div",{style:{display:"flex"},children:[e.jsx("div",{style:{flex:1,borderRight:"1px solid var(--nice-border-color, #444)"},children:u.map((p,w)=>s(p,w,"old"))}),e.jsx("div",{style:{flex:1},children:h.map((p,w)=>s(p,w,"new"))})]})]},o)})});return e.jsxs("div",{className:`nice-git-diff-viewer ${I||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...$},"data-testid":W,children:[U&&e.jsxs("div",{style:{width:280,borderRight:"1px solid var(--nice-border-color, #333)",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(n.NiceIcon,{name:"folder",size:16}),e.jsx("span",{style:{fontWeight:600,fontSize:13},children:"Changed Files"}),e.jsx("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--nice-bg-tertiary, #333)",borderRadius:10,fontSize:11},children:g.length})]}),(B||T)&&e.jsxs("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:[B&&e.jsx("span",{children:B}),B&&T&&e.jsx("span",{style:{margin:"0 4px"},children:"→"}),T&&e.jsx("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:T})]})]}),e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:12,fontSize:12},children:[e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["+",H.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",H.deletions]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:g.map(l=>{const r=j(l.status),o=l.path===re;return e.jsxs("div",{onClick:()=>ee(l.path),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",cursor:"pointer",background:o?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderLeft:o?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent"},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:2,background:r.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--nice-color-white, #fff)",fontWeight:600},children:r.icon}),e.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.path.split("/").pop()}),e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10},children:[l.additions>0&&e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["+",l.additions]}),l.deletions>0&&e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",l.deletions]})]})]},l.path)})})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)",display:"flex",alignItems:"center",gap:16},children:[L&&e.jsx("div",{style:{flex:1,fontSize:13,fontFamily:"monospace"},children:L.oldPath&&L.oldPath!==L.path?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:L.oldPath}),e.jsx("span",{style:{margin:"0 8px",color:"var(--nice-text-muted, #888)"},children:"→"}),e.jsx("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:L.path})]}):L.path}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>d("unified"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:z==="unified"?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:z==="unified"?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Unified"}),e.jsx("button",{onClick:()=>d("split"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:z==="split"?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:z==="split"?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:"Split"})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--nice-text-muted, #888)",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:R,onChange:l=>K(l.target.checked)}),"Show whitespace"]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:L?L.binary?e.jsxs("div",{style:{padding:40,textAlign:"center",color:"var(--nice-text-muted, #888)"},children:[e.jsx(n.NiceIcon,{name:"box",size:48}),e.jsx("p",{children:"Binary file cannot be displayed"})]}):z==="split"?v(L):M(L):e.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--nice-text-muted, #666)"},children:"Select a file to view changes"})}),f.length>0&&e.jsxs("div",{style:{borderTop:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)",maxHeight:200,overflow:"auto"},children:[e.jsxs("div",{style:{padding:"8px 16px",fontSize:12,fontWeight:600,borderBottom:"1px solid var(--nice-border-color, #333)"},children:["Comments (",f.length,")"]}),f.map(l=>e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--nice-border-color, #333)",opacity:l.resolved?.5:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[l.author.avatar?e.jsx("img",{src:l.author.avatar,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):e.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:"var(--nice-bg-tertiary, #666)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10},children:l.author.name[0]}),e.jsx("span",{style:{fontSize:12,fontWeight:500},children:l.author.name}),e.jsxs("span",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:["Line ",l.line," (",l.side,")"]}),l.resolved&&e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,background:"var(--nice-success-tint-15, #22c55e22)",color:"var(--nice-color-success, #22c55e)"},children:"Resolved"}),m&&!l.resolved&&e.jsx("button",{onClick:()=>m(l.id),style:{marginLeft:"auto",padding:"4px 8px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-muted, #888)",cursor:"pointer",fontSize:10},children:"Resolve"})]}),e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-secondary, #ccc)"},children:l.body})]},l.id))]}),x&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--nice-overlay-70, rgba(0, 0, 0, 0.7))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>q(null),children:e.jsxs("div",{style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:20},onClick:l=>l.stopPropagation(),children:[e.jsxs("h3",{style:{margin:"0 0 12px",fontSize:14},children:["Add comment on line ",x.line]}),e.jsx("textarea",{value:x.body,onChange:l=>q({...x,body:l.target.value}),placeholder:"Write a comment...",rows:4,style:{width:"100%",padding:12,borderRadius:6,border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:13,resize:"vertical"},autoFocus:!0}),e.jsxs("div",{style:{marginTop:12,display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>q(null),style:{padding:"8px 16px",borderRadius:4,border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:()=>{x.body.trim()&&(D?.(x.filePath,x.line,x.side,x.body.trim()),q(null))},disabled:!x.body.trim(),style:{padding:"8px 16px",borderRadius:4,border:"none",background:x.body.trim()?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:x.body.trim()?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:x.body.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Add Comment"})]})]})})]})]})},Fe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitDiffViewer:Ce},Symbol.toStringTag,{value:"Module"})),He=(g,y)=>{const N=new Date().getTime()-g.getTime(),A=Math.floor(N/(1e3*60*60*24));return A===0?"today":A===1?"yesterday":A<7?`${A} days ago`:A<30?`${Math.floor(A/7)} weeks ago`:A<365?`${Math.floor(A/30)} months ago`:`${Math.floor(A/365)} years ago`},Ge=g=>{const S=new Date().getTime()-g.getTime(),N=Math.floor(S/(1e3*60*60*24));return N<7?"var(--nice-primary-tint-30, rgba(59, 130, 246, 0.3))":N<30?"var(--nice-success-tint-30, rgba(34, 197, 94, 0.3))":N<90?"var(--nice-warning-tint-30, rgba(234, 179, 8, 0.3))":N<365?"var(--nice-warning-tint-30, rgba(249, 115, 22, 0.3))":"var(--nice-danger-tint-30, rgba(239, 68, 68, 0.3))"},oe=g=>{const y=["var(--nice-color-primary, #3b82f6)","var(--nice-color-success, #22c55e)","var(--nice-color-warning, #f59e0b)","var(--nice-color-error, #ef4444)","var(--nice-color-accent, #8b5cf6)","var(--nice-color-info, #06b6d4)","var(--nice-color-accent-pink, #ec4899)","var(--nice-info, #14b8a6)","var(--nice-warning, #f97316)","var(--nice-color-accent, #6366f1)"];let S=0;for(let N=0;N<g.length;N++)S=(S<<5)-S+g.charCodeAt(N),S=S&S;return y[Math.abs(S)%y.length]},ze=({file:g,viewMode:y="inline",showAgeHeatmap:S=!0,showAvatars:N=!0,groupHunks:A=!0,highlightOnHover:U=!0,timeZone:F,dateRange:B,authorFilter:T,selectedLine:G,syntaxTheme:J="dark",onLineClick:D,onCommitClick:m,onAuthorClick:b,onBlameParent:I,className:$,style:W,"data-testid":E="nice-git-blame"})=>{const[P,O]=i.useState(null),[K,Q]=i.useState(null),[_,C]=i.useState(null),k=i.useMemo(()=>{const a=[];return g.hunks.forEach(f=>{f.lines.forEach(j=>{a.push(j)})}),a.sort((f,j)=>f.lineNumber-j.lineNumber)},[g.hunks]),x=i.useMemo(()=>k.filter(a=>!(B?.from&&a.commit.timestamp<B.from||B?.to&&a.commit.timestamp>B.to||T&&T.length>0&&!T.includes(a.commit.author.id))),[k,B,T]),q=i.useMemo(()=>{if(!A)return x.map(s=>({startLine:s.lineNumber,endLine:s.lineNumber,commit:s.commit,lines:[s],isFirstOfCommit:!0}));const a=[];let f=null;const j=new Set;return x.forEach(s=>{if(!f||f.commit.id!==s.commit.id){const M=!j.has(s.commit.id);j.add(s.commit.id),f={startLine:s.lineNumber,endLine:s.lineNumber,commit:s.commit,lines:[s],isFirstOfCommit:M},a.push(f)}else f.endLine=s.lineNumber,f.lines.push(s)}),a},[x,A]),z=i.useMemo(()=>{const a=new Map;return k.forEach(f=>{a.has(f.commit.author.id)||a.set(f.commit.author.id,f.commit.author)}),Array.from(a.values())},[k]),R=i.useMemo(()=>{const a=new Map;return k.forEach(f=>{a.has(f.commit.id)||a.set(f.commit.id,f.commit)}),Array.from(a.values()).sort((f,j)=>j.timestamp.getTime()-f.timestamp.getTime())},[k]),re=i.useCallback(a=>{D?.(a)},[D]),L=i.useCallback((a,f)=>{f.stopPropagation(),K===a.id?Q(null):Q(a.id),m?.(a)},[K,m]),H=(a,f)=>{const j=f===0,s=a.commit,M=U&&P===s.id;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"0 12px",minWidth:y==="inline"?280:40,background:M?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":S?Ge(s.timestamp):"transparent",borderRight:`3px solid ${oe(s.author.id)}`,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:()=>O(s.id),onMouseLeave:()=>O(null),onClick:v=>L(s,v),children:[j&&y==="inline"&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:oe(s.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"var(--nice-text-primary, #0f172a)",fontWeight:500,flexShrink:0},title:s.author.name,children:s.author.avatar?e.jsx("img",{src:s.author.avatar,alt:s.author.name,style:{width:"100%",height:"100%",borderRadius:"50%"}}):s.author.name[0].toUpperCase()}),e.jsxs("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[e.jsx("div",{style:{fontSize:11,fontFamily:"monospace",color:"var(--nice-text-muted, #6b7280)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.shortId}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #9ca3af)",whiteSpace:"nowrap"},children:He(s.timestamp)})]})]}),y==="gutter"&&j&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:oe(s.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--nice-text-primary, #0f172a)"},title:`${s.author.name} - ${s.shortId}
2
+ ${s.message}`,children:s.author.name[0].toUpperCase()})]})},ee=a=>{if(_!==a.lineNumber||y!=="tooltip")return null;const f=a.commit;return e.jsxs("div",{style:{position:"absolute",left:60,top:-8,zIndex:100,background:"var(--nice-bg-elevated, #ffffff)",border:"1px solid var(--nice-border-color, #e2e8f0)",borderRadius:8,padding:12,boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",minWidth:320},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:"50%",background:oe(f.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-primary, #0f172a)",fontWeight:500},children:f.author.name[0].toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,color:"var(--nice-text-secondary, #475569)"},children:f.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #9ca3af)"},children:f.author.email})]})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:12,color:"var(--nice-color-primary-light, #60a5fa)",marginBottom:4},children:f.shortId}),e.jsx("div",{style:{fontSize:13,color:"var(--nice-text-secondary, #475569)",marginBottom:8},children:f.message}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #6b7280)"},children:f.timestamp.toLocaleString()}),f.parents&&f.parents.length>0&&I&&e.jsxs("button",{onClick:()=>I(f),style:{marginTop:8,padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-secondary, #475569)",fontSize:11,cursor:"pointer"},children:[e.jsx(n.NiceIcon,{name:"arrow-up",size:11})," Blame parent"]})]})},d=a=>K!==a.id?null:e.jsx("div",{style:{background:"var(--nice-bg-elevated, #ffffff)",borderBottom:"1px solid var(--nice-border-color, #e2e8f0)",padding:16},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:oe(a.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-primary, #0f172a)",fontSize:20,fontWeight:500,flexShrink:0},children:a.author.name[0].toUpperCase()}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--nice-text-secondary, #475569)"},children:a.author.name}),e.jsx("span",{style:{fontSize:11,color:"var(--nice-text-muted, #6b7280)"},children:a.author.email})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:13,color:"var(--nice-color-primary-light, #60a5fa)",marginBottom:8},children:a.id}),e.jsx("div",{style:{fontSize:14,color:"var(--nice-text-secondary, #475569)",marginBottom:8,lineHeight:1.5},children:a.message}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,fontSize:12,color:"var(--nice-text-muted, #9ca3af)"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(n.NiceIcon,{name:"calendar",size:12})," ",a.timestamp.toLocaleString()]}),a.parents&&a.parents.length>0&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(n.NiceIcon,{name:"cursor",size:12})," ",a.parents.length," parent(s)"]})]}),I&&a.parents&&a.parents.length>0&&e.jsxs("button",{onClick:()=>I(a),style:{marginTop:12,padding:"6px 12px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",fontSize:12,cursor:"pointer"},children:[e.jsx(n.NiceIcon,{name:"arrow-up",size:12})," Blame in parent commit"]})]})]})});return e.jsxs("div",{className:`nice-git-blame ${$||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:J==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #ffffff)",color:J==="dark"?"var(--nice-text-primary, #e6edf3)":"var(--nice-text-primary, #ffffff)",fontFamily:"system-ui, sans-serif",...W},"data-testid":E,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:J==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:"clipboard",size:16}),e.jsx("span",{style:{fontWeight:500},children:g.path}),e.jsxs("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:["at ",g.revision.substring(0,7)]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:e.jsxs("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:[R.length," commits by ",z.length," author(s)"]})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:J==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)",flexWrap:"wrap"},children:[z.slice(0,10).map(a=>e.jsxs("div",{onClick:()=>b?.(a),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("div",{style:{width:12,height:12,borderRadius:"50%",background:oe(a.id)}}),e.jsx("span",{style:{fontSize:12},children:a.name})]},a.id)),z.length>10&&e.jsxs("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:["+",z.length-10," more"]})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:q.map((a,f)=>e.jsxs(i.Fragment,{children:[a.isFirstOfCommit&&K===a.commit.id&&d(a.commit),a.lines.map((j,s)=>e.jsxs("div",{onClick:()=>re(j),onMouseEnter:()=>C(j.lineNumber),onMouseLeave:()=>C(null),style:{display:"flex",alignItems:"stretch",background:G===j.lineNumber?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":U&&P===a.commit.id?"var(--nice-primary-tint-8, rgba(59, 130, 246, 0.08))":"transparent",borderLeft:G===j.lineNumber?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent",position:"relative"},children:[H(a,s),e.jsx("div",{style:{padding:"0 12px",color:"var(--nice-text-muted, #6e7681)",textAlign:"right",minWidth:50,userSelect:"none",background:J==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-secondary, #f6f8fa)",borderRight:"1px solid var(--nice-border, #30363d)"},children:j.lineNumber}),e.jsx("div",{style:{flex:1,padding:"0 16px",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:j.content}),y==="tooltip"&&ee(j)]},j.lineNumber))]},`${a.commit.id}-${a.startLine}`))}),S&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,padding:"8px 16px",borderTop:"1px solid var(--nice-border, #30363d)",background:J==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)",fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:[e.jsx("span",{children:"Age:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"var(--nice-primary-tint-30, rgba(59, 130, 246, 0.3))",borderRadius:2}}),e.jsx("span",{children:"<1 week"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"var(--nice-success-tint-30, rgba(34, 197, 94, 0.3))",borderRadius:2}}),e.jsx("span",{children:"<1 month"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"var(--nice-warning-tint-30, rgba(234, 179, 8, 0.3))",borderRadius:2}}),e.jsx("span",{children:"<3 months"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"var(--nice-warning-tint-30, rgba(249, 115, 22, 0.3))",borderRadius:2}}),e.jsx("span",{children:"<1 year"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"var(--nice-danger-tint-30, rgba(239, 68, 68, 0.3))",borderRadius:2}}),e.jsx("span",{children:">1 year"})]})]})]})},qe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitBlame:ze},Symbol.toStringTag,{value:"Module"})),Ve=g=>{if(!g.resolved)return[];switch(g.resolution){case"ours":return g.oursContent;case"theirs":return g.theirsContent;case"both":return[...g.oursContent,...g.theirsContent];case"custom":return g.customContent||[];default:return[]}},we=({file:g,context:y,viewMode:S="split",showLineNumbers:N=!0,showBase:A=!1,currentConflictIndex:U,syntaxTheme:F="dark",onResolve:B,onResolveAll:T,onNavigateConflict:G,onSave:J,onCancel:D,className:m,style:b,"data-testid":I="nice-git-conflict-resolver"})=>{const[$,W]=i.useState(g.conflicts),[E,P]=i.useState(U??0),[O,K]=i.useState(null),[Q,_]=i.useState(""),C=i.useMemo(()=>$.filter(s=>!s.resolved).length,[$]),k=i.useMemo(()=>$.filter(s=>s.resolved).length,[$]),x=$[E],q=i.useCallback((s,M,v)=>{W(r=>r.map(o=>o.id===s?{...o,resolved:!0,resolution:M,customContent:v}:o)),K(null),B?.(s,M,v);const l=$.findIndex((r,o)=>o>E&&!r.resolved);l!==-1&&(P(l),G?.(l))},[$,E,B,G]),z=i.useCallback(s=>{W(M=>M.map(v=>v.resolved?v:{...v,resolved:!0,resolution:s})),T?.(s)},[T]),R=i.useCallback(s=>{const M=s==="prev"?Math.max(0,E-1):Math.min($.length-1,E+1);P(M),G?.(M)},[E,$.length,G]),re=i.useCallback(()=>{x&&(K(x.id),_(x.oursContent.join(`
3
+ `)))},[x]),L=i.useCallback(()=>{O&&q(O,"custom",Q.split(`
4
+ `))},[O,Q,q]),H=i.useCallback(()=>{const s=g.content.split(`
5
+ `);let M=[],v=0;$.forEach(l=>{M=[...M,...s.slice(v,l.startLine-1)],M=[...M,...Ve(l)],v=l.endLine}),M=[...M,...s.slice(v)],J?.(M.join(`
6
+ `))},[g.content,$,J]),ee=(s,M,v,l)=>e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,borderLeft:`3px solid ${v}`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:`${v}20`,borderBottom:"1px solid var(--nice-border, #30363d)"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:500,color:v},children:s}),l&&e.jsx("button",{onClick:l,style:{padding:"4px 10px",background:v,border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",fontSize:11,cursor:"pointer"},children:"Accept"})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:M.map((r,o)=>e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:F==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #fff)"},children:[N&&e.jsx("span",{style:{padding:"0 12px",color:"var(--nice-text-muted, #6e7681)",textAlign:"right",minWidth:40,borderRight:"1px solid var(--nice-border, #30363d)",userSelect:"none"},children:o+1}),e.jsx("span",{style:{padding:"0 12px",whiteSpace:"pre"},children:r||" "})]},o))})]}),d=()=>x?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[e.jsxs("div",{style:{background:"var(--nice-success-tint-10, rgba(34, 197, 94, 0.1))",borderLeft:"3px solid var(--nice-success, #22c55e)"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--nice-border, #30363d)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontSize:12,color:"var(--nice-color-success, #22c55e)",fontWeight:500},children:["← Ours (",y?.oursCommit.branch||"HEAD",")"]}),e.jsx("button",{onClick:()=>q(x.id,"ours"),style:{padding:"4px 10px",background:"var(--nice-color-success, #22c55e)",border:"none",borderRadius:4,color:"var(--nice-text-on-primary, #fff)",fontSize:11,cursor:"pointer"},children:"Accept Ours"})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:x.oursContent.join(`
7
+ `)})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",background:"var(--nice-bg-elevated, #ffffff)"},children:[e.jsx("div",{style:{flex:1,height:1,background:"var(--nice-border-color, #e2e8f0)"}}),e.jsx("span",{style:{color:"var(--nice-text-muted, #9ca3af)",fontSize:11},children:"VS"}),e.jsx("div",{style:{flex:1,height:1,background:"var(--nice-border-color, #e2e8f0)"}})]}),e.jsxs("div",{style:{background:"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))",borderLeft:"3px solid var(--nice-primary, #3b82f6)"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--nice-border, #30363d)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontSize:12,color:"var(--nice-color-primary, #3b82f6)",fontWeight:500},children:["→ Theirs (",y?.theirsCommit.branch||"incoming",")"]}),e.jsx("button",{onClick:()=>q(x.id,"theirs"),style:{padding:"4px 10px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:4,color:"var(--nice-text-on-primary, #fff)",fontSize:11,cursor:"pointer"},children:"Accept Theirs"})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:x.theirsContent.join(`
8
+ `)})]})]}):null,a=()=>x?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[ee(`← Ours (${y?.oursCommit.branch||"HEAD"})`,x.oursContent,"var(--nice-color-success, #22c55e)",()=>q(x.id,"ours")),A&&ee("Base (ancestor)",x.baseContent,"var(--nice-text-muted, #6b7280)"),ee(`→ Theirs (${y?.theirsCommit.branch||"incoming"})`,x.theirsContent,"var(--nice-color-primary, #3b82f6)",()=>q(x.id,"theirs"))]}):null,f=()=>x?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[ee(`← Ours (${y?.oursCommit.branch||"HEAD"})`,x.oursContent,"var(--nice-color-success, #22c55e)",()=>q(x.id,"ours")),ee("Base",x.baseContent,"var(--nice-text-muted, #6b7280)"),ee(`→ Theirs (${y?.theirsCommit.branch||"incoming"})`,x.theirsContent,"var(--nice-color-primary, #3b82f6)",()=>q(x.id,"theirs"))]}):null,j=()=>O!==x?.id?null:e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"80%",maxWidth:800,background:"var(--nice-bg-elevated, #ffffff)",borderRadius:8,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontWeight:500},children:[e.jsx(n.NiceIcon,{name:"edit",size:14})," Edit Resolution"]}),e.jsx("button",{onClick:()=>K(null),"aria-label":"Close editor",style:{background:"transparent",border:"none",color:"var(--nice-text-muted, #9ca3af)",cursor:"pointer",fontSize:18},children:e.jsx(n.NiceIcon,{name:"close",size:18})})]}),e.jsx("textarea",{value:Q,onChange:s=>_(s.target.value),style:{width:"100%",height:300,padding:16,fontFamily:"monospace",fontSize:13,background:"var(--nice-bg-canvas, #0d1117)",color:"var(--nice-text-primary, #e6edf3)",border:"none",resize:"none"}}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{onClick:()=>K(null),style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:L,style:{padding:"8px 16px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer"},children:"Save Changes"})]})]})});return e.jsxs("div",{className:`nice-git-conflict-resolver ${m||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:F==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #ffffff)",color:F==="dark"?"var(--nice-text-primary, #e6edf3)":"var(--nice-text-primary, #ffffff)",fontFamily:"system-ui, sans-serif",position:"relative",...b},"data-testid":I,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:F==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:"warning",size:18}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:g.path}),e.jsxs("div",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:[$.length," conflict(s) • ",k," resolved • ",C," ","remaining"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:D,style:{padding:"6px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:"Cancel"}),e.jsxs("button",{onClick:H,disabled:C>0,style:{padding:"6px 12px",background:C>0?"var(--nice-bg-tertiary, #e2e8f0)":"var(--nice-color-success, #22c55e)",border:"none",borderRadius:6,color:C>0?"var(--nice-text-muted, #94a3b8)":"var(--nice-color-white, #fff)",cursor:C>0?"not-allowed":"pointer",opacity:C>0?.5:1,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Save Resolved"]})]})]}),y&&e.jsxs("div",{style:{display:"flex",gap:24,padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:F==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)",fontSize:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:"← Ours:"}),e.jsx("span",{children:y.oursCommit.branch}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontFamily:"monospace"},children:["(",y.oursCommit.shortId,")"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{color:"var(--nice-color-primary, #3b82f6)"},children:"→ Theirs:"}),e.jsx("span",{children:y.theirsCommit.branch}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontFamily:"monospace"},children:["(",y.theirsCommit.shortId,")"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:F==="dark"?"var(--nice-bg-elevated, #ffffff)":"var(--nice-bg-secondary, #f0f0f0)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:()=>R("prev"),disabled:E===0,style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:E===0?"not-allowed":"pointer",opacity:E===0?.5:1},children:"← Prev"}),e.jsxs("span",{style:{padding:"0 8px"},children:["Conflict ",E+1," of ",$.length,x?.resolved&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,marginLeft:8,color:"var(--nice-color-success, #22c55e)"},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Resolved"]})]}),e.jsx("button",{onClick:()=>R("next"),disabled:E===$.length-1,style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:E===$.length-1?"not-allowed":"pointer",opacity:E===$.length-1?.5:1},children:"Next →"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:()=>z("ours"),disabled:C===0,style:{padding:"4px 10px",background:"var(--nice-color-success, #22c55e)",border:"none",borderRadius:4,color:"var(--nice-text-on-primary, #fff)",fontSize:11,cursor:C===0?"not-allowed":"pointer",opacity:C===0?.5:1},children:"Accept All Ours"}),e.jsx("button",{onClick:()=>z("theirs"),disabled:C===0,style:{padding:"4px 10px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:4,color:"var(--nice-text-on-primary, #fff)",fontSize:11,cursor:C===0?"not-allowed":"pointer",opacity:C===0?.5:1},children:"Accept All Theirs"})]})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[x&&!x.resolved&&e.jsxs(e.Fragment,{children:[S==="inline"&&d(),S==="split"&&a(),S==="three-way"&&f()]}),x?.resolved&&e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16,color:"var(--nice-color-success, #22c55e)"},children:[e.jsx(n.NiceIcon,{name:"check",size:48}),e.jsx("span",{style:{fontSize:18},children:"Conflict Resolved"}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontSize:13},children:["Resolution: ",x.resolution]}),e.jsxs("button",{onClick:()=>W(s=>s.map(M=>M.id===x.id?{...M,resolved:!1,resolution:void 0}:M)),style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"reply",size:14})," Re-resolve"]})]})]}),x&&!x.resolved&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,padding:"12px 16px",borderTop:"1px solid var(--nice-border, #30363d)",background:F==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)"},children:[e.jsxs("button",{onClick:()=>q(x.id,"ours"),style:{padding:"8px 20px",background:"var(--nice-color-success, #22c55e)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Accept Ours"]}),e.jsxs("button",{onClick:()=>q(x.id,"theirs"),style:{padding:"8px 20px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Accept Theirs"]}),e.jsxs("button",{onClick:()=>q(x.id,"both"),style:{padding:"8px 20px",background:"var(--nice-color-accent, #8b5cf6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:14})," Accept Both"]}),e.jsxs("button",{onClick:re,style:{padding:"8px 20px",background:"var(--nice-color-warning, #f59e0b)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"edit",size:14})," Edit Manually"]})]}),j()]})},Ue=Object.freeze(Object.defineProperty({__proto__:null,NiceGitConflictResolver:we},Symbol.toStringTag,{value:"Module"})),pe={"pre-commit":{title:"Pre-commit",description:"Runs before commit is created. Good for linting and formatting.",icon:"check"},"prepare-commit-msg":{title:"Prepare Commit Message",description:"Runs before commit message editor opens. Can modify default message.",icon:"edit"},"commit-msg":{title:"Commit Message",description:"Validates commit message format (e.g., conventional commits).",icon:"message"},"post-commit":{title:"Post-commit",description:"Runs after commit is created. Good for notifications.",icon:"upload"},"pre-push":{title:"Pre-push",description:"Runs before push. Good for running tests.",icon:"rocket"},"pre-rebase":{title:"Pre-rebase",description:"Runs before rebase starts.",icon:"shuffle"},"post-merge":{title:"Post-merge",description:"Runs after merge completes. Good for dependency updates.",icon:"link"},"post-checkout":{title:"Post-checkout",description:"Runs after checkout completes.",icon:"download"},"pre-auto-gc":{title:"Pre-auto GC",description:"Runs before automatic garbage collection.",icon:"trash"}},Je=[{id:"eslint-staged",name:"ESLint (staged files)",description:"Run ESLint on staged JavaScript/TypeScript files",icon:"search",category:"lint",hook:"pre-commit",actions:[{type:"lint",name:"ESLint",command:"npx eslint --fix",runOn:"staged",filePatterns:["*.js","*.jsx","*.ts","*.tsx"],enabled:!0,failOnError:!0}]},{id:"prettier-staged",name:"Prettier (staged files)",description:"Format staged files with Prettier",icon:"edit",category:"lint",hook:"pre-commit",actions:[{type:"format",name:"Prettier",command:"npx prettier --write",runOn:"staged",filePatterns:["*.js","*.jsx","*.ts","*.tsx","*.css","*.json","*.md"],enabled:!0,failOnError:!1}]},{id:"jest-tests",name:"Jest Tests",description:"Run Jest tests before push",icon:"flask",category:"test",hook:"pre-push",actions:[{type:"test",name:"Jest",command:"npm test",runOn:"all",enabled:!0,failOnError:!0}]},{id:"typecheck",name:"TypeScript Check",description:"Run TypeScript compiler check",icon:"book",category:"quality",hook:"pre-commit",actions:[{type:"typecheck",name:"tsc",command:"npx tsc --noEmit",runOn:"all",enabled:!0,failOnError:!0}]},{id:"conventional-commits",name:"Conventional Commits",description:"Validate commit message format",icon:"clipboard",category:"quality",hook:"commit-msg",actions:[{type:"custom",name:"Commitlint",command:"npx commitlint --edit $1",enabled:!0,failOnError:!0}]},{id:"secrets-scan",name:"Secret Detection",description:"Scan for accidentally committed secrets",icon:"lock",category:"security",hook:"pre-commit",actions:[{type:"custom",name:"Detect Secrets",command:"npx secretlint",runOn:"staged",enabled:!0,failOnError:!0}]}],Ie=({hooks:g,defaultHooks:y,templates:S=Je,manager:N="husky",repoPath:A,selectedHook:U,onHookChange:F,onHooksChange:B,onHookToggle:T,onActionAdd:G,onActionRemove:J,onActionUpdate:D,onInstall:m,onUninstall:b,onExport:I,className:$,style:W,"data-testid":E="nice-git-hooks"})=>{const P=g!==void 0&&B!==void 0,O=i.useRef([]),K=i.useCallback(r=>{const o=O.current;O.current=r,F&&r.filter(u=>!o.includes(u)).forEach(u=>F(u)),B?.(r)},[F,B]),[Q,_]=n.useControllableState({value:P?g:void 0,defaultValue:P?y:y??g,fallbackValue:[],onChange:K,componentName:"NiceGitHooks"});O.current=Q,ve("NiceGitHooks","hooks","onHooksChange",g,P);const[C,k]=i.useState(U||null),[x,q]=i.useState(!1),[z,R]=i.useState(null),[re,L]=i.useState(!1),H=i.useMemo(()=>Q.find(r=>r.type===C),[Q,C]),ee=i.useCallback((r,o)=>{_(u=>u.map(h=>h.type===r?{...h,enabled:o}:h)),T?.(r,o)},[T,_]),d=i.useCallback(r=>{if(!C)return;const o=r?r.actions.map((u,h)=>({...u,id:n.createId(),order:(H?.actions.length||0)+h})):[{id:n.createId(),type:"custom",name:"New Action",command:'echo "Hello"',order:H?.actions.length||0,enabled:!0,failOnError:!0}];_(u=>u.map(h=>h.type===C?{...h,actions:[...h.actions,...o]}:h)),o.forEach(u=>G?.(C,u)),q(!1)},[C,H,G,_]),a=i.useCallback(r=>{C&&(_(o=>o.map(u=>u.type===C?{...u,actions:u.actions.filter(h=>h.id!==r)}:u)),J?.(C,r))},[C,J,_]),f=i.useCallback(r=>{C&&(_(o=>o.map(u=>u.type===C?{...u,actions:u.actions.map(h=>h.id===r.id?r:h)}:u)),R(null),D?.(C,r))},[C,D,_]),j=i.useCallback((r,o)=>{if(!H)return;const u=[...H.actions],h=u.findIndex(p=>p.id===r);if(h===-1)return;const V=o==="up"?h-1:h+1;V<0||V>=u.length||([u[h],u[V]]=[u[V],u[h]],u.forEach((p,w)=>p.order=w),_(p=>p.map(w=>w.type===C?{...w,actions:u}:w)))},[H,C,_]),s=i.useCallback(r=>{const o=["#!/bin/sh",""];return r.verbose&&o.push("set -x"),o.push("# Generated by NiceGitHooks",`# Hook: ${r.type}`,""),r.actions.forEach(u=>{if(!u.enabled){o.push(`# [DISABLED] ${u.name}`);return}if(o.push(`# ${u.name}`),u.condition){const{type:V,operator:p,value:w}=u.condition;V==="branch"?(o.push("BRANCH=$(git rev-parse --abbrev-ref HEAD)"),p==="equals"?o.push(`if [ "$BRANCH" != "${w}" ]; then exit 0; fi`):p==="matches"&&o.push(`if ! echo "$BRANCH" | grep -q "${w}"; then exit 0; fi`)):V==="env"&&o.push(`if [ -z "$${w}" ]; then exit 0; fi`)}let h=u.command;u.runOn==="staged"&&u.filePatterns?.length&&(u.filePatterns.map(V=>`'${V}'`).join(" "),h=`git diff --cached --name-only --diff-filter=ACM | grep -E "${u.filePatterns.join("|")}" | xargs ${h}`),o.push(h),u.failOnError&&(o.push("if [ $? -ne 0 ]; then"),o.push(` echo "❌ ${u.name} failed""`),o.push(" exit 1"),o.push("fi")),o.push("")}),o.push("exit 0"),o.join(`
9
+ `)},[]),M=r=>({lint:"search",test:"flask",format:"edit",typecheck:"book",build:"settings",custom:"settings"})[r],v=()=>z?e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"90%",maxWidth:600,background:"var(--nice-bg-elevated, #ffffff)",borderRadius:12,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontWeight:500,fontSize:16,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"edit",size:16})," Edit Action"]}),e.jsx("button",{onClick:()=>R(null),"aria-label":"Close",style:{background:"none",border:"none",color:"var(--nice-text-muted, #9ca3af)",cursor:"pointer",fontSize:20},children:e.jsx(n.NiceIcon,{name:"close",size:18})})]}),e.jsxs("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:"Name"}),e.jsx("input",{type:"text",value:z.name,onChange:r=>R({...z,name:r.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"1px solid var(--nice-border-color, #cbd5e1)",borderRadius:6,color:"var(--nice-text-primary, #0f172a)"}})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:"Type"}),e.jsxs("select",{value:z.type,onChange:r=>R({...z,type:r.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"1px solid var(--nice-border-color, #cbd5e1)",borderRadius:6,color:"var(--nice-text-primary, #0f172a)"},children:[e.jsx("option",{value:"lint",children:"Lint"}),e.jsx("option",{value:"test",children:"Test"}),e.jsx("option",{value:"format",children:"Format"}),e.jsx("option",{value:"typecheck",children:"Typecheck"}),e.jsx("option",{value:"build",children:"Build"}),e.jsx("option",{value:"custom",children:"Custom"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:"Command"}),e.jsx("textarea",{value:z.command,onChange:r=>R({...z,command:r.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"1px solid var(--nice-border-color, #cbd5e1)",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",fontFamily:"monospace",minHeight:80,resize:"vertical"}})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:"Run On"}),e.jsxs("select",{value:z.runOn||"all",onChange:r=>R({...z,runOn:r.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"1px solid var(--nice-border-color, #cbd5e1)",borderRadius:6,color:"var(--nice-text-primary, #0f172a)"},children:[e.jsx("option",{value:"all",children:"All files"}),e.jsx("option",{value:"staged",children:"Staged files only"}),e.jsx("option",{value:"changed",children:"Changed files"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:"File Patterns (comma-separated)"}),e.jsx("input",{type:"text",value:z.filePatterns?.join(", ")||"",onChange:r=>R({...z,filePatterns:r.target.value.split(",").map(o=>o.trim()).filter(Boolean)}),placeholder:"*.ts, *.tsx, *.js",style:{width:"100%",padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"1px solid var(--nice-border-color, #cbd5e1)",borderRadius:6,color:"var(--nice-text-primary, #0f172a)"}})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:z.enabled,onChange:r=>R({...z,enabled:r.target.checked})}),e.jsx("span",{style:{fontSize:13},children:"Enabled"})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:z.failOnError,onChange:r=>R({...z,failOnError:r.target.checked})}),e.jsx("span",{style:{fontSize:13},children:"Fail on error"})]})]})]}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{onClick:()=>R(null),style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:()=>f(z),style:{padding:"8px 16px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer"},children:"Save"})]})]})}):null,l=()=>{if(!re||!H)return null;const r=s(H);return e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"90%",maxWidth:700,maxHeight:"80vh",background:"var(--nice-bg-elevated, #ffffff)",borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontWeight:500,fontSize:16,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"file",size:16})," Script Preview: ",H.type]}),e.jsx("button",{onClick:()=>L(!1),"aria-label":"Close",style:{background:"none",border:"none",color:"var(--nice-text-muted, #9ca3af)",cursor:"pointer",fontSize:20},children:e.jsx(n.NiceIcon,{name:"close",size:18})})]}),e.jsx("pre",{style:{flex:1,margin:0,padding:20,background:"var(--nice-bg-canvas, #0d1117)",color:"var(--nice-text-primary, #e6edf3)",fontFamily:"monospace",fontSize:13,overflow:"auto"},children:r}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(r)},style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"clipboard",size:14})," Copy"]}),e.jsx("button",{onClick:()=>L(!1),style:{padding:"8px 16px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer"},children:"Close"})]})]})})};return e.jsxs("div",{className:`nice-git-hooks ${$||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-canvas, #0d1117)",color:"var(--nice-text-primary, #e6edf3)",fontFamily:"system-ui, sans-serif",...W},"data-testid":E,children:[e.jsxs("div",{style:{width:280,borderRight:"1px solid var(--nice-border, #30363d)",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",fontWeight:500,display:"flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"link",size:16})," Git Hooks"]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:Object.entries(pe).map(([r,o])=>{const u=Q.find(p=>p.type===r),h=C===r,V=u?.actions.length||0;return e.jsxs("div",{onClick:()=>k(r),style:{padding:"12px 16px",cursor:"pointer",background:h?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderLeft:h?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent",display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:o.icon,size:18}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:500},children:o.title}),e.jsxs("div",{style:{fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:[V," action",V!==1?"s":""]})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),ee(r,!u?.enabled)},style:{width:36,height:20,borderRadius:10,background:u?.enabled?"var(--nice-color-success, #22c55e)":"var(--nice-bg-tertiary, #cbd5e1)",border:"none",cursor:"pointer",position:"relative",transition:"background 0.2s"},children:e.jsx("div",{style:{position:"absolute",top:2,left:u?.enabled?18:2,width:16,height:16,borderRadius:"50%",background:"var(--nice-bg-primary, #fff)",transition:"left 0.2s"}})})]},r)})}),e.jsx("div",{style:{padding:12,borderTop:"1px solid var(--nice-border, #30363d)",display:"flex",gap:8},children:e.jsx("button",{onClick:()=>I?.(Q,"husky"),style:{flex:1,padding:"8px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",fontSize:12,cursor:"pointer"},children:"Export"})})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:H?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--nice-border, #30363d)",background:"var(--nice-bg-elevated, #161b22)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[e.jsx(n.NiceIcon,{name:pe[H.type].icon,size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:18,fontWeight:500},children:pe[H.type].title}),e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:pe[H.type].description})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:12},children:[e.jsxs("button",{onClick:()=>L(!0),style:{padding:"6px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",fontSize:12,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"file",size:14})," Preview Script"]}),e.jsxs("button",{onClick:()=>m?.(H.type),style:{padding:"6px 12px",background:"var(--nice-color-success, #22c55e)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",fontSize:12,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"download",size:14})," Install"]}),e.jsxs("button",{onClick:()=>b?.(H.type),style:{padding:"6px 12px",background:"var(--nice-color-error, #ef4444)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",fontSize:12,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"close",size:14})," Uninstall"]})]})]}),e.jsx("div",{style:{flex:1,overflow:"auto",padding:16},children:H.actions.length===0?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:40,color:"var(--nice-text-muted, #8b949e)"},children:[e.jsx(n.NiceIcon,{name:"box",size:48}),e.jsx("span",{style:{marginTop:16},children:"No actions configured"}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:"Add an action from templates or create a custom one"})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:H.actions.sort((r,o)=>r.order-o.order).map((r,o)=>e.jsxs("div",{style:{padding:16,background:"var(--nice-bg-elevated, #161b22)",borderRadius:8,border:"1px solid var(--nice-border, #30363d)",opacity:r.enabled?1:.5},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:M(r.type),size:20}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:r.name}),e.jsx("code",{style:{fontSize:11,color:"var(--nice-text-muted, #8b949e)",background:"var(--nice-bg-canvas, #0d1117)",padding:"2px 6px",borderRadius:4},children:r.command})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>j(r.id,"up"),disabled:o===0,"aria-label":"Move up",style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:o===0?"not-allowed":"pointer",opacity:o===0?.5:1},children:e.jsx(n.NiceIcon,{name:"arrow-up",size:14})}),e.jsx("button",{onClick:()=>j(r.id,"down"),disabled:o===H.actions.length-1,"aria-label":"Move down",style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:o===H.actions.length-1?"not-allowed":"pointer",opacity:o===H.actions.length-1?.5:1},children:e.jsx(n.NiceIcon,{name:"arrow-down",size:14})}),e.jsx("button",{onClick:()=>R(r),"aria-label":"Edit action",style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:e.jsx(n.NiceIcon,{name:"edit",size:14})}),e.jsx("button",{onClick:()=>a(r.id),"aria-label":"Remove action",style:{padding:"4px 8px",background:"var(--nice-color-error, #ef4444)",border:"none",borderRadius:4,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer"},children:e.jsx(n.NiceIcon,{name:"trash",size:14})})]})]}),r.filePatterns&&r.filePatterns.length>0&&e.jsxs("div",{style:{marginTop:8,fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:["Files: ",r.filePatterns.join(", ")]}),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[r.runOn&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--nice-color-primary-active, #1d4ed8)",borderRadius:4},children:r.runOn}),r.failOnError&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--nice-color-error, #b91c1c)",borderRadius:4},children:"fail on error"})]})]},r.id))})}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid var(--nice-border, #30363d)",display:"flex",gap:8},children:[e.jsxs("button",{onClick:()=>q(!x),style:{padding:"10px 16px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"plus",size:14})," Add from Template"]}),e.jsxs("button",{onClick:()=>d(),style:{padding:"10px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"settings",size:14})," Custom Action"]})]}),x&&e.jsxs("div",{style:{position:"absolute",bottom:70,left:300,width:400,maxHeight:300,overflow:"auto",background:"var(--nice-bg-elevated, #ffffff)",border:"1px solid var(--nice-border-color, #e2e8f0)",borderRadius:8,boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",zIndex:50},children:[S.filter(r=>r.hook===C).map(r=>e.jsxs("div",{onClick:()=>d(r),style:{padding:12,cursor:"pointer",borderBottom:"1px solid var(--nice-border-color, #e2e8f0)",display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:r.icon,size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:r.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:r.description})]})]},r.id)),S.filter(r=>r.hook===C).length===0&&e.jsx("div",{style:{padding:20,textAlign:"center",color:"var(--nice-text-muted, #8b949e)"},children:"No templates for this hook type"})]})]}):e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #8b949e)"},children:[e.jsx(n.NiceIcon,{name:"link",size:64}),e.jsx("span",{style:{fontSize:18,marginTop:16},children:"Select a hook to configure"}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:"Click on a hook from the list to start editing"})]})}),v(),l()]})},Ye=Object.freeze(Object.defineProperty({__proto__:null,NiceGitHooks:Ie},Symbol.toStringTag,{value:"Module"})),he=i.forwardRef(({menubar:g,toolbar:y,sidebar:S,sidebarWidth:N=220,rightSidebar:A,rightSidebarWidth:U=280,children:F,bottomPanel:B,bottomPanelHeight:T,statusBar:G,height:J="100%",flush:D=!1,className:m,style:b,id:I,"data-testid":$},W)=>{const E=`nice-app-shell__sidebar${D?" nice-app-shell__sidebar--flush":""}`;return e.jsxs("div",{ref:W,id:I,"data-testid":$,className:`nice-app-shell${m?` ${m}`:""}`,style:{height:J,...b},children:[g!=null&&e.jsx("div",{className:`nice-app-shell__menubar${D?" nice-app-shell__chrome--flush":""}`,children:g}),y!=null&&e.jsx("div",{className:`nice-app-shell__toolbar${D?" nice-app-shell__chrome--flush":""}`,children:y}),e.jsxs("div",{className:"nice-app-shell__body",children:[S!=null&&e.jsx("aside",{className:E,style:D?void 0:{width:N},children:S}),e.jsx("main",{className:"nice-app-shell__content",children:F}),A!=null&&e.jsx("aside",{className:`${E} nice-app-shell__sidebar--right`,style:D?void 0:{width:U},children:A})]}),B!=null&&e.jsx("div",{className:`nice-app-shell__bottom${D?" nice-app-shell__bottom--flush":""}`,style:T!=null?{height:T}:void 0,children:B}),G!=null&&e.jsx("div",{className:"nice-app-shell__status",children:G})]})});he.displayName="NiceAppShell";const Xe={id:"",name:"",repository:"",triggers:[],stages:[],variables:[],secrets:[],isEnabled:!0,createdAt:new Date(0),updatedAt:new Date(0)},Ke=[],Ze=[{target:".nice-pipeline-editor",titleKey:"tutorial.pipelineEditor.intro.title",title:"Pipeline editor",contentKey:"tutorial.pipelineEditor.intro.content",content:"Build a CI/CD pipeline from stages, jobs and steps; set triggers, variables and secrets; then validate, save and run it.",placement:"auto"}],Qe={push:"upload",pull_request:"shuffle",schedule:"clock",manual:"cursor",tag:"tag",workflow_dispatch:"zap"},er={script:"file",action:"settings",checkout:"download",upload_artifact:"upload",download_artifact:"download",docker:"box",deploy:"rocket"},Re=({pipeline:g,defaultPipeline:y,templates:S,runners:N=Ke,environments:A,onPipelineChange:U,onStageAdd:F,onStageRemove:B,onStageMove:T,onJobAdd:G,onJobRemove:J,onStepAdd:D,onStepRemove:m,onVariableAdd:b,onVariableRemove:I,onSecretAdd:$,onSecretRemove:W,onTemplateApply:E,onSave:P,onRun:O,onValidate:K,tutorial:Q,className:_,style:C,"data-testid":k})=>{const[x,q]=n.useControllableState({value:g,defaultValue:y,fallbackValue:Xe,onChange:U,componentName:"NicePipelineEditor"}),[z,R]=i.useState("visual"),[re,L]=i.useState(null),[H,ee]=i.useState(null),[d,a]=i.useState(!1),f=x.stages.find(r=>r.id===re),j=f?.jobs.find(r=>r.id===H),s=i.useMemo(()=>{const r=[];return r.push(`name: ${x.name}`),r.push(""),r.push("on:"),x.triggers.forEach(o=>{r.push(` ${o}:`),(o==="push"||o==="pull_request")&&(r.push(" branches:"),r.push(` - ${x.branch||"main"}`))}),r.push(""),x.variables.length>0&&(r.push("env:"),x.variables.filter(o=>!o.isSecret).forEach(o=>{r.push(` ${o.name}: ${o.value}`)}),r.push("")),r.push("jobs:"),x.stages.forEach(o=>{o.jobs.forEach(u=>{r.push(` ${o.name.toLowerCase().replace(/\s+/g,"-")}-${u.name.toLowerCase().replace(/\s+/g,"-")}:`),r.push(` name: ${u.name}`),u.runner&&r.push(` runs-on: ${u.runner}`),o.dependsOn?.length&&r.push(` needs: [${o.dependsOn.join(", ")}]`),r.push(" steps:"),u.steps.forEach(h=>{h.type==="checkout"?r.push(" - uses: actions/checkout@v4"):h.type==="action"&&h.action?(r.push(` - uses: ${h.action}${h.actionVersion?`@${h.actionVersion}`:""}`),h.with&&Object.keys(h.with).length>0&&(r.push(" with:"),Object.entries(h.with).forEach(([V,p])=>{r.push(` ${V}: ${p}`)}))):h.type==="script"&&h.script&&(r.push(` - name: ${h.name}`),r.push(" run: |"),h.script.split(`
10
+ `).forEach(V=>{r.push(` ${V}`)}))})})}),r.join(`
11
+ `)},[x]),M=e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(n.NiceIcon,{name:"settings",size:20}),e.jsx("input",{type:"text",value:x.name,onChange:r=>q({...x,name:r.target.value}),style:{padding:"6px 12px",borderRadius:"4px",border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:"14px",fontWeight:500,width:"250px"}})]}),e.jsx("div",{style:{flex:1}}),e.jsx(n.NiceTutorialButton,{steps:n.resolveTutorial(Q,Ze)}),e.jsx("button",{onClick:()=>a(!0),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"12px"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"clipboard",size:14})," Templates"]})}),e.jsx("button",{onClick:K,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"12px"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," Validate"]})}),e.jsx("button",{onClick:P,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"12px",fontWeight:500},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"save",size:14})," Save"]})}),e.jsx("button",{onClick:O,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-success, #22c55e)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"12px",fontWeight:500},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"play",size:14})," Run Pipeline"]})})]}),v=e.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #1e1e1e)"},children:[{id:"visual",icon:"palette",label:"Visual Editor"},{id:"yaml",icon:"edit",label:"YAML"},{id:"triggers",icon:"zap",label:"Triggers"},{id:"variables",icon:"settings",label:"Variables"}].map(r=>e.jsx("button",{onClick:()=>R(r.id),style:{padding:"10px 20px",border:"none",background:z===r.id?"var(--nice-bg-elevated, #1e1e1e)":"transparent",color:z===r.id?"var(--nice-text-primary, #fff)":"var(--nice-text-muted, #888)",cursor:"pointer",fontSize:"12px",borderBottom:z===r.id?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:r.icon,size:14})," ",r.label]})},r.id))}),l=e.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden",height:"100%"},children:[z==="visual"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{width:"300px",borderRight:"1px solid var(--nice-border-color, #333)",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontWeight:500,fontSize:"13px"},children:"Stages"}),e.jsx("button",{onClick:F,style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Stage"})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"8px"},children:[x.stages.map((r,o)=>e.jsxs("div",{children:[o>0&&e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4px",color:"var(--nice-text-primary, #444)"},children:e.jsx(n.NiceIcon,{name:"arrow-down",size:14})}),e.jsxs("div",{onClick:()=>{L(r.id),ee(null)},style:{padding:"12px",background:re===r.id?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:re===r.id?"1px solid var(--nice-primary, #3b82f6)":"1px solid var(--nice-border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[e.jsx("span",{style:{fontWeight:500,fontSize:"13px"},children:r.name}),e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o>0&&e.jsx("button",{"aria-label":"Move stage up",onClick:u=>{u.stopPropagation(),T(r.id,"up")},style:{padding:"2px 4px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:"2px",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:e.jsx(n.NiceIcon,{name:"arrow-up",size:12})}),o<x.stages.length-1&&e.jsx("button",{"aria-label":"Move stage down",onClick:u=>{u.stopPropagation(),T(r.id,"down")},style:{padding:"2px 4px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:"2px",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:e.jsx(n.NiceIcon,{name:"arrow-down",size:12})}),e.jsx("button",{"aria-label":"Remove stage",onClick:u=>{u.stopPropagation(),B(r.id)},style:{padding:"2px 4px",background:"var(--nice-color-error, #ef4444)",border:"none",borderRadius:"2px",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:e.jsx(n.NiceIcon,{name:"close",size:12})})]})]}),e.jsxs("div",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:[r.jobs.length," job",r.jobs.length!==1?"s":""," •"," ",r.parallel?"Parallel":"Sequential"]})]})]},r.id)),x.stages.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--nice-text-muted, #666)",padding:"24px",fontSize:"12px"},children:"No stages yet. Add a stage to get started."})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:f?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center",background:"var(--nice-bg-elevated, #252525)"},children:[e.jsxs("span",{style:{fontWeight:500},children:["Stage: ",f.name]}),e.jsx("button",{onClick:()=>G(f.id),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-success, #22c55e)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Job"})]}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[e.jsx("div",{style:{width:"200px",borderRight:"1px solid var(--nice-border-color, #333)",overflow:"auto",padding:"8px"},children:f.jobs.map(r=>e.jsxs("div",{onClick:()=>ee(r.id),style:{padding:"10px",marginBottom:"4px",background:H===r.id?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":"var(--nice-bg-elevated, #252525)",borderRadius:"6px",cursor:"pointer",border:H===r.id?"1px solid var(--nice-primary, #3b82f6)":"1px solid transparent"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"12px",fontWeight:500},children:r.name}),e.jsx("button",{"aria-label":"Remove job",onClick:o=>{o.stopPropagation(),J(f.id,r.id)},style:{padding:"2px 4px",background:"var(--nice-color-error, #ef4444)",border:"none",borderRadius:"2px",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"9px"},children:e.jsx(n.NiceIcon,{name:"close",size:11})})]}),e.jsxs("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)",marginTop:"4px"},children:[r.steps.length," steps"]})]},r.id))}),j?e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[e.jsxs("h3",{style:{margin:0,fontSize:"14px"},children:["Job: ",j.name]}),e.jsx("button",{onClick:()=>D(f.id,j.id),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-accent, #8b5cf6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Step"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",marginBottom:"16px",padding:"12px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px"},children:[e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)",display:"block",marginBottom:"4px"},children:"Runner"}),e.jsxs("select",{style:{width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"",children:"Select runner..."}),N.map(r=>e.jsxs("option",{value:r.id,children:[r.name," (",r.os,")"]},r.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)",display:"block",marginBottom:"4px"},children:"Environment"}),e.jsxs("select",{style:{width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"",children:"No environment"}),A.map(r=>e.jsxs("option",{value:r.id,children:[r.name,r.protection?" (protected)":""]},r.id))]})]})]}),j.steps.map((r,o)=>e.jsxs("div",{style:{marginBottom:"8px",padding:"12px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[e.jsx(n.NiceIcon,{name:er[r.type],size:16}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,flex:1},children:r.name}),e.jsx("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)",padding:"2px 6px",background:"var(--nice-bg-tertiary, #333)",borderRadius:"4px"},children:r.type}),e.jsx("button",{"aria-label":"Remove step",onClick:()=>m(f.id,j.id,r.id),style:{padding:"2px 6px",background:"var(--nice-color-error, #ef4444)",border:"none",borderRadius:"4px",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:e.jsx(n.NiceIcon,{name:"close",size:12})})]}),r.type==="script"&&r.script&&e.jsx("pre",{style:{margin:0,padding:"8px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"4px",fontSize:"10px",fontFamily:"monospace",overflow:"auto"},children:r.script}),r.type==="action"&&e.jsxs("div",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:["uses: ",r.action,r.actionVersion&&`@${r.actionVersion}`]})]},r.id)),j.steps.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--nice-text-muted, #666)",padding:"24px",fontSize:"12px"},children:"No steps yet. Add a step to define what this job does."})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)"},children:"Select a job to edit its steps"})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)"},children:"Select a stage to view its jobs"})})]}),z==="yaml"&&e.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:e.jsx("pre",{style:{margin:0,padding:"16px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",fontFamily:"monospace",fontSize:"12px",lineHeight:"1.6",whiteSpace:"pre-wrap"},children:s})}),z==="triggers"&&e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px"},children:[e.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"14px"},children:"Pipeline Triggers"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px"},children:["push","pull_request","schedule","manual","tag","workflow_dispatch"].map(r=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"16px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:x.triggers.includes(r)?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent"},children:[e.jsx("input",{type:"checkbox",checked:x.triggers.includes(r),onChange:o=>{const u=o.target.checked?[...x.triggers,r]:x.triggers.filter(h=>h!==r);q({...x,triggers:u})}}),e.jsx(n.NiceIcon,{name:Qe[r],size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"13px"},children:r.replace("_"," ")}),e.jsxs("div",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:[r==="push"&&"Run on push to branch",r==="pull_request"&&"Run on PR/MR",r==="schedule"&&"Run on schedule (cron)",r==="manual"&&"Manual trigger only",r==="tag"&&"Run on tag push",r==="workflow_dispatch"&&"API/UI trigger"]})]})]},r))})]}),z==="variables"&&e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[e.jsx("h3",{style:{margin:0,fontSize:"14px"},children:"Variables & Secrets"}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsx("button",{onClick:b,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Variable"}),e.jsx("button",{onClick:$,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-warning, #f59e0b)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"lock",size:12})," Add Secret"]})})]})]}),e.jsxs("div",{style:{background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--nice-bg-elevated, #1e1e1e)"},children:[e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontWeight:500},children:"Name"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontWeight:500},children:"Value"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"center",fontWeight:500},children:"Type"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"right",fontWeight:500},children:"Actions"})]})}),e.jsx("tbody",{children:x.variables.map(r=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",fontFamily:"monospace"},children:r.name}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)"},children:r.isSecret?"••••••••":r.value}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",textAlign:"center"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"4px",background:r.isSecret?"var(--nice-warning-tint-15, #f59e0b22)":"var(--nice-primary-tint-15, #3b82f622)",color:r.isSecret?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-primary, #3b82f6)",fontSize:"10px"},children:[r.isSecret&&e.jsx(n.NiceIcon,{name:"lock",size:10}),r.isSecret?"Secret":"Variable"]})}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",textAlign:"right"},children:e.jsx("button",{onClick:()=>I(r.name),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-error, #ef4444)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Remove"})})]},r.name))})]}),x.variables.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:"12px"},children:"No variables defined"})]})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(he,{className:`nice-pipeline-editor ${_||""}`,style:{background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",...C},flush:!0,menubar:M,toolbar:v,"data-testid":k,children:l}),d&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--nice-overlay-70, rgba(0, 0, 0, 0.7))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:e.jsxs("div",{style:{width:"600px",maxHeight:"80vh",background:"var(--nice-bg-elevated, #252525)",borderRadius:"12px",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px",borderBottom:"1px solid var(--nice-border-color, #333)"},children:[e.jsx("span",{style:{fontWeight:600},children:"Pipeline Templates"}),e.jsx("button",{"aria-label":"Close templates",onClick:()=>a(!1),style:{background:"none",border:"none",color:"var(--nice-text-muted, #888)",cursor:"pointer",fontSize:"18px"},children:e.jsx(n.NiceIcon,{name:"close",size:18})})]}),e.jsx("div",{style:{maxHeight:"60vh",overflow:"auto",padding:"16px"},children:S.map(r=>e.jsxs("div",{onClick:()=>{E(r),a(!1)},style:{display:"flex",alignItems:"center",gap:"16px",padding:"16px",marginBottom:"8px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"8px",cursor:"pointer"},children:[e.jsx(n.NiceIcon,{name:r.icon,size:32}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:r.name}),e.jsx("div",{style:{fontSize:"12px",color:"var(--nice-text-muted, #888)"},children:r.description}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #666)",marginTop:"4px"},children:r.category})]})]},r.id))})]})})]})},rr=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineEditor:Re},Symbol.toStringTag,{value:"Module"})),ir=[],xe={queued:{color:"var(--nice-text-muted, #6b7280)",icon:"clock",label:"Queued"},pending:{color:"var(--nice-text-muted, #6b7280)",icon:"clock",label:"Pending"},waiting:{color:"var(--nice-color-warning, #f59e0b)",icon:"pause",label:"Waiting"},in_progress:{color:"var(--nice-color-primary, #3b82f6)",icon:"refresh",label:"In Progress"},running:{color:"var(--nice-color-primary, #3b82f6)",icon:"refresh",label:"Running"},completed:{color:"var(--nice-color-success, #22c55e)",icon:"check",label:"Completed"},success:{color:"var(--nice-color-success, #22c55e)",icon:"check",label:"Success"},failed:{color:"var(--nice-color-error, #ef4444)",icon:"close",label:"Failed"},failure:{color:"var(--nice-color-error, #ef4444)",icon:"close",label:"Failed"},cancelled:{color:"var(--nice-text-muted, #6b7280)",icon:"close",label:"Cancelled"},skipped:{color:"var(--nice-text-muted, #6b7280)",icon:"skip-forward",label:"Skipped"}},Ne=({runs:g=ir,stats:y,selectedRunId:S,onRunSelect:N,onCancel:A,onRerun:U,onRerunFromStage:F,onDownloadArtifact:B,onDownloadLogs:T,onApprove:G,onReject:J,className:D,style:m,"data-testid":b})=>{const[I,$]=i.useState("all"),[W,E]=i.useState("all"),[P,O]=i.useState(new Set),[K,Q]=i.useState(new Set),[_,C]=i.useState(null),k=g.find(d=>d.id===S),x=i.useMemo(()=>g.filter(d=>!(I!=="all"&&d.status!==I||W!=="all"&&d.branch!==W)),[g,I,W]),q=i.useMemo(()=>[...new Set(g.map(d=>d.branch))],[g]),z=d=>{if(!d)return"-";const a=Math.floor(d/1e3);if(a<60)return`${a}s`;const f=Math.floor(a/60),j=a%60;if(f<60)return`${f}m ${j}s`;const s=Math.floor(f/60),M=f%60;return`${s}h ${M}m`},R=d=>d?new Date(d).toLocaleString():"-",re=d=>d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`,L=d=>{O(a=>{const f=new Set(a);return f.has(d)?f.delete(d):f.add(d),f})},H=d=>{Q(a=>{const f=new Set(a);return f.has(d)?f.delete(d):f.add(d),f})},ee=()=>{if(!_||!k)return[];for(const d of k.stages)for(const a of d.jobs)if(a.id===_.jobId)return a.steps.find(j=>j.id===_.stepId)?.logs||[];return[]};return e.jsxs("div",{className:`nice-pipeline-monitor ${D||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",...m},"data-testid":b,children:[e.jsxs("div",{style:{width:"400px",borderRight:"1px solid var(--nice-border-color, #333)",display:"flex",flexDirection:"column"},children:[y&&e.jsx("div",{style:{padding:"16px",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"12px",textAlign:"center"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-primary, #3b82f6)"},children:y.totalRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:"Total Runs"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-success, #22c55e)"},children:[y.successRate.toFixed(0),"%"]}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:"Success Rate"})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-warning, #f59e0b)"},children:z(y.avgDuration)}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:"Avg Duration"})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-error, #ef4444)"},children:y.failedRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:"Failed"})]})]})}),e.jsxs("div",{style:{padding:"12px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:"8px"},children:[e.jsxs("select",{value:I,onChange:d=>$(d.target.value),style:{flex:1,padding:"6px",borderRadius:"4px",border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"in_progress",children:"In Progress"}),e.jsx("option",{value:"completed",children:"Completed"}),e.jsx("option",{value:"failed",children:"Failed"}),e.jsx("option",{value:"cancelled",children:"Cancelled"})]}),e.jsxs("select",{value:W,onChange:d=>E(d.target.value),style:{flex:1,padding:"6px",borderRadius:"4px",border:"1px solid var(--nice-border-color, #444)",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"all",children:"All Branches"}),q.map(d=>e.jsx("option",{value:d,children:d},d))]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[x.map(d=>{const a=xe[d.status];return e.jsxs("div",{onClick:()=>N(d.id),style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",cursor:"pointer",background:S===d.id?"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))":"transparent"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[e.jsx("span",{style:{display:"inline-flex",color:a.color,animation:d.status==="in_progress"?"spin 1s linear infinite":"none"},children:e.jsx(n.NiceIcon,{name:a.icon,size:16})}),e.jsxs("span",{style:{flex:1,fontWeight:500,fontSize:"13px"},children:[d.pipelineName," #",d.runNumber]}),e.jsx("span",{style:{padding:"2px 8px",borderRadius:"4px",background:`${a.color}22`,color:a.color,fontSize:"10px"},children:a.label})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:12})," ",d.branch]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:d.commit.sha.slice(0,7)}),e.jsx("span",{children:"•"}),e.jsx("span",{children:z(d.duration)})]}),e.jsx("div",{style:{marginTop:"6px",fontSize:"11px",color:"var(--nice-text-muted, #666)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.commit.message})]},d.id)}),x.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:"12px"},children:"No pipeline runs match the filters"})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:k?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid var(--nice-border-color, #333)",background:"var(--nice-bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},children:[e.jsxs("div",{children:[e.jsxs("h2",{style:{margin:"0 0 4px 0",fontSize:"16px",fontWeight:500},children:[k.pipelineName," #",k.runNumber]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",fontSize:"12px",color:"var(--nice-text-muted, #888)"},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[k.commit.authorAvatar&&e.jsx("img",{src:k.commit.authorAvatar,alt:"",style:{width:"16px",height:"16px",borderRadius:"50%"}}),k.commit.author]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:12})," ",k.branch]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"edit",size:12})," ",k.commit.sha.slice(0,7)]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[(k.status==="in_progress"||k.status==="queued"||k.status==="waiting")&&e.jsx("button",{onClick:()=>A(k.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-error, #ef4444)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"Cancel"}),e.jsx("button",{onClick:()=>U(k.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-color-primary, #3b82f6)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"Re-run"}),e.jsxs("button",{onClick:()=>T(k.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"11px",display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"download",size:14})," Logs"]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px"},children:[e.jsxs("span",{children:["Started: ",R(k.startedAt)]}),k.completedAt&&e.jsxs("span",{children:["Completed: ",R(k.completedAt)]}),e.jsxs("span",{children:["Duration: ",z(k.duration)]})]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[e.jsx("div",{style:{marginBottom:"24px"},children:k.stages.map((d,a)=>{const f=xe[d.status],j=P.has(d.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{onClick:()=>L(d.id),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:`2px solid ${f.color}44`},children:[e.jsx("span",{style:{color:"var(--nice-text-muted, #666)",display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:j?"chevron-down":"chevron-right",size:14})}),e.jsx("span",{style:{display:"inline-flex",color:f.color},children:e.jsx(n.NiceIcon,{name:f.icon,size:16})}),e.jsx("span",{style:{flex:1,fontWeight:500},children:d.name}),e.jsx("span",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:z(d.duration)}),d.status==="waiting"&&G&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s=>{s.stopPropagation(),G(k.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-success, #22c55e)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Approve"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),J?.(k.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-color-error, #ef4444)",color:"var(--nice-text-on-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Reject"})]}),e.jsx("button",{onClick:s=>{s.stopPropagation(),F(k.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--nice-bg-tertiary, #333)",color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Re-run from here"})]}),j&&e.jsx("div",{style:{marginLeft:"32px",marginTop:"8px"},children:d.jobs.map(s=>{const M=xe[s.status],v=K.has(s.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{onClick:()=>H(s.id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"6px",cursor:"pointer",borderLeft:`3px solid ${M.color}`},children:[e.jsx("span",{style:{color:"var(--nice-text-muted, #666)",display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:v?"chevron-down":"chevron-right",size:12})}),e.jsx("span",{style:{display:"inline-flex",color:M.color},children:e.jsx(n.NiceIcon,{name:M.icon,size:14})}),e.jsx("span",{style:{flex:1,fontSize:"12px"},children:s.name}),s.runner&&e.jsxs("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #666)",display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"monitor",size:12})," ",s.runner]}),e.jsx("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:z(s.duration)})]}),v&&e.jsx("div",{style:{marginLeft:"24px",marginTop:"4px"},children:s.steps.map(l=>{const r=xe[l.status];return e.jsxs("div",{onClick:()=>C({jobId:s.id,stepId:l.id}),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 10px",marginBottom:"2px",background:"transparent",borderRadius:"4px",cursor:l.logs?.length?"pointer":"default"},children:[e.jsx("span",{style:{display:"inline-flex",color:r.color},children:e.jsx(n.NiceIcon,{name:r.icon,size:12})}),e.jsx("span",{style:{flex:1,fontSize:"11px"},children:l.name}),e.jsx("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:z(l.duration)}),l.logs?.length?e.jsx("span",{style:{display:"inline-flex",color:"var(--nice-text-muted, #666)"},children:e.jsx(n.NiceIcon,{name:"file",size:10})}):null]},l.id)})})]},s.id)})}),a<k.stages.length-1&&e.jsx("div",{style:{marginLeft:"24px",padding:"4px 0",color:"var(--nice-text-primary, #444)",display:"flex"},children:e.jsx(n.NiceIcon,{name:"arrow-down",size:14})})]},d.id)})}),k.artifacts.length>0&&e.jsxs("div",{style:{marginTop:"24px"},children:[e.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"13px",color:"var(--nice-text-muted, #888)"},children:"Artifacts"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"8px"},children:k.artifacts.map(d=>e.jsxs("div",{onClick:()=>B(d),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer"},children:[e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:"box",size:24})}),e.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[e.jsx("div",{style:{fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.name}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:re(d.size)})]}),e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:"download",size:16})})]},d.id))})]})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)"},children:"Select a pipeline run to view details"})}),_&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:e.jsxs("div",{style:{width:"80%",height:"80%",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontWeight:500},children:"Step Logs"}),e.jsx("button",{onClick:()=>C(null),"aria-label":"Close logs",style:{background:"none",border:"none",color:"var(--nice-text-muted, #888)",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:e.jsx(n.NiceIcon,{name:"close",size:18})})]}),e.jsx("div",{style:{flex:1,overflow:"auto",padding:"12px"},children:e.jsx("pre",{style:{margin:0,fontFamily:"monospace",fontSize:"11px",lineHeight:"1.5",whiteSpace:"pre-wrap",color:"var(--nice-text-secondary, #d4d4d4)"},children:ee().join(`
12
+ `)||"No logs available"})})]})}),e.jsx("style",{children:`
13
+ @keyframes spin {
14
+ from { transform: rotate(0deg); }
15
+ to { transform: rotate(360deg); }
16
+ }
17
+ `})]})},nr=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineMonitor:Ne},Symbol.toStringTag,{value:"Module"}));exports.NiceAppShell=he;exports.NiceBranchManager=ke;exports.NiceBranchManager$1=Ee;exports.NiceGitBlame=ze;exports.NiceGitBlame$1=qe;exports.NiceGitConflictResolver=we;exports.NiceGitConflictResolver$1=Ue;exports.NiceGitDiffViewer=Ce;exports.NiceGitDiffViewer$1=Fe;exports.NiceGitGraph=je;exports.NiceGitGraph$1=Pe;exports.NiceGitHooks=Ie;exports.NiceGitHooks$1=Ye;exports.NiceMergeRequestBuilder=Se;exports.NiceMergeRequestBuilder$1=Oe;exports.NicePipelineEditor=Re;exports.NicePipelineEditor$1=rr;exports.NicePipelineMonitor=Ne;exports.NicePipelineMonitor$1=nr;exports.useIgnoredPropChangeWarning=ve;
package/dist/devops.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./devops-AqIppm8_.cjs");exports.NiceBranchManager=e.NiceBranchManager;exports.NiceGitBlame=e.NiceGitBlame;exports.NiceGitConflictResolver=e.NiceGitConflictResolver;exports.NiceGitDiffViewer=e.NiceGitDiffViewer;exports.NiceGitGraph=e.NiceGitGraph;exports.NiceGitHooks=e.NiceGitHooks;exports.NiceMergeRequestBuilder=e.NiceMergeRequestBuilder;exports.NicePipelineEditor=e.NicePipelineEditor;exports.NicePipelineMonitor=e.NicePipelineMonitor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./devops-rVpB0ZAX.cjs");exports.NiceBranchManager=e.NiceBranchManager;exports.NiceGitBlame=e.NiceGitBlame;exports.NiceGitConflictResolver=e.NiceGitConflictResolver;exports.NiceGitDiffViewer=e.NiceGitDiffViewer;exports.NiceGitGraph=e.NiceGitGraph;exports.NiceGitHooks=e.NiceGitHooks;exports.NiceMergeRequestBuilder=e.NiceMergeRequestBuilder;exports.NicePipelineEditor=e.NicePipelineEditor;exports.NicePipelineMonitor=e.NicePipelineMonitor;
package/dist/devops.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a, b as c, c as s, d as r, e as t, f as o, g as N, h as l, i as n } from "./devops-Dxhp-Qj2.js";
1
+ import { a, b as c, c as s, d as r, e as t, f as o, g as N, h as l, i as n } from "./devops-D5yIDM3e.js";
2
2
  export {
3
3
  a as NiceBranchManager,
4
4
  c as NiceGitBlame,
package/dist/editors.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./pickerCommons-CMgL5F67.cjs"),i=require("./NiceForm-Ke5HC628.cjs"),e=require("./NiceMention-0WgTAXE9.cjs"),o=require("./NiceSelect-C-Q3AJKj.cjs"),N=require("./NiceColorPicker-Dib7qP88.cjs"),t=require("./NiceHtmlEditor-CROQAv7y.cjs"),r=require("./NiceCodeEditor-8W1SGems.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceTextInput=c.NiceTextInput;exports.NiceToggle=c.NiceToggle;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceSelect=o.NiceSelect;exports.NiceColorPicker=N.NiceColorPicker;exports.NiceHtmlEditor=t.NiceHtmlEditor;exports.NiceCodeEditor=r.NiceCodeEditor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./no-code-6WyYb3hL.cjs"),i=require("./NiceForm-BCEXovJR.cjs"),e=require("./NiceMention-DcaUEMSg.cjs"),o=require("./NiceSelect-tMz9QQUs.cjs"),N=require("./pickerCommons-BFbItm8o.cjs"),t=require("./NiceColorPicker-DtPFxDKM.cjs"),r=require("./NiceHtmlEditor-BYk1roA4.cjs"),n=require("./NiceCodeEditor-BJSEzhcY.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceTextInput=c.NiceTextInput;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceSelect=o.NiceSelect;exports.NiceToggle=N.NiceToggle;exports.NiceColorPicker=t.NiceColorPicker;exports.NiceHtmlEditor=r.NiceHtmlEditor;exports.NiceCodeEditor=n.NiceCodeEditor;
package/dist/editors.d.ts CHANGED
@@ -295,7 +295,8 @@ export declare const NiceAutocomplete: default_2.FC<NiceAutocompleteProps>;
295
295
 
296
296
  /** Props for the {@link NiceAutocomplete} component — a text input with filtered suggestion dropdown and optional multi-select. */
297
297
  export declare interface NiceAutocompleteProps extends NiceFormFieldProps {
298
- options: NiceOption[];
298
+ /** Suggestions to pick from. Optional: without them the field is a plain text input. */
299
+ options?: NiceOption[];
299
300
  /** Single value or array of values if multiple=true (controlled). Omit it to let the field keep its own. */
300
301
  value?: string | string[];
301
302
  /** Initial value when uncontrolled. */
@@ -312,8 +313,6 @@ export declare interface NiceAutocompleteProps extends NiceFormFieldProps {
312
313
  renderOption?: (option: NiceOption, query: string) => default_2.ReactNode;
313
314
  /** Highlight matching text in suggestions (default true). */
314
315
  highlightMatch?: boolean;
315
- /** Alias for options — array of string suggestions. */
316
- suggestions?: (string | NiceOption)[];
317
316
  /**
318
317
  * When `true` (default), focusing the field (before typing) opens the dropdown
319
318
  * with **all** options sorted alphabetically. Set `false` to only show
@@ -833,16 +832,6 @@ export declare interface NiceCountryPickerProps extends NiceFormFieldProps, Dual
833
832
  showSearch?: boolean;
834
833
  /** Search placeholder */
835
834
  searchPlaceholder?: string;
836
- /**
837
- * @deprecated Use `showDialCodeInValue` and `showDialCodeInMenu` for fine-grained control.
838
- * When set, applies to both trigger and menu (legacy behaviour).
839
- */
840
- showDialCode?: boolean;
841
- /**
842
- * @deprecated Use `showFlagInValue` and `showFlagInMenu` for fine-grained control.
843
- * When set, applies to both trigger and menu (legacy behaviour).
844
- */
845
- showFlag?: boolean;
846
835
  /** Show dial code in trigger (selected value). Default: false (compact) */
847
836
  showDialCodeInValue?: boolean;
848
837
  /** Show dial code in dropdown options. Default: true */
@@ -1012,11 +1001,6 @@ export declare interface NiceDateRangeBoxProps extends NiceFormFieldProps {
1012
1001
  * browser locale. The emitted value stays ISO regardless of display locale.
1013
1002
  */
1014
1003
  locale?: string;
1015
- /**
1016
- * @deprecated Use `dateFormatPreset`. Native input type forwarded to both
1017
- * inner pickers.
1018
- */
1019
- type?: 'date' | 'datetime-local' | 'time' | 'month' | 'week';
1020
1004
  /**
1021
1005
  * How the end date is constrained relative to the start (default
1022
1006
  * `'greater-or-equal'` — the end can equal the start).
@@ -1062,12 +1046,7 @@ export declare interface NiceDateTimePickerProps extends NiceFormFieldProps {
1062
1046
  min?: string;
1063
1047
  /** Maximum selectable date (passed to the hidden native picker). */
1064
1048
  max?: string;
1065
- /**
1066
- * @deprecated Use `dateFormatPreset` instead.
1067
- * Input type — `'date'`, `'datetime-local'`, `'time'`, `'month'`, or `'week'`.
1068
- */
1069
- type?: 'date' | 'datetime-local' | 'time' | 'month' | 'week';
1070
- /** Date format preset. Takes precedence over `type`. */
1049
+ /** Date format preset — what the field holds and how it is shown (default: a local date). */
1071
1050
  dateFormatPreset?: NiceDateFormatPreset;
1072
1051
  /** Placeholder text. Defaults to a derived placeholder (e.g. `dd.MM.yyyy`). */
1073
1052
  placeholder?: string;
@@ -2309,6 +2288,11 @@ export declare interface NiceSelectProps extends NiceFormFieldProps {
2309
2288
  renderOption?: (option: NiceOption, isSelected: boolean) => default_2.ReactNode;
2310
2289
  /** When true (default false), the trigger width grows to fit selected items in `multiple` mode. When false, width stays fixed. */
2311
2290
  multipleAutosize?: boolean;
2291
+ /**
2292
+ * Accessible name when the select has no visible `label` (a toolbar filter, a compact row).
2293
+ * It used to be dropped: the trigger had no name at all.
2294
+ */
2295
+ 'aria-label'?: string;
2312
2296
  }
2313
2297
 
2314
2298
  export declare const NiceSignature: default_2.ForwardRefExoticComponent<NiceSignatureProps & default_2.RefAttributes<NiceSignatureRef>>;
@@ -2592,8 +2576,6 @@ declare interface NiceTreeSelectNode {
2592
2576
  label: string;
2593
2577
  children?: NiceTreeSelectNode[];
2594
2578
  disabled?: boolean;
2595
- /** @deprecated Icons are no longer rendered — prop kept for backward compatibility. */
2596
- icon?: default_2.ReactNode;
2597
2579
  }
2598
2580
 
2599
2581
  /** Props for the {@link NiceTreeSelect} component — a dropdown that lets the user pick from a tree hierarchy. */