@nice2dev/ui 1.3.6 → 1.3.8

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 (59) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/NiceCodeEditor-B5YtKZOe.js +1222 -0
  3. package/dist/NiceCodeEditor-D0QZW88r.cjs +268 -0
  4. package/dist/NiceColorPicker-Bzvei7D6.cjs +1 -0
  5. package/dist/NiceColorPicker-DzzJhSXT.js +552 -0
  6. package/dist/NiceDataGrid-BSaBBoNr.js +2267 -0
  7. package/dist/NiceDataGrid-C_E6zIGS.cjs +10 -0
  8. package/dist/NiceForm-D2P6XuaT.cjs +1 -0
  9. package/dist/NiceForm-_kaB4Ikt.js +5017 -0
  10. package/dist/NiceHtmlEditor-CBCJdjmy.cjs +10 -0
  11. package/dist/NiceHtmlEditor-DfkdSxL3.js +901 -0
  12. package/dist/NiceLoginForm-BFvbroGJ.js +820 -0
  13. package/dist/NiceLoginForm-FGf32sro.cjs +1 -0
  14. package/dist/NiceMention-CctjYriS.cjs +430 -0
  15. package/dist/NiceMention-umOghLCf.js +11653 -0
  16. package/dist/NiceModal-BRVzjuUN.cjs +1 -0
  17. package/dist/NiceModal-CU9FqzIH.js +83 -0
  18. package/dist/NiceModuleLifecyclePanel-DQT_forg.js +7404 -0
  19. package/dist/NiceModuleLifecyclePanel-DtOlPChV.cjs +1 -0
  20. package/dist/NicePagination-CK4ZJgu4.cjs +1 -0
  21. package/dist/NicePagination-flHgG-FT.js +200 -0
  22. package/dist/NicePivotGrid-99ZeQ9j6.js +1180 -0
  23. package/dist/NicePivotGrid-CpsBxUhq.cjs +152 -0
  24. package/dist/NiceSavedQueryPanel-Br1LQR7u.js +5311 -0
  25. package/dist/NiceSavedQueryPanel-C4SU6W22.cjs +586 -0
  26. package/dist/NiceScheduler-CeYqH0Ux.cjs +5 -0
  27. package/dist/NiceScheduler-yTpVRxfe.js +1710 -0
  28. package/dist/NiceSelect-C3NqDYwR.js +495 -0
  29. package/dist/NiceSelect-CTwSAb8G.cjs +1 -0
  30. package/dist/charts-B0tHOpJ7.cjs +768 -0
  31. package/dist/charts-C3u-VyJj.js +5019 -0
  32. package/dist/charts.cjs +1 -1
  33. package/dist/charts.mjs +1 -1
  34. package/dist/core-lazy-Bglo0hFt.cjs +1 -0
  35. package/dist/core-lazy-CRBgQkQl.js +351 -0
  36. package/dist/data.cjs +1 -1
  37. package/dist/data.mjs +3 -3
  38. package/dist/devops-Bzp3ZqZ3.cjs +18 -0
  39. package/dist/devops-fLElpPvD.js +9128 -0
  40. package/dist/devops.cjs +1 -1
  41. package/dist/devops.mjs +1 -1
  42. package/dist/editors.cjs +1 -1
  43. package/dist/editors.d.ts +5 -0
  44. package/dist/editors.mjs +7 -7
  45. package/dist/feedback.cjs +1 -1
  46. package/dist/feedback.mjs +3 -3
  47. package/dist/index.cjs +251 -251
  48. package/dist/index.d.ts +76 -9
  49. package/dist/index.mjs +15550 -15248
  50. package/dist/lazy.cjs +1 -1
  51. package/dist/lazy.mjs +18 -18
  52. package/dist/navigation.cjs +1 -1
  53. package/dist/navigation.d.ts +42 -3
  54. package/dist/navigation.mjs +2 -2
  55. package/dist/no-code-Bt7SWzsN.js +8318 -0
  56. package/dist/no-code-DnT061qn.cjs +331 -0
  57. package/dist/no-code.cjs +1 -1
  58. package/dist/no-code.mjs +1 -1
  59. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("@nice2dev/ui-core"),o=require("react"),qe=require("react-dom");function Se(l){const h=l?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");if(!h)return"";const z=h.getAttribute("data-theme");return z==="dark"||h.classList.contains("nice-dark")||h.classList.contains("dark")?"nice-dark":z==="light"||h.classList.contains("nice-light")?"nice-light":""}const Ge={info:e.jsx(n.NiceIcon,{name:"info",size:28}),warning:e.jsx(n.NiceIcon,{name:"warning",size:28}),error:e.jsx(n.NiceIcon,{name:"error",size:28}),success:e.jsx(n.NiceIcon,{name:"success",size:28})},Ce=({visible:l,message:h,header:z,icon:B,variant:_="warning",acceptLabel:L,rejectLabel:$,onAccept:A,onReject:T,closeOnOverlay:N=!1,closeOnEscape:k=!0,showReject:O=!0,size:R="md",className:S,style:C,testId:j,"data-testid":M})=>{const{t:w}=n.useNiceTranslation(),i=o.useRef(null),b=$??w("confirm.reject","No");if(n.useOverlayFocus(i,{open:l,onClose:T,closeOnEscape:k,closeHint:O?b:void 0}),o.useEffect(()=>(l?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[l]),!l)return null;const Y=B??Ge[_],y=L??w("confirm.accept","Yes");return e.jsx("div",{className:"nice-modal-overlay",role:"presentation",onClick:K=>{K.stopPropagation(),N&&K.target===K.currentTarget&&T()},onKeyDown:K=>{K.key!=="Escape"&&K.stopPropagation()},children:e.jsxs("div",{ref:i,className:`nice-confirm nice-confirm--${_} nice-confirm--${R} ${S||""}`,style:C,role:"alertdialog","aria-modal":"true","aria-label":z,"aria-describedby":"nice-confirm-message","data-testid":M??j,children:[z&&e.jsx("div",{className:"nice-confirm__header",children:e.jsx("h3",{className:"nice-confirm__title",children:z})}),e.jsxs("div",{className:"nice-confirm__body",children:[Y&&e.jsx("div",{className:`nice-confirm__icon nice-confirm__icon--${_}`,children:Y}),e.jsx("div",{id:"nice-confirm-message",className:"nice-confirm__message",children:h})]}),e.jsxs("div",{className:"nice-confirm__footer",children:[O&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--ghost nice-btn--md",onClick:T,children:b}),e.jsx("button",{type:"button",className:`nice-btn nice-btn--${_==="error"?"error":"primary"} nice-btn--md`,onClick:A,autoFocus:!0,children:y})]})]})})},je=new Set,Ke=(l,h)=>{if(Object.is(l,h))return!0;try{return JSON.stringify(l)===JSON.stringify(h)}catch{return!1}};function we(l,h,z,B,_,L="on its own the prop is only the initial value"){const $=o.useRef(B);if(process.env.NODE_ENV==="production"||_){$.current=B;return}const A=`${l}.${h}`;B!==void 0&&!je.has(A)&&!Ke(B,$.current)&&(je.add(A),console.warn(`[Nice2Dev] <${l}> \`${h}\` changed after mount without \`${z}\`, so the change is ignored: ${L}. Pass \`${z}\` to control it.`)),$.current=B}const me=[],be=["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)"],ve=24,ze=40,Re=28,Ve=6,Ue=4;function Ye(l,h,z,B){const _=[],L=[],$=new Map;l.forEach((R,S)=>$.set(R.hash,S));const A=new Map,T=[],N=new Map;let k=0;const O=new Map;if(h.forEach(R=>{if(!R.lastCommit)return;const S=O.get(R.lastCommit)||[];S.push({type:R.isRemote?"remote":"branch",name:R.name,commit:R.lastCommit,color:R.isHead?"var(--nice-color-success, #22c55e)":R.isRemote?"var(--nice-text-muted, #6b7280)":"var(--nice-color-primary, #3b82f6)"}),O.set(R.lastCommit,S)}),z.forEach(R=>{const S=O.get(R.commit)||[];S.push({type:"tag",name:R.name,commit:R.commit,color:"var(--nice-color-warning, #f59e0b)"}),O.set(R.commit,S)}),B){const R=O.get(B)||[];R.push({type:"head",name:"HEAD",commit:B,color:"var(--nice-color-error, #ef4444)"}),O.set(B,R)}return l.forEach((R,S)=>{let C=T.findIndex(M=>M===R.hash);C===-1&&(C=T.findIndex(M=>M===null),C===-1&&(C=T.length,T.push(null))),N.has(C)||(N.set(C,be[k%be.length]),k++),A.set(R.hash,C);const j=N.get(C)||be[0];_.push({commit:R,x:C,y:S,color:j,refs:O.get(R.hash)||[]}),R.parents.forEach((M,w)=>{const i=$.get(M);if(i!==void 0){let b=A.get(M);b===void 0&&(w===0?(b=C,T[C]=M):(b=T.findIndex(y=>y===null),b===-1?(b=T.length,T.push(M)):T[b]=M),A.set(M,b));const Y=N.get(b)||j;L.push({from:R.hash,to:M,fromX:C,fromY:S,toX:b,toY:i,color:w===0?j:Y,type:w===0?C===b?"straight":"branch":"merge"})}}),(R.parents.length===0||!l.slice(S+1).some(M=>M.parents.includes(R.hash)))&&(T[C]=null)}),{nodes:_,edges:L}}const Je=({nodes:l,edges:h,selectedHash:z,compact:B,onNodeClick:_,onNodeDoubleClick:L})=>{const $=B?Re:ze,A=B?Ue:Ve,N=(Math.max(...l.map(S=>S.x),0)+2)*ve,k=(l.length+1)*$,O=S=>ve/2+S*ve,R=S=>$/2+S*$;return e.jsxs("svg",{width:N,height:k,style:{minWidth:N,minHeight:k,display:"block"},children:[h.map((S,C)=>{const j=O(S.fromX),M=R(S.fromY),w=O(S.toX),i=R(S.toY);if(S.type==="straight")return e.jsx("line",{x1:j,y1:M,x2:w,y2:i,stroke:S.color,strokeWidth:2},C);const b=(M+i)/2,Y=`M ${j} ${M} C ${j} ${b}, ${w} ${b}, ${w} ${i}`;return e.jsx("path",{d:Y,fill:"none",stroke:S.color,strokeWidth:2,strokeDasharray:S.type==="merge"?"4,2":void 0},C)}),l.map(S=>{const C=O(S.x),j=R(S.y),M=S.commit.hash===z,w=S.commit.isMerge;return e.jsxs("g",{onClick:()=>_(S.commit.hash),onDoubleClick:()=>L(S.commit.hash),style:{cursor:"pointer"},children:[M&&e.jsx("circle",{cx:C,cy:j,r:A+4,fill:"none",stroke:"var(--nice-bg, #fff)",strokeWidth:2}),e.jsx("circle",{cx:C,cy:j,r:A,fill:w?"var(--nice-bg-elevated, #1e1e1e)":S.color,stroke:S.color,strokeWidth:w?2:0}),S.refs.length>0&&!B&&e.jsx("foreignObject",{x:C+10,y:j-8,width:200,height:16,children:e.jsx("div",{style:{display:"flex",gap:4,whiteSpace:"nowrap"},children:S.refs.map((i,b)=>e.jsxs("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:10,fontWeight:500,background:`${i.color}22`,color:i.color,border:`1px solid ${i.color}44`},children:[i.type==="tag"?e.jsx(n.NiceIcon,{name:"tag",size:10}):i.type==="head"?e.jsx(n.NiceIcon,{name:"cursor",size:10}):null,(i.type==="tag"||i.type==="head")&&" ",i.name]},b))})})]},S.commit.hash)})]})},Ie=({commits:l=me,branches:h=me,tags:z=me,head:B,selectedCommit:_,branchFilter:L,authorFilter:$,dateRange:A,searchQuery:T,maxCommits:N=100,showRemotes:k=!0,showTags:O=!0,compact:R=!1,onCommitSelect:S,onCommitDoubleClick:C,onBranchCheckout:j,onBranchCreate:M,onTagCreate:w,onCherryPick:i,onRevert:b,onReset:Y,onCompare:y,onViewDiff:K,className:G,style:P,"data-testid":c})=>{const{t:a,lang:W}=n.useNiceTranslation(),[D,J]=o.useState(_),[X,Z]=o.useState(null),[V,Q]=o.useState(!1),[f,x]=o.useState(null),g=o.useRef(null),E=_??D,p=o.useMemo(()=>{let m=l;if(L&&L.length>0){const v=new Set;h.filter(F=>L.includes(F.name)).forEach(F=>{F.lastCommit&&v.add(F.lastCommit)}),m=m.filter(F=>v.has(F.hash))}if($&&$.length>0&&(m=m.filter(v=>$.some(F=>v.author.name.toLowerCase().includes(F.toLowerCase())||v.author.email.toLowerCase().includes(F.toLowerCase())))),A&&(A.from&&(m=m.filter(v=>v.date>=A.from)),A.to&&(m=m.filter(v=>v.date<=A.to))),T&&T.trim()){const v=T.toLowerCase();m=m.filter(F=>F.hash.toLowerCase().includes(v)||F.shortHash.toLowerCase().includes(v)||F.message.toLowerCase().includes(v)||F.author.name.toLowerCase().includes(v))}return m.slice(0,N)},[l,L,$,A,T,N,h]),{nodes:H,edges:q}=o.useMemo(()=>Ye(p,k?h:h.filter(m=>!m.isRemote),O?z:[],B),[p,h,z,B,k,O]),s=o.useMemo(()=>p.find(m=>m.hash===E),[p,E]),t=o.useCallback(m=>{if(V&&f)y?.(f,m),Q(!1),x(null);else if(V)x(m);else{J(m);const v=p.find(F=>F.hash===m);v&&S?.(v)}},[V,f,p,S,y]),d=o.useCallback(m=>{const v=p.find(F=>F.hash===m);v&&(C?.(v),K?.(m))},[p,C,K]),u=o.useCallback((m,v)=>{m.preventDefault(),Z({x:m.clientX,y:m.clientY,commit:v})},[]),I=o.useCallback(()=>Z(null),[]),te=m=>{const F=new Date().getTime()-m.getTime(),ne=Math.floor(F/(1e3*60*60*24));return ne===0?a("gitGraph.today","Today"):ne===1?a("gitGraph.yesterday","Yesterday"):ne<7?new Intl.RelativeTimeFormat(W).format(-ne,"day"):m.toLocaleDateString(W)},ee=R?Re:ze;return e.jsxs("div",{role:"presentation",className:`nice-git-graph ${G||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...P},"data-testid":c,onClick:I,children:[e.jsxs("div",{ref:g,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(Je,{nodes:H,edges:q,selectedHash:E,compact:R,onNodeClick:t,onNodeDoubleClick:d})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[H.map(m=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>t(m.commit.hash),onDoubleClick:()=>d(m.commit.hash),onContextMenu:v=>u(v,m.commit),style:{height:ee,padding:"0 12px",display:"flex",alignItems:"center",gap:12,cursor:"pointer",background:m.commit.hash===E?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderBottom:"1px solid var(--nice-bg-secondary, #2a2a2a)"},children:[m.commit.author.avatar?e.jsx("img",{src:m.commit.author.avatar,alt:"",style:{width:R?20:24,height:R?20:24,borderRadius:"50%",flexShrink:0}}):e.jsx("div",{style:{width:R?20:24,height:R?20:24,borderRadius:"50%",background:m.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:R?10:12,color:"var(--nice-color-white, #fff)",fontWeight:600,flexShrink:0},children:m.commit.author.name.charAt(0).toUpperCase()}),e.jsx("div",{style:{flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:R?12:13},children:m.commit.message}),m.commit.stats&&!R&&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:["+",m.commit.stats.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",m.commit.stats.deletions]})]}),e.jsx("code",{style:{fontSize:R?10:11,color:"var(--nice-text-muted, #888)",fontFamily:"monospace",flexShrink:0},children:m.commit.shortHash}),!R&&e.jsx("span",{style:{fontSize:11,color:"var(--nice-text-muted, #888)",flexShrink:0,width:100},children:m.commit.author.name}),e.jsx("span",{style:{fontSize:R?10:11,color:"var(--nice-text-muted, #666)",flexShrink:0,width:R?60:80,textAlign:"right"},children:te(m.commit.date)})]},m.commit.hash)),p.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:13},children:a("gitGraph.noCommitsMatchTheFilters","No commits match the filters")})]})]}),s&&!R&&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:[s.author.avatar?e.jsx("img",{src:s.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:s.author.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:13},children:s.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:s.author.email})]})]}),e.jsx("code",{style:{fontSize:11,color:"var(--nice-text-muted, #888)",fontFamily:"monospace"},children:s.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:s.message}),s.body&&e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #aaa)",whiteSpace:"pre-wrap",maxHeight:120,overflow:"auto"},children:s.body})]}),s.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:s.stats.filesChanged}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:a("gitGraph.filesChanged","files changed")})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--nice-color-success, #22c55e)"},children:["+",s.stats.additions]}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:a("gitGraph.additions","additions")})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--nice-color-error, #ef4444)"},children:["-",s.stats.deletions]}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:a("gitGraph.deletions","deletions")})]})]}),e.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("button",{onClick:()=>K?.(s.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:a("gitGraph.viewChanges","View Changes")}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>i?.(s.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:a("gitGraph.cherryPick","Cherry Pick")}),e.jsx("button",{onClick:()=>b?.(s.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:a("gitGraph.revert","Revert")})]}),e.jsx("button",{onClick:()=>M?.(s.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:a("gitGraph.createBranchHere","Create Branch Here")}),e.jsx("button",{onClick:()=>w?.(s.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:a("gitGraph.createTagHere","Create Tag Here")}),e.jsx("button",{onClick:()=>{Q(!0),x(s.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:a("gitGraph.compareWith","Compare with...")})]})]}),V&&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:[f?a("gitGraph.selectCommitToCompareWith","Select commit to compare with {compareBase}").replace("{compareBase}",String(f.slice(0,7))):a("gitGraph.selectFirstCommit","Select first commit"),e.jsx("button",{onClick:()=>{Q(!1),x(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:a("gitGraph.cancel","Cancel")})]}),X&&e.jsx("div",{style:{position:"fixed",left:X.x,top:X.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:a("gitGraph.viewChanges","View Changes"),onClick:()=>K?.(X.commit.hash)},{label:a("gitGraph.cherryPick","Cherry Pick"),onClick:()=>i?.(X.commit.hash)},{label:a("gitGraph.revert","Revert"),onClick:()=>b?.(X.commit.hash)},{divider:!0},{label:a("gitGraph.createBranch","Create Branch"),onClick:()=>M?.(X.commit.hash)},{label:a("gitGraph.createTag","Create Tag"),onClick:()=>w?.(X.commit.hash)},{divider:!0},{label:a("gitGraph.resetSoft","Reset Soft"),onClick:()=>Y?.(X.commit.hash,"soft")},{label:a("gitGraph.resetMixed","Reset Mixed"),onClick:()=>Y?.(X.commit.hash,"mixed")},{label:a("gitGraph.resetHard","Reset Hard"),onClick:()=>Y?.(X.commit.hash,"hard"),danger:!0}].map((m,v)=>"divider"in m?e.jsx("div",{style:{height:1,background:"var(--nice-bg-tertiary, #444)",margin:"4px 0"}},v):e.jsx("button",{onClick:()=>{m.onClick?.(),I()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in m&&m.danger?"var(--nice-color-error, #ef4444)":"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:F=>{F.currentTarget.style.background="var(--nice-bg-tertiary, #333)"},onMouseOut:F=>{F.currentTarget.style.background="transparent"},children:m.label},v))})]})},Xe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitGraph:Ie},Symbol.toStringTag,{value:"Module"})),ye=({open:l,onSubmit:h,onCancel:z,title:B,message:_,defaultValue:L="",placeholder:$,inputType:A="text",confirmLabel:T,cancelLabel:N,className:k="",style:O,testId:R,"data-testid":S})=>{const{t:C}=n.useNiceTranslation(),[j,M]=o.useState(L),w=o.useRef(null),i=o.useRef(null);return o.useEffect(()=>{l&&M(L)},[l,L]),n.useOverlayFocus(i,{open:l,onClose:z,initialFocus:w,closeHint:typeof N=="string"?N:void 0}),l?e.jsx("div",{className:`nice-prompt-dialog ${k}`,style:O,role:"presentation",onClick:b=>{b.target===b.currentTarget&&z()},onKeyDown:b=>{b.key!=="Escape"&&b.stopPropagation()},children:e.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-labelledby":"nice-prompt-title",className:"nice-prompt-dialog__panel","data-testid":S??R,children:[e.jsx("h2",{id:"nice-prompt-title",className:"nice-prompt-dialog__title",children:B}),_&&e.jsx("p",{className:"nice-prompt-dialog__message",children:_}),e.jsx("input",{ref:w,type:A,value:j,placeholder:$,className:"nice-prompt-dialog__input",onChange:b=>M(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),h(j))}}),e.jsxs("div",{className:"nice-prompt-dialog__actions",children:[e.jsx("button",{type:"button",className:"nice-prompt-dialog__btn nice-prompt-dialog__btn--cancel",onClick:z,children:N??C("cancel","Cancel")}),e.jsx("button",{type:"button",className:"nice-prompt-dialog__btn nice-prompt-dialog__btn--confirm",onClick:()=>h(j),children:T??C("ok","OK")})]})]})}):null};process.env.NODE_ENV!=="production"&&(ye.displayName="NicePromptDialog");function Ne(){const[l,h]=o.useState(null),z=o.useRef(null),B=o.useCallback(N=>{const k=z.current;k&&(k.kind==="prompt"?k.resolve(null):k.resolve(!1)),z.current=N,h(N)},[]),_=o.useCallback(()=>{z.current=null,h(null)},[]),L=o.useCallback(N=>new Promise(k=>B({kind:"prompt",request:N,resolve:k})),[B]),$=o.useCallback(N=>new Promise(k=>B({kind:"confirm",request:N,resolve:k})),[B]),A=o.useCallback(N=>new Promise(k=>B({kind:"alert",request:N,resolve:()=>k()})),[B]);let T=null;if(l?.kind==="prompt"){const{resolve:N,request:k}=l;T=e.jsx(ye,{open:!0,...k,onSubmit:O=>{_(),N(O)},onCancel:()=>{_(),N(null)}})}else if(l){const{resolve:N,request:k,kind:O}=l;T=e.jsx(Ce,{visible:!0,...k,variant:k.variant??(O==="alert"?"info":"warning"),showReject:O!=="alert",onAccept:()=>{_(),N(!0)},onReject:()=>{_(),N(!1)}})}return{prompt:L,confirm:$,alert:A,element:T}}const Ze=[],Be=({branches:l=Ze,currentBranch:h,defaultBranch:z="main",protectionRules:B=[],showRemotes:_=!0,selectedBranch:L,onBranchSelect:$,onCheckout:A,onCreateBranch:T,onDeleteBranch:N,onRenameBranch:k,onMerge:O,onRebase:R,onSetUpstream:S,onPush:C,onPull:j,onCompare:M,onProtectionChange:w,className:i,style:b,"data-testid":Y})=>{const{t:y,lang:K}=n.useNiceTranslation(),G=Ne(),[P,c]=o.useState(""),[a,W]=o.useState("all"),[D,J]=o.useState(),[X,Z]=o.useState(!1),[V,Q]=o.useState(!1),[f,x]=o.useState(!1),[g,E]=o.useState(""),[p,H]=o.useState(h||z),[q,s]=o.useState(""),[t,d]=o.useState(h||z),[u,I]=o.useState(null),te=L??D,ee=o.useMemo(()=>{let r=l;if(a==="local"?r=r.filter(U=>!U.isRemote):a==="remote"?r=r.filter(U=>U.isRemote):_||(r=r.filter(U=>!U.isRemote)),P.trim()){const U=P.toLowerCase();r=r.filter(ie=>ie.name.toLowerCase().includes(U))}return r.sort((U,ie)=>U.isHead?-1:ie.isHead?1:U.name===z?-1:ie.name===z?1:U.isRemote!==ie.isRemote?U.isRemote?1:-1:U.name.localeCompare(ie.name))},[l,a,_,P,z]),m=o.useMemo(()=>{const r=ee.filter(ie=>!ie.isRemote),U=ee.filter(ie=>ie.isRemote);return{local:r,remote:U}},[ee]),v=o.useCallback(r=>{J(r),$?.(r)},[$]),F=o.useCallback((r,U)=>{r.preventDefault(),I({x:r.clientX,y:r.clientY,branch:U})},[]),ne=o.useCallback(()=>I(null),[]),ce=o.useCallback(()=>{g.trim()&&(T?.(g.trim(),p),E(""),Z(!1))},[g,p,T]),he=o.useCallback(()=>{q&&t&&q!==t&&(O?.(q,t),Q(!1))},[q,t,O]),xe=r=>{if(!r)return"-";const ie=new Date().getTime()-r.getTime(),se=Math.floor(ie/(1e3*60*60*24));if(se===0)return y("branchManager.today","Today");if(se===1)return y("branchManager.yesterday","Yesterday");const ue=new Intl.RelativeTimeFormat(K);return se<7?ue.format(-se,"day"):se<30?ue.format(-Math.floor(se/7),"week"):r.toLocaleDateString(K)},re=o.useMemo(()=>l.find(r=>r.name===te),[l,te]),de=o.useCallback(r=>B.some(U=>new RegExp(U.pattern.replace(/\*/g,".*")).test(r)),[B]),ae=m.local,oe=r=>{const U=r.name===te,ie=r.isHead,se=r.name===z,ue=de(r.name);return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>v(r.name),onDoubleClick:()=>A?.(r.name),onContextMenu:We=>F(We,r),style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",cursor:"pointer",background:U?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":ie?"color-mix(in srgb, var(--nice-color-success, #22c55e) 8%, transparent)":"transparent",borderLeft:ie?"3px solid var(--nice-success, #22c55e)":"3px solid transparent"},children:[e.jsx(n.NiceIcon,{name:r.isRemote?"cloud":ie?"map-pin":"box",size:16}),e.jsx("span",{style:{flex:1,fontSize:13,fontWeight:ie?600:400,color:ie?"var(--nice-color-success, #22c55e)":"var(--nice-text-primary, #e0e0e0)"},children:r.name}),e.jsxs("div",{style:{display:"flex",gap:4},children:[se&&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 color-mix(in srgb, var(--nice-color-primary, #3b82f6) 27%, transparent)"},children:y("branchManager.default","default")}),ue&&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 color-mix(in srgb, var(--nice-color-warning, #f59e0b) 27%, transparent)"},children:[e.jsx(n.NiceIcon,{name:"lock",size:10})," ",y("branchManager.protected","protected")]})]}),r.upstream&&(r.ahead||r.behind)&&e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10,color:"var(--nice-text-muted, #888)"},children:[r.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}),r.ahead]}):null,r.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}),r.behind]}):null]}),r.lastCommit&&e.jsx("span",{style:{fontSize:10,color:"var(--nice-text-muted, #666)",width:80,textAlign:"right"},children:xe(r.lastCommit.date)})]},r.name)};return e.jsxs("div",{role:"presentation",className:`nice-branch-manager ${i||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...b},"data-testid":Y,onClick:ne,children:[G.element,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:y("branchManager.branches","Branches")}),e.jsx("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--nice-bg-tertiary, #333)",borderRadius:10,fontSize:11},children:y("branchManager.local","{branches} local").replace("{branches}",String(l.filter(r=>!r.isRemote).length))})]}),e.jsx("input",{type:"text",placeholder:y("branchManager.searchBranches","Search branches..."),value:P,onChange:r=>c(r.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(r=>e.jsx("button",{onClick:()=>W(r),style:{flex:1,padding:"6px 0",borderRadius:4,border:"none",background:a===r?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:a===r?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11,textTransform:"capitalize"},children:r},r))})]}),e.jsxs("div",{style:{padding:8,borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:8},children:[e.jsxs("button",{onClick:()=>Z(!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})," ",y("branchManager.newBranch","New Branch")]}),e.jsxs("button",{onClick:()=>Q(!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})," ",y("branchManager.merge","Merge")]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[m.local.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"8px 12px",fontSize:10,fontWeight:600,color:"var(--nice-text-muted, #888)",textTransform:"uppercase",background:"var(--nice-bg-elevated, #252525)"},children:y("branchManager.local2","Local ({local})").replace("{local}",String(m.local.length))}),m.local.map(oe)]}),_&&m.remote.length>0&&a!=="local"&&e.jsxs(e.Fragment,{children:[e.jsx("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:y("branchManager.remote","Remote ({remote})").replace("{remote}",String(m.remote.length))}),m.remote.map(oe)]}),ee.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:12},children:y("branchManager.noBranchesMatchTheFilter","No branches match the filter")})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:re?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:re.isRemote?"cloud":re.isHead?"map-pin":"box",size:24}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600},children:re.name}),re.description&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--nice-text-muted, #888)"},children:re.description})]}),re.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})," ",y("branchManager.current","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:y("branchManager.upstream","Upstream")}),e.jsx("div",{style:{fontSize:13},children:re.upstream||e.jsx("span",{style:{color:"var(--nice-text-muted, #666)"},children:y("branchManager.notSet","Not set")})})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #888)",marginBottom:4},children:y("branchManager.syncStatus","Sync Status")}),e.jsx("div",{style:{display:"flex",gap:8,fontSize:13},children:re.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("branchManager.ahead","{ahead} ahead").replace("{ahead}",String(re.ahead||0))]}),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("branchManager.behind","{behind} behind").replace("{behind}",String(re.behind||0))]})]}):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:y("branchManager.lastCommit","Last Commit")}),e.jsx("div",{style:{fontSize:13},children:re.lastCommit?e.jsxs(e.Fragment,{children:[e.jsx("code",{style:{fontSize:11,color:"var(--nice-text-muted, #aaa)"},children:re.lastCommit.hash.slice(0,7)})," ",xe(re.lastCommit.date)]}):e.jsx("span",{style:{color:"var(--nice-text-muted, #666)"},children:"-"})})]})]}),re.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:re.lastCommit.message}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:y("branchManager.by","by {author}").replace("{author}",String(re.lastCommit.author))})]})]}),e.jsx("div",{style:{padding:16},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8},children:[!re.isHead&&e.jsxs("button",{onClick:()=>A?.(re.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})," ",y("branchManager.checkout","Checkout")]}),re.upstream&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>j?.(re.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})," ",y("branchManager.pull","Pull")]}),e.jsxs("button",{onClick:()=>C?.(re.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})," ",y("branchManager.push","Push")]})]}),!re.upstream&&!re.isRemote&&e.jsx("button",{onClick:()=>S?.(re.name,`origin/${re.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:y("branchManager.setUpstream","Set Upstream")}),e.jsxs("button",{onClick:()=>{s(re.name),d(h||z),Q(!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})," ",y("branchManager.mergeInto","Merge into...")]}),e.jsxs("button",{onClick:()=>M?.(z,re.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})," ",y("branchManager.compare","Compare")]}),!re.isHead&&!re.isRemote&&!de(re.name)&&e.jsxs("button",{onClick:()=>N?.(re.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})," ",y("branchManager.delete","Delete")]})]})})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)",fontSize:13},children:y("branchManager.selectABranchToView","Select a branch to view details")})}),X&&e.jsx("div",{role:"presentation",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:()=>Z(!1),children:e.jsxs("div",{role:"presentation",style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:24},onClick:r=>r.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:y("branchManager.createNewBranch","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:y("branchManager.branchName","Branch Name")}),e.jsx("input",{type:"text",placeholder:y("branchManager.featureMyFeature","feature/my-feature"),value:g,onChange:r=>E(r.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:y("branchManager.basedOn","Based on")}),e.jsx("select",{value:p,onChange:r=>H(r.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(r=>e.jsxs("option",{value:r.name,children:[r.name," ",r.isHead?y("branchManager.current2","(current)"):""]},r.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>Z(!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:y("branchManager.cancel","Cancel")}),e.jsx("button",{onClick:ce,disabled:!g.trim(),style:{padding:"10px 20px",borderRadius:6,border:"none",background:g.trim()?"var(--nice-color-success, #22c55e)":"var(--nice-bg-tertiary, #333)",color:g.trim()?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:g.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:y("branchManager.createBranch","Create Branch")})]})]})}),V&&e.jsx("div",{role:"presentation",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(!1),children:e.jsxs("div",{role:"presentation",style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:24},onClick:r=>r.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:y("branchManager.mergeBranches","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:y("branchManager.mergeFrom","Merge from")}),e.jsxs("select",{value:q,onChange:r=>s(r.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:y("branchManager.selectBranch","Select branch...")}),ae.map(r=>e.jsx("option",{value:r.name,children:r.name},r.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})," ",y("branchManager.into","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:y("branchManager.mergeInto2","Merge into")}),e.jsx("select",{value:t,onChange:r=>d(r.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(r=>e.jsxs("option",{value:r.name,children:[r.name," ",r.isHead?y("branchManager.current2","(current)"):""]},r.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>Q(!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:y("branchManager.cancel","Cancel")}),e.jsx("button",{onClick:he,disabled:!q||!t||q===t,style:{padding:"10px 20px",borderRadius:6,border:"none",background:q&&t&&q!==t?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:q&&t&&q!==t?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:q&&t&&q!==t?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:y("branchManager.merge","Merge")})]})]})}),u&&e.jsx("div",{style:{position:"fixed",left:u.x,top:u.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:[!u.branch.isHead&&{label:y("branchManager.checkout","Checkout"),onClick:()=>A?.(u.branch.name)},{label:y("branchManager.compare","Compare"),onClick:()=>M?.(z,u.branch.name)},{label:y("branchManager.mergeIntoCurrent","Merge into current"),onClick:()=>O?.(u.branch.name,h||z)},{divider:!0},!u.branch.isRemote&&{label:y("branchManager.rename","Rename"),onClick:()=>{const r=u.branch.name;G.prompt({title:y("branchManager.renamePrompt","New branch name"),defaultValue:r}).then(U=>{U&&k?.(r,U)})}},!u.branch.isHead&&!u.branch.isRemote&&!de(u.branch.name)&&{label:y("branchManager.delete","Delete"),onClick:()=>N?.(u.branch.name),danger:!0}].filter(Boolean).map((r,U)=>r?"divider"in r?e.jsx("div",{style:{height:1,background:"var(--nice-bg-tertiary, #444)",margin:"4px 0"}},U):e.jsx("button",{onClick:()=>{r.onClick?.(),ne()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in r&&r.danger?"var(--nice-color-error, #ef4444)":"var(--nice-text-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:ie=>ie.currentTarget.style.background="var(--nice-bg-tertiary, #333)",onMouseOut:ie=>ie.currentTarget.style.background="transparent",children:r.label},U):null)})]})},Qe=Object.freeze(Object.defineProperty({__proto__:null,NiceBranchManager:Be},Symbol.toStringTag,{value:"Module"})),et=[],tt=[{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"}],Me=({branches:l=et,users:h=[],labels:z=[],issues:B=[],templates:_=[],diff:L,currentBranch:$,defaultTargetBranch:A="main",initialSourceBranch:T,platform:N="github",onSubmit:k,onCancel:O,onBranchChange:R,onPreview:S,tutorial:C,className:j,style:M,"data-testid":w})=>{const{t:i}=n.useNiceTranslation(),[b,Y]=o.useState(""),[y,K]=o.useState(""),[G,P]=o.useState(T||$||""),[c,a]=o.useState(A),[W,D]=o.useState(!1),[J,X]=o.useState([]),[Z,V]=o.useState([]),[Q,f]=o.useState([]),[x,g]=o.useState([]),[E,p]=o.useState(!1),[H,q]=o.useState(!0),[s,t]=o.useState(!1),[d,u]=o.useState(!1),[I,te]=o.useState(!1),[ee,m]=o.useState(!1),v=o.useMemo(()=>G?G.replace(/^(feature|bugfix|hotfix|release)\//,"").replace(/[-_]/g," ").replace(/\b\w/g,U=>U.toUpperCase()):"",[G]),F=o.useMemo(()=>l.filter(r=>!r.isRemote),[l]),ne=o.useCallback((r,U)=>{P(r),a(U),R?.(r,U)},[R]),ce=o.useCallback(()=>{if(!G||!c||!b.trim())return;const r={title:b.trim(),description:y.trim(),sourceBranch:G,targetBranch:c,isDraft:W,labels:J,reviewers:Z,assignees:Q,linkedIssues:x,squashCommits:E,deleteSourceBranch:H};k?.(r)},[b,y,G,c,W,J,Z,Q,x,E,H,k]),he=r=>{K(r.content),m(!1)},xe=r=>{X(U=>U.includes(r)?U.filter(ie=>ie!==r):[...U,r])},re=r=>{V(U=>U.includes(r)?U.filter(ie=>ie!==r):[...U,r])},de=r=>{g(U=>U.includes(r)?U.filter(ie=>ie!==r):[...U,r])},ae={github:{title:i("mergeRequestBuilder.pullRequest","Pull Request"),btn:"Create Pull Request"},gitlab:{title:i("mergeRequestBuilder.mergeRequest","Merge Request"),btn:"Create Merge Request"},bitbucket:{title:i("mergeRequestBuilder.pullRequest","Pull Request"),btn:"Create Pull Request"},azure:{title:i("mergeRequestBuilder.pullRequest","Pull Request"),btn:"Create Pull Request"}},oe=G&&c&&G!==c&&b.trim();return e.jsxs("div",{className:`nice-merge-request-builder ${j||""}`,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",...M},"data-testid":w,children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:20},children:e.jsx(n.NiceTutorialButton,{steps:n.resolveTutorial(C,tt)})}),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:[W?`${i("mergeRequestBuilder.draft","Draft")} `:"",ae[N].title]}),e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--nice-text-muted, #888)"},children:N==="gitlab"?i("mergeRequestBuilder.createMergeRequest","Create a new merge request"):i("mergeRequestBuilder.createPullRequest","Create a new 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:i("mergeRequestBuilder.from","From")}),e.jsxs("select",{value:G,onChange:r=>ne(r.target.value,c),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:i("mergeRequestBuilder.selectSourceBranch","Select source branch...")}),F.map(r=>e.jsx("option",{value:r.name,children:r.name},r.name))]})]}),e.jsx("div",{style:{padding:"20px 0 0"},children:e.jsx("span",{style:{fontSize:20,color:"var(--nice-text-muted, #888)"},children:e.jsx(n.NiceIcon,{name:"arrow-right",size:20})})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:11,color:"var(--nice-text-muted, #888)",marginBottom:4},children:i("mergeRequestBuilder.into","Into")}),e.jsx("select",{value:c,onChange:r=>ne(G,r.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:F.map(r=>e.jsx("option",{value:r.name,children:r.name},r.name))})]})]}),L&&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.jsx("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:i("mergeRequestBuilder.additions","+{additions} additions").replace("{additions}",String(L.additions))}),e.jsx("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:i("mergeRequestBuilder.deletions","-{deletions} deletions").replace("{deletions}",String(L.deletions))}),e.jsx("span",{style:{color:"var(--nice-text-muted, #888)"},children:i("mergeRequestBuilder.filesChanged","{changedFiles} files changed").replace("{changedFiles}",String(L.changedFiles))})]}),G===c&&G&&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:i("mergeRequestBuilder.sourceAndTargetBranchesCannot","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:i("mergeRequestBuilder.title","Title")}),e.jsx("input",{type:"text",value:b,onChange:r=>Y(r.target.value),placeholder:v||i("mergeRequestBuilder.enterATitle","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}}),!b&&v&&e.jsx("button",{onClick:()=>Y(v),style:{marginTop:4,padding:0,background:"none",border:"none",color:"var(--nice-color-primary, #3b82f6)",fontSize:11,cursor:"pointer"},children:i("mergeRequestBuilder.useSuggested",'Use suggested: "{suggestedTitle}"').replace("{suggestedTitle}",String(v))})]}),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:i("mergeRequestBuilder.description","Description")}),_.length>0&&e.jsxs("button",{onClick:()=>m(!ee),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})," ",i("mergeRequestBuilder.templates","Templates")]})]}),e.jsx("textarea",{value:y,onChange:r=>K(r.target.value),placeholder:i("mergeRequestBuilder.describeYourChanges","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"}})]}),ee&&_.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:i("mergeRequestBuilder.selectTemplate","Select Template")}),_.map(r=>e.jsxs("button",{onClick:()=>he(r),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:r.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:r.description})]},r.id))]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:16,marginBottom:20},children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>t(!s),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})," ",i("mergeRequestBuilder.labels","Labels")]}),J.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-primary, #3b82f6)"},children:["(",J.length,")"]})]})}),s&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:z.map(r=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:J.includes(r.id),onChange:()=>xe(r.id)}),e.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:r.color}}),e.jsx("span",{style:{fontSize:12},children:r.name})]},r.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>u(!d),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})," ",i("mergeRequestBuilder.reviewers","Reviewers")]}),Z.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["(",Z.length,")"]})]})}),d&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:h.map(r=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:Z.includes(r.id),onChange:()=>re(r.id)}),r.avatar?e.jsx("img",{src:r.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:r.name[0]}),e.jsx("span",{style:{fontSize:12},children:r.name})]},r.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>te(!I),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})," ",i("mergeRequestBuilder.linkedIssues","Linked Issues")]}),x.length>0&&e.jsxs("span",{style:{color:"var(--nice-color-accent, #8b5cf6)"},children:["(",x.length,")"]})]})}),I&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--nice-bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:B.filter(r=>r.state==="open").map(r=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:x.includes(r.id),onChange:()=>de(r.id)}),e.jsxs("span",{style:{fontSize:12,color:"var(--nice-text-muted, #888)"},children:["#",r.number]}),e.jsx("span",{style:{fontSize:12,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.title})]},r.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:W,onChange:r=>D(r.target.checked)}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"edit",size:14})," ",i("mergeRequestBuilder.createAsDraft","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:i("mergeRequestBuilder.mergeOptions","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:E,onChange:r=>p(r.target.checked)}),i("mergeRequestBuilder.squashCommitsOnMerge","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:H,onChange:r=>q(r.target.checked)}),i("mergeRequestBuilder.deleteSourceBranchAfterMerge","Delete source branch after merge")]})]})]}),L&&L.files.length>0&&e.jsxs("div",{style:{background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:16},children:[e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #888)",marginBottom:12},children:i("mergeRequestBuilder.changedFiles","Changed Files ({changedFiles})").replace("{changedFiles}",String(L.changedFiles))}),e.jsx("div",{style:{maxHeight:200,overflow:"auto"},children:L.files.map(r=>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:r.status==="added"?"var(--nice-color-success, #22c55e)":r.status==="deleted"?"var(--nice-color-error, #ef4444)":r.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:r.status==="added"?"+":r.status==="deleted"?"-":r.status==="renamed"?"R":"M"}),e.jsx("span",{style:{flex:1,fontFamily:"monospace",fontSize:11},children:r.path}),e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)",fontSize:11},children:["+",r.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)",fontSize:11},children:["-",r.deletions]})]},r.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:O,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:i("mergeRequestBuilder.cancel","Cancel")}),e.jsx("button",{onClick:()=>S?.({title:b,description:y,sourceBranch:G,targetBranch:c,isDraft:W,labels:J,reviewers:Z,assignees:Q,linkedIssues:x,squashCommits:E,deleteSourceBranch:H}),disabled:!oe,style:{padding:"10px 20px",borderRadius:6,border:"none",background:oe?"var(--nice-bg-tertiary, #333)":"var(--nice-bg-elevated, #222)",color:oe?"var(--nice-text-primary, #fff)":"var(--nice-text-muted, #666)",cursor:oe?"pointer":"not-allowed",fontSize:13},children:i("mergeRequestBuilder.preview","Preview")}),e.jsx("button",{onClick:ce,disabled:!oe,style:{padding:"10px 24px",borderRadius:6,border:"none",background:oe?"var(--nice-color-success, #22c55e)":"var(--nice-bg-elevated, #222)",color:oe?"var(--nice-color-white, #fff)":"var(--nice-text-muted, #666)",cursor:oe?"pointer":"not-allowed",fontSize:13,fontWeight:500},children:W?i("mergeRequestBuilder.createDraft","Create Draft"):ae[N].btn})]})]})},nt=Object.freeze(Object.defineProperty({__proto__:null,NiceMergeRequestBuilder:Me},Symbol.toStringTag,{value:"Module"})),rt=[],Ee=({files:l=rt,viewMode:h,showWhitespace:z,comments:B=[],selectedFile:_,showFileTree:L=!0,contextLines:$=3,baseRef:A,headRef:T,onFileSelect:N,onViewModeChange:k,onAddComment:O,onResolveComment:R,onExpandChunk:S,className:C,style:j,"data-testid":M})=>{const{t:w}=n.useNiceTranslation(),[i,b]=o.useState("split"),[Y,y]=o.useState(!1),[K,G]=o.useState(void 0),[P,c]=o.useState(new Set),[a,W]=o.useState(null),D=h??i,J=z??Y,X=_??K??l[0]?.path,Z=o.useMemo(()=>l.find(s=>s.path===X),[l,X]),V=o.useMemo(()=>({additions:l.reduce((s,t)=>s+t.additions,0),deletions:l.reduce((s,t)=>s+t.deletions,0)}),[l]),Q=o.useCallback(s=>{G(s),N?.(s)},[N]),f=o.useCallback(s=>{b(s),k?.(s)},[k]),x=o.useCallback((s,t)=>{const d=`${s}:${t}`;c(u=>{const I=new Set(u);return I.has(d)?I.delete(d):I.add(d),I}),S?.(s,t)},[S]),g=o.useMemo(()=>B.filter(s=>s.filePath===X),[B,X]),E=s=>{switch(s){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:"R",color:"var(--nice-color-primary, #3b82f6)"};case"copied":return{icon:"C",color:"var(--nice-color-accent, #8b5cf6)"}}},p=(s,t,d)=>{const u=s.type==="addition"?"var(--nice-success-tint-10, rgba(34, 197, 94, 0.1))":s.type==="deletion"?"var(--nice-danger-tint-10, rgba(239, 68, 68, 0.1))":s.type==="header"?"var(--nice-primary-tint-10, rgba(59, 130, 246, 0.1))":"transparent",I=s.type==="addition"?"var(--nice-success-text, #4ade80)":s.type==="deletion"?"var(--nice-danger-text, #f87171)":s.type==="header"?"var(--nice-info-text, #60a5fa)":"var(--nice-text-primary, #e0e0e0)",te=d==="old"?s.lineNumberOld:d==="new"?s.lineNumberNew:void 0,ee=J?s.content.replace(/ /g,"·").replace(/\t/g,"→ "):s.content;return e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:u,minHeight:20,fontSize:12,fontFamily:'"JetBrains Mono", "Fira Code", monospace'},children:[te!==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:te}),D==="unified"&&e.jsx("div",{style:{width:20,textAlign:"center",color:I,fontWeight:600},children:s.type==="addition"?"+":s.type==="deletion"?"-":" "}),e.jsx("div",{style:{flex:1,padding:"0 8px",color:I,whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:ee||" "}),O&&te&&s.type!=="header"&&e.jsx("button",{type:"button",onClick:()=>W({filePath:X,line:te,side:d||"new",body:""}),style:{width:24,border:"none",background:"transparent",color:"var(--nice-color-primary, #3b82f6)",cursor:"pointer",opacity:.3,transition:"opacity 0.2s"},onMouseEnter:m=>m.currentTarget.style.opacity="1",onMouseLeave:m=>m.currentTarget.style.opacity="0.3",onFocus:m=>m.currentTarget.style.opacity="1",onBlur:m=>m.currentTarget.style.opacity="0.3","aria-label":w("gitDiffViewer.addComment","Add comment"),children:e.jsx(n.NiceIcon,{name:"message",size:14})})]},`${t}-${d||"unified"}`)},H=s=>e.jsx("div",{style:{borderTop:"1px solid var(--nice-border-color, #333)"},children:s.chunks.map((t,d)=>{const u=`${s.path}:${d}`;return P.has(u),e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>x(s.path,d),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:["@@ -",t.oldStart,",",t.oldLines," +",t.newStart,",",t.newLines," @@"," ",t.header||""]}),t.lines.map((I,te)=>p(I,te))]},d)})}),q=s=>e.jsx("div",{style:{borderTop:"1px solid var(--nice-border-color, #333)"},children:s.chunks.map((t,d)=>{const u=[],I=[];for(const ee of t.lines)(ee.type==="deletion"||ee.type==="context")&&u.push(ee),(ee.type==="addition"||ee.type==="context")&&I.push(ee);const te=Math.max(u.length,I.length);for(;u.length<te;)u.push({content:"",type:"context"});for(;I.length<te;)I.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:["@@ -",t.oldStart,",",t.oldLines," +",t.newStart,",",t.newLines," @@"," ",t.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((ee,m)=>p(ee,m,"old"))}),e.jsx("div",{style:{flex:1},children:I.map((ee,m)=>p(ee,m,"new"))})]})]},d)})});return e.jsxs("div",{className:`nice-git-diff-viewer ${C||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...j},"data-testid":M,children:[L&&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:w("gitDiffViewer.changedFiles","Changed Files")}),e.jsx("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--nice-bg-tertiary, #333)",borderRadius:10,fontSize:11},children:l.length})]}),(A||T)&&e.jsxs("div",{style:{fontSize:11,color:"var(--nice-text-muted, #888)"},children:[A&&e.jsx("span",{children:A}),A&&T&&e.jsx("span",{style:{margin:"0 4px"},children:e.jsx(n.NiceIcon,{name:"arrow-right",size:12})}),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:["+",V.additions]}),e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",V.deletions]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:l.map(s=>{const t=E(s.status),d=s.path===X;return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>Q(s.path),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",cursor:"pointer",background:d?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderLeft:d?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent"},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:2,background:t.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--nice-color-white, #fff)",fontWeight:600},children:t.icon}),e.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.path.split("/").pop()}),e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10},children:[s.additions>0&&e.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:["+",s.additions]}),s.deletions>0&&e.jsxs("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:["-",s.deletions]})]})]},s.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:[Z&&e.jsx("div",{style:{flex:1,fontSize:13,fontFamily:"monospace"},children:Z.oldPath&&Z.oldPath!==Z.path?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"var(--nice-color-error, #ef4444)"},children:Z.oldPath}),e.jsx("span",{style:{margin:"0 8px",color:"var(--nice-text-muted, #888)"},children:e.jsx(n.NiceIcon,{name:"arrow-right",size:12})}),e.jsx("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:Z.path})]}):Z.path}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>f("unified"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:D==="unified"?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:D==="unified"?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:w("gitDiffViewer.unified","Unified")}),e.jsx("button",{onClick:()=>f("split"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:D==="split"?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:D==="split"?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:11},children:w("gitDiffViewer.split","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:J,onChange:s=>y(s.target.checked)}),w("gitDiffViewer.showWhitespace","Show whitespace")]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:Z?Z.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:w("gitDiffViewer.binaryFileCannotBeDisplayed","Binary file cannot be displayed")})]}):D==="split"?q(Z):H(Z):e.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--nice-text-muted, #666)"},children:w("gitDiffViewer.selectAFileToView","Select a file to view changes")})}),g.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.jsx("div",{style:{padding:"8px 16px",fontSize:12,fontWeight:600,borderBottom:"1px solid var(--nice-border-color, #333)"},children:w("gitDiffViewer.comments","Comments ({fileComments})").replace("{fileComments}",String(g.length))}),g.map(s=>e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--nice-border-color, #333)",opacity:s.resolved?.5:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.author.avatar?e.jsx("img",{src:s.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:s.author.name[0]}),e.jsx("span",{style:{fontSize:12,fontWeight:500},children:s.author.name}),e.jsx("span",{style:{fontSize:10,color:"var(--nice-text-muted, #888)"},children:(s.side==="old"?w("gitDiffViewer.lineOld","Line {line} (old)"):w("gitDiffViewer.lineNew","Line {line} (new)")).replace("{line}",String(s.line))}),s.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:w("gitDiffViewer.resolved","Resolved")}),R&&!s.resolved&&e.jsx("button",{onClick:()=>R(s.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:w("gitDiffViewer.resolve","Resolve")})]}),e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-secondary, #ccc)"},children:s.body})]},s.id))]}),a&&e.jsx("div",{role:"presentation",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:()=>W(null),children:e.jsxs("div",{role:"presentation",style:{width:400,background:"var(--nice-bg-elevated, #252525)",borderRadius:8,padding:20},onClick:s=>s.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 12px",fontSize:14},children:w("gitDiffViewer.addCommentOnLine","Add comment on line {line}").replace("{line}",String(a.line))}),e.jsx("textarea",{value:a.body,onChange:s=>W({...a,body:s.target.value}),placeholder:w("gitDiffViewer.writeAComment","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:()=>W(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:w("gitDiffViewer.cancel","Cancel")}),e.jsx("button",{onClick:()=>{a.body.trim()&&(O?.(a.filePath,a.line,a.side,a.body.trim()),W(null))},disabled:!a.body.trim(),style:{padding:"8px 16px",borderRadius:4,border:"none",background:a.body.trim()?"var(--nice-color-primary, #3b82f6)":"var(--nice-bg-tertiary, #333)",color:a.body.trim()?"var(--nice-color-white, #fff)":"var(--nice-text-primary, #fff)",cursor:a.body.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:w("gitDiffViewer.addComment2","Add Comment")})]})]})})]})]})},it=Object.freeze(Object.defineProperty({__proto__:null,NiceGitDiffViewer:Ee},Symbol.toStringTag,{value:"Module"})),ot=(l,h)=>{const B=new Date().getTime()-l.getTime(),_=Math.floor(B/(1e3*60*60*24));return _===0?"today":_===1?"yesterday":_<7?`${_} days ago`:_<30?`${Math.floor(_/7)} weeks ago`:_<365?`${Math.floor(_/30)} months ago`:`${Math.floor(_/365)} years ago`},st=l=>{const z=new Date().getTime()-l.getTime(),B=Math.floor(z/(1e3*60*60*24));return B<7?"var(--nice-primary-tint-30, rgba(59, 130, 246, 0.3))":B<30?"var(--nice-success-tint-30, rgba(34, 197, 94, 0.3))":B<90?"var(--nice-warning-tint-30, rgba(234, 179, 8, 0.3))":B<365?"var(--nice-warning-tint-30, rgba(249, 115, 22, 0.3))":"var(--nice-danger-tint-30, rgba(239, 68, 68, 0.3))"},le=l=>{const h=["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 z=0;for(let B=0;B<l.length;B++)z=(z<<5)-z+l.charCodeAt(B),z=z&z;return h[Math.abs(z)%h.length]},Te=({file:l,viewMode:h="inline",showAgeHeatmap:z=!0,showAvatars:B=!0,groupHunks:_=!0,highlightOnHover:L=!0,timeZone:$,dateRange:A,authorFilter:T,selectedLine:N,syntaxTheme:k="dark",onLineClick:O,onCommitClick:R,onAuthorClick:S,onBlameParent:C,className:j,style:M,"data-testid":w="nice-git-blame"})=>{const{t:i}=n.useNiceTranslation(),[b,Y]=o.useState(null),[y,K]=o.useState(null),[G,P]=o.useState(null),c=o.useMemo(()=>{const x=[];return l.hunks.forEach(g=>{g.lines.forEach(E=>{x.push(E)})}),x.sort((g,E)=>g.lineNumber-E.lineNumber)},[l.hunks]),a=o.useMemo(()=>c.filter(x=>!(A?.from&&x.commit.timestamp<A.from||A?.to&&x.commit.timestamp>A.to||T&&T.length>0&&!T.includes(x.commit.author.id))),[c,A,T]),W=o.useMemo(()=>{if(!_)return a.map(p=>({startLine:p.lineNumber,endLine:p.lineNumber,commit:p.commit,lines:[p],isFirstOfCommit:!0}));const x=[];let g=null;const E=new Set;return a.forEach(p=>{if(!g||g.commit.id!==p.commit.id){const H=!E.has(p.commit.id);E.add(p.commit.id),g={startLine:p.lineNumber,endLine:p.lineNumber,commit:p.commit,lines:[p],isFirstOfCommit:H},x.push(g)}else g.endLine=p.lineNumber,g.lines.push(p)}),x},[a,_]),D=o.useMemo(()=>{const x=new Map;return c.forEach(g=>{x.has(g.commit.author.id)||x.set(g.commit.author.id,g.commit.author)}),Array.from(x.values())},[c]),J=o.useMemo(()=>{const x=new Map;return c.forEach(g=>{x.has(g.commit.id)||x.set(g.commit.id,g.commit)}),Array.from(x.values()).sort((g,E)=>E.timestamp.getTime()-g.timestamp.getTime())},[c]),X=o.useCallback(x=>{O?.(x)},[O]),Z=o.useCallback((x,g)=>{g.stopPropagation(),y===x.id?K(null):K(x.id),R?.(x)},[y,R]),V=(x,g)=>{const E=g===0,p=x.commit,H=L&&b===p.id;return e.jsxs("div",{role:E?"button":void 0,tabIndex:E?0:void 0,onKeyDown:E?n.clickOnActivationKey:void 0,style:{display:"flex",alignItems:"center",gap:8,padding:"0 12px",minWidth:h==="inline"?280:40,background:H?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":z?st(p.timestamp):"transparent",borderRight:`3px solid ${le(p.author.id)}`,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:()=>Y(p.id),onMouseLeave:()=>Y(null),onClick:q=>Z(p,q),children:[E&&h==="inline"&&e.jsxs(e.Fragment,{children:[B&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:le(p.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"var(--nice-text-primary, #0f172a)",fontWeight:500,flexShrink:0},title:p.author.name,children:p.author.avatar?e.jsx("img",{src:p.author.avatar,alt:p.author.name,style:{width:"100%",height:"100%",borderRadius:"50%"}}):p.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:p.shortId}),e.jsx("div",{style:{fontSize:10,color:"var(--nice-text-muted, #9ca3af)",whiteSpace:"nowrap"},children:ot(p.timestamp)})]})]}),h==="gutter"&&E&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:le(p.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--nice-text-primary, #0f172a)"},title:`${p.author.name} - ${p.shortId}
2
+ ${p.message}`,children:p.author.name[0].toUpperCase()})]})},Q=x=>{if(G!==x.lineNumber||h!=="tooltip")return null;const g=x.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:le(g.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-primary, #0f172a)",fontWeight:500},children:g.author.name[0].toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,color:"var(--nice-text-secondary, #475569)"},children:g.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #9ca3af)"},children:g.author.email})]})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:12,color:"var(--nice-color-primary-light, #60a5fa)",marginBottom:4},children:g.shortId}),e.jsx("div",{style:{fontSize:13,color:"var(--nice-text-secondary, #475569)",marginBottom:8},children:g.message}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #6b7280)"},children:g.timestamp.toLocaleString()}),g.parents&&g.parents.length>0&&C&&e.jsxs("button",{onClick:()=>C(g),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})," ",i("gitBlame.blameParent","Blame parent")]})]})},f=x=>y!==x.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:le(x.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-primary, #0f172a)",fontSize:20,fontWeight:500,flexShrink:0},children:x.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:x.author.name}),e.jsx("span",{style:{fontSize:11,color:"var(--nice-text-muted, #6b7280)"},children:x.author.email})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:13,color:"var(--nice-color-primary-light, #60a5fa)",marginBottom:8},children:x.id}),e.jsx("div",{style:{fontSize:14,color:"var(--nice-text-secondary, #475569)",marginBottom:8,lineHeight:1.5},children:x.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})," ",x.timestamp.toLocaleString()]}),x.parents&&x.parents.length>0&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(n.NiceIcon,{name:"cursor",size:12})," ",i("gitBlame.parentS","{parents} parent(s)").replace("{parents}",String(x.parents.length))]})]}),C&&x.parents&&x.parents.length>0&&e.jsxs("button",{onClick:()=>C(x),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})," ",i("gitBlame.blameInParentCommit","Blame in parent commit")]})]})]})});return e.jsxs("div",{className:`nice-git-blame ${j||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:k==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #ffffff)",color:k==="dark"?"var(--nice-text-primary, #e6edf3)":"var(--nice-text-primary, #ffffff)",fontFamily:"system-ui, sans-serif",...M},"data-testid":w,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:k==="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:l.path}),e.jsx("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:i("gitBlame.at","at {revision}").replace("{revision}",String(l.revision.substring(0,7)))})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:e.jsx("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:i("gitBlame.commitsByAuthorS","{commits} commits by {authors} author(s)").replace("{commits}",String(J.length)).replace("{authors}",String(D.length))})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:k==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)",flexWrap:"wrap"},children:[D.slice(0,10).map(x=>e.jsxs("div",{role:S?"button":void 0,tabIndex:S?0:void 0,onKeyDown:S?n.clickOnActivationKey:void 0,onClick:()=>S?.(x),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("div",{style:{width:12,height:12,borderRadius:"50%",background:le(x.id)}}),e.jsx("span",{style:{fontSize:12},children:x.name})]},x.id)),D.length>10&&e.jsx("span",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:i("gitBlame.more","+{authors} more").replace("{authors}",String(D.length-10))})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:W.map((x,g)=>e.jsxs(o.Fragment,{children:[x.isFirstOfCommit&&y===x.commit.id&&f(x.commit),x.lines.map((E,p)=>e.jsxs("div",{role:"presentation",onClick:()=>X(E),onMouseEnter:()=>P(E.lineNumber),onMouseLeave:()=>P(null),style:{display:"flex",alignItems:"stretch",background:N===E.lineNumber?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":L&&b===x.commit.id?"var(--nice-primary-tint-8, rgba(59, 130, 246, 0.08))":"transparent",borderLeft:N===E.lineNumber?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent",position:"relative"},children:[V(x,p),e.jsx("div",{style:{padding:"0 12px",color:"var(--nice-text-muted, #6e7681)",textAlign:"right",minWidth:50,userSelect:"none",background:k==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-secondary, #f6f8fa)",borderRight:"1px solid var(--nice-border, #30363d)"},children:E.lineNumber}),e.jsx("div",{style:{flex:1,padding:"0 16px",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:E.content}),h==="tooltip"&&Q(E)]},E.lineNumber))]},`${x.commit.id}-${x.startLine}`))}),z&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,padding:"8px 16px",borderTop:"1px solid var(--nice-border, #30363d)",background:k==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)",fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:[e.jsx("span",{children:i("gitBlame.age","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:i("gitBlame.n1Week","<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:i("gitBlame.n1Month","<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:i("gitBlame.n3Months","<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:i("gitBlame.n1Year","<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:i("gitBlame.n1Year2",">1 year")})]})]})]})},at=Object.freeze(Object.defineProperty({__proto__:null,NiceGitBlame:Te},Symbol.toStringTag,{value:"Module"})),lt=l=>{if(!l.resolved)return[];switch(l.resolution){case"ours":return l.oursContent;case"theirs":return l.theirsContent;case"both":return[...l.oursContent,...l.theirsContent];case"custom":return l.customContent||[];default:return[]}},_e=({file:l,context:h,viewMode:z="split",showLineNumbers:B=!0,showBase:_=!1,currentConflictIndex:L,syntaxTheme:$="dark",onResolve:A,onResolveAll:T,onNavigateConflict:N,onSave:k,onCancel:O,className:R,style:S,"data-testid":C="nice-git-conflict-resolver"})=>{const{t:j}=n.useNiceTranslation(),[M,w]=o.useState(l.conflicts),[i,b]=o.useState(L??0),[Y,y]=o.useState(null),[K,G]=o.useState(""),P=o.useMemo(()=>M.filter(p=>!p.resolved).length,[M]),c=o.useMemo(()=>M.filter(p=>p.resolved).length,[M]),a=M[i],W=o.useCallback((p,H,q)=>{w(t=>t.map(d=>d.id===p?{...d,resolved:!0,resolution:H,customContent:q}:d)),y(null),A?.(p,H,q);const s=M.findIndex((t,d)=>d>i&&!t.resolved);s!==-1&&(b(s),N?.(s))},[M,i,A,N]),D=o.useCallback(p=>{w(H=>H.map(q=>q.resolved?q:{...q,resolved:!0,resolution:p})),T?.(p)},[T]),J=o.useCallback(p=>{const H=p==="prev"?Math.max(0,i-1):Math.min(M.length-1,i+1);b(H),N?.(H)},[i,M.length,N]),X=o.useCallback(()=>{a&&(y(a.id),G(a.oursContent.join(`
3
+ `)))},[a]),Z=o.useCallback(()=>{Y&&W(Y,"custom",K.split(`
4
+ `))},[Y,K,W]),V=o.useCallback(()=>{const p=l.content.split(`
5
+ `);let H=[],q=0;M.forEach(s=>{H=[...H,...p.slice(q,s.startLine-1)],H=[...H,...lt(s)],q=s.endLine}),H=[...H,...p.slice(q)],k?.(H.join(`
6
+ `))},[l.content,M,k]),Q=(p,H,q,s)=>e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,borderLeft:`3px solid ${q}`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:`${q}20`,borderBottom:"1px solid var(--nice-border, #30363d)"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:500,color:q},children:p}),s&&e.jsx("button",{onClick:s,style:{padding:"4px 10px",background:q,border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",fontSize:11,cursor:"pointer"},children:j("gitConflictResolver.accept","Accept")})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:H.map((t,d)=>e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:$==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #fff)"},children:[B&&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:d+1}),e.jsx("span",{style:{padding:"0 12px",whiteSpace:"pre"},children:t||" "})]},d))})]}),f=()=>a?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:[e.jsx(n.NiceIcon,{name:"arrow-left",size:14})," ",j("gitConflictResolver.oursBranch","Ours ({branch})").replace("{branch}",h?.oursCommit.branch||"HEAD")]}),e.jsx("button",{onClick:()=>W(a.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:j("gitConflictResolver.acceptOurs","Accept Ours")})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:a.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:j("gitConflictResolver.vs","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:[e.jsx(n.NiceIcon,{name:"arrow-right",size:14})," ",j("gitConflictResolver.theirsBranch","Theirs ({branch})").replace("{branch}",h?.theirsCommit.branch||"incoming")]}),e.jsx("button",{onClick:()=>W(a.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:j("gitConflictResolver.acceptTheirs","Accept Theirs")})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:a.theirsContent.join(`
8
+ `)})]})]}):null,x=()=>a?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[Q(e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"arrow-left",size:14})," ",j("gitConflictResolver.oursBranch","Ours ({branch})").replace("{branch}",h?.oursCommit.branch||"HEAD")]}),a.oursContent,"var(--nice-color-success, #22c55e)",()=>W(a.id,"ours")),_&&Q(j("gitConflictResolver.baseAncestor","Base (ancestor)"),a.baseContent,"var(--nice-text-muted, #6b7280)"),Q(e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"arrow-right",size:14})," ",j("gitConflictResolver.theirsBranch","Theirs ({branch})").replace("{branch}",h?.theirsCommit.branch||"incoming")]}),a.theirsContent,"var(--nice-color-primary, #3b82f6)",()=>W(a.id,"theirs"))]}):null,g=()=>a?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[Q(e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"arrow-left",size:14})," ",j("gitConflictResolver.oursBranch","Ours ({branch})").replace("{branch}",h?.oursCommit.branch||"HEAD")]}),a.oursContent,"var(--nice-color-success, #22c55e)",()=>W(a.id,"ours")),Q(j("gitConflictResolver.base","Base"),a.baseContent,"var(--nice-text-muted, #6b7280)"),Q(e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"arrow-right",size:14})," ",j("gitConflictResolver.theirsBranch","Theirs ({branch})").replace("{branch}",h?.theirsCommit.branch||"incoming")]}),a.theirsContent,"var(--nice-color-primary, #3b82f6)",()=>W(a.id,"theirs"))]}):null,E=()=>Y!==a?.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})," ",j("gitConflictResolver.editResolution","Edit Resolution")]}),e.jsx("button",{onClick:()=>y(null),"aria-label":j("gitConflictResolver.closeEditor","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:K,onChange:p=>G(p.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:()=>y(null),style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:j("gitConflictResolver.cancel","Cancel")}),e.jsx("button",{onClick: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:j("gitConflictResolver.saveChanges","Save Changes")})]})]})});return e.jsxs("div",{className:`nice-git-conflict-resolver ${R||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:$==="dark"?"var(--nice-bg-canvas, #0d1117)":"var(--nice-bg-primary, #ffffff)",color:$==="dark"?"var(--nice-text-primary, #e6edf3)":"var(--nice-text-primary, #ffffff)",fontFamily:"system-ui, sans-serif",position:"relative",...S},"data-testid":C,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:$==="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:l.path}),e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:j("gitConflictResolver.conflictSResolvedRemaining","{conflicts} conflict(s) • {resolvedCount} resolved • {unresolvedCount} remaining").replace("{conflicts}",String(M.length)).replace("{resolvedCount}",String(c)).replace("{unresolvedCount}",String(P))})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:O,style:{padding:"6px 12px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:j("gitConflictResolver.cancel","Cancel")}),e.jsxs("button",{onClick:V,disabled:P>0,style:{padding:"6px 12px",background:P>0?"var(--nice-bg-tertiary, #e2e8f0)":"var(--nice-color-success, #22c55e)",border:"none",borderRadius:6,color:P>0?"var(--nice-text-muted, #94a3b8)":"var(--nice-color-white, #fff)",cursor:P>0?"not-allowed":"pointer",opacity:P>0?.5:1,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(n.NiceIcon,{name:"check",size:14})," ",j("gitConflictResolver.saveResolved","Save Resolved")]})]})]}),h&&e.jsxs("div",{style:{display:"flex",gap:24,padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:$==="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.jsxs("span",{style:{color:"var(--nice-color-success, #22c55e)"},children:[e.jsx(n.NiceIcon,{name:"arrow-left",size:14})," ",j("gitConflictResolver.oursLabel","Ours:")]}),e.jsx("span",{children:h.oursCommit.branch}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontFamily:"monospace"},children:["(",h.oursCommit.shortId,")"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsxs("span",{style:{color:"var(--nice-color-primary, #3b82f6)"},children:[e.jsx(n.NiceIcon,{name:"arrow-right",size:14})," ",j("gitConflictResolver.theirsLabel","Theirs:")]}),e.jsx("span",{children:h.theirsCommit.branch}),e.jsxs("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontFamily:"monospace"},children:["(",h.theirsCommit.shortId,")"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--nice-border, #30363d)",background:$==="dark"?"var(--nice-bg-elevated, #ffffff)":"var(--nice-bg-secondary, #f0f0f0)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsxs("button",{onClick:()=>J("prev"),disabled:i===0,style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:i===0?"not-allowed":"pointer",opacity:i===0?.5:1},children:[e.jsx(n.NiceIcon,{name:"arrow-left",size:14})," ",j("gitConflictResolver.prev","Prev")]}),e.jsxs("span",{style:{padding:"0 8px"},children:[j("gitConflictResolver.conflictOf","Conflict {current} of {total}").replace("{current}",String(i+1)).replace("{total}",String(M.length)),a?.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})," ",j("gitConflictResolver.resolved","Resolved")]})]}),e.jsxs("button",{onClick:()=>J("next"),disabled:i===M.length-1,style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:i===M.length-1?"not-allowed":"pointer",opacity:i===M.length-1?.5:1},children:[j("gitConflictResolver.next","Next")," ",e.jsx(n.NiceIcon,{name:"arrow-right",size:14})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:()=>D("ours"),disabled:P===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:P===0?"not-allowed":"pointer",opacity:P===0?.5:1},children:j("gitConflictResolver.acceptAllOurs","Accept All Ours")}),e.jsx("button",{onClick:()=>D("theirs"),disabled:P===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:P===0?"not-allowed":"pointer",opacity:P===0?.5:1},children:j("gitConflictResolver.acceptAllTheirs","Accept All Theirs")})]})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[a&&!a.resolved&&e.jsxs(e.Fragment,{children:[z==="inline"&&f(),z==="split"&&x(),z==="three-way"&&g()]}),a?.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:j("gitConflictResolver.conflictResolved","Conflict Resolved")}),e.jsx("span",{style:{color:"var(--nice-text-muted, #8b949e)",fontSize:13},children:j("gitConflictResolver.resolution","Resolution: {resolution}").replace("{resolution}",String(a.resolution??""))}),e.jsxs("button",{onClick:()=>w(p=>p.map(H=>H.id===a.id?{...H,resolved:!1,resolution:void 0}:H)),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})," ",j("gitConflictResolver.reResolve","Re-resolve")]})]})]}),a&&!a.resolved&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,padding:"12px 16px",borderTop:"1px solid var(--nice-border, #30363d)",background:$==="dark"?"var(--nice-bg-elevated, #161b22)":"var(--nice-bg-secondary, #f6f8fa)"},children:[e.jsxs("button",{onClick:()=>W(a.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})," ",j("gitConflictResolver.acceptOurs","Accept Ours")]}),e.jsxs("button",{onClick:()=>W(a.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})," ",j("gitConflictResolver.acceptTheirs","Accept Theirs")]}),e.jsxs("button",{onClick:()=>W(a.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})," ",j("gitConflictResolver.acceptBoth","Accept Both")]}),e.jsxs("button",{onClick:X,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})," ",j("gitConflictResolver.editManually","Edit Manually")]})]}),E()]})},ct=Object.freeze(Object.defineProperty({__proto__:null,NiceGitConflictResolver:_e},Symbol.toStringTag,{value:"Module"})),ge={"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"}},dt=[{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}]}],Ae=({hooks:l,defaultHooks:h,templates:z=dt,manager:B="husky",repoPath:_,selectedHook:L,onHookChange:$,onHooksChange:A,onHookToggle:T,onActionAdd:N,onActionRemove:k,onActionUpdate:O,onInstall:R,onUninstall:S,onExport:C,className:j,style:M,"data-testid":w="nice-git-hooks"})=>{const{t:i}=n.useNiceTranslation(),b=l!==void 0&&A!==void 0,Y=o.useRef([]),y=o.useCallback(t=>{const d=Y.current;Y.current=t,$&&t.filter(u=>!d.includes(u)).forEach(u=>$(u)),A?.(t)},[$,A]),[K,G]=n.useControllableState({value:b?l:void 0,defaultValue:b?h:h??l,fallbackValue:[],onChange:y,componentName:"NiceGitHooks"});Y.current=K,we("NiceGitHooks","hooks","onHooksChange",l,b);const[P,c]=o.useState(L||null),[a,W]=o.useState(!1),[D,J]=o.useState(null),[X,Z]=o.useState(!1),V=o.useMemo(()=>K.find(t=>t.type===P),[K,P]),Q=o.useCallback((t,d)=>{G(u=>u.map(I=>I.type===t?{...I,enabled:d}:I)),T?.(t,d)},[T,G]),f=o.useCallback(t=>{if(!P)return;const d=t?t.actions.map((u,I)=>({...u,id:n.createId(),order:(V?.actions.length||0)+I})):[{id:n.createId(),type:"custom",name:"New Action",command:'echo "Hello"',order:V?.actions.length||0,enabled:!0,failOnError:!0}];G(u=>u.map(I=>I.type===P?{...I,actions:[...I.actions,...d]}:I)),d.forEach(u=>N?.(P,u)),W(!1)},[P,V,N,G]),x=o.useCallback(t=>{P&&(G(d=>d.map(u=>u.type===P?{...u,actions:u.actions.filter(I=>I.id!==t)}:u)),k?.(P,t))},[P,k,G]),g=o.useCallback(t=>{P&&(G(d=>d.map(u=>u.type===P?{...u,actions:u.actions.map(I=>I.id===t.id?t:I)}:u)),J(null),O?.(P,t))},[P,O,G]),E=o.useCallback((t,d)=>{if(!V)return;const u=[...V.actions],I=u.findIndex(ee=>ee.id===t);if(I===-1)return;const te=d==="up"?I-1:I+1;te<0||te>=u.length||([u[I],u[te]]=[u[te],u[I]],u.forEach((ee,m)=>ee.order=m),G(ee=>ee.map(m=>m.type===P?{...m,actions:u}:m)))},[V,P,G]),p=o.useCallback(t=>{const d=["#!/bin/sh",""];return t.verbose&&d.push("set -x"),d.push("# Generated by NiceGitHooks",`# Hook: ${t.type}`,""),t.actions.forEach(u=>{if(!u.enabled){d.push(`# [DISABLED] ${u.name}`);return}if(d.push(`# ${u.name}`),u.condition){const{type:te,operator:ee,value:m}=u.condition;te==="branch"?(d.push("BRANCH=$(git rev-parse --abbrev-ref HEAD)"),ee==="equals"?d.push(`if [ "$BRANCH" != "${m}" ]; then exit 0; fi`):ee==="matches"&&d.push(`if ! echo "$BRANCH" | grep -q "${m}"; then exit 0; fi`)):te==="env"&&d.push(`if [ -z "$${m}" ]; then exit 0; fi`)}let I=u.command;u.runOn==="staged"&&u.filePatterns?.length&&(u.filePatterns.map(te=>`'${te}'`).join(" "),I=`git diff --cached --name-only --diff-filter=ACM | grep -E "${u.filePatterns.join("|")}" | xargs ${I}`),d.push(I),u.failOnError&&(d.push("if [ $? -ne 0 ]; then"),d.push(` echo "❌ ${u.name} failed""`),d.push(" exit 1"),d.push("fi")),d.push("")}),d.push("exit 0"),d.join(`
9
+ `)},[]),H=t=>({lint:"search",test:"flask",format:"edit",typecheck:"book",build:"settings",custom:"settings"})[t],q=()=>D?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})," ",i("gitHooks.editAction","Edit Action")]}),e.jsx("button",{onClick:()=>J(null),"aria-label":i("gitHooks.close","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:i("gitHooks.name","Name")}),e.jsx("input",{type:"text",value:D.name,onChange:t=>J({...D,name:t.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:i("gitHooks.type","Type")}),e.jsxs("select",{value:D.type,onChange:t=>J({...D,type:t.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:i("gitHooks.lint","Lint")}),e.jsx("option",{value:"test",children:i("gitHooks.test","Test")}),e.jsx("option",{value:"format",children:i("gitHooks.format","Format")}),e.jsx("option",{value:"typecheck",children:i("gitHooks.typecheck","Typecheck")}),e.jsx("option",{value:"build",children:i("gitHooks.build","Build")}),e.jsx("option",{value:"custom",children:i("gitHooks.custom","Custom")})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:i("gitHooks.command","Command")}),e.jsx("textarea",{value:D.command,onChange:t=>J({...D,command:t.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:i("gitHooks.runOn","Run On")}),e.jsxs("select",{value:D.runOn||"all",onChange:t=>J({...D,runOn:t.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:i("gitHooks.allFiles","All files")}),e.jsx("option",{value:"staged",children:i("gitHooks.stagedFilesOnly","Staged files only")}),e.jsx("option",{value:"changed",children:i("gitHooks.changedFiles","Changed files")})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--nice-text-muted, #9ca3af)",marginBottom:4},children:i("gitHooks.filePatternsCommaSeparated","File Patterns (comma-separated)")}),e.jsx("input",{type:"text",value:D.filePatterns?.join(", ")||"",onChange:t=>J({...D,filePatterns:t.target.value.split(",").map(d=>d.trim()).filter(Boolean)}),placeholder:i("gitHooks.tsTsxJs","*.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:D.enabled,onChange:t=>J({...D,enabled:t.target.checked})}),e.jsx("span",{style:{fontSize:13},children:i("gitHooks.enabled","Enabled")})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:D.failOnError,onChange:t=>J({...D,failOnError:t.target.checked})}),e.jsx("span",{style:{fontSize:13},children:i("gitHooks.failOnError","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:()=>J(null),style:{padding:"8px 16px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:6,color:"var(--nice-text-primary, #0f172a)",cursor:"pointer"},children:i("gitHooks.cancel","Cancel")}),e.jsx("button",{onClick:()=>g(D),style:{padding:"8px 16px",background:"var(--nice-color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--nice-text-on-primary, #fff)",cursor:"pointer"},children:i("gitHooks.save","Save")})]})]})}):null,s=()=>{if(!X||!V)return null;const t=p(V);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})," ",i("gitHooks.scriptPreview","Script Preview: {type}").replace("{type}",String(V.type))]}),e.jsx("button",{onClick:()=>Z(!1),"aria-label":i("gitHooks.close","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:t}),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(t)},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})," ",i("gitHooks.copy","Copy")]}),e.jsx("button",{onClick:()=>Z(!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:i("gitHooks.close","Close")})]})]})})};return e.jsxs("div",{className:`nice-git-hooks ${j||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-canvas, #0d1117)",color:"var(--nice-text-primary, #e6edf3)",fontFamily:"system-ui, sans-serif",...M},"data-testid":w,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})," ",i("gitHooks.gitHooks","Git Hooks")]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:Object.entries(ge).map(([t,d])=>{const u=K.find(ee=>ee.type===t),I=P===t,te=u?.actions.length||0;return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>c(t),style:{padding:"12px 16px",cursor:"pointer",background:I?"var(--nice-primary-tint-15, rgba(59, 130, 246, 0.15))":"transparent",borderLeft:I?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent",display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:d.icon,size:18}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:500},children:d.title}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:te!==1?i("gitHooks.actionsMany","{actionCount} actions").replace("{actionCount}",String(te)):i("gitHooks.actionsOne","{actionCount} action").replace("{actionCount}",String(te))})]}),e.jsx("button",{onClick:ee=>{ee.stopPropagation(),Q(t,!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"}})})]},t)})}),e.jsx("div",{style:{padding:12,borderTop:"1px solid var(--nice-border, #30363d)",display:"flex",gap:8},children:e.jsx("button",{onClick:()=>C?.(K,"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:i("gitHooks.export","Export")})})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:V?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:ge[V.type].icon,size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:18,fontWeight:500},children:ge[V.type].title}),e.jsx("div",{style:{fontSize:12,color:"var(--nice-text-muted, #8b949e)"},children:ge[V.type].description})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:12},children:[e.jsxs("button",{onClick:()=>Z(!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})," ",i("gitHooks.previewScript","Preview Script")]}),e.jsxs("button",{onClick:()=>R?.(V.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})," ",i("gitHooks.install","Install")]}),e.jsxs("button",{onClick:()=>S?.(V.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})," ",i("gitHooks.uninstall","Uninstall")]})]})]}),e.jsx("div",{style:{flex:1,overflow:"auto",padding:16},children:V.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:i("gitHooks.noActionsConfigured","No actions configured")}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:i("gitHooks.addAnActionFromTemplates","Add an action from templates or create a custom one")})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:V.actions.sort((t,d)=>t.order-d.order).map((t,d)=>e.jsxs("div",{style:{padding:16,background:"var(--nice-bg-elevated, #161b22)",borderRadius:8,border:"1px solid var(--nice-border, #30363d)",opacity:t.enabled?1:.5},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(n.NiceIcon,{name:H(t.type),size:20}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:t.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:t.command})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>E(t.id,"up"),disabled:d===0,"aria-label":i("gitHooks.moveUp","Move up"),style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:d===0?"not-allowed":"pointer",opacity:d===0?.5:1},children:e.jsx(n.NiceIcon,{name:"arrow-up",size:14})}),e.jsx("button",{onClick:()=>E(t.id,"down"),disabled:d===V.actions.length-1,"aria-label":i("gitHooks.moveDown","Move down"),style:{padding:"4px 8px",background:"var(--nice-bg-secondary, #f8fafc)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #0f172a)",cursor:d===V.actions.length-1?"not-allowed":"pointer",opacity:d===V.actions.length-1?.5:1},children:e.jsx(n.NiceIcon,{name:"arrow-down",size:14})}),e.jsx("button",{onClick:()=>J(t),"aria-label":i("gitHooks.editAction2","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:()=>x(t.id),"aria-label":i("gitHooks.removeAction","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})})]})]}),t.filePatterns&&t.filePatterns.length>0&&e.jsx("div",{style:{marginTop:8,fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:i("gitHooks.files","Files: {filePatterns}").replace("{filePatterns}",String(t.filePatterns.join(", ")))}),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[t.runOn&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--nice-color-primary-active, #1d4ed8)",borderRadius:4},children:t.runOn}),t.failOnError&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--nice-color-error, #b91c1c)",borderRadius:4},children:i("gitHooks.failOnError2","fail on error")})]})]},t.id))})}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid var(--nice-border, #30363d)",display:"flex",gap:8},children:[e.jsxs("button",{onClick:()=>W(!a),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})," ",i("gitHooks.addFromTemplate","Add from Template")]}),e.jsxs("button",{onClick:()=>f(),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})," ",i("gitHooks.customAction","Custom Action")]})]}),a&&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:[z.filter(t=>t.hook===P).map(t=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>f(t),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:t.icon,size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:t.name}),e.jsx("div",{style:{fontSize:11,color:"var(--nice-text-muted, #8b949e)"},children:t.description})]})]},t.id)),z.filter(t=>t.hook===P).length===0&&e.jsx("div",{style:{padding:20,textAlign:"center",color:"var(--nice-text-muted, #8b949e)"},children:i("gitHooks.noTemplatesForThisHook","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:i("gitHooks.selectAHookToConfigure","Select a hook to configure")}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:i("gitHooks.clickOnAHookFrom","Click on a hook from the list to start editing")})]})}),q(),s()]})},pt=Object.freeze(Object.defineProperty({__proto__:null,NiceGitHooks:Ae},Symbol.toStringTag,{value:"Module"})),xt=[...n.NICE_KEYBOARD_NUMERIC,[{value:"-"},{value:","},{...n.NICE_KEY_ENTER,width:1}]];function ut(l){const h=(l??"en").slice(0,2).toLowerCase();return h in n.NICE_KEYBOARD_LAYOUTS?h:"en"}function gt(l){const h=n.NICE_KEYBOARD_LAYOUTS[l]?.accents;if(!h)return null;const z=[...new Set(Object.values(h).flat())];return z.length?z.map(B=>({value:B})):null}const Oe=Object.assign(function({value:h,defaultValue:z,caret:B,onChange:_,onSubmit:L,onClose:$,language:A,languages:T,layout:N="text",multiline:k=!1,masked:O=!1,maxLength:R,enterLabel:S,showPreview:C=!0,fieldLabel:j,modal:M=!0,className:w,style:i}){const{t:b,lang:Y}=n.useNiceTranslation(),y=o.useRef(null),[K,G]=n.useControllableState({value:h,defaultValue:z,fallbackValue:"",componentName:"NiceOnScreenKeyboard"}),[P,c]=o.useState(null),a=Math.max(0,Math.min(K.length,B??P??K.length)),W=o.useMemo(()=>({text:K,caret:a}),[K,a]),D=A??ut(Y),J=o.useMemo(()=>T&&T.length>0?T:[D],[T,D]),X=o.useMemo(()=>[{kind:"letters",lang:J[0]},{kind:"symbols"},...J.slice(1).map(v=>({kind:"letters",lang:v}))],[J]),[Z,V]=o.useState(0),Q=X[Math.min(Z,X.length-1)],[f,x]=o.useState(!1),g=o.useMemo(()=>{if(N==="number")return xt;const v=Q.kind==="letters"?Q.lang:J[0],F=n.buildKeyboardRows(v,"compact",Q.kind==="symbols",J.length>1,S),ne=Q.kind==="letters"?gt(v):null;return ne?[...F.slice(0,-1),ne,F[F.length-1]]:F},[N,Q,J,S]),E=o.useCallback(v=>{v.text===W.text&&v.caret===W.caret||(G(v.text),c(v.caret),_?.(v.text,v.caret))},[W,_,G]),p=o.useCallback(v=>E(n.insertAtCaret(W,v,R)),[E,W,R]),H=o.useCallback(()=>E(n.deleteBeforeCaret(W)),[E,W]),q=o.useCallback(v=>E(n.moveTextCaret(W,v)),[E,W]),s=o.useCallback(v=>V(F=>(F+v+X.length)%X.length),[X.length]),t=v=>{switch(v.type){case"backspace":H();return;case"enter":k?p(`
10
+ `):L?.(K);return;case"shift":case"caps":x(F=>!F);return;case"space":p(" ");return;case"tab":p(" ");return;case"lang":s(1);return;case"fn":v.value==="123"||v.value==="ABC"||v.value==="#+="?V(Q.kind==="symbols"?0:X.findIndex(F=>F.kind==="symbols")):(v.value==="Clear"||v.value==="C")&&E({text:"",caret:0});return;default:{const F=f&&v.value.length===1?v.value.toUpperCase():v.value;p(F),f&&x(!1)}}};n.useOverlayFocus(y,{open:M,modal:!0,onClose:()=>$?.()}),n.useIntent(["secondary","tertiary","pagePrev","pageNext","sectionPrev","sectionNext","menu"],v=>{const F={secondary:H,tertiary:()=>p(" "),pagePrev:()=>q(-1),pageNext:()=>q(1),sectionPrev:()=>s(-1),sectionNext:()=>s(1),menu:()=>L?.(K)};if(v.source==="keyboard"&&v.intent!=="secondary")return!1;F[v.intent]?.()},{ref:y}),n.useInputHints(y,[{intent:"activate",label:b("osk.type","Type")},{intent:"secondary",label:b("osk.delete","Delete")},{intent:"tertiary",label:b("touchKeyboard.space","Space")},{intent:"pageNext",label:b("osk.cursor","Cursor")},{intent:"sectionNext",label:b("osk.layout","Layout")},{intent:"menu",label:b("osk.done","Done")},{intent:"back",label:b("osk.close","Close")}]);const d=o.useRef({backspace:H,typeChars:p});d.current={backspace:H,typeChars:p},o.useEffect(()=>{const v=y.current;if(!v)return;const F=ne=>{ne.ctrlKey||ne.metaKey||ne.altKey||ne.defaultPrevented||(ne.key==="Backspace"?(ne.preventDefault(),d.current.backspace()):ne.key.length===1&&ne.key!==" "&&(ne.preventDefault(),d.current.typeChars(ne.key)))};return v.addEventListener("keydown",F),()=>v.removeEventListener("keydown",F)},[]);const u=v=>{switch(v.type){case"backspace":return b("touchKeyboard.backspace","Backspace");case"enter":return k?b("osk.newLine","New line"):S??b("touchKeyboard.enter","Enter");case"space":return b("touchKeyboard.space","Space");case"shift":case"caps":return b("osk.shift","Shift");case"tab":return b("input.key.tab","Tab");case"lang":return b("touchKeyboard.language","Lang");case"fn":return v.value==="ABC"?b("osk.letters","Letters"):v.value==="123"||v.value==="#+="?b("osk.symbols","Symbols"):v.label??v.value;default:return f&&v.value.length===1?v.value.toUpperCase():v.value}},I=v=>{switch(v.type){case"backspace":return e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"key-backspace",size:18}),e.jsx(n.NiceControlHint,{intent:"secondary",always:!0})]});case"enter":return e.jsxs(e.Fragment,{children:[S&&!k?e.jsx("span",{className:"nice-osk__key-text",children:S}):e.jsx(n.NiceIcon,{name:"key-enter",size:18}),!k&&e.jsx(n.NiceControlHint,{intent:"menu",always:!0})]});case"space":return e.jsxs(e.Fragment,{children:[e.jsx(n.NiceIcon,{name:"key-space",size:18}),e.jsx(n.NiceControlHint,{intent:"tertiary",always:!0})]});case"shift":case"caps":return e.jsx(n.NiceIcon,{name:"key-shift",size:18});case"tab":return e.jsx(n.NiceIcon,{name:"key-tab",size:18});case"lang":return e.jsx(n.NiceIcon,{name:"globe",size:18});default:return e.jsx("span",{className:"nice-osk__key-text",children:u(v)})}},te=g.length>1?g[Math.min(1,g.length-1)][0]:g[0]?.[0],ee=O?"•".repeat(K.length):K,m=N==="text"&&Q.kind==="letters"&&n.isRtlKeyboardLanguage(Q.lang);return e.jsxs("div",{ref:y,className:`nice-osk${w?` ${w}`:""}`,style:i,role:M?"dialog":"group","aria-modal":M||void 0,"aria-label":b("osk.label","On-screen keyboard"),children:[C&&e.jsxs("div",{className:"nice-osk__preview",children:[j&&e.jsx("span",{className:"nice-osk__preview-label",children:j}),e.jsxs("span",{className:"nice-osk__preview-text",dir:m?"rtl":void 0,children:[ee.slice(0,a),e.jsx("span",{className:"nice-osk__caret","aria-hidden":"true"}),ee.slice(a)]})]}),e.jsx("div",{className:"nice-osk__keys",dir:m?"rtl":void 0,children:g.map((v,F)=>e.jsx("div",{className:"nice-osk__row",children:v.map((ne,ce)=>e.jsx("button",{type:"button",className:`nice-osk__key nice-osk__key--${ne.type??"char"}${(ne.type==="shift"||ne.type==="caps")&&f?" nice-osk__key--active":""}`,style:{flexGrow:ne.width??1},onClick:()=>t(ne),"aria-label":u(ne),"aria-pressed":ne.type==="shift"||ne.type==="caps"?f:void 0,"data-autofocus":ne===te?"":void 0,children:I(ne)},`${F}-${ce}-${ne.value}`))},F))}),e.jsxs("div",{className:"nice-osk__bar",children:[e.jsxs("button",{type:"button",className:"nice-osk__bar-btn",onClick:()=>q(-1),"aria-label":b("osk.cursorLeft","Cursor left"),children:[e.jsx(n.NiceIcon,{name:"chevron-left",size:16}),e.jsx(n.NiceControlHint,{intent:"pagePrev",always:!0})]}),e.jsxs("button",{type:"button",className:"nice-osk__bar-btn",onClick:()=>q(1),"aria-label":b("osk.cursorRight","Cursor right"),children:[e.jsx(n.NiceControlHint,{intent:"pageNext",always:!0}),e.jsx(n.NiceIcon,{name:"chevron-right",size:16})]}),e.jsx("span",{className:"nice-osk__bar-spacer"}),e.jsxs("button",{type:"button",className:"nice-osk__bar-btn",onClick:()=>$?.(),"aria-label":b("osk.close","Close"),children:[e.jsx(n.NiceControlHint,{intent:"back",always:!0}),e.jsx(n.NiceIcon,{name:"close",size:16})]})]})]})},{displayName:"NiceOnScreenKeyboard"});function ke(l){return(l instanceof HTMLTextAreaElement||l instanceof Element&&n.isTextInput(l))&&!l.readOnly&&!l.disabled}function ft(l){return l.labels?.[0]?.textContent?.trim()||l.getAttribute("aria-label")||l.placeholder||void 0}const pe=[];function De(){const{t:l}=n.useNiceTranslation(),[h]=n.useInputPreferences(),z=n.useInputMethod();n.useInputEngine();const B=o.useRef({}),[_,L]=o.useState(null),[$,A]=o.useState({text:"",caret:0}),T=o.useRef(z);T.current=z,o.useEffect(()=>{const w=B.current;return pe.push(w),()=>{pe.splice(pe.indexOf(w),1)}},[]);const N=o.useCallback(w=>{let i=w.value.length;try{i=w.selectionEnd??i}catch{}A({text:w.value,caret:i}),L({el:w,before:w.value})},[]);if(o.useEffect(()=>{if(h.onScreenKeyboard==="never")return;const w=b=>{const Y=b.detail;pe[0]===B.current&&Y.engaged&&(Y.source==="gamepad"||Y.source==="remote")&&ke(b.target)&&N(b.target)},i=b=>{h.onScreenKeyboard==="always"&&T.current==="touch"&&pe[0]===B.current&&ke(b.target)&&N(b.target)};return document.addEventListener(n.NICE_ENGAGE_EVENT,w),document.addEventListener("focusin",i),()=>{document.removeEventListener(n.NICE_ENGAGE_EVENT,w),document.removeEventListener("focusin",i)}},[h.onScreenKeyboard,N]),!_||typeof document>"u")return null;const{el:k}=_,O=()=>{k.value!==_.before&&k.dispatchEvent(new Event("change",{bubbles:!0})),L(null)},R=()=>{O(),window.setTimeout(()=>{const w=new KeyboardEvent("keydown",{key:"Enter",bubbles:!0,cancelable:!0});if(k.dispatchEvent(w),!w.defaultPrevented&&k instanceof HTMLInputElement&&k.form)try{k.form.requestSubmit()}catch{}},0)},S=k.getAttribute("inputmode"),C=S==="numeric"||S==="decimal"||S==="tel"||k.type==="tel",j=k.getAttribute("enterkeyhint"),M=k.type==="search"||j==="search"?l("osk.search","Search"):j==="send"?l("osk.send","Send"):j==="go"?l("osk.go","Go"):j==="next"?l("osk.next","Next"):void 0;return qe.createPortal(e.jsx("div",{className:`nice-osk-host ${Se(k)}`,children:e.jsx(Oe,{value:$.text,caret:$.caret,onChange:(w,i)=>{A({text:w,caret:i}),n.setFieldText(k,w,i)},onSubmit:k instanceof HTMLTextAreaElement?()=>O():()=>R(),onClose:O,layout:C?"number":"text",multiline:k instanceof HTMLTextAreaElement,masked:k.type==="password",maxLength:k.maxLength>0?k.maxLength:void 0,enterLabel:M,fieldLabel:ft(k)})}),document.body)}const ht={"data-nice-focus-scope":"spatial","data-nice-arrows":"spatial"};function Pe(){return n.useInputEngine(),ht}function $e({position:l,block:h}){return e.jsxs(e.Fragment,{children:[l!=="none"&&e.jsx(n.NiceInputHintBar,{visibility:"pad",position:l,className:`${h}__hint-bar`}),e.jsx(De,{})]})}const He=Object.assign(o.forwardRef(({menubar:l,toolbar:h,sidebar:z,sidebarWidth:B=220,rightSidebar:_,rightSidebarWidth:L=280,children:$,bottomPanel:A,bottomPanelHeight:T,statusBar:N,height:k="100%",flush:O=!1,hintBar:R="bottom",className:S,style:C,id:j,"data-testid":M},w)=>{const{t:i}=n.useNiceTranslation(),b=Pe(),Y=`nice-app-shell__sidebar${O?" nice-app-shell__sidebar--flush":""}`;return e.jsxs("div",{ref:w,id:j,"data-testid":M,className:`nice-app-shell${S?` ${S}`:""}`,style:{height:k,...C},...b,children:[l!=null&&e.jsx("div",{className:`nice-app-shell__menubar${O?" nice-app-shell__chrome--flush":""}`,"data-nice-region":i("appShell.region.menubar","Menu bar"),children:l}),h!=null&&e.jsx("div",{className:`nice-app-shell__toolbar${O?" nice-app-shell__chrome--flush":""}`,"data-nice-region":i("appShell.region.toolbar","Toolbar"),children:h}),e.jsxs("div",{className:"nice-app-shell__body",children:[z!=null&&e.jsx("aside",{className:Y,style:O?void 0:{width:B},children:z}),e.jsx("main",{className:"nice-app-shell__content",children:$}),_!=null&&e.jsx("aside",{className:`${Y} nice-app-shell__sidebar--right`,style:O?void 0:{width:L},children:_})]}),A!=null&&e.jsx("div",{className:`nice-app-shell__bottom${O?" nice-app-shell__bottom--flush":""}`,style:T!=null?{height:T}:void 0,"data-nice-region":i("appShell.region.bottom","Bottom panel"),children:A}),N!=null&&e.jsx("div",{className:"nice-app-shell__status","data-nice-region":i("appShell.region.status","Status bar"),children:N}),e.jsx($e,{position:R,block:"nice-app-shell"})]})}),{displayName:"NiceAppShell"}),mt=[],bt=[],vt={id:"",name:"",repository:"",triggers:[],stages:[],variables:[],secrets:[],isEnabled:!0,createdAt:new Date(0),updatedAt:new Date(0)},yt=[],jt=[{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"}],kt={push:"upload",pull_request:"shuffle",schedule:"clock",manual:"cursor",tag:"tag",workflow_dispatch:"zap"},St={script:"file",action:"settings",checkout:"download",upload_artifact:"upload",download_artifact:"download",docker:"box",deploy:"rocket"},Le=({pipeline:l,defaultPipeline:h,templates:z=mt,runners:B=yt,environments:_=bt,onPipelineChange:L,onStageAdd:$,onStageRemove:A,onStageMove:T,onJobAdd:N,onJobRemove:k,onStepAdd:O,onStepRemove:R,onVariableAdd:S,onVariableRemove:C,onSecretAdd:j,onSecretRemove:M,onTemplateApply:w,onSave:i,onRun:b,onValidate:Y,tutorial:y,className:K,style:G,"data-testid":P})=>{const{t:c}=n.useNiceTranslation(),[a,W]=n.useControllableState({value:l,defaultValue:h,fallbackValue:vt,onChange:L,componentName:"NicePipelineEditor"}),[D,J]=o.useState("visual"),[X,Z]=o.useState(null),[V,Q]=o.useState(null),[f,x]=o.useState(!1),g=a.stages.find(t=>t.id===X),E=g?.jobs.find(t=>t.id===V),p=o.useMemo(()=>{const t=[];return t.push(`name: ${a.name}`),t.push(""),t.push("on:"),a.triggers.forEach(d=>{t.push(` ${d}:`),(d==="push"||d==="pull_request")&&(t.push(" branches:"),t.push(` - ${a.branch||"main"}`))}),t.push(""),a.variables.length>0&&(t.push("env:"),a.variables.filter(d=>!d.isSecret).forEach(d=>{t.push(` ${d.name}: ${d.value}`)}),t.push("")),t.push("jobs:"),a.stages.forEach(d=>{d.jobs.forEach(u=>{t.push(` ${d.name.toLowerCase().replace(/\s+/g,"-")}-${u.name.toLowerCase().replace(/\s+/g,"-")}:`),t.push(` name: ${u.name}`),u.runner&&t.push(` runs-on: ${u.runner}`),d.dependsOn?.length&&t.push(` needs: [${d.dependsOn.join(", ")}]`),t.push(" steps:"),u.steps.forEach(I=>{I.type==="checkout"?t.push(" - uses: actions/checkout@v4"):I.type==="action"&&I.action?(t.push(` - uses: ${I.action}${I.actionVersion?`@${I.actionVersion}`:""}`),I.with&&Object.keys(I.with).length>0&&(t.push(" with:"),Object.entries(I.with).forEach(([te,ee])=>{t.push(` ${te}: ${ee}`)}))):I.type==="script"&&I.script&&(t.push(` - name: ${I.name}`),t.push(" run: |"),I.script.split(`
11
+ `).forEach(te=>{t.push(` ${te}`)}))})})}),t.join(`
12
+ `)},[a]),H=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:a.name,onChange:t=>W({...a,name:t.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(y,jt)}),e.jsx("button",{onClick:()=>x(!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})," ",c("pipelineEditor.templates","Templates")]})}),e.jsx("button",{onClick:Y,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})," ",c("pipelineEditor.validate","Validate")]})}),e.jsx("button",{onClick:i,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})," ",c("pipelineEditor.save","Save")]})}),e.jsx("button",{onClick:b,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})," ",c("pipelineEditor.runPipeline","Run Pipeline")]})})]}),q=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:c("pipelineEditor.visualEditor","Visual Editor")},{id:"yaml",icon:"edit",label:"YAML"},{id:"triggers",icon:"zap",label:c("pipelineEditor.triggers","Triggers")},{id:"variables",icon:"settings",label:c("pipelineEditor.variables","Variables")}].map(t=>e.jsx("button",{onClick:()=>J(t.id),style:{padding:"10px 20px",border:"none",background:D===t.id?"var(--nice-bg-elevated, #1e1e1e)":"transparent",color:D===t.id?"var(--nice-text-primary, #fff)":"var(--nice-text-muted, #888)",cursor:"pointer",fontSize:"12px",borderBottom:D===t.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:t.icon,size:14})," ",t.label]})},t.id))}),s=e.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden",height:"100%"},children:[D==="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:c("pipelineEditor.stages","Stages")}),e.jsx("button",{onClick:$,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:c("pipelineEditor.addStage","+ Add Stage")})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"8px"},children:[a.stages.map((t,d)=>e.jsxs("div",{children:[d>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",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>{Z(t.id),Q(null)},style:{padding:"12px",background:X===t.id?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:X===t.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:t.name}),e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[d>0&&e.jsx("button",{"aria-label":c("pipelineEditor.moveStageUp","Move stage up"),onClick:u=>{u.stopPropagation(),T(t.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})}),d<a.stages.length-1&&e.jsx("button",{"aria-label":c("pipelineEditor.moveStageDown","Move stage down"),onClick:u=>{u.stopPropagation(),T(t.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":c("pipelineEditor.removeStage","Remove stage"),onClick:u=>{u.stopPropagation(),A(t.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:[t.jobs.length!==1?c("pipelineEditor.jobsMany","{count} jobs").replace("{count}",String(t.jobs.length)):c("pipelineEditor.jobsOne","{count} job").replace("{count}",String(t.jobs.length))," ","•"," ",t.parallel?c("pipelineEditor.parallel","Parallel"):c("pipelineEditor.sequential","Sequential")]})]})]},t.id)),a.stages.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--nice-text-muted, #666)",padding:"24px",fontSize:"12px"},children:c("pipelineEditor.noStagesYetAddA","No stages yet. Add a stage to get started.")})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:g?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.jsx("span",{style:{fontWeight:500},children:c("pipelineEditor.stage","Stage: {name}").replace("{name}",String(g.name))}),e.jsx("button",{onClick:()=>N(g.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:c("pipelineEditor.addJob","+ 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:g.jobs.map(t=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>Q(t.id),style:{padding:"10px",marginBottom:"4px",background:V===t.id?"var(--nice-primary-tint-20, rgba(59, 130, 246, 0.2))":"var(--nice-bg-elevated, #252525)",borderRadius:"6px",cursor:"pointer",border:V===t.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:t.name}),e.jsx("button",{"aria-label":c("pipelineEditor.removeJob","Remove job"),onClick:d=>{d.stopPropagation(),k(g.id,t.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.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)",marginTop:"4px"},children:c("pipelineEditor.steps","{steps} steps").replace("{steps}",String(t.steps.length))})]},t.id))}),E?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.jsx("h3",{style:{margin:0,fontSize:"14px"},children:c("pipelineEditor.job","Job: {name}").replace("{name}",String(E.name))}),e.jsx("button",{onClick:()=>O(g.id,E.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:c("pipelineEditor.addStep","+ 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:c("pipelineEditor.runner","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:c("pipelineEditor.selectRunner","Select runner...")}),B.map(t=>e.jsxs("option",{value:t.id,children:[t.name," (",t.os,")"]},t.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)",display:"block",marginBottom:"4px"},children:c("pipelineEditor.environment","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:c("pipelineEditor.noEnvironment","No environment")}),_.map(t=>e.jsxs("option",{value:t.id,children:[t.name,t.protection?c("pipelineEditor.protected"," (protected)"):""]},t.id))]})]})]}),E.steps.map((t,d)=>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:St[t.type],size:16}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,flex:1},children:t.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:t.type}),e.jsx("button",{"aria-label":c("pipelineEditor.removeStep","Remove step"),onClick:()=>R(g.id,E.id,t.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})})]}),t.type==="script"&&t.script&&e.jsx("pre",{style:{margin:0,padding:"8px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"4px",fontSize:"10px",fontFamily:"monospace",overflow:"auto"},children:t.script}),t.type==="action"&&e.jsxs("div",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:["uses: ",t.action,t.actionVersion&&`@${t.actionVersion}`]})]},t.id)),E.steps.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--nice-text-muted, #666)",padding:"24px",fontSize:"12px"},children:c("pipelineEditor.noStepsYetAddA","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:c("pipelineEditor.selectAJobToEdit","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:c("pipelineEditor.selectAStageToView","Select a stage to view its jobs")})})]}),D==="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:p})}),D==="triggers"&&e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px"},children:[e.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"14px"},children:c("pipelineEditor.pipelineTriggers","Pipeline Triggers")}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px"},children:["push","pull_request","schedule","manual","tag","workflow_dispatch"].map(t=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"16px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:a.triggers.includes(t)?"2px solid var(--nice-primary, #3b82f6)":"2px solid transparent"},children:[e.jsx("input",{type:"checkbox",checked:a.triggers.includes(t),onChange:d=>{const u=d.target.checked?[...a.triggers,t]:a.triggers.filter(I=>I!==t);W({...a,triggers:u})}}),e.jsx(n.NiceIcon,{name:kt[t],size:24}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"13px"},children:t.replace("_"," ")}),e.jsxs("div",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:[t==="push"&&c("pipelineEditor.runOnPushToBranch","Run on push to branch"),t==="pull_request"&&c("pipelineEditor.runOnPrMr","Run on PR/MR"),t==="schedule"&&c("pipelineEditor.runOnScheduleCron","Run on schedule (cron)"),t==="manual"&&c("pipelineEditor.manualTriggerOnly","Manual trigger only"),t==="tag"&&c("pipelineEditor.runOnTagPush","Run on tag push"),t==="workflow_dispatch"&&c("pipelineEditor.apiUiTrigger","API/UI trigger")]})]})]},t))})]}),D==="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:c("pipelineEditor.variablesSecrets","Variables & Secrets")}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsx("button",{onClick:S,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:c("pipelineEditor.addVariable","+ Add Variable")}),e.jsx("button",{onClick:j,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})," ",c("pipelineEditor.addSecret","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:c("pipelineEditor.name","Name")}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontWeight:500},children:c("pipelineEditor.value","Value")}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"center",fontWeight:500},children:c("pipelineEditor.type","Type")}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"right",fontWeight:500},children:c("pipelineEditor.actions","Actions")})]})}),e.jsx("tbody",{children:a.variables.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",fontFamily:"monospace"},children:t.name}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)"},children:t.isSecret?"••••••••":t.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:t.isSecret?"var(--nice-warning-tint-15, #f59e0b22)":"var(--nice-primary-tint-15, #3b82f622)",color:t.isSecret?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-primary, #3b82f6)",fontSize:"10px"},children:[t.isSecret&&e.jsx(n.NiceIcon,{name:"lock",size:10}),t.isSecret?c("pipelineEditor.secret","Secret"):c("pipelineEditor.variable","Variable")]})}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",textAlign:"right"},children:e.jsx("button",{onClick:()=>C(t.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:c("pipelineEditor.remove","Remove")})})]},t.name))})]}),a.variables.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:"12px"},children:c("pipelineEditor.noVariablesDefined","No variables defined")})]})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(He,{className:`nice-pipeline-editor ${K||""}`,style:{background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",...G},flush:!0,menubar:H,toolbar:q,"data-testid":P,children:s}),f&&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:c("pipelineEditor.pipelineTemplates","Pipeline Templates")}),e.jsx("button",{"aria-label":c("pipelineEditor.closeTemplates","Close templates"),onClick:()=>x(!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:z.map(t=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>{w(t),x(!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:t.icon,size:32}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:t.name}),e.jsx("div",{style:{fontSize:"12px",color:"var(--nice-text-muted, #888)"},children:t.description}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #666)",marginTop:"4px"},children:t.category})]})]},t.id))})]})})]})},Ct=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineEditor:Le},Symbol.toStringTag,{value:"Module"})),wt=[],fe={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"}},Fe=({runs:l=wt,stats:h,selectedRunId:z,onRunSelect:B,onCancel:_,onRerun:L,onRerunFromStage:$,onDownloadArtifact:A,onDownloadLogs:T,onApprove:N,onReject:k,className:O,style:R,"data-testid":S})=>{const{t:C}=n.useNiceTranslation(),[j,M]=o.useState("all"),[w,i]=o.useState("all"),[b,Y]=o.useState(new Set),[y,K]=o.useState(new Set),[G,P]=o.useState(null),c=l.find(f=>f.id===z),a=o.useMemo(()=>l.filter(f=>!(j!=="all"&&f.status!==j||w!=="all"&&f.branch!==w)),[l,j,w]),W=o.useMemo(()=>[...new Set(l.map(f=>f.branch))],[l]),D=f=>{if(!f)return"-";const x=Math.floor(f/1e3);if(x<60)return`${x}s`;const g=Math.floor(x/60),E=x%60;if(g<60)return`${g}m ${E}s`;const p=Math.floor(g/60),H=g%60;return`${p}h ${H}m`},J=f=>f?new Date(f).toLocaleString():"-",X=f=>f<1024?`${f} B`:f<1024*1024?`${(f/1024).toFixed(1)} KB`:`${(f/(1024*1024)).toFixed(1)} MB`,Z=f=>{Y(x=>{const g=new Set(x);return g.has(f)?g.delete(f):g.add(f),g})},V=f=>{K(x=>{const g=new Set(x);return g.has(f)?g.delete(f):g.add(f),g})},Q=()=>{if(!G||!c)return[];for(const f of c.stages)for(const x of f.jobs)if(x.id===G.jobId)return x.steps.find(E=>E.id===G.stepId)?.logs||[];return[]};return e.jsxs("div",{className:`nice-pipeline-monitor ${O||""}`,style:{display:"flex",height:"100%",background:"var(--nice-bg-elevated, #1e1e1e)",color:"var(--nice-text-primary, #e0e0e0)",...R},"data-testid":S,children:[e.jsxs("div",{style:{width:"400px",borderRight:"1px solid var(--nice-border-color, #333)",display:"flex",flexDirection:"column"},children:[h&&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:h.totalRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:C("pipelineMonitor.totalRuns","Total Runs")})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-success, #22c55e)"},children:[h.successRate.toFixed(0),"%"]}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:C("pipelineMonitor.successRate","Success Rate")})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-warning, #f59e0b)"},children:D(h.avgDuration)}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:C("pipelineMonitor.avgDuration","Avg Duration")})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--nice-color-error, #ef4444)"},children:h.failedRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:C("pipelineMonitor.failed","Failed")})]})]})}),e.jsxs("div",{style:{padding:"12px",borderBottom:"1px solid var(--nice-border-color, #333)",display:"flex",gap:"8px"},children:[e.jsxs("select",{value:j,onChange:f=>M(f.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:C("pipelineMonitor.allStatus","All Status")}),e.jsx("option",{value:"in_progress",children:C("pipelineMonitor.inProgress","In Progress")}),e.jsx("option",{value:"completed",children:C("pipelineMonitor.completed","Completed")}),e.jsx("option",{value:"failed",children:C("pipelineMonitor.failed","Failed")}),e.jsx("option",{value:"cancelled",children:C("pipelineMonitor.cancelled","Cancelled")})]}),e.jsxs("select",{value:w,onChange:f=>i(f.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:C("pipelineMonitor.allBranches","All Branches")}),W.map(f=>e.jsx("option",{value:f,children:f},f))]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[a.map(f=>{const x=fe[f.status];return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>B(f.id),style:{padding:"12px 16px",borderBottom:"1px solid var(--nice-border-color, #333)",cursor:"pointer",background:z===f.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:x.color,animation:f.status==="in_progress"?"spin 1s linear infinite":"none"},children:e.jsx(n.NiceIcon,{name:x.icon,size:16})}),e.jsxs("span",{style:{flex:1,fontWeight:500,fontSize:"13px"},children:[f.pipelineName," #",f.runNumber]}),e.jsx("span",{style:{padding:"2px 8px",borderRadius:"4px",background:`${x.color}22`,color:x.color,fontSize:"10px"},children:x.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})," ",f.branch]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:f.commit.sha.slice(0,7)}),e.jsx("span",{children:"•"}),e.jsx("span",{children:D(f.duration)})]}),e.jsx("div",{style:{marginTop:"6px",fontSize:"11px",color:"var(--nice-text-muted, #666)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:f.commit.message})]},f.id)}),a.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--nice-text-muted, #666)",fontSize:"12px"},children:C("pipelineMonitor.noPipelineRunsMatchThe","No pipeline runs match the filters")})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:c?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:[c.pipelineName," #",c.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:[c.commit.authorAvatar&&e.jsx("img",{src:c.commit.authorAvatar,alt:"",style:{width:"16px",height:"16px",borderRadius:"50%"}}),c.commit.author]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"shuffle",size:12})," ",c.branch]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(n.NiceIcon,{name:"edit",size:12})," ",c.commit.sha.slice(0,7)]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[(c.status==="in_progress"||c.status==="queued"||c.status==="waiting")&&e.jsx("button",{onClick:()=>_(c.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:C("pipelineMonitor.cancel","Cancel")}),e.jsx("button",{onClick:()=>L(c.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:C("pipelineMonitor.reRun","Re-run")}),e.jsxs("button",{onClick:()=>T(c.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})," ",C("pipelineMonitor.logs","Logs")]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px"},children:[e.jsx("span",{children:C("pipelineMonitor.started","Started: {time}").replace("{time}",String(J(c.startedAt)))}),c.completedAt&&e.jsx("span",{children:C("pipelineMonitor.completed2","Completed: {time}").replace("{time}",String(J(c.completedAt)))}),e.jsx("span",{children:C("pipelineMonitor.duration","Duration: {duration}").replace("{duration}",String(D(c.duration)))})]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[e.jsx("div",{style:{marginBottom:"24px"},children:c.stages.map((f,x)=>{const g=fe[f.status],E=b.has(f.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>Z(f.id),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",background:"var(--nice-bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:`2px solid ${g.color}44`},children:[e.jsx("span",{style:{color:"var(--nice-text-muted, #666)",display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:E?"chevron-down":"chevron-right",size:14})}),e.jsx("span",{style:{display:"inline-flex",color:g.color},children:e.jsx(n.NiceIcon,{name:g.icon,size:16})}),e.jsx("span",{style:{flex:1,fontWeight:500},children:f.name}),e.jsx("span",{style:{fontSize:"11px",color:"var(--nice-text-muted, #888)"},children:D(f.duration)}),f.status==="waiting"&&N&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:p=>{p.stopPropagation(),N(c.id,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:"10px"},children:C("pipelineMonitor.approve","Approve")}),e.jsx("button",{onClick:p=>{p.stopPropagation(),k?.(c.id,f.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:C("pipelineMonitor.reject","Reject")})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),$(c.id,f.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:C("pipelineMonitor.reRunFromHere","Re-run from here")})]}),E&&e.jsx("div",{style:{marginLeft:"32px",marginTop:"8px"},children:f.jobs.map(p=>{const H=fe[p.status],q=y.has(p.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>V(p.id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",background:"var(--nice-bg-elevated, #1e1e1e)",borderRadius:"6px",cursor:"pointer",borderLeft:`3px solid ${H.color}`},children:[e.jsx("span",{style:{color:"var(--nice-text-muted, #666)",display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:q?"chevron-down":"chevron-right",size:12})}),e.jsx("span",{style:{display:"inline-flex",color:H.color},children:e.jsx(n.NiceIcon,{name:H.icon,size:14})}),e.jsx("span",{style:{flex:1,fontSize:"12px"},children:p.name}),p.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})," ",p.runner]}),e.jsx("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:D(p.duration)})]}),q&&e.jsx("div",{style:{marginLeft:"24px",marginTop:"4px"},children:p.steps.map(s=>{const t=fe[s.status];return e.jsxs("div",{role:s.logs?.length?"button":void 0,tabIndex:s.logs?.length?0:void 0,onKeyDown:s.logs?.length?n.clickOnActivationKey:void 0,onClick:()=>P({jobId:p.id,stepId:s.id}),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 10px",marginBottom:"2px",background:"transparent",borderRadius:"4px",cursor:s.logs?.length?"pointer":"default"},children:[e.jsx("span",{style:{display:"inline-flex",color:t.color},children:e.jsx(n.NiceIcon,{name:t.icon,size:12})}),e.jsx("span",{style:{flex:1,fontSize:"11px"},children:s.name}),e.jsx("span",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:D(s.duration)}),s.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]},s.id)})})]},p.id)})}),x<c.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})})]},f.id)})}),c.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:C("pipelineMonitor.artifacts","Artifacts")}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"8px"},children:c.artifacts.map(f=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:n.clickOnActivationKey,onClick:()=>A(f),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:f.name}),e.jsx("div",{style:{fontSize:"10px",color:"var(--nice-text-muted, #888)"},children:X(f.size)})]}),e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(n.NiceIcon,{name:"download",size:16})})]},f.id))})]})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--nice-text-muted, #666)"},children:C("pipelineMonitor.selectAPipelineRunTo","Select a pipeline run to view details")})}),G&&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:C("pipelineMonitor.stepLogs","Step Logs")}),e.jsx("button",{onClick:()=>P(null),"aria-label":C("pipelineMonitor.closeLogs","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:Q().join(`
13
+ `)||"No logs available"})})]})}),e.jsx("style",{children:`
14
+ @keyframes spin {
15
+ from { transform: rotate(0deg); }
16
+ to { transform: rotate(360deg); }
17
+ }
18
+ `})]})},zt=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineMonitor:Fe},Symbol.toStringTag,{value:"Module"}));exports.NiceAppShell=He;exports.NiceBranchManager=Be;exports.NiceBranchManager$1=Qe;exports.NiceConfirmDialog=Ce;exports.NiceGitBlame=Te;exports.NiceGitBlame$1=at;exports.NiceGitConflictResolver=_e;exports.NiceGitConflictResolver$1=ct;exports.NiceGitDiffViewer=Ee;exports.NiceGitDiffViewer$1=it;exports.NiceGitGraph=Ie;exports.NiceGitGraph$1=Xe;exports.NiceGitHooks=Ae;exports.NiceGitHooks$1=pt;exports.NiceMergeRequestBuilder=Me;exports.NiceMergeRequestBuilder$1=nt;exports.NiceOnScreenKeyboard=Oe;exports.NiceOnScreenKeyboardHost=De;exports.NicePipelineEditor=Le;exports.NicePipelineEditor$1=Ct;exports.NicePipelineMonitor=Fe;exports.NicePipelineMonitor$1=zt;exports.NicePromptDialog=ye;exports.ShellHintBar=$e;exports.scopeThemeClass=Se;exports.useIgnoredPropChangeWarning=we;exports.useNiceDialogs=Ne;exports.useShellInput=Pe;